Qwiic_KX13X_Py  2.0.0
Python for SFE Qwiic KX13X
Loading...
Searching...
No Matches
qwiic_kx13x.QwiicKX134 Class Reference
Inheritance diagram for qwiic_kx13x.QwiicKX134:

Public Member Functions

def __init__ (self, address=None, i2c_driver=None)
 
def begin (self)
 Checks that communication can be made with the QwiicKX134 by checking the WHO_AM_I register. More...
 
def get_accel_data (self)
 Retrieves acceleration data and converts it, and stores it. More...
 
def conv_accel_data (self)
 Converts raw acceleration data according to the range setting and stores it. More...
 
- Public Member Functions inherited from qwiic_kx13x.QwiicKX13XCore
def __init__ (self, address=None, i2c_driver=None)
 
def is_connected (self)
 Determine if a KX13X device is conntected to the system. More...
 
def beginCore (self)
 Initialize the operation of the KX13X module. More...
 
def initialize (self, settings=DEFAULT_SETTINGS)
 Initialize configures the accelerometer's registers into a number of different modes: asyncronous, hardware trigger, software trigger, and buffer. More...
 
def run_command_test (self)
 This function runs the self test built into the accelerometer. More...
 
def enable_accel (self, enable=True)
 This functions controls the accelerometers power on and off state. More...
 
def accel_control (self, enable=True)
 Same as above enable_accel(), but with a different name to preserve backwards compatibility. More...
 
def get_accel_state (self)
 Retrieves the state of the accelerometer: on or off. More...
 
def set_range (self, kx13x_range)
 Sets the range reported by the accelerometer. More...
 
def set_output_data_rate (self, rate)
 Sets the rate at which the accelerometer outputs data. More...
 
def get_output_data_rate (self)
 Gets the accelerometers output data rate. More...
 
def set_interrupt_pin (self, enable, polarity=0, pulse_width=0, latch_control=False)
 Sets all of whether the data ready bit is reported to the hardware interrupt pin, the polarity of the signal (HIGH or LOW), the width of the pulse, and how the interrupt is cleared. More...
 
def route_hardware_interrupt (self, rdr, pin=1)
 Determines which interrupt is reported: freefall, buffer full, watermark, data ready, back to sleep, tap/double tap, wakeup or tilt. More...
 
def enable_phys_interrupt (self, enable=True, pin=1)
 Enables interrupts to be routed to the interrupt pins. More...
 
def clear_interrupt (self)
 Clears the interrupt. More...
 
def data_ready (self)
 Reads the register indicating whether data is ready to be read. More...
 
def data_trigger (self)
 Same as above data_ready(), but with a different name to preserve backwards compatibility. More...
 
def set_buffer_threshold (self, threshold)
 Sets how many samples are stored in the buffer. More...
 
def set_buffer_operation_and_resolution (self, operation_mode, resolution=True)
 Sets the mode and resolution of the samples stored in the buffer. More...
 
def set_buffer_operation (self, operation_mode, resolution)
 Same as above set_buffer_operation_and_resolution(), but with a different name to preserve backwards compatibility. More...
 
def enable_buffer_and_interrupt (self, enable=True, enable_interrupt=True)
 Enables the buffer and whether the buffer triggers an interrupt when full. More...
 
def get_raw_accel_data (self)
 Retrieves the raw register values representing accelerometer data. More...
 
def get_raw_accel_buffer_data (self, sixteenBit=-1)
 Retrieves the raw buffer values representing accelerometer data. More...
 
def software_reset (self)
 Resets the accelerometer. More...
 
def enable_data_engine (self, enable=True)
 Enables the data ready bit. More...
 
def enable_tap_engine (self, enable=True)
 Enables the tap and double tap features of the accelerometers. More...
 
def enable_direct_tap_interrupt (self, enable=True)
 Enables reporting on the direction of the latest generated tap. More...
 
def tap_detected (self)
 Checks the tap interrupt bit indicating that a tap has been detected. More...
 
def get_direction (self)
 If the tap direction bit is enabled, this register will report the direction of the detected tap. More...
 
def unknown_tap (self)
 if the accelerometer is unsure whether it has in fact detected a tap, it will report an "unknown" state. More...
 
def double_tap_detected (self)
 Checks the double tap interrupt bit indicating that a double tap has been detected. More...
 
def get_sample_level (self)
 Gets the number of samples in the Buffer. More...
 

Public Attributes

 kx134_accel
 
- Public Attributes inherited from qwiic_kx13x.QwiicKX13XCore
 address
 
 raw_output_data
 

