magneticrotary 2.0.0.0
|
Functions | |
void | magneticrotary_cfg_setup (magneticrotary_cfg_t *cfg) |
Config Object Initialization function. | |
MAGNETICROTARY_RETVAL | magneticrotary_init (magneticrotary_t *ctx, magneticrotary_cfg_t *cfg) |
Initialization function. | |
void | magneticrotary_generic_transfer (magneticrotary_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
uint16_t | magnrotary_out_volt_adc (magneticrotary_t *ctx, uint8_t cmd_byte, uint16_t pwr_volt) |
ADC Output Voltage Get function. | |
uint16_t | magnrotary_read_adc (magneticrotary_t *ctx, uint8_t cmnd_byte) |
ADC Result Read function. | |
double | magnrotary_get_field_angle (magneticrotary_t *ctx, uint8_t cmd_byte) |
Magnetic Field Angle Get function. | |
void magneticrotary_cfg_setup | ( | magneticrotary_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void magneticrotary_generic_transfer | ( | magneticrotary_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len ) |
Generic transfer function.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving packages
MAGNETICROTARY_RETVAL magneticrotary_init | ( | magneticrotary_t * | ctx, |
magneticrotary_cfg_t * | cfg ) |
Initialization function.
magneticrotary | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
double magnrotary_get_field_angle | ( | magneticrotary_t * | ctx, |
uint8_t | cmd_byte ) |
Magnetic Field Angle Get function.
ctx | Click object. |
cmd_byte | Settings for AD conversion. |
@description This function returns a magnetic field angle calculated to degrees, in the range from -90 to 90 degrees.
uint16_t magnrotary_out_volt_adc | ( | magneticrotary_t * | ctx, |
uint8_t | cmd_byte, | ||
uint16_t | pwr_volt ) |
ADC Output Voltage Get function.
ctx | Click object. |
cmd_byte | Settings for AD conversion. |
pwr_volt | Power voltage value selection (millivolts). |
@description This function returns ADC voltage value calculated to millivolts, depending on the VDD (power) voltage selection.
uint16_t magnrotary_read_adc | ( | magneticrotary_t * | ctx, |
uint8_t | cmnd_byte ) |
ADC Result Read function.
ctx | Click object. |
cmnd_byte | Settings for AD conversion. |
@description This function returns a 12bit result of AD conversion.