angle8 2.0.0.0
|
API for configuring and manipulating Angle 8 Click driver. More...
Topics | |
Angle 8 Registers List | |
List of registers of Angle 8 Click driver. | |
Angle 8 Registers Settings | |
Settings for registers of Angle 8 Click driver. | |
Angle 8 MikroBUS Map | |
MikroBUS pin mapping of Angle 8 Click driver. | |
Functions | |
void | angle8_cfg_setup (angle8_cfg_t *cfg) |
Angle 8 configuration object setup function. | |
err_t | angle8_init (angle8_t *ctx, angle8_cfg_t *cfg) |
Angle 8 initialization function. | |
err_t | angle8_default_cfg (angle8_t *ctx) |
Angle 8 default configuration function. | |
err_t | angle8_write_register (angle8_t *ctx, uint8_t reg, uint8_t data_in) |
Angle 8 write register function. | |
err_t | angle8_read_register (angle8_t *ctx, uint8_t reg, uint8_t *data_out) |
Angle 8 read register function. | |
err_t | angle8_read_angle (angle8_t *ctx, float *angle) |
Angle 8 read angle function. | |
err_t | angle8_store_all_registers (angle8_t *ctx) |
Angle 8 store all registers function. | |
err_t | angle8_store_single_register (angle8_t *ctx, uint8_t reg) |
Angle 8 store single register function. | |
err_t | angle8_clear_error_flags (angle8_t *ctx) |
Angle 8 clear error flags function. | |
void | angle8_enable_device (angle8_t *ctx) |
Angle 8 enable device function. | |
void | angle8_disable_device (angle8_t *ctx) |
Angle 8 disable device function. | |
uint8_t | angle8_get_nd_pin (angle8_t *ctx) |
Angle 8 get nd pin function. | |
uint8_t | angle8_get_dv_pin (angle8_t *ctx) |
Angle 8 get dv pin function. | |
uint8_t | angle8_get_mgl_pin (angle8_t *ctx) |
Angle 8 get mgl pin function. | |
err_t | angle8_set_cycle_time (angle8_t *ctx, float time_ms) |
Angle 8 set cycle time function. | |
API for configuring and manipulating Angle 8 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void angle8_cfg_setup | ( | angle8_cfg_t * | cfg | ) |
Angle 8 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See angle8_cfg_t object definition for detailed explanation. |
err_t angle8_clear_error_flags | ( | angle8_t * | ctx | ) |
Angle 8 clear error flags function.
This function executes the clear error flags command.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle8_default_cfg | ( | angle8_t * | ctx | ) |
Angle 8 default configuration function.
This function executes a default configuration of Angle 8 click board.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void angle8_disable_device | ( | angle8_t * | ctx | ) |
Angle 8 disable device function.
This function disables the device by setting the EN pin to high logic state.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
void angle8_enable_device | ( | angle8_t * | ctx | ) |
Angle 8 enable device function.
This function enables the device by setting the EN pin to low logic state.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
uint8_t angle8_get_dv_pin | ( | angle8_t * | ctx | ) |
Angle 8 get dv pin function.
This function returns the data valid (DV) pin logic state.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
uint8_t angle8_get_mgl_pin | ( | angle8_t * | ctx | ) |
Angle 8 get mgl pin function.
This function returns the MGL alarm flag (MGL) pin logic state.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
uint8_t angle8_get_nd_pin | ( | angle8_t * | ctx | ) |
Angle 8 get nd pin function.
This function returns the new data ready (ND) pin logic state.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
err_t angle8_init | ( | angle8_t * | ctx, |
angle8_cfg_t * | cfg ) |
Angle 8 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See angle8_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle8_read_angle | ( | angle8_t * | ctx, |
float * | angle ) |
Angle 8 read angle function.
This function reads raw angle data and converts it to degrees.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
[out] | angle | : Angle in degrees. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle8_read_register | ( | angle8_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Angle 8 read register function.
This function reads a data byte from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See angle8_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 angle8_set_cycle_time | ( | angle8_t * | ctx, |
float | time_ms ) |
Angle 8 set cycle time function.
This function sets the sensor cycle time (measurement rate) in milliseconds.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
[in] | time_ms | : Cycle time in milliseconds. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle8_store_all_registers | ( | angle8_t * | ctx | ) |
Angle 8 store all registers function.
This function executes the store all registers to NVM command.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle8_store_single_register | ( | angle8_t * | ctx, |
uint8_t | reg ) |
Angle 8 store single register function.
This function executes the store single register to NVM command.
[in] | ctx | : Click context object. See angle8_t object definition for detailed explanation. |
[in] | reg | : Register address. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle8_write_register | ( | angle8_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Angle 8 write register function.
This function writes a data byte to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See angle8_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.