angle3  2.0.0.0
Functions
Public function

Functions

void angle3_cfg_setup (angle3_cfg_t *cfg)
 Config Object Initialization function. More...
 
void angle3_default_cfg (angle3_t *ctx)
 Default Config Object Initialization function. More...
 
ANGLE3_RETVAL angle3_init (angle3_t *ctx, angle3_cfg_t *cfg)
 Initialization function. More...
 
void angle3_write_data (angle3_t *ctx, uint8_t opcode, uint8_t reg, uint16_t write_data)
 Generic write function. More...
 
uint16_t angle3_read_data (angle3_t *ctx, uint8_t opcode, uint8_t reg)
 Generic read function. More...
 
void angle3_write_EEPROM (angle3_t *ctx, uint8_t reg_addr, uint16_t write_data)
 Write EEPROM function. More...
 
uint16_t angle3_read_EEPROM (angle3_t *ctx, uint8_t reg_addr)
 Read EEPROM function. More...
 
void angle3_lock_EEPROM (angle3_t *ctx)
 EEPROM lock function. More...
 
void angle3_write_register (angle3_t *ctx, uint8_t reg_addr, uint16_t write_data)
 Write register function. More...
 
uint16_t angle3_read_register (angle3_t *ctx, uint8_t reg_addr)
 Read register function. More...
 
void angle3_set_mode (angle3_t *ctx, uint16_t set_mode)
 Set mode function. More...
 
void angle3_set_normal_mode (angle3_t *ctx)
 Set normal mode function. More...
 
void angle3_set_user_mode (angle3_t *ctx)
 Set user mode function. More...
 
uint16_t angle3_read_angle_data (angle3_t *ctx)
 Read angle data function. More...
 
float angle3_calculate_degrees (angle3_t *ctx, uint16_t angle)
 Degrees Calculation function. More...
 
uint8_t angle3_read_error (angle3_t *ctx)
 Read state of Error INT Pin. More...
 

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.

@description 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.

@description 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
cfgClick configuration structure.

@description This function initializes default click configuration structure to init state.

Configuration sets default normal operating mode.

◆ angle3_init()

ANGLE3_RETVAL angle3_init ( angle3_t ctx,
angle3_cfg_t cfg 
)

Initialization function.

Parameters
angle3Click object.
cfgClick configuration structure.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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.

@description 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.

@description Function writes given data to Register at given address.