def __init__(self, sensor, pin_index=None): StreamConfig.__init__(self, sensor) if pin_index is None: pin_index = get_pin_index() self.define_request_message(fmt="<Bhhhhhhh", hdr="ch!ax!ay!az!mx!my!mz!temp", reg=r.KMX62_ACCEL_XOUT_L, pin_index=pin_index)
def __init__(self, sensor, pin_index=None): StreamConfig.__init__(self, sensor) if pin_index is None: pin_index = get_pin_index() self.define_request_message(fmt="<Bhhh", hdr="ch!ax!ay!az", reg=r.KX224_XOUT_L, pin_index=pin_index)
def __init__(self, sensor, pin_index=None): StreamConfig.__init__(self, sensor) if pin_index is None: pin_index = get_pin_index() self.define_request_message(fmt="<Bhhh", hdr="ch!mx!my!mz", reg=r.BM1422GMV_DATAX, pin_index=pin_index)
def __init__(self, sensor, pin_index=None): StreamConfig.__init__(self, sensor) if pin_index is None: pin_index = get_pin_index() self.define_request_message(fmt=">BBBBBh", hdr="ch!stat!P_msb!P_lsb!P_xl!T_raw", reg=r.BM1383AGLV_STATUS_REG, pin_index=pin_index)
def __init__(self, sensor, pin_index=None, timer=0.1): StreamConfig.__init__(self, sensor) if pin_index is None: pin_index = get_pin_index() # Default way to define request message self.define_request_message(fmt="<Bhhh", hdr="ch!ax!ay!az", reg=r.KX022_XOUT_L, timer=timer)
def __init__(self, sensor, pin_index=None): StreamConfig.__init__(self, sensor) if pin_index is None: pin_index = get_pin_index() if 1: # pylint disable=using-constant-test # Default way to define request message self.define_request_message(fmt="<Bhhh", hdr="ch!ax!ay!az", reg=r.KX022_XOUT_L, pin_index=pin_index) if 0: # pylint disable=using-constant-test # define request message with packet counter # works with FW1, not work in FW2 self.define_request_message( fmt="<Bhhh" + ExtraData.fmt_packet_count_8, hdr="ch!ax!ay!az" + ExtraData.hdr_packet_count_8, reg=[sensor.resource[CFG_SAD], r.KX022_XOUT_L, 6] + ExtraData.reg_packet_count_8, pin_index=pin_index)