![]() |
TLx493D 3D Hall Sensor Generic Library
1.3
Generic library for the TLx493D 3D Hall sensor family
|
The TLx493D Generic Library is a microcontroller-agnostic implementation of a software stack abstraction for sensors of the TLx493D 3D Hall family.
The supported hardware versions are:
*TLV493D-A1B6
*TLE493D-A2B6
*TLE493D-W2B6
*TLI493D-W2BW
The library presents the following three levels of abstraction:
*TLx493D abstraction level
*TLV493D/TLE493D + TLI493D-W2BW abstraction levels
*Drivers abstraction levels
Before calling any library function it is important to note that the functions require the ability to communicate with the 3D Hall sensor on the I2C bus. This implementation of such functionality depends on the microcontroller that the library will be compiled for. As such, the user is required to provide certain functions that when called by the library, will establish communication with the sensor. For details about the aforementioned functions regarding implementation and interfacing with the library, please see the file:
interface.h
The Core distribution of this library does not provide implementations for such functions.
The XMC distribution of the library provides XMC drivers already interfaced with the library.
Follow the TODO comments in the code for additional interfacing instructions.
When importing the library as a project in Dave IDE, only use the Debug Build Configuration, otherwise the project might not build !
The library is able to automatically detect the sensor type and version, making it very easy to get started with such a sensor. The downside of using this level is that regardless of the sensor used, only basic functionality is available to the user, and only one sensor can be used at a time (bus mode not supported).
Example code for reading a data frame in Master Control Mode:
For this abstraction level please see the following files:
TLx493D.h
TLx493D.c
By using the functions defined at this abstraction level, the user may change most of the sensor parameters while also not having to manually change register values or ensure that parity values are correct. This level presents a balance between ease of use and access to sensor settings and is the recommended mode for testing sensor features. The sensor type and version must be known by the user (it is written on the PCB of newer kit versions).
Example code for reading a data frame in Master Control Mode on TLE493D-A1B6:
Example code for reading a data frame in Master Control Mode on TLE493D-A2B6/W2B6/TLI493D-W2BW:
For TLV493D-A1B6 please see the following files:
TLV_A1B6.h
TLV_A1B6.c
For TLE493D-A2B6/-W2B6 please see the following files:
TLE_AW2B6.h
TLE_AW2B6.c
The lowest abstraction level presented by the library is the driver level allowing basic read and write operations with reserved data correction for the TLV493D-A1B6. The implementation is stateless and allows reading and writing sensor registers.
Example code for reading a data frame in Master Control Mode on TLE493D-A1B6:
Example code for reading a data frame in Master Control Mode on TLE493D-A1B6:
For this level please see the following files:
For TLV493D-A1B6:
TLV_A1B6_driver.h
TLV_A1B6_defines.h
TLV_A1B6_driver.c
For TLE493D-A2B6/-W2B6 TLI493D-W2BW:
TLE_AW2B6_driver.h
TLE_AW2B6_driver.c
TLE_AW2B6_defines.h