angle3 2.0.0.0
|
Functions | |
void | angle3_cfg_setup (angle3_cfg_t *cfg) |
Config Object Initialization function. | |
void | angle3_default_cfg (angle3_t *ctx) |
Default Config Object Initialization function. | |
err_t | angle3_init (angle3_t *ctx, angle3_cfg_t *cfg) |
Initialization function. | |
void | angle3_write_data (angle3_t *ctx, uint8_t opcode, uint8_t reg, uint16_t write_data) |
Generic write function. | |
uint16_t | angle3_read_data (angle3_t *ctx, uint8_t opcode, uint8_t reg) |
Generic read function. | |
void | angle3_write_eeprom (angle3_t *ctx, uint8_t reg_addr, uint16_t write_data) |
Write EEPROM function. | |
uint16_t | angle3_read_eeprom (angle3_t *ctx, uint8_t reg_addr) |
Read EEPROM function. | |
void | angle3_lock_eeprom (angle3_t *ctx) |
EEPROM lock function. | |
void | angle3_write_register (angle3_t *ctx, uint8_t reg_addr, uint16_t write_data) |
Write register function. | |
uint16_t | angle3_read_register (angle3_t *ctx, uint8_t reg_addr) |
Read register function. | |
void | angle3_set_mode (angle3_t *ctx, uint16_t set_mode) |
Set mode function. | |
void | angle3_set_normal_mode (angle3_t *ctx) |
Set normal mode function. | |
void | angle3_set_user_mode (angle3_t *ctx) |
Set user mode function. | |
uint16_t | angle3_read_angle_data (angle3_t *ctx) |
Read angle data function. | |
float | angle3_calculate_degrees (angle3_t *ctx, uint16_t angle) |
Degrees Calculation function. | |
uint8_t | angle3_read_error (angle3_t *ctx) |
Read state of Error INT Pin. | |
float angle3_calculate_degrees | ( | angle3_t * | ctx, |
uint16_t | angle ) |
Degrees Calculation function.
ctx | Click object. |
angle | Angle to convert to degrees. |
Function converts an angle value read from Angle3 click to degrees.
void angle3_cfg_setup | ( | angle3_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
void angle3_default_cfg | ( | angle3_t * | ctx | ) |
Default Config Object Initialization function.
ctx | Click configuration structure. |
This function initializes default click configuration structure to init state.
Configuration sets default normal operating mode.
err_t angle3_init | ( | angle3_t * | ctx, |
angle3_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void angle3_lock_eeprom | ( | angle3_t * | ctx | ) |
EEPROM lock function.
ctx | Click object. |
Function locks the EEPROM so that it cannot be written to until the next reset.After calling this routine it will be impossible to modify the EEPROM, so all writes to it should be done before calling this.
uint16_t angle3_read_angle_data | ( | angle3_t * | ctx | ) |
Read angle data function.
ctx | Click object. |
Function reads the latest angle output data.
uint16_t angle3_read_data | ( | angle3_t * | ctx, |
uint8_t | opcode, | ||
uint8_t | reg ) |
Generic read function.
ctx | Click object. |
opcode | Operation code. |
reg | Address of data to read. |
Reads data from given address.
uint16_t angle3_read_eeprom | ( | angle3_t * | ctx, |
uint8_t | reg_addr ) |
Read EEPROM function.
ctx | Click object. |
reg_addr | Address in EEPROM to write to. |
Function reads 12-bit read data from given 8-bit register address in EEPROM.
uint8_t angle3_read_error | ( | angle3_t * | ctx | ) |
Read state of Error INT Pin.
ctx | Click object. |
Function read state of Error INT Pin function.
uint16_t angle3_read_register | ( | angle3_t * | ctx, |
uint8_t | reg_addr ) |
Read register function.
ctx | Click object. |
reg_addr | Address of register to read from. |
Function reads 12-bit data from given 8-bit register address.
void angle3_set_mode | ( | angle3_t * | ctx, |
uint16_t | set_mode ) |
Set mode function.
ctx | Click object. |
set_mode | Mode to set Angle3 to. |
Function sets mode of Angle3 click to the one provided. The two valid modes are: normal with value 0x0000, and user with value 0x050F.
void angle3_set_normal_mode | ( | angle3_t * | ctx | ) |
Set normal mode function.
ctx | Click object. |
Function sets mode of Angle3 click to normal. Set value 0x0000 for normal mode.
void angle3_set_user_mode | ( | angle3_t * | ctx | ) |
Set user mode function.
ctx | Click object. |
Function sets mode of Angle3 click to user. Set value 0x050F for user mode.
void angle3_write_data | ( | angle3_t * | ctx, |
uint8_t | opcode, | ||
uint8_t | reg, | ||
uint16_t | write_data ) |
Generic write function.
ctx | Click object. |
opcode | Operation code. |
reg | Address of data to write. |
write_data | Data to write. |
Writes given data to given address.
void angle3_write_eeprom | ( | angle3_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t | write_data ) |
Write EEPROM function.
ctx | Click object. |
reg_addr | Address in EEPROM to write to. |
write_data | Data to write. |
Function writes given 16-bit data to given 8-bit register address in EEPROM. Only write to EEPROM before calling the lock function, and provide only the valid EEPROM addresses.
void angle3_write_register | ( | angle3_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t | write_data ) |
Write register function.
ctx | Click object. |
reg_addr | Address of register to write to. |
write_data | Data to write. |
Function writes given data to Register at given address.