inclinometer2 2.0.0.0
|
API for configuring and manipulating Inclinometer 2 Click driver. More...
Topics | |
Inclinometer 2 Registers List | |
List of registers of Inclinometer 2 Click driver. | |
Inclinometer 2 Registers Settings | |
Settings for registers of Inclinometer 2 Click driver. | |
Inclinometer 2 MikroBUS Map | |
MikroBUS pin mapping of Inclinometer 2 Click driver. | |
Functions | |
void | inclinometer2_cfg_setup (inclinometer2_cfg_t *cfg) |
Inclinometer 2 configuration object setup function. | |
void | inclinometer2_drv_interface_selection (inclinometer2_cfg_t *cfg, inclinometer2_drv_t drv_sel) |
Inclinometer 2 driver interface setup function. | |
err_t | inclinometer2_init (inclinometer2_t *ctx, inclinometer2_cfg_t *cfg) |
Inclinometer 2 initialization function. | |
err_t | inclinometer2_default_cfg (inclinometer2_t *ctx) |
Inclinometer 2 default configuration function. | |
err_t | inclinometer2_generic_write (inclinometer2_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Inclinometer 2 data writing function. | |
err_t | inclinometer2_generic_read (inclinometer2_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Inclinometer 2 data reading function. | |
err_t | inclinometer2_write_register (inclinometer2_t *ctx, uint8_t reg, uint8_t data_in) |
Inclinometer 2 write register function. | |
err_t | inclinometer2_read_register (inclinometer2_t *ctx, uint8_t reg, uint8_t *data_out) |
Inclinometer 2 read register function. | |
err_t | inclinometer2_check_communication (inclinometer2_t *ctx) |
Inclinometer 2 check communication function. | |
uint8_t | inclinometer2_get_int_pin (inclinometer2_t *ctx) |
Inclinometer 2 get int pin function. | |
err_t | inclinometer2_set_fsr_and_odr (inclinometer2_t *ctx, inclinometer2_fsr_t fsr, inclinometer2_odr_t odr) |
Inclinometer 2 set fsr and odr function. | |
err_t | inclinometer2_get_accel (inclinometer2_t *ctx, float *x_axis, float *y_axis) |
Inclinometer 2 get accel function. | |
err_t | inclinometer2_get_temperature (inclinometer2_t *ctx, float *temperature) |
Inclinometer 2 get temperature function. | |
API for configuring and manipulating Inclinometer 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void inclinometer2_cfg_setup | ( | inclinometer2_cfg_t * | cfg | ) |
Inclinometer 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See inclinometer2_cfg_t object definition for detailed explanation. |
err_t inclinometer2_check_communication | ( | inclinometer2_t * | ctx | ) |
Inclinometer 2 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See inclinometer2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t inclinometer2_default_cfg | ( | inclinometer2_t * | ctx | ) |
Inclinometer 2 default configuration function.
This function executes a default configuration of Inclinometer 2 click board.
[in] | ctx | : Click context object. See inclinometer2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void inclinometer2_drv_interface_selection | ( | inclinometer2_cfg_t * | cfg, |
inclinometer2_drv_t | drv_sel ) |
Inclinometer 2 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 inclinometer2_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See inclinometer2_drv_t object definition for detailed explanation. |
err_t inclinometer2_generic_read | ( | inclinometer2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Inclinometer 2 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See inclinometer2_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 inclinometer2_generic_write | ( | inclinometer2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Inclinometer 2 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See inclinometer2_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 inclinometer2_get_accel | ( | inclinometer2_t * | ctx, |
float * | x_axis, | ||
float * | y_axis ) |
Inclinometer 2 get accel function.
This function checks if the accel data is ready and than reads the accel X and Y axis in mg.
[in] | ctx | : Click context object. See inclinometer2_t object definition for detailed explanation. |
[out] | x_axis | : Accel X-axis data in mg. |
[out] | y_axis | : Accel Y-axis data in mg. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t inclinometer2_get_int_pin | ( | inclinometer2_t * | ctx | ) |
Inclinometer 2 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See inclinometer2_t object definition for detailed explanation. |
err_t inclinometer2_get_temperature | ( | inclinometer2_t * | ctx, |
float * | temperature ) |
Inclinometer 2 get temperature function.
This function checks if the temperature data is ready and than reads the temperature in Celsius.
[in] | ctx | : Click context object. See inclinometer2_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t inclinometer2_init | ( | inclinometer2_t * | ctx, |
inclinometer2_cfg_t * | cfg ) |
Inclinometer 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See inclinometer2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See inclinometer2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t inclinometer2_read_register | ( | inclinometer2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Inclinometer 2 read register function.
This function reads data from the selected register.
[in] | ctx | : Click context object. See inclinometer2_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t inclinometer2_set_fsr_and_odr | ( | inclinometer2_t * | ctx, |
inclinometer2_fsr_t | fsr, | ||
inclinometer2_odr_t | odr ) |
Inclinometer 2 set fsr and odr function.
This function sets the accel full-scale range (FSR) and output data rate (ODR) bits in CTRL1_XL register.
[in] | ctx | : Click context object. See inclinometer2_t object definition for detailed explanation. |
[in] | fsr | : Accel full-scale range bits setting. See inclinometer2_fsr_t enum definition for detailed explanation. |
[in] | odr | : Output data rate bits setting. See inclinometer2_odr_t enum definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t inclinometer2_write_register | ( | inclinometer2_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Inclinometer 2 write register function.
This function writes a data byte to the selected register.
[in] | ctx | : Click context object. See inclinometer2_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.