magneticrotary5 2.1.0.0
|
API for configuring and manipulating Magnetic Rotary 5 Click driver. More...
Topics | |
Magnetic Rotary 5 Registers List | |
List of registers of Magnetic Rotary 5 Click driver. | |
Magnetic Rotary 5 Registers Settings | |
Settings for registers of Magnetic Rotary 5 Click driver. | |
Magnetic Rotary 5 MikroBUS Map | |
MikroBUS pin mapping of Magnetic Rotary 5 Click driver. | |
Functions | |
void | magneticrotary5_cfg_setup (magneticrotary5_cfg_t *cfg) |
Magnetic Rotary 5 configuration object setup function. | |
err_t | magneticrotary5_init (magneticrotary5_t *ctx, magneticrotary5_cfg_t *cfg) |
Magnetic Rotary 5 initialization function. | |
err_t | magneticrotary5_default_cfg (magneticrotary5_t *ctx) |
Magnetic Rotary 5 default configuration function. | |
err_t | magneticrotary5_write_cmd (magneticrotary5_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len) |
Magnetic Rotary 5 write cmd function. | |
err_t | magneticrotary5_read_cmd (magneticrotary5_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len) |
Magnetic Rotary 5 read cmd function. | |
err_t | magneticrotary5_read_angle (magneticrotary5_t *ctx, uint8_t *agc, uint16_t *angle) |
Magnetic Rotary 5 read angle function. | |
err_t | magneticrotary5_read_mt_cnt (magneticrotary5_t *ctx, int16_t *mt_cnt) |
Magnetic Rotary 5 read multi turn counter function. | |
err_t | magneticrotary5_set_mt_cnt (magneticrotary5_t *ctx, int16_t mt_cnt) |
Magnetic Rotary 5 set multi turn counter function. | |
err_t | magneticrotary5_read_raw_adc (magneticrotary5_t *ctx, uint16_t *raw_adc) |
Magnetic Rotary 5 read raw ADC value function. | |
err_t | magneticrotary5_read_voltage (magneticrotary5_t *ctx, float *voltage) |
Magnetic Rotary 5 read voltage level function. | |
err_t | magneticrotary5_set_vref (magneticrotary5_t *ctx, float vref) |
Magnetic Rotary 5 set vref function. | |
API for configuring and manipulating Magnetic Rotary 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 magneticrotary5_cfg_setup | ( | magneticrotary5_cfg_t * | cfg | ) |
Magnetic Rotary 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See magneticrotary5_cfg_t object definition for detailed explanation. |
err_t magneticrotary5_default_cfg | ( | magneticrotary5_t * | ctx | ) |
Magnetic Rotary 5 default configuration function.
This function executes a default configuration of Magnetic Rotary 5 click board.
[in] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary5_init | ( | magneticrotary5_t * | ctx, |
magneticrotary5_cfg_t * | cfg ) |
Magnetic Rotary 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See magneticrotary5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary5_read_angle | ( | magneticrotary5_t * | ctx, |
uint8_t * | agc, | ||
uint16_t * | angle ) |
Magnetic Rotary 5 read angle function.
This function reads the magnetic angle and automatic gain control (AGC) values measured by the sensor.
[in] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
[out] | agc | : Automatic gain control (AGC) value [0,63]. |
[out] | angle | : Magnetic angle in degrees [0,360]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary5_read_cmd | ( | magneticrotary5_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Magnetic Rotary 5 read cmd function.
This function reads a desired number of data bytes from the selected command by using SSI serial interface bit banging.
[in] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
[in] | cmd | : Command byte (5-bits). |
[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 magneticrotary5_read_mt_cnt | ( | magneticrotary5_t * | ctx, |
int16_t * | mt_cnt ) |
Magnetic Rotary 5 read multi turn counter function.
This function reads the multi turn counter value. With each zero transition in any direction, the output of a special counter is incremented or decremented.
[in] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
[out] | mt_cnt | : Multi turn counter value [-256,255]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary5_read_raw_adc | ( | magneticrotary5_t * | ctx, |
uint16_t * | raw_adc ) |
Magnetic Rotary 5 read raw ADC value function.
This function reads raw ADC value.
[in] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
[out] | raw_adc | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary5_read_voltage | ( | magneticrotary5_t * | ctx, |
float * | voltage ) |
Magnetic Rotary 5 read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
[in] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
[out] | voltage | : Output voltage level [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary5_set_mt_cnt | ( | magneticrotary5_t * | ctx, |
int16_t | mt_cnt ) |
Magnetic Rotary 5 set multi turn counter function.
This function sets the multi turn counter value. The initial value after reset is 0 LSB.
[in] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
[in] | mt_cnt | : Multi turn counter value [-256,255]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary5_set_vref | ( | magneticrotary5_t * | ctx, |
float | vref ) |
Magnetic Rotary 5 set vref function.
This function sets the voltage reference for Magnetic Rotary 5 click driver.
[in] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
[in] | vref | : Reference voltage (volts). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneticrotary5_write_cmd | ( | magneticrotary5_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Magnetic Rotary 5 write cmd function.
This function writes a desired number of data bytes to the selected command by using SSI serial interface bit banging.
[in] | ctx | : Click context object. See magneticrotary5_t object definition for detailed explanation. |
[in] | cmd | : Command byte (5-bits). |
[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.