libDaisy
Hardware Library for Daisy
Loading...
Searching...
No Matches
daisy::Tlv493d< Transport > Class Template Reference

Device support for TLV493D Magnetic Sensor. More...

Detailed Description

template<typename Transport>
class daisy::Tlv493d< Transport >

Device support for TLV493D Magnetic Sensor.

Author
beserge
Date
December 2021

#include <tlv493d.h>

Classes

struct  AccessMode_t
 
struct  Config
 
struct  RegMask_t
 

Public Types

enum  Registers_e {
  R_BX1 = 0 , R_BX2 , R_BY1 , R_BY2 ,
  R_BZ1 , R_BZ2 , R_TEMP1 , R_TEMP2 ,
  R_FRAMECOUNTER , R_CHANNEL , R_POWERDOWNFLAG , R_RES1 ,
  R_RES2 , R_RES3 , W_PARITY , W_ADDR ,
  W_INT , W_FAST , W_LOWPOWER , W_TEMP_NEN ,
  W_LP_PERIOD , W_PARITY_EN , W_RES1 , W_RES2 ,
  W_RES3
}
 
enum  AccessMode_e {
  POWERDOWNMODE = 0 , FASTMODE , LOWPOWERMODE , ULTRALOWPOWERMODE ,
  MASTERCONTROLLEDMODE
}
 
enum  Result { OK = 0 , ERR }
 

Public Member Functions

 Tlv493d ()
 
 ~Tlv493d ()
 
Result Init (Config config)
 
void ReadOut ()
 
void WriteOut ()
 
void SetRegBits (uint8_t regMaskIndex, uint8_t data)
 
uint8_t GetRegBits (uint8_t regMaskIndex)
 
void UpdateData ()
 
void SetInterrupt (bool enable)
 
void EnableTemp (bool enable)
 
float GetX ()
 
float GetY ()
 
float GetZ ()
 
float GetTemp ()
 
float GetAmount ()
 
float GetAzimuth ()
 
float GetPolar ()
 
uint16_t GetMeasurementDelay ()
 
void SetAccessMode (AccessMode_e mode)
 
void CalcParity ()
 
int16_t ConcatResults (uint8_t upperByte, uint8_t lowerByte, bool upperFull)
 

Public Attributes

const AccessMode_t accModes [5]
 
const RegMask_t RegMasks [25]
 

Member Enumeration Documentation

◆ AccessMode_e

Enumerator
POWERDOWNMODE 
FASTMODE 
LOWPOWERMODE 
ULTRALOWPOWERMODE 
MASTERCONTROLLEDMODE 

◆ Registers_e

Enumerator
R_BX1 
R_BX2 
R_BY1 
R_BY2 
R_BZ1 
R_BZ2 
R_TEMP1 
R_TEMP2 
R_FRAMECOUNTER 
R_CHANNEL 
R_POWERDOWNFLAG 
R_RES1 
R_RES2 
R_RES3 
W_PARITY 
W_ADDR 
W_INT 
W_FAST 
W_LOWPOWER 
W_TEMP_NEN 
W_LP_PERIOD 
W_PARITY_EN 
W_RES1 
W_RES2 
W_RES3 

◆ Result

Enumerator
OK 
ERR 

Constructor & Destructor Documentation

◆ Tlv493d()

template<typename Transport >
daisy::Tlv493d< Transport >::Tlv493d ( )
inline

◆ ~Tlv493d()

template<typename Transport >
daisy::Tlv493d< Transport >::~Tlv493d ( )
inline

Member Function Documentation

◆ CalcParity()

template<typename Transport >
void daisy::Tlv493d< Transport >::CalcParity ( )
inline

◆ ConcatResults()

template<typename Transport >
int16_t daisy::Tlv493d< Transport >::ConcatResults ( uint8_t  upperByte,
uint8_t  lowerByte,
bool  upperFull 
)
inline

◆ EnableTemp()

template<typename Transport >
void daisy::Tlv493d< Transport >::EnableTemp ( bool  enable)
inline

◆ GetAmount()

template<typename Transport >
float daisy::Tlv493d< Transport >::GetAmount ( )
inline

◆ GetAzimuth()

template<typename Transport >
float daisy::Tlv493d< Transport >::GetAzimuth ( )
inline

◆ GetMeasurementDelay()

template<typename Transport >
uint16_t daisy::Tlv493d< Transport >::GetMeasurementDelay ( )
inline

◆ GetPolar()

template<typename Transport >
float daisy::Tlv493d< Transport >::GetPolar ( )
inline

◆ GetRegBits()

template<typename Transport >
uint8_t daisy::Tlv493d< Transport >::GetRegBits ( uint8_t  regMaskIndex)
inline

◆ GetTemp()

template<typename Transport >
float daisy::Tlv493d< Transport >::GetTemp ( )
inline

◆ GetX()

template<typename Transport >
float daisy::Tlv493d< Transport >::GetX ( )
inline

◆ GetY()

template<typename Transport >
float daisy::Tlv493d< Transport >::GetY ( )
inline

◆ GetZ()

template<typename Transport >
float daisy::Tlv493d< Transport >::GetZ ( )
inline

◆ Init()

template<typename Transport >
Result daisy::Tlv493d< Transport >::Init ( Config  config)
inline

Initialize the TLV493D device

Parameters
configConfiguration settings

◆ ReadOut()

template<typename Transport >
void daisy::Tlv493d< Transport >::ReadOut ( )
inline

◆ SetAccessMode()

template<typename Transport >
void daisy::Tlv493d< Transport >::SetAccessMode ( AccessMode_e  mode)
inline

◆ SetInterrupt()

template<typename Transport >
void daisy::Tlv493d< Transport >::SetInterrupt ( bool  enable)
inline

◆ SetRegBits()

template<typename Transport >
void daisy::Tlv493d< Transport >::SetRegBits ( uint8_t  regMaskIndex,
uint8_t  data 
)
inline

◆ UpdateData()

template<typename Transport >
void daisy::Tlv493d< Transport >::UpdateData ( )
inline

◆ WriteOut()

template<typename Transport >
void daisy::Tlv493d< Transport >::WriteOut ( )
inline

Member Data Documentation

◆ accModes

Initial value:
= {
{0, 0, 0, 1000},
{1, 0, 0, 0},
{0, 1, 1, 10},
{0, 1, 0, 100},
{1, 1, 1, 10}
}

◆ RegMasks

Initial value:
= {
{ 0 , 0, 0xFF, 0},
{ 0 , 4, 0xF0, 4},
{ 0 , 1, 0xFF, 0},
{ 0 , 4, 0x0F, 0},
{ 0 , 2, 0xFF, 0},
{ 0 , 5, 0x0F, 0},
{ 0 , 3, 0xF0, 4},
{ 0 , 6, 0xFF, 0},
{ 0 , 3, 0x0C, 2},
{ 0 , 3, 0x03, 0},
{ 0 , 5, 0x10, 4},
{ 0 , 7, 0x18, 3},
{ 0 , 8, 0xFF, 0},
{ 0 , 9, 0x1F, 0},
{ 1 , 1, 0x80, 7},
{ 1 , 1, 0x60, 5},
{ 1 , 1, 0x04, 2},
{ 1 , 1, 0x02, 1},
{ 1 , 1, 0x01, 0},
{ 1 , 3, 0x80, 7},
{ 1 , 3, 0x40, 6},
{ 1 , 3, 0x20, 5},
{ 1 , 1, 0x18, 3},
{ 1 , 2, 0xFF, 0},
{ 1 , 3, 0x1F, 0}
}

The documentation for this class was generated from the following file: