magneto 2.0.0.0
|
Functions | |
void | magneto_cfg_setup (magneto_cfg_t *cfg) |
Config Object Initialization function. | |
MAGNETO_RETVAL | magneto_init (magneto_t *ctx, magneto_cfg_t *cfg) |
Initialization function. | |
void | magneto_generic_transfer (magneto_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
uint16_t | magneto_read_data (magneto_t *ctx, uint16_t address_command) |
16-bit command generic read function. | |
void | magneto_write_data (magneto_t *ctx, uint16_t address_command, uint16_t write_data) |
16-bit command generic write function. | |
uint16_t | magneto_get_state (magneto_t *ctx) |
Get state function. | |
uint8_t | magneto_check_state (magneto_t *ctx) |
Check state function. | |
float | magneto_get_angle (magneto_t *ctx) |
Calculate angle function. | |
void magneto_cfg_setup | ( | magneto_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t magneto_check_state | ( | magneto_t * | ctx | ) |
Check state function.
ctx | Click object. |
@description This function check and returns 0 or 1.
void magneto_generic_transfer | ( | magneto_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
float magneto_get_angle | ( | magneto_t * | ctx | ) |
Calculate angle function.
ctx | Click object. |
@description This function read the 16-bit data from register then calculate and convert to float angle value from 0deg to 360deg.
uint16_t magneto_get_state | ( | magneto_t * | ctx | ) |
Get state function.
ctx | Click object. |
@description This function read and returns the value of the state register.
MAGNETO_RETVAL magneto_init | ( | magneto_t * | ctx, |
magneto_cfg_t * | cfg ) |
Initialization function.
magneto | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint16_t magneto_read_data | ( | magneto_t * | ctx, |
uint16_t | address_command ) |
16-bit command generic read function.
ctx | Click object. |
address_command | 14-bit command address. |
@description This function takes 16-bit address commnand of the target register to be written to that register.
void magneto_write_data | ( | magneto_t * | ctx, |
uint16_t | address_command, | ||
uint16_t | write_data ) |
16-bit command generic write function.
ctx | Click object. |
address_command | 14-bit command address. |
write_data | 14-bit data to write. |
@description This function takes 16-bit address commnand of the target register and the 16-bit write data to be written to that register.