angle5 2.0.0.0
Public function

Functions

void angle5_cfg_setup (angle5_cfg_t *cfg)
 Config Object Initialization function.
 
ANGLE5_RETVAL angle5_init (angle5_t *ctx, angle5_cfg_t *cfg)
 Initialization function.
 
void angle5_default_cfg (angle5_t *ctx)
 Click Default Configuration function.
 
void angle5_generic_transfer (angle5_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 Generic transfer function.
 
uint16_t angle5_read_raw_angle (angle5_t *ctx)
 Reads Raw Angle data.
 
float angle5_read_angle_deg (angle5_t *ctx)
 Reads Angle data in deg.
 
uint16_t angle5_read_register (angle5_t *ctx, uint8_t reg_addr, uint8_t *rsp)
 Generic read function.
 
uint16_t angle5_write_register (angle5_t *ctx, uint8_t reg_addr, uint8_t tx_data, uint8_t *status)
 Generic write function.
 
float angle5_calc_rpm (float old_angle, float new_angle)
 Calculating angle data to RPM.
 
uint8_t angle5_get_mgh_pin_state (angle5_t *ctx)
 Gets MGH (PWM) pin state.
 
uint8_t angle5_get_mgl_pin_state (angle5_t *ctx)
 Gets MGL (INT) pin state.
 

Detailed Description

Function Documentation

◆ angle5_calc_rpm()

float angle5_calc_rpm ( float old_angle,
float new_angle )

Calculating angle data to RPM.

Parameters
old_angleOld Angle data ( previous measurement )
new_angleNew Angle data ( current measurement )
Returns
RPM ( Revolutions per minute )

@description Function for calculating angle data to RPM

◆ angle5_cfg_setup()

void angle5_cfg_setup ( angle5_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.

◆ angle5_default_cfg()

void angle5_default_cfg ( angle5_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

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

◆ angle5_generic_transfer()

void angle5_generic_transfer ( angle5_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

◆ angle5_get_mgh_pin_state()

uint8_t angle5_get_mgh_pin_state ( angle5_t * ctx)

Gets MGH (PWM) pin state.

Parameters
ctxClick object.
Returns
MGH pin state

@description Function for getting MGH (PWM) pin state

◆ angle5_get_mgl_pin_state()

uint8_t angle5_get_mgl_pin_state ( angle5_t * ctx)

Gets MGL (INT) pin state.

Parameters
ctxClick object.
Returns
MGL pin state

@description Function for getting MGL (INT) pin state

◆ angle5_init()

ANGLE5_RETVAL angle5_init ( angle5_t * ctx,
angle5_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ angle5_read_angle_deg()

float angle5_read_angle_deg ( angle5_t * ctx)

Reads Angle data in deg.

Parameters
ctxClick object.
Returns
Angle data ( 0 - 360 deg )

@description Use this function for reads angle data

◆ angle5_read_raw_angle()

uint16_t angle5_read_raw_angle ( angle5_t * ctx)

Reads Raw Angle data.

Parameters
ctxClick object.
Returns
( 12 bit ) angle data

@description Use this function for reads raw angle data

◆ angle5_read_register()

uint16_t angle5_read_register ( angle5_t * ctx,
uint8_t reg_addr,
uint8_t * rsp )

Generic read function.

Parameters
ctxClick object.
reg_addrRegister address
rspData reads from register
Returns
Angle raw data

@description Use this function for reads data via SPI

◆ angle5_write_register()

uint16_t angle5_write_register ( angle5_t * ctx,
uint8_t reg_addr,
uint8_t tx_data,
uint8_t * status )

Generic write function.

Parameters
ctxClick object.
reg_addrRegister address
tx_dataData thet will be send
statusReading status
Returns
Angle raw data

@description Use this function for send data via SPI