angle7 2.0.0.0
|
API for configuring and manipulating Angle 7 Click driver. More...
Topics | |
Angle 7 Registers List | |
List of registers of Angle 7 Click driver. | |
Angle 7 Registers Settings | |
Settings for registers of Angle 7 Click driver. | |
Angle 7 MikroBUS Map | |
MikroBUS pin mapping of Angle 7 Click driver. | |
Functions | |
void | angle7_cfg_setup (angle7_cfg_t *cfg) |
Angle 7 configuration object setup function. | |
err_t | angle7_init (angle7_t *ctx, angle7_cfg_t *cfg) |
Angle 7 initialization function. | |
err_t | angle7_default_cfg (angle7_t *ctx) |
Angle 7 default configuration function. | |
err_t | angle7_generic_write (angle7_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Angle 7 I2C writing function. | |
err_t | angle7_generic_read (angle7_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Angle 7 I2C reading function. | |
err_t | angle7_write_two_bytes (angle7_t *ctx, uint8_t reg, uint16_t data_in) |
Angle 7 write two bytes function. | |
err_t | angle7_read_two_bytes (angle7_t *ctx, uint8_t reg, uint16_t *data_out) |
Angle 7 read two bytes function. | |
err_t | angle7_read_an_pin_value (angle7_t *ctx, uint16_t *data_out) |
Angle 7 read AN pin value function. | |
err_t | angle7_read_an_pin_voltage (angle7_t *ctx, float *data_out) |
Angle 7 read AN pin voltage level function. | |
uint8_t | angle7_get_int_pin (angle7_t *ctx) |
Angle 7 get int pin function. | |
void | angle7_enable_device (angle7_t *ctx) |
Angle 7 enable device function. | |
void | angle7_disable_device (angle7_t *ctx) |
Angle 7 disable device function. | |
err_t | angle7_set_start_position (angle7_t *ctx, float angle) |
Angle 7 set start position function. | |
err_t | angle7_get_start_position (angle7_t *ctx, float *angle) |
Angle 7 get start position function. | |
err_t | angle7_set_stop_position (angle7_t *ctx, float angle) |
Angle 7 set stop position function. | |
err_t | angle7_get_stop_position (angle7_t *ctx, float *angle) |
Angle 7 get stop position function. | |
err_t | angle7_get_raw_angle (angle7_t *ctx, float *angle) |
Angle 7 get raw angle function. | |
err_t | angle7_get_angle (angle7_t *ctx, float *angle) |
Angle 7 get angle function. | |
err_t | angle7_get_status (angle7_t *ctx, uint8_t *status) |
Angle 7 get status function. | |
err_t | angle7_get_agc (angle7_t *ctx, uint8_t *agc) |
Angle 7 get agc function. | |
err_t | angle7_get_magnitude (angle7_t *ctx, uint16_t *magnitude) |
Angle 7 get magnitude function. | |
API for configuring and manipulating Angle 7 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void angle7_cfg_setup | ( | angle7_cfg_t * | cfg | ) |
Angle 7 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See angle7_cfg_t object definition for detailed explanation. |
err_t angle7_default_cfg | ( | angle7_t * | ctx | ) |
Angle 7 default configuration function.
This function executes a default configuration of Angle 7 click board.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void angle7_disable_device | ( | angle7_t * | ctx | ) |
Angle 7 disable device function.
This function disables the device by setting the EN pin to LOW logic state.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
void angle7_enable_device | ( | angle7_t * | ctx | ) |
Angle 7 enable device function.
This function enables the device by setting the EN pin to HIGH logic state.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
err_t angle7_generic_read | ( | angle7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Angle 7 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See angle7_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 angle7_generic_write | ( | angle7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Angle 7 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See angle7_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 angle7_get_agc | ( | angle7_t * | ctx, |
uint8_t * | agc ) |
Angle 7 get agc function.
This function reads the AGC (automatic gain control) data.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[out] | agc | : AGC register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_get_angle | ( | angle7_t * | ctx, |
float * | angle ) |
Angle 7 get angle function.
This function reads the calculated angle in degrees.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[out] | angle | : Calculated angle in degrees. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t angle7_get_int_pin | ( | angle7_t * | ctx | ) |
Angle 7 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
err_t angle7_get_magnitude | ( | angle7_t * | ctx, |
uint16_t * | magnitude ) |
Angle 7 get magnitude function.
This function reads the magnitude data.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[out] | magnitude | : Magnitude register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_get_raw_angle | ( | angle7_t * | ctx, |
float * | angle ) |
Angle 7 get raw angle function.
This function reads the RAW angle in degrees.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[out] | angle | : RAW angle in degrees. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_get_start_position | ( | angle7_t * | ctx, |
float * | angle ) |
Angle 7 get start position function.
This function reads the start position in angle degrees used for angle calculation.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[out] | angle | : Start angle in degrees. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_get_status | ( | angle7_t * | ctx, |
uint8_t * | status ) |
Angle 7 get status function.
This function reads the status data.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[out] | status | : Status register data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_get_stop_position | ( | angle7_t * | ctx, |
float * | angle ) |
Angle 7 get stop position function.
This function reads the stop position in angle degrees used for angle calculation.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[out] | angle | : Stop angle in degrees. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_init | ( | angle7_t * | ctx, |
angle7_cfg_t * | cfg ) |
Angle 7 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See angle7_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_read_an_pin_value | ( | angle7_t * | ctx, |
uint16_t * | data_out ) |
Angle 7 read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_read_an_pin_voltage | ( | angle7_t * | ctx, |
float * | data_out ) |
Angle 7 read AN pin voltage level function.
This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_read_two_bytes | ( | angle7_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
Angle 7 read two bytes function.
This function reads two bytes of data from two consecutive registers starting from the selected address by using I2C serial interface.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_set_start_position | ( | angle7_t * | ctx, |
float | angle ) |
Angle 7 set start position function.
This function sets the start position in angle degrees used for angle calculation.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[in] | angle | : Start angle in degrees. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_set_stop_position | ( | angle7_t * | ctx, |
float | angle ) |
Angle 7 set stop position function.
This function sets the stop position in angle degrees used for angle calculation.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[in] | angle | : Stop angle in degrees. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t angle7_write_two_bytes | ( | angle7_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
Angle 7 write two bytes function.
This function writes two bytes of data to two consecutive registers starting from the selected address by using I2C serial interface.
[in] | ctx | : Click context object. See angle7_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.