angle4 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ angle4_cfg_setup()

void angle4_cfg_setup ( angle4_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.

◆ angle4_default_cfg()

void angle4_default_cfg ( angle4_t * ctx,
uint8_t dir,
uint8_t data_resolution )

Click Default Configuration function.

Parameters
ctxClick object.
dirDirection definition (counter-clockwise rotation or clockwise rotation)
data_resolutionAbsolute Resolution ( 10bit, 12bit, 14bit or 16bit)

@description This function executes default configuration for Angle 4 click.

◆ angle4_generic_transfer()

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.

Parameters
ctxClick object.
wr_bufWrite data buffer
wr_lenNumber of byte in write data buffer
rd_bufRead data buffer
rd_lenNumber of byte in read data buffer

@description Generic SPI transfer, for sending and receiving packages

◆ angle4_get_new_angle()

uint8_t angle4_get_new_angle ( angle4_t * ctx,
uint16_t * data_out )

Functions for reading Angle.

Parameters
ctxClick object.
data_outBuffer in which angle data will be stored.
Return values
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_init()

ANGLE4_RETVAL angle4_init ( angle4_t * ctx,
angle4_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ angle4_read_byte()

uint8_t angle4_read_byte ( angle4_t * ctx,
uint8_t addr )

One byte read function.

Parameters
ctxClick object.
addrAddress from which data will be read.
Return values
onebyte of data that was read from the desired address.

@description This function is used to read single byte of Data on the desired address.

◆ angle4_start_mesuremenet()

void angle4_start_mesuremenet ( angle4_t * ctx)

Start meaasurement function.

Parameters
ctxClick object.

@description function used to start measurement mode.

◆ angle4_write_byte()

void angle4_write_byte ( angle4_t * ctx,
uint8_t addr,
uint8_t w_data )

One byte write function.

Parameters
ctxClick object.
addrAddress in which the data will be written
w_dataData which be written in the address

@description This function is used to write single byte of Data on the desired address.