amrangle2 2.1.0.0
|
API for configuring and manipulating AMR Angle 2 Click driver. More...
Topics | |
AMR Angle 2 Registers List | |
List of registers of AMR Angle 2 Click driver. | |
AMR Angle 2 Registers Settings | |
Settings for registers of AMR Angle 2 Click driver. | |
AMR Angle 2 MikroBUS Map | |
MikroBUS pin mapping of AMR Angle 2 Click driver. | |
Functions | |
void | amrangle2_cfg_setup (amrangle2_cfg_t *cfg) |
AMR Angle 2 configuration object setup function. | |
err_t | amrangle2_init (amrangle2_t *ctx, amrangle2_cfg_t *cfg) |
AMR Angle 2 initialization function. | |
err_t | amrangle2_default_cfg (amrangle2_t *ctx) |
AMR Angle 2 default configuration function. | |
err_t | amrangle2_spi_transfer (amrangle2_t *ctx, uint16_t data_in) |
AMR Angle 2 spi transfer function. | |
err_t | amrangle2_read_an_pin_value (amrangle2_t *ctx, uint16_t *data_out) |
AMR Angle 2 read AN pin value function. | |
err_t | amrangle2_read_an_pin_voltage (amrangle2_t *ctx, float *data_out) |
AMR Angle 2 read AN pin voltage level function. | |
err_t | amrangle2_calibrate_temperature (amrangle2_t *ctx) |
AMR Angle 2 calibrate temperature function. | |
err_t | amrangle2_read_temperature (amrangle2_t *ctx, float *temperature) |
AMR Angle 2 read temperature function. | |
err_t | amrangle2_read_vsin_vcos (amrangle2_t *ctx, float *vsin, float *vcos) |
AMR Angle 2 read vsin vcos function. | |
err_t | amrangle2_read_angle (amrangle2_t *ctx, float *angle) |
AMR Angle 2 read angle function. | |
void | amrangle2_set_cst_pin (amrangle2_t *ctx, uint8_t state) |
AMR Angle 2 set cst pin function. | |
uint8_t | amrangle2_get_eoc_pin (amrangle2_t *ctx) |
AMR Angle 2 get eoc pin function. | |
void | amrangle2_start_conversion (amrangle2_t *ctx) |
AMR Angle 2 start conversion function. | |
API for configuring and manipulating AMR Angle 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t amrangle2_calibrate_temperature | ( | amrangle2_t * | ctx | ) |
AMR Angle 2 calibrate temperature function.
This function calibrates the temperature readings (ctx->vcal) to the known room temperature in Celsius (AMRANGLE2_TEMP_TCAL).
[in] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void amrangle2_cfg_setup | ( | amrangle2_cfg_t * | cfg | ) |
AMR Angle 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See amrangle2_cfg_t object definition for detailed explanation. |
err_t amrangle2_default_cfg | ( | amrangle2_t * | ctx | ) |
AMR Angle 2 default configuration function.
This function executes a default configuration of AMR Angle 2 click board.
[in] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t amrangle2_get_eoc_pin | ( | amrangle2_t * | ctx | ) |
AMR Angle 2 get eoc pin function.
This function returns the conversion end (EOC) pin logic state.
[in] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |
err_t amrangle2_init | ( | amrangle2_t * | ctx, |
amrangle2_cfg_t * | cfg ) |
AMR Angle 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See amrangle2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t amrangle2_read_an_pin_value | ( | amrangle2_t * | ctx, |
uint16_t * | data_out ) |
AMR Angle 2 read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See amrangle2_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 amrangle2_read_an_pin_voltage | ( | amrangle2_t * | ctx, |
float * | data_out ) |
AMR Angle 2 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 amrangle2_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 amrangle2_read_angle | ( | amrangle2_t * | ctx, |
float * | angle ) |
AMR Angle 2 read angle function.
This function reads a Vsin and Vcos voltages and converts them to angle in Degrees.
[in] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |
[out] | angle | : Angular position in degrees. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t amrangle2_read_temperature | ( | amrangle2_t * | ctx, |
float * | temperature ) |
AMR Angle 2 read temperature function.
This function reads a temperature measurements in Celsius.
[in] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t amrangle2_read_vsin_vcos | ( | amrangle2_t * | ctx, |
float * | vsin, | ||
float * | vcos ) |
AMR Angle 2 read vsin vcos function.
This function reads a voltage of sine and cosine differential signal outputs.
[in] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |
[out] | vsin | : Sine voltage. |
[out] | vcos | : Cosine voltage. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void amrangle2_set_cst_pin | ( | amrangle2_t * | ctx, |
uint8_t | state ) |
AMR Angle 2 set cst pin function.
This function sets the conversion start (CST) pin logic state.
[in] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t amrangle2_spi_transfer | ( | amrangle2_t * | ctx, |
uint16_t | data_in ) |
AMR Angle 2 spi transfer function.
This function writes and reads a word of data simultaneously by using SPI serial interface.
[in] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
>=0
- 16-bit data read, -1
- Error. See #err_t definition for detailed explanation. void amrangle2_start_conversion | ( | amrangle2_t * | ctx | ) |
AMR Angle 2 start conversion function.
This function starts the conversion and waits for the end of conversion indication.
[in] | ctx | : Click context object. See amrangle2_t object definition for detailed explanation. |