TLx493D 3D Hall Sensor Generic Library  1.3
Generic library for the TLx493D 3D Hall sensor family
Macros | Functions
TLV_A1B6.c File Reference
#include <stdint.h>
#include "driver/TLV_A1B6_defines.h"
#include "driver/TLV_A1B6_driver.h"
#include "TLV_A1B6.h"
#include "../TLx493D.h"

Macros

#define NULL   ((void*) 0)
 

Functions

int32_t TLV493D_A1B6_init (TLV493D_data_t *data, bool addr_high, TLV493D_address_t addr_type)
 Initialize the sensor. More...
 
int32_t TLV493D_A1B6_set_operation_mode (TLV493D_data_t *data, TLV493D_op_mode_t mode)
 Change the operation mode of the sensor.
 
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_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.
 

Function Documentation

◆ TLV493D_A1B6_hard_reset_reconfigure()

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.

Parameters
dataSensor data structure. By passing NULL, local data will be used.

◆ TLV493D_A1B6_init()

int32_t TLV493D_A1B6_init ( TLV493D_data_t data,
bool  ADDR_high,
TLV493D_address_t  addr_type 
)

Initialize the sensor.

Parameters
dataparameter 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_highindicates 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_typeindicates the desired address after initialization while keeping in mind the value of ADDR_high and the ADDR pin logic value at startup.
// ========================= Example =============================
// NULL -> store sensor information internally inside the library
// This mode supports only one sensor at a time
// true -> At startup the ADDR pin was HIGH so the internal sensor
// address pin is set to 1
// TLV493D_A1B6_ADDR_1E_9C -> the desired sensor address is either
// 1E or 9C. Since the ADDR pin was HIGH at startup, the address will
// always be 9C
TLV493D_A1B6_init(NULL, true, TLV493D_A1B6_ADDR_1E_9C);