21 #ifndef TLE5012B_UTIL_HPP
22 #define TLE5012B_UTIL_HPP
35 #define TRIGGER_DELAY 5
38 #define READ_SENSOR 0x8000
39 #define WRITE_SENSOR 0x5000
40 #define READ_BLOCK_CRC 0x8088
43 #define SYSTEM_ERROR_MASK 0x4000
44 #define INTERFACE_ERROR_MASK 0x2000
45 #define INV_ANGLE_ERROR_MASK 0x1000
47 #define CRC_POLYNOMIAL 0x1D
49 #define CRC_NUM_REGISTERS 0x0008
50 #define MAX_REGISTER_MEM 0x0030
51 #define MAX_NUM_REG 0x16
53 #define DELETE_BIT_15 0x7FFF
54 #define CHANGE_UINT_TO_INT_15 0x8000
55 #define CHECK_BIT_14 0x4000
56 #define GET_BIT_14_4 0x7FF0
58 #define DELETE_7BITS 0x01FF
59 #define CHANGE_UNIT_TO_INT_9 0x0200
60 #define CHECK_BIT_9 0x0100
62 #define POW_2_15 32768.0
64 #define ANGLE_360_VAL 360.0
66 #define TEMP_OFFSET 152.0
67 #define TEMP_DIV 2.776
errorTypes
Error types from safety word.
Definition: tle5012b_util.hpp:73
updTypes
Definition: tle5012b_util.hpp:84
safetyTypes
Definition: tle5012b_util.hpp:91
@ ANGLE_SPEED_ERROR
ANGLE_SPEED_ERROR = combined error, angular speed calculation wrong.
Definition: tle5012b_util.hpp:78
@ CRC_ERROR
CRC_ERROR = Cyclic Redundancy Check (CRC), which includes the STAT and RESP bits wrong.
Definition: tle5012b_util.hpp:79
@ INTERFACE_ACCESS_ERROR
INTERFACE_ACCESS_ERROR = wrong address or wrong lock.
Definition: tle5012b_util.hpp:76
@ SYSTEM_ERROR
SYSTEM_ERROR = over/under voltage, VDD negative, GND off, ROM defect.
Definition: tle5012b_util.hpp:75
@ INVALID_ANGLE_ERROR
INVALID_ANGLE_ERROR = NO_GMR_A = 1 or NO_GMR_XY = 1.
Definition: tle5012b_util.hpp:77
@ NO_ERROR
NO_ERROR = Safety word was OK.
Definition: tle5012b_util.hpp:74
@ UPD_high
read update buffer registers
Definition: tle5012b_util.hpp:86
@ UPD_low
read normal registers
Definition: tle5012b_util.hpp:85
@ SAFE_low
switch of safety word generation
Definition: tle5012b_util.hpp:92
@ SAFE_high
switch on safety word generation
Definition: tle5012b_util.hpp:93