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 #ifndef _TLV493D__H_
21 #define _TLV493D__H_
22 
33 #include <stdbool.h>
34 #include <stdint.h>
35 
39 typedef struct {
41  int16_t x;
43  int16_t y;
45  int16_t z;
47  int16_t temp;
49 
51 enum {
64 };
65 
66 
68 typedef enum {
69  TLx493D_TYPE_UNKNOWN,
70  TLx493D_TYPE_TLV_A1B6,
71  TLx493D_TYPE_TLE_A2B6,
72  TLx493D_TYPE_TLE_W2B6,
73  TLx493D_TYPE_TLI_W2BW
75 
77 typedef enum {
78  TLx493D_OP_MODE_NOT_INITIALIZED,
79  TLx493D_OP_MODE_POWER_DOWN,
80  TLx493D_OP_MODE_MCM,
81  TLx493D_OP_MODE_FAST,
82  TLx493D_OP_MODE_LOW_POWER,
83  TLx493D_OP_MODE_ULTRA_LOW_POWER,
85 
86 
87 
94 int32_t TLx493D_init(void);
95 
98 
102 
105 
109 
110 
114 uint8_t MISC_get_parity(uint8_t data);
115 
116 #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:120
uint8_t MISC_get_parity(uint8_t data)
Compute the EVEN parity of a byte of data.
Definition: TLx493D.c:150
TLV493D_op_mode_t TLx493D_get_operation_mode()
Get the operation mode of the sensors.
Definition: TLx493D.c:136
int16_t y
Magnetic field intensity raw value on the Y axis.
Definition: TLx493D.h:43
The WU feature failed to activate; unknown error.
Definition: TLx493D.h:63
int32_t TLx493D_read_frame(TLx493D_data_frame_t *frame)
Read a data frame from the sensor.
Definition: TLx493D.c:141
The called method has not been implemented yet.
Definition: TLx493D.h:59
No error encountered.
Definition: TLx493D.h:53
Function called with invalid argument.
Definition: TLx493D.h:55
int16_t temp
Raw Temperature value.
Definition: TLx493D.h:47
TLV493D_sensor_type_t
Type of sensor on board.
Definition: TLx493D.h:68
int16_t x
Magnetic field intensity raw value on the X axis.
Definition: TLx493D.h:41
TLV493D_sensor_type_t TLx493D_get_sensor_type(void)
Return the type of sensor present on the board.
Definition: TLx493D.c:115
One or mode sensor registers are set incorrectly.
Definition: TLx493D.h:61
Generic data frame, common to all supported hardware version.
Definition: TLx493D.h:39
int16_t z
Magnetic field intensity raw value on the Z axis.
Definition: TLx493D.h:45
TLV493D_op_mode_t
Operating Mode.
Definition: TLx493D.h:77
The returned frame is invalid and should be discarded.
Definition: TLx493D.h:57
int32_t TLx493D_init(void)
Detect and initialize the connected sensor.
Definition: TLx493D.c:45