TLE5012B  3.1.0
The TLE5012B is a pre-calibrated 360° angle sensor that detects the orientation of a magnetic field. The raw signals (sine and cosine) are digitally processed internally to calculate the angle orientation of the magnetic field (magnet).
Tle5012 macros and global enums
Collaboration diagram for Tle5012 macros and global enums:

tle5012b_util.hpp - core support header for the TLE5012B angle sensor.

GMR-based angle sensor for angular position sensing in automotive applications

Author
Infineon Technologies AG
Version
3.1.0

This file includes the registry definition macros of all Sensor registers and the bit settings for each of the register content values. Depending on the type of secondary interface (PWM, IIF or HSM) the meaning of some register values differs, so please have look in the TLE5012 manual for the exact meaning. Also included here are other sensefull macros for handling the TLE5012 sensor. Core Library

SPDX-License-Identifier: MIT

enum  errorTypes {
  NO_ERROR = 0x00 , SYSTEM_ERROR = 0x01 , INTERFACE_ACCESS_ERROR = 0x02 , INVALID_ANGLE_ERROR = 0x03 ,
  ANGLE_SPEED_ERROR = 0x04 , CRC_ERROR = 0xFF
}
 Error types from safety word. More...
 
enum  updTypes { UPD_low = 0x0000 , UPD_high = 0x0400 }
 
enum  safetyTypes { SAFE_low = 0x0000 , SAFE_high = 0x0001 }
 
#define TRIGGER_DELAY   5
 5 microseconds trigger delay time More...
 
#define READ_SENSOR   0x8000
 base command for read More...
 
#define WRITE_SENSOR   0x5000
 base command for write More...
 
#define READ_BLOCK_CRC   0x8088
 initialize block CRC check command More...
 
#define SYSTEM_ERROR_MASK   0x4000
 System error masks for safety words. More...
 
#define INTERFACE_ERROR_MASK   0x2000
 Interface error masks for safety words. More...
 
#define INV_ANGLE_ERROR_MASK   0x1000
 Angle error masks for safety words. More...
 
#define CRC_POLYNOMIAL   0x1D
 values used for calculating the CRC More...
 
#define CRC_SEED   0xFF
 
#define CRC_NUM_REGISTERS   0x0008
 number of CRC relevant registers More...
 
#define MAX_REGISTER_MEM   0x0030
 max readable register values buffer More...
 
#define MAX_NUM_REG   0x16
 defines the value for temporary data to read all readable registers More...
 
#define DELETE_BIT_15   0x7FFF
 Value used to delete everything except the first 15 bits. More...
 
#define CHANGE_UINT_TO_INT_15   0x8000
 Value used to change unsigned 16bit integer into signed. More...
 
#define CHECK_BIT_14   0x4000
 
#define GET_BIT_14_4   0x7FF0
 
#define DELETE_7BITS   0x01FF
 values used to calculate 9 bit signed integer sent by the sensor More...
 
#define CHANGE_UNIT_TO_INT_9   0x0200
 Value used to change unsigned 9bit integer into signed. More...
 
#define CHECK_BIT_9   0x0100
 
#define POW_2_15   32768.0
 values used to for final calculations of angle speed, revolutions, range and value More...
 
#define POW_2_7   128.0
 
#define ANGLE_360_VAL   360.0
 
#define TEMP_OFFSET   152.0
 values used to calculate the temperature More...
 
#define TEMP_DIV   2.776
 

Detailed Description

Macro Definition Documentation

◆ TRIGGER_DELAY

#define TRIGGER_DELAY   5

5 microseconds trigger delay time

◆ READ_SENSOR

#define READ_SENSOR   0x8000

base command for read

◆ WRITE_SENSOR

#define WRITE_SENSOR   0x5000

base command for write

◆ READ_BLOCK_CRC

#define READ_BLOCK_CRC   0x8088

initialize block CRC check command

◆ SYSTEM_ERROR_MASK

#define SYSTEM_ERROR_MASK   0x4000

System error masks for safety words.

◆ INTERFACE_ERROR_MASK

#define INTERFACE_ERROR_MASK   0x2000

Interface error masks for safety words.

◆ INV_ANGLE_ERROR_MASK

#define INV_ANGLE_ERROR_MASK   0x1000

Angle error masks for safety words.

◆ CRC_POLYNOMIAL

#define CRC_POLYNOMIAL   0x1D

values used for calculating the CRC

◆ CRC_SEED

#define CRC_SEED   0xFF

◆ CRC_NUM_REGISTERS

#define CRC_NUM_REGISTERS   0x0008

number of CRC relevant registers

◆ MAX_REGISTER_MEM

#define MAX_REGISTER_MEM   0x0030

max readable register values buffer

◆ MAX_NUM_REG

#define MAX_NUM_REG   0x16

defines the value for temporary data to read all readable registers

◆ DELETE_BIT_15

#define DELETE_BIT_15   0x7FFF

Value used to delete everything except the first 15 bits.

◆ CHANGE_UINT_TO_INT_15

#define CHANGE_UINT_TO_INT_15   0x8000

Value used to change unsigned 16bit integer into signed.

◆ CHECK_BIT_14

#define CHECK_BIT_14   0x4000

◆ GET_BIT_14_4

#define GET_BIT_14_4   0x7FF0

◆ DELETE_7BITS

#define DELETE_7BITS   0x01FF

values used to calculate 9 bit signed integer sent by the sensor

◆ CHANGE_UNIT_TO_INT_9

#define CHANGE_UNIT_TO_INT_9   0x0200

Value used to change unsigned 9bit integer into signed.

◆ CHECK_BIT_9

#define CHECK_BIT_9   0x0100

◆ POW_2_15

#define POW_2_15   32768.0

values used to for final calculations of angle speed, revolutions, range and value

◆ POW_2_7

#define POW_2_7   128.0

◆ ANGLE_360_VAL

#define ANGLE_360_VAL   360.0

◆ TEMP_OFFSET

#define TEMP_OFFSET   152.0

values used to calculate the temperature

◆ TEMP_DIV

#define TEMP_DIV   2.776

Enumeration Type Documentation

◆ errorTypes

enum errorTypes

Error types from safety word.

Enumerator
NO_ERROR 

NO_ERROR = Safety word was OK.

SYSTEM_ERROR 

SYSTEM_ERROR = over/under voltage, VDD negative, GND off, ROM defect.

INTERFACE_ACCESS_ERROR 

INTERFACE_ACCESS_ERROR = wrong address or wrong lock.

INVALID_ANGLE_ERROR 

INVALID_ANGLE_ERROR = NO_GMR_A = 1 or NO_GMR_XY = 1.

ANGLE_SPEED_ERROR 

ANGLE_SPEED_ERROR = combined error, angular speed calculation wrong.

CRC_ERROR 

CRC_ERROR = Cyclic Redundancy Check (CRC), which includes the STAT and RESP bits wrong.

◆ updTypes

enum updTypes
Enumerator
UPD_low 

read normal registers

UPD_high 

read update buffer registers

◆ safetyTypes

Enumerator
SAFE_low 

switch of safety word generation

SAFE_high 

switch on safety word generation