angle3 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ angle3_calculate_degrees()

float angle3_calculate_degrees ( angle3_t * ctx,
uint16_t angle )

Degrees Calculation function.

Parameters
ctxClick object.
angleAngle to convert to degrees.
Returns
result Float value of angle in degrees.

Function converts an angle value read from Angle3 click to degrees.

◆ angle3_cfg_setup()

void angle3_cfg_setup ( angle3_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ angle3_default_cfg()

void angle3_default_cfg ( angle3_t * ctx)

Default Config Object Initialization function.

Parameters
ctxClick configuration structure.

This function initializes default click configuration structure to init state.

Configuration sets default normal operating mode.

◆ angle3_init()

err_t angle3_init ( angle3_t * ctx,
angle3_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

This function initializes all necessary pins and peripherals used for this click.

◆ angle3_lock_eeprom()

void angle3_lock_eeprom ( angle3_t * ctx)

EEPROM lock function.

Parameters
ctxClick 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.

◆ angle3_read_angle_data()

uint16_t angle3_read_angle_data ( angle3_t * ctx)

Read angle data function.

Parameters
ctxClick object.
Returns
result 12-bit Read angle data.

Function reads the latest angle output data.

◆ angle3_read_data()

uint16_t angle3_read_data ( angle3_t * ctx,
uint8_t opcode,
uint8_t reg )

Generic read function.

Parameters
ctxClick object.
opcodeOperation code.
regAddress of data to read.
Returns
result 16-bit read data.

Reads data from given address.

◆ angle3_read_eeprom()

uint16_t angle3_read_eeprom ( angle3_t * ctx,
uint8_t reg_addr )

Read EEPROM function.

Parameters
ctxClick object.
reg_addrAddress in EEPROM to write to.
Returns
result 12-bit read data.

Function reads 12-bit read data from given 8-bit register address in EEPROM.

◆ angle3_read_error()

uint8_t angle3_read_error ( angle3_t * ctx)

Read state of Error INT Pin.

Parameters
ctxClick object.
Returns
INT Pin state 0 - Error, 1- No Error.

Function read state of Error INT Pin function.

◆ angle3_read_register()

uint16_t angle3_read_register ( angle3_t * ctx,
uint8_t reg_addr )

Read register function.

Parameters
ctxClick object.
reg_addrAddress of register to read from.
Returns
result 12-bit read data.

Function reads 12-bit data from given 8-bit register address.

◆ angle3_set_mode()

void angle3_set_mode ( angle3_t * ctx,
uint16_t set_mode )

Set mode function.

Parameters
ctxClick object.
set_modeMode 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.

◆ angle3_set_normal_mode()

void angle3_set_normal_mode ( angle3_t * ctx)

Set normal mode function.

Parameters
ctxClick object.

Function sets mode of Angle3 click to normal. Set value 0x0000 for normal mode.

◆ angle3_set_user_mode()

void angle3_set_user_mode ( angle3_t * ctx)

Set user mode function.

Parameters
ctxClick object.

Function sets mode of Angle3 click to user. Set value 0x050F for user mode.

◆ angle3_write_data()

void angle3_write_data ( angle3_t * ctx,
uint8_t opcode,
uint8_t reg,
uint16_t write_data )

Generic write function.

Parameters
ctxClick object.
opcodeOperation code.
regAddress of data to write.
write_dataData to write.

Writes given data to given address.

◆ angle3_write_eeprom()

void angle3_write_eeprom ( angle3_t * ctx,
uint8_t reg_addr,
uint16_t write_data )

Write EEPROM function.

Parameters
ctxClick object.
reg_addrAddress in EEPROM to write to.
write_dataData 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.

◆ angle3_write_register()

void angle3_write_register ( angle3_t * ctx,
uint8_t reg_addr,
uint16_t write_data )

Write register function.

Parameters
ctxClick object.
reg_addrAddress of register to write to.
write_dataData to write.

Function writes given data to Register at given address.