tmrangle 2.0.0.0
Public function

Functions

void tmrangle_cfg_setup (tmrangle_cfg_t *cfg)
 Config Object Initialization function.
 
TMRANGLE_RETVAL tmrangle_init (tmrangle_t *ctx, tmrangle_cfg_t *cfg)
 Initialization function.
 
uint16_t tmrangle_read_channel_adc (tmrangle_t *ctx, uint8_t channel)
 Read the ADC value of the selected channel function.
 
void tmrangle_calculate_diff (tmrangle_t *ctx)
 Calculate the differential values of sin,cos signal and angle function.
 
void tmrangle_init_sensor_data (tmrangle_t *ctx)
 Read and stores parameters data function.
 
void tmrangle_calib_calculate_one_direction (tmrangle_t *ctx, tmrangle_rotation_data_store_t *rotation_data_store)
 Calculates and stores parameters, based on found parameters function.
 
void tmrangle_calib_calculate_ortho (tmrangle_calib_data_t *calib_param)
 Calculates and stores parameters, based on found parameters from both CW and CCW function.
 
void tmrangle_init_calib_data (tmrangle_t *ctx, tmrangle_calib_data_t *calib_param, trigonometry_t *dev)
 Initialization and stores calibration parameters function.
 
float tmrangle_get_calib_deff_angle (tmrangle_t *ctx, tmrangle_calib_data_t *calib_param)
 Calculate the calibrated angle ( radians ) function.
 
float tmrangle_get_calib_angle (tmrangle_t *ctx, tmrangle_calib_data_t *calib_param)
 Calculate the calibrated angle ( degree ) function.
 
void tmrangle_calib_find_min_max (tmrangle_t *ctx, tmrangle_rotation_data_store_t *rotation_data_store)
 Compare and stores rotation parameters function.
 
void tmrangle_calib_one_direction_min_max (tmrangle_t *ctx, tmrangle_rotation_data_store_t *rotation_data_store)
 Find and stores rotation parameters ( min, max ) function.
 
void tmrangle_calibration_find_param (tmrangle_t *ctx, tmrangle_calib_data_t *calib_param)
 Get new calibration rotation parameters function.
 

Detailed Description

Function Documentation

◆ tmrangle_calculate_diff()

void tmrangle_calculate_diff ( tmrangle_t * ctx)

Calculate the differential values of sin,cos signal and angle function.

Parameters
ctxClick object.

@description Function calculates the differential values will be used to get the uncalibrated angle value or in the calibration procedure of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

◆ tmrangle_calib_calculate_one_direction()

void tmrangle_calib_calculate_one_direction ( tmrangle_t * ctx,
tmrangle_rotation_data_store_t * rotation_data_store )

Calculates and stores parameters, based on found parameters function.

Parameters
ctxClick object.
rotation_data_storeStructure where rotation data be stored

@description Function calculates and stores parameters, based on found parameters of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

◆ tmrangle_calib_calculate_ortho()

void tmrangle_calib_calculate_ortho ( tmrangle_calib_data_t * calib_param)

Calculates and stores parameters, based on found parameters from both CW and CCW function.

Parameters
calib_paramStructure where calibration parameters ( CW and CCW ) data be stored

@description Function calculates and stores parameters, based on found parameters from both CW and CCW of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

◆ tmrangle_calib_find_min_max()

void tmrangle_calib_find_min_max ( tmrangle_t * ctx,
tmrangle_rotation_data_store_t * rotation_data_store )

Compare and stores rotation parameters function.

Parameters
ctxClick object.
rotation_data_storeStructure where rotation parameters data be stored

@description Function compare and stores rotation parameters, used to search for the min/max differential signal level of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

◆ tmrangle_calib_one_direction_min_max()

void tmrangle_calib_one_direction_min_max ( tmrangle_t * ctx,
tmrangle_rotation_data_store_t * rotation_data_store )

Find and stores rotation parameters ( min, max ) function.

Parameters
ctxClick object.
rotation_data_storeStructure where rotation parameters data be stored

@description Function compare and stores rotation parameters, used to search for the magnitude components (at 45 and 135 deg) and min/max signal level of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

◆ tmrangle_calibration_find_param()

void tmrangle_calibration_find_param ( tmrangle_t * ctx,
tmrangle_calib_data_t * calib_param )

Get new calibration rotation parameters function.

Parameters
ctxClick object.
calib_paramStructure where calibration parameters data be stored

@description Function get when new calibration parameters have been found, this function will do mathematical calculations, which will take more time for one moment of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

Note
@description This function will extract the maximum, minimum voltage levels, amplitude, offset, and orthogonality.

◆ tmrangle_cfg_setup()

void tmrangle_cfg_setup ( tmrangle_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.

◆ tmrangle_get_calib_angle()

float tmrangle_get_calib_angle ( tmrangle_t * ctx,
tmrangle_calib_data_t * calib_param )

Calculate the calibrated angle ( degree ) function.

Parameters
ctxClick object.
calib_paramStructure where calibration parameters data be stored
Returns
result float value of the angle in degree

@description Function calculate the calibrated angle in degree and this structure holds the current sensor calibration parameters of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

◆ tmrangle_get_calib_deff_angle()

float tmrangle_get_calib_deff_angle ( tmrangle_t * ctx,
tmrangle_calib_data_t * calib_param )

Calculate the calibrated angle ( radians ) function.

Parameters
ctxClick object.
calib_paramStructure where calibration parameters data be stored
Returns
result float value of the angle in radians

@description Function calculates the calibrated angle in radians of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

◆ tmrangle_init()

TMRANGLE_RETVAL tmrangle_init ( tmrangle_t * ctx,
tmrangle_cfg_t * cfg )

Initialization function.

Parameters
tmrangleClick object.
cfgClick configuration structure.

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

◆ tmrangle_init_calib_data()

void tmrangle_init_calib_data ( tmrangle_t * ctx,
tmrangle_calib_data_t * calib_param,
trigonometry_t * dev )

Initialization and stores calibration parameters function.

Parameters
ctxClick object.
calib_paramStructure where calibration parameters data be stored
devStructure with trigonometry values.

@description Function initialization and stores calibration parameters of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

Note
This function must be called once before tmrangle_calibrationFindParam( tmrangle_calib_data_t *calibParam ).

◆ tmrangle_init_sensor_data()

void tmrangle_init_sensor_data ( tmrangle_t * ctx)

Read and stores parameters data function.

Parameters
ctxClick object.

@description Function read and stores negative and positive, sine and cosine parameters data of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.

◆ tmrangle_read_channel_adc()

uint16_t tmrangle_read_channel_adc ( tmrangle_t * ctx,
uint8_t channel )

Read the ADC value of the selected channel function.

Parameters
ctxClick object.
channel
Returns
result 12-bit selected channel ADC value

@description Function read the ADC value of the selected channel of the TLE5501 magnetic position sensor � analog TMR based angle sensors on TMR Angle Click board.