|
Bridle API 4.2.99
A Zephyr based application framework
|
This file provides a set of functions needed to drive the STK8BA58 simplified inertial module. More...
Topics | |
| Common Functions | |
| This section groups common useful functions. | |
| Data generation | |
| This section groups all the functions concerning data generation. | |
| Data output | |
| This section groups all the data output functions. | |
| Endianness definitions | |
| The endianness of the STK8BA58 registers depends on the definition selected by the chosen architecture: | |
| Infos | |
| This section provide a set of default and identification values. | |
| Interfaces Functions | |
| This section provide a set of functions used to read and write a generic register of the device. | |
| Sensitivity | |
| These functions convert raw-data into engineering units. | |
| Serial Interface | |
| This section groups all the functions concerning main serial interface management (not auxiliary) | |
Data Structures | |
| struct | stk8ba58_out1_t |
| Data for any-axis acceleration data (LSB) and the new data flag. More... | |
| struct | stk8ba58_out2_t |
| Data struct for any-axis acceleration data (MSB). More... | |
| struct | stk8ba58_intsts1_t |
| Data for motion detection interrupts status. More... | |
| struct | stk8ba58_intsts2_t |
| Data for new data interrupt status. More... | |
| struct | stk8ba58_eventinfo1_t |
| Data for any-motion (slope) detection information. More... | |
| struct | stk8ba58_rangesel_t |
| Data for acceleration sensing range. More... | |
| struct | stk8ba58_bwsel_t |
| Data for output data bandwidth selection. More... | |
| struct | stk8ba58_powmode_t |
| Data for power mode selection and the sleep time duration setting. More... | |
| struct | stk8ba58_datasetup_t |
| Data for output data filter and protection function. More... | |
| struct | stk8ba58_inten1_t |
| Data for motion detection interrupts enable. More... | |
| struct | stk8ba58_inten2_t |
| Data for new data interrupt enable. More... | |
| struct | stk8ba58_intmap1_t |
| Data for motion detection interrupts mapping to INT1 pin. More... | |
| struct | stk8ba58_intmap2_t |
| Data for new data interrupt mapping to INT1 pin. More... | |
| struct | stk8ba58_intcfg1_t |
| Data for INT1 pin output type and active level. More... | |
| struct | stk8ba58_intcfg2_t |
| Data for INT1 pin mode and latched hold-time. More... | |
| struct | stk8ba58_slopedly_t |
| Data for number of samples in the slope detection. More... | |
| struct | stk8ba58_sigmot1_t |
| Data for skip time (LSB) of the significant motion. More... | |
| struct | stk8ba58_sigmot2_t |
| Data for skip time (MSB) of the significant motion, interrupt enable. More... | |
| struct | stk8ba58_sigmot3_t |
| Data for proof time of the significant motion. More... | |
| struct | stk8ba58_intfcfg_t |
| Data for digital interface parameters of the I2C interface. More... | |
| struct | stk8ba58_ofstcomp1_t |
| Data for settings of the offset compensation. More... | |
| struct | stk8ba58_ofst_t |
| Data struct for any-axis offset compensation value. More... | |
| struct | stk8ba58_all_sources_t |
| Data for motion detection and data interrupts status. More... | |
| struct | stk8ba58_pin_int1_route_t |
| Data for motion detection and data interrupts mapping to INT1 pin. More... | |
| struct | stk8ba58_int_enable_t |
| Data for motion detection and data interrupts enable. More... | |
Macros | |
| #define | STK8BA58_CHIP_ID 0x00U |
| Address for device identification (CHIP ID). | |
| #define | STK8BA58_XOUT1 0x02U |
| Address for x-axis acceleration data (LSB) and the new data flag. | |
| #define | STK8BA58_YOUT1 0x04U |
| Address for y-axis acceleration data (LSB) and the new data flag. | |
| #define | STK8BA58_ZOUT1 0x06U |
| Address for z-axis acceleration data (LSB) and the new data flag. | |
| #define | STK8BA58_XOUT2 0x03U |
| Address for x-axis acceleration data (MSB). | |
| #define | STK8BA58_YOUT2 0x05U |
| Address for y-axis acceleration data (MSB). | |
| #define | STK8BA58_ZOUT2 0x07U |
| Address for z-axis acceleration data (MSB). | |
| #define | STK8BA58_INTSTS1 0x09U |
| Address for motion detection interrupts status. | |
| #define | STK8BA58_INTSTS2 0x0AU |
| Address for new data interrupt status. | |
| #define | STK8BA58_EVENTINFO1 0x0BU |
| Address for any-motion (slope) detection information. | |
| #define | STK8BA58_RANGESEL 0x0FU |
| Address for acceleration sensing range. | |
| #define | STK8BA58_BWSEL 0x10U |
| Address for output data bandwidth selection. | |
| #define | STK8BA58_POWMODE 0x11U |
| Address for power mode selection and the sleep time duration setting. | |
| #define | STK8BA58_DATASETUP 0x13U |
| Address for output data filter and protection function. | |
| #define | STK8BA58_SWRST 0x14U |
| Address for device software reset. | |
| #define | STK8BA58_INTEN1 0x16U |
| Address for motion detection interrupts enable. | |
| #define | STK8BA58_INTEN2 0x17U |
| Address for new data interrupt enable. | |
| #define | STK8BA58_INTMAP1 0x19U |
| Address for motion detection interrupts mapping to INT1 pin. | |
| #define | STK8BA58_INTMAP2 0x1AU |
| Address for new data interrupt mapping to INT1 pin. | |
| #define | STK8BA58_INTCFG1 0x20U |
| Address for INT1 pin output type and active level. | |
| #define | STK8BA58_INTCFG2 0x21U |
| Address for INT1 pin mode and latched hold-time. | |
| #define | STK8BA58_SLOPEDLY 0x27U |
| Address for number of samples in the slope detection. | |
| #define | STK8BA58_SLOPETHD 0x28U |
| Address for threshold value of the slope detection. | |
| #define | STK8BA58_SIGMOT1 0x29U |
| Address for skip time (LSB) of the significant motion. | |
| #define | STK8BA58_SIGMOT2 0x2AU |
| Address for skip time (MSB) of the significant motion, interrupt enable. | |
| #define | STK8BA58_SIGMOT3 0x2BU |
| Address for proof time of the significant motion. | |
| #define | STK8BA58_INTFCFG 0x34U |
| Address for digital interface parameters of the I2C interface. | |
| #define | STK8BA58_OFSTCOMP1 0x36U |
| Address for settings of the offset compensation. | |
| #define | STK8BA58_OFSTX 0x38U |
| Address for x-axis offset compensation value. | |
| #define | STK8BA58_OFSTY 0x39U |
| Address for y-axis offset compensation value. | |
| #define | STK8BA58_OFSTZ 0x3AU |
| Address for z-axis offset compensation value. | |
| #define | STK8BA58_I2C_WRITE_BUFFER_SIZE (16U) |
| The size of the buffer pushed on the stack used to copy the data to be written along with the register address. | |
Functions | |
| int32_t | stk8ba58_read_reg (const struct i2c_dt_spec *i2c, uint8_t reg, uint8_t *data, uint16_t len) |
| Read generic device register. | |
| int32_t | stk8ba58_write_reg (const struct i2c_dt_spec *i2c, uint8_t reg, uint8_t *data, uint16_t len) |
| Write generic device register. | |
| float_t | stk8ba58_from_fs2g_to_mg (int16_t lsb) |
| float_t | stk8ba58_from_fs4g_to_mg (int16_t lsb) |
| float_t | stk8ba58_from_fs8g_to_mg (int16_t lsb) |
| int32_t | stk8ba58_all_sources_get (const struct i2c_dt_spec *i2c, stk8ba58_all_sources_t *val) |
| Read all the interrupt/status flag of the device. | |
| int32_t | stk8ba58_xl_range_set (const struct i2c_dt_spec *i2c, stk8ba58_range_t val) |
| Accelerometer range selection. | |
| int32_t | stk8ba58_xl_range_get (const struct i2c_dt_spec *i2c, stk8ba58_range_t *val) |
| Accelerometer range selection. | |
| int32_t | stk8ba58_xl_bandwidth_set (const struct i2c_dt_spec *i2c, stk8ba58_bw_t val, stk8ba58_ds_t sel) |
| Accelerometer bandwidth selection. | |
| int32_t | stk8ba58_xl_bandwidth_get (const struct i2c_dt_spec *i2c, stk8ba58_bw_t *val, stk8ba58_ds_t *sel) |
| Accelerometer bandwidth selection. | |
| int32_t | stk8ba58_xl_power_mode_set (const struct i2c_dt_spec *i2c, stk8ba58_sleepdur_t val, stk8ba58_pm_t sel) |
| Accelerometer power mode selection. | |
| int32_t | stk8ba58_xl_power_mode_get (const struct i2c_dt_spec *i2c, stk8ba58_sleepdur_t *val, stk8ba58_pm_t *sel) |
| Accelerometer bandwidth selection. | |
| int32_t | stk8ba58_acceleration_raw_get (const struct i2c_dt_spec *i2c, int16_t *buff) |
| Linear acceleration output register. | |
| int32_t | stk8ba58_device_id_get (const struct i2c_dt_spec *i2c, uint8_t *buff) |
| DeviceChipID. | |
| int32_t | stk8ba58_reset_set (const struct i2c_dt_spec *i2c, uint8_t val) |
| Software reset. | |
| int32_t | stk8ba58_pin_int1_mode_set (const struct i2c_dt_spec *i2c, stk8ba58_pp_od_t val) |
| Push-pull/open-drain selection on interrupt pad. | |
| int32_t | stk8ba58_pin_int1_mode_get (const struct i2c_dt_spec *i2c, stk8ba58_pp_od_t *val) |
| Push-pull/open-drain selection on interrupt pad. | |
| int32_t | stk8ba58_pin_int1_polarity_set (const struct i2c_dt_spec *i2c, stk8ba58_hl_active_t val) |
| Polarity active-high/-low selection on interrupt pad. | |
| int32_t | stk8ba58_pin_int1_polarity_get (const struct i2c_dt_spec *i2c, stk8ba58_hl_active_t *val) |
| Polarity active-high/-low selection on interrupt pad. | |
| int32_t | stk8ba58_int_notification_set (const struct i2c_dt_spec *i2c, stk8ba58_intlatch_t val) |
| Latched/pulsed interrupt. | |
| int32_t | stk8ba58_int_notification_get (const struct i2c_dt_spec *i2c, stk8ba58_intlatch_t *val) |
| Latched/pulsed interrupt. | |
| int32_t | stk8ba58_pin_int1_route_set (const struct i2c_dt_spec *i2c, stk8ba58_pin_int1_route_t val) |
| Select the signal that need to route on int1 pad. | |
| int32_t | stk8ba58_pin_int1_route_get (const struct i2c_dt_spec *i2c, stk8ba58_pin_int1_route_t *val) |
| Select the signal that need to route on int1 pad. | |
| int32_t | stk8ba58_int_enable_set (const struct i2c_dt_spec *i2c, stk8ba58_int_enable_t val) |
| Enable the source that need to trigger interrupt. | |
| int32_t | stk8ba58_int_enable_get (const struct i2c_dt_spec *i2c, stk8ba58_int_enable_t *val) |
| Enable the source that need to trigger interrupt. | |
This file provides a set of functions needed to drive the STK8BA58 simplified inertial module.
I2C chip register access for the Sensortek Technology STK8BA58 3-axis accelerometer. Data sheet can be found here: https://datasheet4u.com/pdf-down/S/T/K/STK8BA58-Sensortek.pdf
The values for the defines below as well as the register definitions were taken from the datasheet revision 1.0, which can be found at: https://datasheet4u.com/pdf-down/S/T/K/STK8BA58-Sensortek.pdf
| #define STK8BA58_BWSEL 0x10U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for output data bandwidth selection.
| #define STK8BA58_CHIP_ID 0x00U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for device identification (CHIP ID).
| #define STK8BA58_DATASETUP 0x13U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for output data filter and protection function.
| #define STK8BA58_EVENTINFO1 0x0BU |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for any-motion (slope) detection information.
| #define STK8BA58_I2C_WRITE_BUFFER_SIZE (16U) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
The size of the buffer pushed on the stack used to copy the data to be written along with the register address.
| #define STK8BA58_INTCFG1 0x20U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for INT1 pin output type and active level.
| #define STK8BA58_INTCFG2 0x21U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for INT1 pin mode and latched hold-time.
| #define STK8BA58_INTEN1 0x16U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for motion detection interrupts enable.
| #define STK8BA58_INTEN2 0x17U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for new data interrupt enable.
| #define STK8BA58_INTFCFG 0x34U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for digital interface parameters of the I2C interface.
| #define STK8BA58_INTMAP1 0x19U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for motion detection interrupts mapping to INT1 pin.
| #define STK8BA58_INTMAP2 0x1AU |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for new data interrupt mapping to INT1 pin.
| #define STK8BA58_INTSTS1 0x09U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for motion detection interrupts status.
| #define STK8BA58_INTSTS2 0x0AU |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for new data interrupt status.
| #define STK8BA58_OFSTCOMP1 0x36U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for settings of the offset compensation.
| #define STK8BA58_OFSTX 0x38U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for x-axis offset compensation value.
| #define STK8BA58_OFSTY 0x39U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for y-axis offset compensation value.
| #define STK8BA58_OFSTZ 0x3AU |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for z-axis offset compensation value.
| #define STK8BA58_POWMODE 0x11U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for power mode selection and the sleep time duration setting.
| #define STK8BA58_RANGESEL 0x0FU |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for acceleration sensing range.
| #define STK8BA58_SIGMOT1 0x29U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for skip time (LSB) of the significant motion.
| #define STK8BA58_SIGMOT2 0x2AU |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for skip time (MSB) of the significant motion, interrupt enable.
| #define STK8BA58_SIGMOT3 0x2BU |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for proof time of the significant motion.
| #define STK8BA58_SLOPEDLY 0x27U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for number of samples in the slope detection.
| #define STK8BA58_SLOPETHD 0x28U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for threshold value of the slope detection.
| #define STK8BA58_SWRST 0x14U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for device software reset.
| #define STK8BA58_XOUT1 0x02U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for x-axis acceleration data (LSB) and the new data flag.
| #define STK8BA58_XOUT2 0x03U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for x-axis acceleration data (MSB).
| #define STK8BA58_YOUT1 0x04U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for y-axis acceleration data (LSB) and the new data flag.
| #define STK8BA58_YOUT2 0x05U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for y-axis acceleration data (MSB).
| #define STK8BA58_ZOUT1 0x06U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for z-axis acceleration data (LSB) and the new data flag.
| #define STK8BA58_ZOUT2 0x07U |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Address for z-axis acceleration data (MSB).
| enum stk8ba58_bw_t |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Values for output data bandwidth selection.
| enum stk8ba58_ds_t |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
| Enumerator | |
|---|---|
| STK8BA58_XL_DS_FILTERED | |
| STK8BA58_XL_DS_UNFILTERED | |
| enum stk8ba58_hl_active_t |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Values for INT1 pin output active level.
| Enumerator | |
|---|---|
| STK8BA58_ACTIVE_LOW | |
| STK8BA58_ACTIVE_HIGH | |
| enum stk8ba58_intlatch_t |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Values for INT1 pin mode and latched hold-time.
| enum stk8ba58_pm_t |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Values for output data filter and protection function.
| Enumerator | |
|---|---|
| STK8BA58_XL_PM_NORMAL | |
| STK8BA58_XL_PM_LOWPOWER | |
| STK8BA58_XL_PM_SUSPEND | |
| enum stk8ba58_pp_od_t |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Values for INT1 pin output type.
| Enumerator | |
|---|---|
| STK8BA58_PUSH_PULL | |
| STK8BA58_OPEN_DRAIN | |
| enum stk8ba58_range_t |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Values for acceleration sensing range.
| Enumerator | |
|---|---|
| STK8BA58_2g | |
| STK8BA58_4g | |
| STK8BA58_8g | |
| enum stk8ba58_sleepdur_t |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Values for power mode selection and the sleep time duration setting.
| int32_t stk8ba58_acceleration_raw_get | ( | const struct i2c_dt_spec * | i2c, |
| int16_t * | buff ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Linear acceleration output register.
The value is expressed as a 16-bit word in two’s complement.[get]
| i2c | Read / write interface definitions.(ptr) |
| buff | Buffer that stores data read.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_all_sources_get | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_all_sources_t * | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Read all the interrupt/status flag of the device.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Get INTSTS1, INTSTS2, EVENTINFO1.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_device_id_get | ( | const struct i2c_dt_spec * | i2c, |
| uint8_t * | buff ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
DeviceChipID.
[get]
| i2c | Read / write interface definitions.(ptr) |
| buff | Buffer that stores data read.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| float_t stk8ba58_from_fs2g_to_mg | ( | int16_t | lsb | ) |
| float_t stk8ba58_from_fs4g_to_mg | ( | int16_t | lsb | ) |
| float_t stk8ba58_from_fs8g_to_mg | ( | int16_t | lsb | ) |
| int32_t stk8ba58_int_enable_get | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_int_enable_t * | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Enable the source that need to trigger interrupt.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Get union of registers from INTEN1 to INTEN2.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_int_enable_set | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_int_enable_t | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Enable the source that need to trigger interrupt.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Change union of registers from INTEN1 to INTEN2. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_int_notification_get | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_intlatch_t * | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Latched/pulsed interrupt.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Get the values of int-latch in reg INTCFG2.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_int_notification_set | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_intlatch_t | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Latched/pulsed interrupt.
[set]
| i2c | Read / write interface definitions.(ptr) |
| val | Change the values of int-latch in reg INTCFG2. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_pin_int1_mode_get | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_pp_od_t * | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Push-pull/open-drain selection on interrupt pad.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Get the values of int1_od in reg INTCFG1.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_pin_int1_mode_set | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_pp_od_t | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Push-pull/open-drain selection on interrupt pad.
[set]
| i2c | Read / write interface definitions.(ptr) |
| val | Change the values of int1_od in reg INTCFG1. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_pin_int1_polarity_get | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_hl_active_t * | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Polarity active-high/-low selection on interrupt pad.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Get the values of int1_lv in reg INTCFG1.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_pin_int1_polarity_set | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_hl_active_t | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Polarity active-high/-low selection on interrupt pad.
[set]
| i2c | Read / write interface definitions.(ptr) |
| val | Change the values of int1_lv in reg INTCFG1. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_pin_int1_route_get | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_pin_int1_route_t * | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Select the signal that need to route on int1 pad.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Get union of registers from INTMAP1 to INTMAP2.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_pin_int1_route_set | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_pin_int1_route_t | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Select the signal that need to route on int1 pad.
[set]
| i2c | Read / write interface definitions.(ptr) |
| val | Change union of registers from INTMAP1 to INTMAP2. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_read_reg | ( | const struct i2c_dt_spec * | i2c, |
| uint8_t | reg, | ||
| uint8_t * | data, | ||
| uint16_t | len ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Read generic device register.
| i2c | Read / write interface definitions.(ptr) |
| reg | Register to read. |
| data | Pointer to buffer that store the data read.(ptr) |
| len | Number of consecutive register to read. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_reset_set | ( | const struct i2c_dt_spec * | i2c, |
| uint8_t | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Software reset.
Restore the default values in user registers.[set]
| i2c | Read / write interface definitions.(ptr) |
| val | Change the value with soft-reset in reg SWRST. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_write_reg | ( | const struct i2c_dt_spec * | i2c, |
| uint8_t | reg, | ||
| uint8_t * | data, | ||
| uint16_t | len ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Write generic device register.
| i2c | Read / write interface definitions.(ptr) |
| reg | Register to write. |
| data | Pointer to data to write in register reg.(ptr) |
| len | Number of consecutive register to write. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_xl_bandwidth_get | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_bw_t * | val, | ||
| stk8ba58_ds_t * | sel ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Accelerometer bandwidth selection.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Get the values of bw in reg BWSEL.(ptr) |
| sel | Get the values of data-sel in reg DATASETUP.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_xl_bandwidth_set | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_bw_t | val, | ||
| stk8ba58_ds_t | sel ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Accelerometer bandwidth selection.
[set]
| i2c | Read / write interface definitions.(ptr) |
| val | Change the values of bw in reg BWSEL. |
| sel | Change the values of data-sel in reg DATASETUP. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_xl_power_mode_get | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_sleepdur_t * | val, | ||
| stk8ba58_pm_t * | sel ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Accelerometer bandwidth selection.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Get the values of sleep-dur in reg POWMODE.(ptr) |
| sel | Get the values of lowpower / suspend in reg POWMODE.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_xl_power_mode_set | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_sleepdur_t | val, | ||
| stk8ba58_pm_t | sel ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Accelerometer power mode selection.
[set]
| i2c | Read / write interface definitions.(ptr) |
| val | Change the values of sleep-dur in reg POWMODE. |
| sel | Change the values of lowpower / suspend in reg POWMODE. |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_xl_range_get | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_range_t * | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Accelerometer range selection.
[get]
| i2c | Read / write interface definitions.(ptr) |
| val | Get the values of range in reg RANGESEL.(ptr) |
| Interface | status (MANDATORY: return 0 -> no Error). |
| int32_t stk8ba58_xl_range_set | ( | const struct i2c_dt_spec * | i2c, |
| stk8ba58_range_t | val ) |
#include </__w/bridle/bridle/workspace/bridle/drivers/sensor/sensortek/stk8ba58/stk8ba58_reg.h>
Accelerometer range selection.
[set]
| i2c | Read / write interface definitions.(ptr) |
| val | Change the values of range in reg RANGESEL. |
| Interface | status (MANDATORY: return 0 -> no Error). |