gmrangle  2.0.0.0
Functions
Public function

Functions

void gmrangle_cfg_setup (gmrangle_cfg_t *cfg)
 Config Object Initialization function. More...
 
err_t gmrangle_init (gmrangle_t *ctx, gmrangle_cfg_t *cfg)
 Initialization function. More...
 
uint16_t gmrangle_read_data (gmrangle_t *ctx, uint8_t reg)
 Generic read 16-bit data function. More...
 
void gmrangle_write_data (gmrangle_t *ctx, uint8_t reg, uint16_t tx_data)
 Generic write 16-bit data function. More...
 
uint16_t gmrangle_get_status (gmrangle_t *ctx)
 Get the status data function. More...
 
void gmrangle_set_act_status (gmrangle_t *ctx, uint16_t a_data)
 Set activation status register function. More...
 
int16_t gmrangle_get_angle_speed_value (gmrangle_t *ctx)
 Get the angle speed value function. More...
 
void gmrangle_get_angle_speed (gmrangle_t *ctx, float *final_angle_speed, int16_t *angle_speed_val)
 Get the angle speed function. More...
 
float gmrangle_get_angle_range (gmrangle_t *ctx)
 Get the angle range function. More...
 
int16_t gmrangle_get_num_revolutions (gmrangle_t *ctx)
 Get the number of revolutions function. More...
 
uint16_t gmrangle_get_angle_value (gmrangle_t *ctx)
 Get the angle value function. More...
 
float gmrangle_calculate_angle (gmrangle_t *ctx)
 Calculate angle function. More...
 

Detailed Description

Function Documentation

◆ gmrangle_calculate_angle()

float gmrangle_calculate_angle ( gmrangle_t ctx)

Calculate angle function.

Parameters
ctxClick object.
Returns
float value of the angle in degree.

This function calculate the float value of the angle in degree of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.

◆ gmrangle_cfg_setup()

void gmrangle_cfg_setup ( gmrangle_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.

◆ gmrangle_get_angle_range()

float gmrangle_get_angle_range ( gmrangle_t ctx)

Get the angle range function.

Parameters
ctxClick object.
Returns
float value of the angle range

This function read value of the angle range from the 6-bit register address ( GMRANGLE_REG_MOD_2 ) of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.

◆ gmrangle_get_angle_speed()

void gmrangle_get_angle_speed ( gmrangle_t ctx,
float *  final_angle_speed,
int16_t *  angle_speed_val 
)

Get the angle speed function.

Parameters
ctxClick object.
final_angle_speedPointer to the memory location where float be stored
angle_speed_valPointer to the memory location where 16-bit signed be stored

This function get the angle speed by read from the from the 6-bit register address ( GMRANGLE_REG_ASPD ) of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.

◆ gmrangle_get_angle_speed_value()

int16_t gmrangle_get_angle_speed_value ( gmrangle_t ctx)

Get the angle speed value function.

Parameters
ctxClick object.
Returns
16-bit signed angle speed value

This function read 16-bit signed angle speed value from the 6-bit register address ( GMRANGLE_REG_ASPD ) of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.

◆ gmrangle_get_angle_value()

uint16_t gmrangle_get_angle_value ( gmrangle_t ctx)

Get the angle value function.

Parameters
ctxClick object.
Returns
16-bit signed value of the angle.

This function read the 16-bit signed value of the angle from the 6-bit register address ( GMRANGLE_REG_AVAL ) of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.

◆ gmrangle_get_num_revolutions()

int16_t gmrangle_get_num_revolutions ( gmrangle_t ctx)

Get the number of revolutions function.

Parameters
ctxClick object.
Returns
16-bit signed value of the number of the revolutions.

This function read the number of the revolutions from the 6-bit register address ( GMRANGLE_REG_AREV ) of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.

◆ gmrangle_get_status()

uint16_t gmrangle_get_status ( gmrangle_t ctx)

Get the status data function.

Parameters
ctxClick object.
Returns
16-bit status data:
  • [ bit 15 ] : Read Status:
    • 0 : after readout;
    • 1 : status values changed ( Reset value );
  • [ bit 14 : 13 ] : Slave Number:
    • 0 : ( Reset value );
  • [ bit 12 ] : No GMR Angle Value:
    • 0 : valid GMR angle value on the interface ( Reset value );
    • 1 : no valid GMR angle value on the interface;
  • [ bit 11 ] : No GMR XY Values:
    • 0 : valid GMR_XY values on the interface ( Reset value );
    • 1 : no valid GMR_XY values on the interface;
  • [ bit 10 ] : Status ROM:
    • 0 : after readout, CRC ok ( Reset value );
    • 1 : CRC fail or running;
  • [ bit 9 ] : Status ADC-Test:
    • 0 : after readout ( Reset value );
    • 1 : Test vectors out of limit;
  • [ bit 8 ] : Reserved;
  • [ bit 7 ] : Status Magnitude Out of Limit:
    • 0 : after readout ( Reset value );
    • 1 : TGMR-magnitude out of limit ( >23230 digits );
  • [ bit 6 ] : Status X,Y Data Out of Limit:
    • 0 : after readout ( Reset value );
    • 1 : X,Y data out of limit ( >23230 digits );
  • [ bit 5 ] : Status Overflow:
    • 0 : after readout ( Reset value );
    • 1 : DSPU overflow occurred;
  • [ bit 4 ] : Status Digital Signal Processing Unit:
    • 0 : after readout ( Reset value );
    • 1 : DSPU self test not ok, or selftest is running;
  • [ bit 3 ] : Status Fuse CRC:
    • 0 : after readout, Fuse CRC ok ( Reset value );
    • 1 : Fuse CRC fail;
  • [ bit 2 ] : Status Voltage Regulator:
    • 0 : after readout ( Reset value );
    • 1 : VDD overvoltage, VDD undervoltage, VDD-off ,GNDoff or VOVG, VOVA, VOVD to high;
  • [ bit 1 ] : Status Watchdog:
    • 0 : after chip reset ( Reset value );
    • 1 : watchdog counter expired;
  • [ bit 0 ] : Status Reset:
    • 0 : after readout ( Reset value );
    • 1 : indication of power-up, short power-break or active reset;

This function read 16-bit status data from the 6-bit register address ( GMRANGLE_REG_STAT ) of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.

◆ gmrangle_init()

err_t gmrangle_init ( gmrangle_t ctx,
gmrangle_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ gmrangle_read_data()

uint16_t gmrangle_read_data ( gmrangle_t ctx,
uint8_t  reg 
)

Generic read 16-bit data function.

Parameters
ctxClick object.
reg6-bit register address.
Returns
16-bit read data.

This function read 16-bit data from the targeted 6-bit register address of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.

◆ gmrangle_set_act_status()

void gmrangle_set_act_status ( gmrangle_t ctx,
uint16_t  a_data 
)

Set activation status register function.

Parameters
ctxClick object.
Returns
16-bit activation status data:
  • [ bit 15 : 10 ] : Reserved;
  • [ bit 9 ] : Enable GMR Vector check:
    • 0 : ( Reset value );
  • [ bit 8 ] : Reserved;
  • [ bit 7 ] : Activation of ADC-Redundancy-BIST:
    • 0 : after execution;
    • 1 : activation of redundancy BIST ( Reset value );
  • [ bit 6 ] : Activation of ADC-BIST:
    • 0 : after execution;
    • 1 : activation of redundancy BIST ( Reset value );
  • [ bit 5 ] : Enable of DSPU Overflow Check:
    • 1 : ( Reset value );
  • [ bit 4 ] : Activation DSPU BIST:
    • 0 : after execution;
    • 1 : activation of DSPU BIST ( Reset value );
  • [ bit 3 ] : Activation Fuse CRC:
    • 0 : after execution;
    • 1 : activation of Fuse CRC ( Reset value );
  • [ bit 2 ] : Enable Voltage Regulator Check:
    • 1 : ( Reset value );
  • [ bit 1 ] : Enable DSPU Watchdog-HW-Reset:
    • 1 : ( Reset value );
  • [ bit 0 ] : Activation of Hardware Reset:
    • 0 : after execution ( Reset value );
    • 1 : activation of HW Reset;

This function write 16-bit a_data data to the 6-bit register address ( GMRANGLE_REG_ACSTAT ) of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.

◆ gmrangle_write_data()

void gmrangle_write_data ( gmrangle_t ctx,
uint8_t  reg,
uint16_t  tx_data 
)

Generic write 16-bit data function.

Parameters
ctxClick object.
reg6-bit register address.
tx_data16-bit data to write.

This function write the 16-bit data to the targeted 6-bit register address of the TLE5012 GMR-Based Angular Sensor on the GMR Angle Click board.