Static Public Attributes

int KX134_WHO_AM_I = 0x46
 
int KX134_RANGE8G = 0x00
 
int KX134_RANGE16G = 0x01
 
int KX134_RANGE32G = 0x02
 
int KX134_RANGE64G = 0x03
 
int CONV_8G = .000244140751365703299
 
int CONV_16G = .000488281197546311838
 
int CONV_32G = .000976523950926236762
 
int CONV_64G = .001953125095370342112
 
- Static Public Attributes inherited from qwiic_kx13x.QwiicKX13XCore
 device_name = _DEFAULT_NAME
 
 available_addresses = _AVAILABLE_I2C_ADDRESS
 
int TOTAL_ACCEL_DATA_16BIT = 6
 
int TOTAL_ACCEL_DATA_8BIT = 3
 
int MAX_BUFFER_LENGTH = 32
 
int XLSB = 0
 
int XMSB = 1
 
int YLSB = 2
 
int YMSB = 3
 
int ZLSB = 4
 
int ZMSB = 5
 
int DEFAULT_SETTINGS = 0xC0
 
int INT_SETTINGS = 0xE0
 
int SOFT_INT_SETTINGS = 0xE1
 
int BUFFER_SETTINGS = 0xE2
 
int TILT_SETTINGS = 0xE3
 
int COTR_DEF_STATE = 0x55
 
int COTR_POS_STATE = 0xAA
 
int BUFFER_16BIT_SAMPLES = 0x01
 
int BUFFER_8BIT_SAMPLES = 0x00
 
int BUFFER_MODE_FIFO = 0x00
 
int BUFFER_MODE_STREAM = 0x01
 
int BUFFER_MODE_TRIGGER = 0x02
 
int KX13X_MAN_ID = 0x00
 
int KX13X_PART_ID = 0x01
 
int KX13X_XADP_L = 0x02
 
int KX13X_XADP_H = 0x03
 
int KX13X_YADP_L = 0x04
 
int KX13X_YADP_H = 0x05
 
int KX13X_ZADP_L = 0x06
 
int KX13X_ZADP_H = 0x07
 
int KX13X_XOUT_L = 0x08
 
int KX13X_XOUT_H = 0x09
 
int KX13X_YOUT_L = 0x0A
 
int KX13X_YOUT_H = 0x0B
 
int KX13X_ZOUT_L = 0x0C
 
int KX13X_ZOUT_H = 0x0D
 
int KX13X_COTR = 0x12
 
int KX13X_WHO_AM_I = 0x13
 
int KXI3X_TSCP = 0x14
 
int KX13X_TSPP = 0x15
 
int KX13X_INS1 = 0x16
 
int KX13X_INS2 = 0x17
 
int KX13X_INS3 = 0x18
 
int KX13X_STATUS_REG = 0x19
 
int KX13X_INT_REL = 0x1A
 
int KX13X_CNTL1 = 0x1B
 
int KX13X_CNTL2 = 0x1C
 
int KX13X_CNTL3 = 0x1D
 
int KX13X_CNTL4 = 0x1E
 
int KX13X_CNTL5 = 0x1F
 
int KX13X_CNTL6 = 0x20
 
int KX13X_ODCNTL = 0x21
 
int KX13X_INC1 = 0x22
 
int KX13X_INC2 = 0x23
 
int KX13X_INC3 = 0x24
 
int KX13X_INC4 = 0x25
 
int KX13X_INC5 = 0x26
 
int KX13X_INC6 = 0x27
 
int KX13X_TILT_TIMER = 0x29
 
int KX13X_TDTRC = 0x2A
 
int KX13X_TDTC = 0x2B
 
int KX13X_TTH = 0x2C
 
int KX13X_TTL = 0x2D
 
int KX13X_FTD = 0x2E
 
int KX13X_STD = 0x2F
 
int KX13X_TLT = 0x30
 
int KX13X_TWS = 0x31
 
int KX13X_FFTH = 0x32
 
int KX13X_FFC = 0x33
 
int KX13X_FFCNTL = 0x34
 
int KX13X_TILT_ANGLE_LL = 0x37
 
int KX13X_TILT_ANGLE_HL = 0x38
 
int KX13X_HYST_SET = 0x39
 
int KX13X_LP_CNTL1 = 0x3A
 
int KX13X_LP_CNTL2 = 0x3B
 
int KX13X_WUFTH = 0x49
 
int KX13X_BTSWUFTH = 0x4A
 
int KX13X_BTSTH = 0x4B
 
int KX13X_BTSC = 0x4C
 
