smartdof5
2.1.0.0
|
API for configuring and manipulating Smart DOF 5 Click driver. More...
Modules | |
Smart DOF 5 Registers List | |
List of registers of Smart DOF 5 Click driver. | |
Smart DOF 5 Registers Settings | |
Settings for registers of Smart DOF 5 Click driver. | |
Smart DOF 5 MikroBUS Map | |
MikroBUS pin mapping of Smart DOF 5 Click driver. | |
Functions | |
void | smartdof5_cfg_setup (smartdof5_cfg_t *cfg) |
Smart DOF 5 configuration object setup function. More... | |
void | smartdof5_drv_interface_sel (smartdof5_cfg_t *cfg, smartdof5_drv_t drv_sel) |
Smart DOF 5 driver interface setup function. More... | |
err_t | smartdof5_init (smartdof5_t *ctx, smartdof5_cfg_t *cfg) |
Smart DOF 5 initialization function. More... | |
err_t | smartdof5_default_cfg (smartdof5_t *ctx) |
Smart DOF 5 default configuration function. More... | |
err_t | smartdof5_write_reg (smartdof5_t *ctx, uint8_t reg, uint8_t data_in) |
Smart DOF 5 write reg function. More... | |
err_t | smartdof5_write_regs (smartdof5_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Smart DOF 5 write regs function. More... | |
err_t | smartdof5_read_reg (smartdof5_t *ctx, uint8_t reg, uint8_t *data_out) |
Smart DOF 5 read reg function. More... | |
err_t | smartdof5_read_regs (smartdof5_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Smart DOF 5 read regs function. More... | |
uint8_t | smartdof5_get_int_pin (smartdof5_t *ctx) |
Smart DOF 5 get int pin function. More... | |
err_t | smartdof5_check_communication (smartdof5_t *ctx) |
Smart DOF 5 check communication function. More... | |
err_t | smartdof5_set_mem_bank (smartdof5_t *ctx, uint8_t mem_bank) |
Smart DOF 5 set mem bank function. More... | |
err_t | smartdof5_sw_reset (smartdof5_t *ctx) |
Smart DOF 5 sw reset function. More... | |
err_t | smartdof5_set_accel_odr (smartdof5_t *ctx, uint8_t odr) |
Smart DOF 5 set accel odr function. More... | |
err_t | smartdof5_set_gyro_odr (smartdof5_t *ctx, uint8_t odr) |
Smart DOF 5 set gyro odr function. More... | |
err_t | smartdof5_set_accel_fsr (smartdof5_t *ctx, uint8_t fsr) |
Smart DOF 5 set accel fsr function. More... | |
err_t | smartdof5_set_gyro_fsr (smartdof5_t *ctx, uint8_t fsr) |
Smart DOF 5 set gyro fsr function. More... | |
err_t | smartdof5_get_accel_drdy (smartdof5_t *ctx, uint8_t *drdy) |
Smart DOF 5 get accel drdy function. More... | |
err_t | smartdof5_get_gyro_drdy (smartdof5_t *ctx, uint8_t *drdy) |
Smart DOF 5 get gyro drdy function. More... | |
err_t | smartdof5_get_temp_drdy (smartdof5_t *ctx, uint8_t *drdy) |
Smart DOF 5 get temp drdy function. More... | |
err_t | smartdof5_get_accel (smartdof5_t *ctx, smartdof5_axes_t *accel) |
Smart DOF 5 get accel function. More... | |
err_t | smartdof5_get_gyro (smartdof5_t *ctx, smartdof5_axes_t *gyro) |
Smart DOF 5 get gyro function. More... | |
err_t | smartdof5_get_temp (smartdof5_t *ctx, float *temp) |
Smart DOF 5 get temp function. More... | |
err_t | smartdof5_get_data (smartdof5_t *ctx, smartdof5_data_t *data_out) |
Smart DOF 5 get data function. More... | |
API for configuring and manipulating Smart DOF 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void smartdof5_cfg_setup | ( | smartdof5_cfg_t * | cfg | ) |
Smart DOF 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See smartdof5_cfg_t object definition for detailed explanation. |
err_t smartdof5_check_communication | ( | smartdof5_t * | ctx | ) |
Smart DOF 5 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_default_cfg | ( | smartdof5_t * | ctx | ) |
Smart DOF 5 default configuration function.
This function executes a default configuration of Smart DOF 5 click board.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void smartdof5_drv_interface_sel | ( | smartdof5_cfg_t * | cfg, |
smartdof5_drv_t | drv_sel | ||
) |
Smart DOF 5 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 smartdof5_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See smartdof5_drv_t object definition for detailed explanation. |
err_t smartdof5_get_accel | ( | smartdof5_t * | ctx, |
smartdof5_axes_t * | accel | ||
) |
Smart DOF 5 get accel function.
This function reads the accelerometer of X, Y, and Z axis relative to standard gravity (g).
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[out] | accel | : Output accelerometer data. See smartdof5_axes_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_get_accel_drdy | ( | smartdof5_t * | ctx, |
uint8_t * | drdy | ||
) |
Smart DOF 5 get accel drdy function.
This function gets the accel new data available flag.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[out] | drdy | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_get_data | ( | smartdof5_t * | ctx, |
smartdof5_data_t * | data_out | ||
) |
Smart DOF 5 get data function.
This function reads the accelerometer, gyroscope, and temperature measurement data.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[out] | data_out | : Output data structure read. See smartdof5_data_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_get_gyro | ( | smartdof5_t * | ctx, |
smartdof5_axes_t * | gyro | ||
) |
Smart DOF 5 get gyro function.
This function reads the angular rate of X, Y, and Z axis in degrees per second (dps).
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[out] | gyro | : Output gyro data. See smartdof5_axes_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_get_gyro_drdy | ( | smartdof5_t * | ctx, |
uint8_t * | drdy | ||
) |
Smart DOF 5 get gyro drdy function.
This function gets the gyro new data available flag.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[out] | drdy | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t smartdof5_get_int_pin | ( | smartdof5_t * | ctx | ) |
Smart DOF 5 get int pin function.
This function returns the interrupt 1 pin logic state.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
err_t smartdof5_get_temp | ( | smartdof5_t * | ctx, |
float * | temp | ||
) |
Smart DOF 5 get temp function.
This function reads the temperature measurement in degrees Celsius.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[out] | temp | : Temperature in degrees Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_get_temp_drdy | ( | smartdof5_t * | ctx, |
uint8_t * | drdy | ||
) |
Smart DOF 5 get temp drdy function.
This function gets the temperature new data available flag.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[out] | drdy | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_init | ( | smartdof5_t * | ctx, |
smartdof5_cfg_t * | cfg | ||
) |
Smart DOF 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See smartdof5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_read_reg | ( | smartdof5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out | ||
) |
Smart DOF 5 read reg function.
This function reads a data byte from the selected register.
[in] | ctx | : Click context object. See smartdof5_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 smartdof5_read_regs | ( | smartdof5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len | ||
) |
Smart DOF 5 read regs function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See smartdof5_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 smartdof5_set_accel_fsr | ( | smartdof5_t * | ctx, |
uint8_t | fsr | ||
) |
Smart DOF 5 set accel fsr function.
This function sets the accel measurement full scale range.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[in] | fsr | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_set_accel_odr | ( | smartdof5_t * | ctx, |
uint8_t | odr | ||
) |
Smart DOF 5 set accel odr function.
This function sets the accel measurement output data rate.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[in] | odr | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_set_gyro_fsr | ( | smartdof5_t * | ctx, |
uint8_t | fsr | ||
) |
Smart DOF 5 set gyro fsr function.
This function sets the gyro measurement full scale range.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[in] | fsr | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_set_gyro_odr | ( | smartdof5_t * | ctx, |
uint8_t | odr | ||
) |
Smart DOF 5 set gyro odr function.
This function sets the gyro measurement output data rate.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[in] | odr | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_set_mem_bank | ( | smartdof5_t * | ctx, |
uint8_t | mem_bank | ||
) |
Smart DOF 5 set mem bank function.
This function sets the memory bank to user memory, sensor hub, or embedded functions configuration registers.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
[in] | mem_bank | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_sw_reset | ( | smartdof5_t * | ctx | ) |
Smart DOF 5 sw reset function.
This function restores the default values in user memory registers.
[in] | ctx | : Click context object. See smartdof5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t smartdof5_write_reg | ( | smartdof5_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in | ||
) |
Smart DOF 5 write reg function.
This function writes a data byte to the selected register.
[in] | ctx | : Click context object. See smartdof5_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. err_t smartdof5_write_regs | ( | smartdof5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len | ||
) |
Smart DOF 5 write regs function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See smartdof5_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.