TLx493D 3D Hall Sensor Generic Library  1.3
Generic library for the TLx493D 3D Hall sensor family
TLx493D.h
Go to the documentation of this file.
1 /*
2 *****************************************************************************
3 * Copyright (C) 2019 Infineon Technologies AG. All rights reserved.
4 *
5 * Infineon Technologies AG (INFINEON) is supplying this file for use
6 * exclusively with Infineon's products. This file can be freely
7 * distributed within development tools and software supporting such microcontroller
8 * products.
9 *
10 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
11 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
13 * INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL,
14 * ASPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
15 *
16 ******************************************************************************
17 */
18 
19 
20 
21 #ifndef _TLV493D__H_
22 #define _TLV493D__H_
23 
34 #include <stdbool.h>
35 #include <stdint.h>
36 
40 typedef struct {
42  int16_t x;
44  int16_t y;
46  int16_t z;
48  int16_t temp;
50 
52 enum {
65 };
66 
67 
69 typedef enum {
70  TLx493D_TYPE_UNKNOWN,
71  TLx493D_TYPE_TLV_A1B6,
72  TLx493D_TYPE_TLE_A2B6,
73  TLx493D_TYPE_TLE_W2B6,
74  TLx493D_TYPE_TLI_W2BW
76 
78 typedef enum {
79  TLx493D_OP_MODE_NOT_INITIALIZED,
80  TLx493D_OP_MODE_POWER_DOWN,
81  TLx493D_OP_MODE_MCM,
82  TLx493D_OP_MODE_FAST,
83  TLx493D_OP_MODE_LOW_POWER,
84  TLx493D_OP_MODE_ULTRA_LOW_POWER,
86 
87 
88 
95 int32_t TLx493D_init(void);
96 
99 
103 
106 
110 
111 
115 uint8_t MISC_get_parity(uint8_t data);
116 
117 #endif //_TLV493D__H_
int32_t TLx493D_set_operation_mode(TLV493D_op_mode_t mode)
Set the operation mode of the sensors, if supported.
Definition: TLx493D.c:111
uint8_t MISC_get_parity(uint8_t data)
Compute the EVEN parity of a byte of data.
Definition: TLx493D.c:141
TLV493D_op_mode_t TLx493D_get_operation_mode()
Get the operation mode of the sensors.
Definition: TLx493D.c:127
int16_t y
Magnetic field intensity raw value on the Y axis.
Definition: TLx493D.h:44
The WU feature failed to activate; unknown error.
Definition: TLx493D.h:64
int32_t TLx493D_read_frame(TLx493D_data_frame_t *frame)
Read a data frame from the sensor.
Definition: TLx493D.c:132
The called method has not been implemented yet.
Definition: TLx493D.h:60
No error encountered.
Definition: TLx493D.h:54
Function called with invalid argument.
Definition: TLx493D.h:56
int16_t temp
Raw Temperature value.
Definition: TLx493D.h:48
TLV493D_sensor_type_t
Type of sensor on board.
Definition: TLx493D.h:69
int16_t x
Magnetic field intensity raw value on the X axis.
Definition: TLx493D.h:42
TLV493D_sensor_type_t TLx493D_get_sensor_type(void)
Return the type of sensor present on the board.
Definition: TLx493D.c:106
One or mode sensor registers are set incorrectly.
Definition: TLx493D.h:62
Generic data frame, common to all supported hardware version.
Definition: TLx493D.h:40
int16_t z
Magnetic field intensity raw value on the Z axis.
Definition: TLx493D.h:46
TLV493D_op_mode_t
Operating Mode.
Definition: TLx493D.h:78
The returned frame is invalid and should be discarded.
Definition: TLx493D.h:58
int32_t TLx493D_init(void)
Detect and initialize the connected sensor.
Definition: TLx493D.c:43