magneto12
2.0.0.0
|
API for configuring and manipulating Magneto 12 Click driver. More...
Modules | |
Magneto 12 Registers Settings | |
Settings for registers of Magneto 12 Click driver. | |
Magneto 12 MikroBUS Map | |
MikroBUS pin mapping of Magneto 12 Click driver. | |
Functions | |
void | magneto12_cfg_setup (magneto12_cfg_t *cfg) |
Magneto 12 configuration object setup function. More... | |
void | magneto12_drv_interface_selection (magneto12_cfg_t *cfg, magneto12_drv_t drv_sel) |
Magneto 12 driver interface setup function. More... | |
err_t | magneto12_init (magneto12_t *ctx, magneto12_cfg_t *cfg) |
Magneto 12 initialization function. More... | |
err_t | magneto12_read_raw_adc (magneto12_t *ctx, uint16_t *raw_adc) |
Magneto 12 read raw ADC value function. More... | |
err_t | magneto12_read_voltage (magneto12_t *ctx, float *voltage) |
Magneto 12 read voltage level function. More... | |
err_t | magneto12_set_vref (magneto12_t *ctx, float vref) |
Magneto 12 set vref function. More... | |
err_t | magneto12_read_angle (magneto12_t *ctx, float *angle) |
Magneto 12 read angle function. More... | |
API for configuring and manipulating Magneto 12 Click driver.
void magneto12_cfg_setup | ( | magneto12_cfg_t * | cfg | ) |
Magneto 12 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See magneto12_cfg_t object definition for detailed explanation. |
void magneto12_drv_interface_selection | ( | magneto12_cfg_t * | cfg, |
magneto12_drv_t | drv_sel | ||
) |
Magneto 12 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 magneto12_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See magneto12_drv_t object definition for detailed explanation. |
err_t magneto12_init | ( | magneto12_t * | ctx, |
magneto12_cfg_t * | cfg | ||
) |
Magneto 12 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See magneto12_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See magneto12_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t magneto12_read_angle | ( | magneto12_t * | ctx, |
float * | angle | ||
) |
Magneto 12 read angle function.
This function reads the sensor output voltage and converts it to angular position in degrees.
[in] | ctx | : Click context object. See magneto12_t object definition for detailed explanation. |
[out] | angle | : Angle in degrees. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t magneto12_read_raw_adc | ( | magneto12_t * | ctx, |
uint16_t * | raw_adc | ||
) |
Magneto 12 read raw ADC value function.
This function reads raw ADC value.
[in] | ctx | : Click context object. See magneto12_t object definition for detailed explanation. |
[out] | raw_adc | : Output ADC result. |
0
- Success, -1
- Error.err_t magneto12_read_voltage | ( | magneto12_t * | ctx, |
float * | voltage | ||
) |
Magneto 12 read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
[in] | ctx | : Click context object. See magneto12_t object definition for detailed explanation. |
[out] | voltage | : Output voltage level [V]. |
0
- Success, -1
- Error.err_t magneto12_set_vref | ( | magneto12_t * | ctx, |
float | vref | ||
) |
Magneto 12 set vref function.
This function sets the voltage reference for Magneto 12 click driver.
[in] | ctx | : Click context object. See magneto12_t object definition for detailed explanation. |
[in] | vref | : Reference voltage (volts). |
0
- Success, -1
- Error.