![]() |
TLx493D 3D Hall Sensor Generic Library
1.3
Generic library for the TLx493D 3D Hall sensor family
|
TLV493D-A1B6 abstraction. More...
Go to the source code of this file.
Classes | |
struct | TLV493D_data_t |
Data structure containing information about the internal state of a sensor. Also used to identify a sensor on a bus. More... | |
Enumerations | |
enum | TLV493D_address_t { TLV493D_A1B6_ADDR_3E_BC, TLV493D_A1B6_ADDR_36_B4, TLV493D_A1B6_ADDR_1E_9C, TLV493D_A1B6_ADDR_16_94 } |
I2C addresses supported by the TLV493D-A1B6 sensor. More... | |
Functions | |
int32_t | TLV493D_A1B6_init (TLV493D_data_t *data, bool ADDR_high, TLV493D_address_t addr_type) |
Initialize the sensor. More... | |
void | TLV493D_A1B6_hard_reset_reconfigure (TLV493D_data_t *data) |
Hard reset the sensor by executing a power cycle and reinitialize using the settings from the data structure. Will only set the address. More... | |
int32_t | TLV493D_A1B6_read_frame (TLV493D_data_t *data, TLx493D_data_frame_t *frame) |
Read the registers of the TLx493D sensor and create a data frame. | |
int32_t | TLV493D_A1B6_set_operation_mode (TLV493D_data_t *data, TLV493D_op_mode_t mode) |
Change the operation mode of the sensor. | |
int32_t | TLV493D_A1B6_set_temp_measure (TLV493D_data_t *data, bool enabled) |
Enable or disable the temperature measurement. | |
int32_t | TLV493D_A1B6_set_parity_test (TLV493D_data_t *data, bool enabled) |
Enable or disable the parity test. | |
int32_t | TLV493D_A1B6_set_IIC_address (TLV493D_data_t *data, TLV493D_address_t new_addr_type) |
Set a new I2C address for the sensor, considering the ADDR pin level at startup. | |
void | TLV493D_A1B6_get_data (TLV493D_data_t *dest) |
Copy the data stored in the library to the dest structure. | |
int32_t | TLV493D_A1B6_set_data (TLV493D_data_t *src) |
Copy the data from src to the library. | |
TLV493D-A1B6 abstraction.
Abstracts the basic functions of the TLV493D-A1B6 and offers a way to store the internal state of the sensor registers.
enum TLV493D_address_t |
I2C addresses supported by the TLV493D-A1B6 sensor.
The left side addresses from the define names (3E, 36, 1E, 16) are relevant when the sensor is powered up with the ADDR pin LOW. The right side addresses can be used when the sensor is powered up with the ADDR pin HIGH. All values are in hexadecimal representation.
void TLV493D_A1B6_hard_reset_reconfigure | ( | TLV493D_data_t * | data | ) |
Hard reset the sensor by executing a power cycle and reinitialize using the settings from the data structure. Will only set the address.
data | Sensor data structure. By passing NULL, local data will be used. |
int32_t TLV493D_A1B6_init | ( | TLV493D_data_t * | data, |
bool | ADDR_high, | ||
TLV493D_address_t | addr_type | ||
) |
Initialize the sensor.
data | parameter is optional (can be replaced with NULL) and specifies a data structure that should store the state of the sensor. If no data structure is sepcifiec, an internal data structure will be used. This parameter should be used in a bus configuration to easily identify sensors and also to manually inspect the internal state of the sensor. |
ADDR_high | indicates the level of ADDR at the time the sensor was powered up. ADDR_high=true indicates that the sensor was powered up with ADDR=HIGH ADDR_high=false indicates that the sensor was powered up with ADDR=LOW |
addr_type | indicates the desired address after initialization while keeping in mind the value of ADDR_high and the ADDR pin logic value at startup. |