angle4 2.0.0.0
|
Functions | |
void | angle4_cfg_setup (angle4_cfg_t *cfg) |
Config Object Initialization function. | |
ANGLE4_RETVAL | angle4_init (angle4_t *ctx, angle4_cfg_t *cfg) |
Initialization function. | |
void | angle4_default_cfg (angle4_t *ctx, uint8_t dir, uint8_t data_resolution) |
Click Default Configuration function. | |
void | angle4_generic_transfer (angle4_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
void | angle4_write_byte (angle4_t *ctx, uint8_t addr, uint8_t w_data) |
One byte write function. | |
uint8_t | angle4_read_byte (angle4_t *ctx, uint8_t addr) |
One byte read function. | |
void | angle4_start_mesuremenet (angle4_t *ctx) |
Start meaasurement function. | |
uint8_t | angle4_get_new_angle (angle4_t *ctx, uint16_t *data_out) |
Functions for reading Angle. | |
void angle4_cfg_setup | ( | angle4_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void angle4_default_cfg | ( | angle4_t * | ctx, |
uint8_t | dir, | ||
uint8_t | data_resolution ) |
Click Default Configuration function.
ctx | Click object. |
dir | Direction definition (counter-clockwise rotation or clockwise rotation) |
data_resolution | Absolute Resolution ( 10bit, 12bit, 14bit or 16bit) |
@description This function executes default configuration for Angle 4 click.
void angle4_generic_transfer | ( | angle4_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
uint8_t angle4_get_new_angle | ( | angle4_t * | ctx, |
uint16_t * | data_out ) |
Functions for reading Angle.
ctx | Click object. |
data_out | Buffer in which angle data will be stored. |
status |
Status :
3-bit Ready (chip is ready) 2-bit Magnet High ( This indicates that the magnet strength detected by the chip is too strong. When this is flagged high consistently, change the weaker magnet or increase the distance between the chip and the magnet.) 1-bit Magnet Low (This indicates that the magnet strength detected by the chip is too weak. When this is flagged high consistently, change the stronger magnet or decrease the distance between the chip and the magnet ) 0-bit Parity
@description
ANGLE4_RETVAL angle4_init | ( | angle4_t * | ctx, |
angle4_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t angle4_read_byte | ( | angle4_t * | ctx, |
uint8_t | addr ) |
One byte read function.
ctx | Click object. |
addr | Address from which data will be read. |
one | byte of data that was read from the desired address. |
@description This function is used to read single byte of Data on the desired address.
void angle4_start_mesuremenet | ( | angle4_t * | ctx | ) |
Start meaasurement function.
ctx | Click object. |
@description function used to start measurement mode.
void angle4_write_byte | ( | angle4_t * | ctx, |
uint8_t | addr, | ||
uint8_t | w_data ) |
One byte write function.
ctx | Click object. |
addr | Address in which the data will be written |
w_data | Data which be written in the address |
@description This function is used to write single byte of Data on the desired address.