airmotion 2.1.0.0
|
API for configuring and manipulating Air Motion Click driver. More...
Topics | |
Air Motion Registers List | |
List of registers of Air Motion Click driver. | |
Air Motion Registers Settings | |
Settings for registers of Air Motion Click driver. | |
Air Motion MikroBUS Map | |
MikroBUS pin mapping of Air Motion Click driver. | |
Functions | |
void | airmotion_cfg_setup (airmotion_cfg_t *cfg) |
Air Motion configuration object setup function. | |
void | airmotion_drv_interface_selection (airmotion_cfg_t *cfg, airmotion_drv_t drv_sel) |
Air Motion driver interface setup function. | |
err_t | airmotion_init (airmotion_t *ctx, airmotion_cfg_t *cfg) |
Air Motion initialization function. | |
err_t | airmotion_default_cfg (airmotion_t *ctx) |
Air Motion default configuration function. | |
err_t | airmotion_generic_write (airmotion_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Air Motion data writing function. | |
err_t | airmotion_generic_read (airmotion_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Air Motion data reading function. | |
err_t | airmotion_set_reg_bank (airmotion_t *ctx, uint8_t bank) |
Air Motion set register bank function. | |
err_t | airmotion_reg_write (airmotion_t *ctx, uint8_t reg_bank, uint8_t reg, uint8_t *data_in, uint8_t len) |
Air Motion register data writing function. | |
err_t | airmotion_reg_read (airmotion_t *ctx, uint8_t reg_bank, uint8_t reg, uint8_t *data_out, uint8_t len) |
Air Motion data reading function. | |
err_t | airmotion_configure_digital_interface (airmotion_t *ctx, uint8_t slew_rate) |
Air Motion configure digital interface function. | |
uint8_t | airmotion_get_int1_state (airmotion_t *ctx) |
Air Motion read INT1 pin state function. | |
err_t | airmotion_sw_reset (airmotion_t *ctx) |
Air Motion software reset function. | |
err_t | airmotion_read_temperature (airmotion_t *ctx, float *temperature_data) |
Air Motion read temperature function. | |
err_t | airmotion_read_timestamp (airmotion_t *ctx, uint32_t *tmst_data) |
Air Motion read timestamp function. | |
err_t | airmotion_get_data_from_register (airmotion_t *ctx, float *temperature_data, airmotion_data_t *accel_data, airmotion_data_t *gyro_data, uint32_t *tmst_data) |
Air Motion read data function. | |
err_t | airmotion_set_basic_tap_detection (airmotion_t *ctx) |
Air Motion basic tap detection configuration function. | |
err_t | airmotion_get_tap_detection (airmotion_t *ctx, uint8_t *tap_num, uint8_t *tap_axis, uint8_t *tap_dir) |
Air Motion get tap detection data function. | |
API for configuring and manipulating Air Motion Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void airmotion_cfg_setup | ( | airmotion_cfg_t * | cfg | ) |
Air Motion configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See airmotion_cfg_t object definition for detailed explanation. |
err_t airmotion_configure_digital_interface | ( | airmotion_t * | ctx, |
uint8_t | slew_rate ) |
Air Motion configure digital interface function.
This function sets a digital communication interface based on selected communication.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[in] | slew_rate | : Slew rate of selected interface. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_default_cfg | ( | airmotion_t * | ctx | ) |
Air Motion default configuration function.
This function executes a default configuration of Air Motion click board.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void airmotion_drv_interface_selection | ( | airmotion_cfg_t * | cfg, |
airmotion_drv_t | drv_sel ) |
Air Motion driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See airmotion_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See airmotion_drv_t object definition for detailed explanation. |
err_t airmotion_generic_read | ( | airmotion_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Air Motion data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_generic_write | ( | airmotion_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Air Motion data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_get_data_from_register | ( | airmotion_t * | ctx, |
float * | temperature_data, | ||
airmotion_data_t * | accel_data, | ||
airmotion_data_t * | gyro_data, | ||
uint32_t * | tmst_data ) |
Air Motion read data function.
This function is used to read accel, gyro, temperature, and timestamp data from the Air Motion click board. This data can be then processed and used in a specific way.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[out] | temperature_data | : Temperature data value. |
[out] | accel_data | : Accel data value. |
[out] | gyro_data | : Gyro data value. |
[out] | tmst_data | : Timestamp value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t airmotion_get_int1_state | ( | airmotion_t * | ctx | ) |
Air Motion read INT1 pin state function.
Air Motion read INT2 pin state function.
This function is used to get state of the INT1 (int_pin).
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
This function is used to get state of the INT2 (int_pin).
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
err_t airmotion_get_tap_detection | ( | airmotion_t * | ctx, |
uint8_t * | tap_num, | ||
uint8_t * | tap_axis, | ||
uint8_t * | tap_dir ) |
Air Motion get tap detection data function.
This function is used to read tap detection data from the Air Motion click board.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[out] | tap_num | : Numbers of taps. |
[out] | tap_axis | : Axis of the tap direction. |
[out] | tap_dir | : Direction of the tap in correspondence to the starting point. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_init | ( | airmotion_t * | ctx, |
airmotion_cfg_t * | cfg ) |
Air Motion initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See airmotion_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_read_temperature | ( | airmotion_t * | ctx, |
float * | temperature_data ) |
Air Motion read temperature function.
This function is used to read temperature from the Air Motion click board.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[out] | temperature_data | : Temperature value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_read_timestamp | ( | airmotion_t * | ctx, |
uint32_t * | tmst_data ) |
Air Motion read timestamp function.
This function is used to read data timestamp from the Air Motion click board.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[out] | tmst_data | : Timestamp value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_reg_read | ( | airmotion_t * | ctx, |
uint8_t | reg_bank, | ||
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Air Motion data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_reg_write | ( | airmotion_t * | ctx, |
uint8_t | reg_bank, | ||
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Air Motion register data writing function.
This function writes a desired number of data bytes starting from the selected register. Register addresses are self increasing according to the number of bytes of input data.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[in] | bank | : Specific register bank. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_set_basic_tap_detection | ( | airmotion_t * | ctx | ) |
Air Motion basic tap detection configuration function.
This function is used to configure the Air Motion click board into tap detection configuration.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_set_reg_bank | ( | airmotion_t * | ctx, |
uint8_t | bank ) |
Air Motion set register bank function.
This function switches to the desired register bank in order to access specific registers on that bank.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
[in] | bank | : Specific register bank. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t airmotion_sw_reset | ( | airmotion_t * | ctx | ) |
Air Motion software reset function.
This function is used to perform a software reset of the Air Motion click board.
[in] | ctx | : Click context object. See airmotion_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.