int KX13X_WUFC = 0x4D
 
int KX13X_SELF_TEST = 0x5D
 
int KX13X_BUF_CNTL1 = 0x5E
 
int KX13X_BUF_CNTL2 = 0x5F
 
int KX13X_BUF_STATUS_1 = 0x60
 
int KX13X_BUF_STATUS_2 = 0x61
 
int KX13X_BUF_CLEAR = 0x62
 
int KX13X_BUF_READ = 0x63
 
int KX13X_ADP_CNTL1 = 0x64
 
int KX13X_ADP_CNTL2 = 0x65
 
int KX13X_ADP_CNTL3 = 0x66
 
int KX13X_ADP_CNTL4 = 0x67
 
int KX13X_ADP_CNTL5 = 0x68
 
int KX13X_ADP_CNTL6 = 0x69
 
int KX13X_ADP_CNTL7 = 0x6A
 
int KX13X_ADP_CNTL8 = 0x6B
 
int KX13X_ADP_CNTL9 = 0x6C
 
int KX13X_ADP_CNTL10 = 0x6D
 
int KX13X_ADP_CNTL11 = 0x6E
 
int KX13X_ADP_CNTL12 = 0x6F
 
int KX13X_ADP_CNTL13 = 0x70
 
int KX13X_ADP_CNTL14 = 0x71
 
int KX13X_ADP_CNTL15 = 0x72
 
int KX13X_ADP_CNTL16 = 0x73
 
int KX13X_ADP_CNTL17 = 0x74
 
int KX13X_ADP_CNTL18 = 0x75
 
int KX13X_ADP_CNTL19 = 0x76
 
int KX13X_SUCCESS = 0x00
 
int KX13X_GENERAL_ERROR = 0x01
 
int KX13X_I2C_ERROR = 0x02
 
int HI_TILT_POSITION = 0x01
 
int HI_WAKE_UP = 0x02
 
int HI_TAP_DOUBLE_TAP = 0x04
 
int HI_BACK_TO_SLEEP = 0x08
 
int HI_DATA_READY = 0x10
 
int HI_WATERMARK = 0x20
 
int HI_BUFFER_FULL = 0x40
 
int HI_FREEFALL = 0x80
 

Additional Inherited Members

- Properties inherited from qwiic_kx13x.QwiicKX13XCore
 connected = property(is_connected)
 
 output_data_rate = property(get_output_data_rate, set_output_data_rate)
 

Constructor & Destructor Documentation

◆ __init__()

def qwiic_kx13x.QwiicKX134.__init__ (   self,
  address = None,
  i2c_driver = None 
)

Reimplemented from qwiic_kx13x.QwiicKX13XCore.

Member Function Documentation

◆ begin()

def qwiic_kx13x.QwiicKX134.begin (   self)

Checks that communication can be made with the QwiicKX134 by checking the WHO_AM_I register.

Returns
bool Returns true if WHO_AM_I value is the correct one and false otherwise.

◆ conv_accel_data()

def qwiic_kx13x.QwiicKX134.conv_accel_data (   self)

Converts raw acceleration data according to the range setting and stores it.

◆ get_accel_data()

def qwiic_kx13x.QwiicKX134.get_accel_data (   self)

Retrieves acceleration data and converts it, and stores it.

Member Data Documentation

◆ CONV_16G

int qwiic_kx13x.QwiicKX134.CONV_16G = .000488281197546311838
static

◆ CONV_32G

int qwiic_kx13x.QwiicKX134.CONV_32G = .000976523950926236762
static

◆ CONV_64G

int qwiic_kx13x.QwiicKX134.CONV_64G = .001953125095370342112
static

◆ CONV_8G

int qwiic_kx13x.QwiicKX134.CONV_8G = .000244140751365703299
static

◆ kx134_accel

qwiic_kx13x.QwiicKX134.kx134_accel

◆ KX134_RANGE16G

int qwiic_kx13x.QwiicKX134.KX134_RANGE16G = 0x01
static

◆ KX134_RANGE32G

int qwiic_kx13x.QwiicKX134.KX134_RANGE32G = 0x02
static

◆ KX134_RANGE64G

int qwiic_kx13x.QwiicKX134.KX134_RANGE64G = 0x03
static

◆ KX134_RANGE8G

int qwiic_kx13x.QwiicKX134.KX134_RANGE8G = 0x00
static

◆ KX134_WHO_AM_I

int qwiic_kx13x.QwiicKX134.KX134_WHO_AM_I = 0x46
static

The documentation for this class was generated from the following file: