TLE5012B  3.1.0
The TLE5012B is a pre-calibrated 360° angle sensor that detects the orientation of a magnetic field. The raw signals (sine and cosine) are digitally processed internally to calculate the angle orientation of the magnetic field (magnet).
Platform Abstraction Layer Interface
Collaboration diagram for Platform Abstraction Layer Interface:

Data Structures

class  GPIO
 
class  SPIC
 
class  Timer
 

Detailed Description


Data Structure Documentation

◆ GPIO

class GPIO
Inheritance diagram for GPIO:

Public Types

enum  Error_t {
  OK = 0 , INTF_ERROR = -1 , CONF_ERROR = -2 , READ_ERROR = -3 ,
  WRITE_ERROR = -4
}
 
Interrupt event
enum  IntEvent_t { INT_FALLING_EDGE = 0 , INT_RISING_EDGE = 1 }
 
Voltage level
enum  VLevel_t { GPIO_LOW = 0 , GPIO_HIGH = 1 }
 
Voltage logic
enum  VLogic_t { NEGATIVE = 1 , POSITIVE = 2 }
 

Public Member Functions

virtual Error_t init ()=0
 Initializes the GPIO. More...
 
virtual Error_t deinit ()=0
 Deinitializes the GPIO. More...
 
virtual Error_t changeMode (uint8_t mode)=0
 Changes the IN/OUT mode. More...
 
virtual VLevel_t read ()=0
 Reads the GPIO voltage level. More...
 
virtual Error_t write (VLevel_t level)=0
 Writes the GPIO output voltage level. More...
 
virtual Error_t enable ()=0
 Enables the GPIO output according to the GPIO logic. More...
 
virtual Error_t disable ()=0
 Disables the GPIO output according to the GPIO logic. More...
 
Error_t checkErrorStatus ()
 

Member Enumeration Documentation

◆ Error_t

Enumerator
OK 

No error

INTF_ERROR 

Interface error

CONF_ERROR 

Configuration error

READ_ERROR 

Read error

WRITE_ERROR 

Write error

◆ IntEvent_t

Enumerator
INT_FALLING_EDGE 

Interrupt on falling edge

INT_RISING_EDGE 

Interrupt on rising edge

◆ VLevel_t

Enumerator
GPIO_LOW 

Level low

GPIO_HIGH 

Level high

◆ VLogic_t

Enumerator
NEGATIVE 

Negative logic. 0 on voltage level high, 1 on voltage low

POSITIVE 

Positive logic. 1 on voltage level high, 0 on voltage low

Member Function Documentation

◆ init()

virtual Error_t GPIO::init ( )
pure virtual

Initializes the GPIO.

Returns
GPIO error code
Return values
OKif success
INIT_ERRORif initialization error

Implemented in GPIOWiced, GPIOMtb, and GPIOIno.

◆ deinit()

virtual Error_t GPIO::deinit ( )
pure virtual

Deinitializes the GPIO.

Returns
GPIO error code
Return values
OKif success
INIT_ERRORif deinitialization error

Implemented in GPIOWiced, GPIOMtb, and GPIOIno.

◆ changeMode()

virtual Error_t GPIO::changeMode ( uint8_t  mode)
pure virtual

Changes the IN/OUT mode.

Parameters
[in]modeINPUT or OUTPUT mode of pin
Returns
GPIO error code
Return values
OKif success
INIT_ERRORif deinitialization error

Implemented in GPIOIno.

◆ read()

virtual VLevel_t GPIO::read ( )
pure virtual

Reads the GPIO voltage level.

Returns
GPIO voltage level
Return values
GPIO_LOWif voltage low
GPIO_HIGHif voltage high

Implemented in GPIOWiced, GPIOMtb, and GPIOIno.

◆ write()

virtual Error_t GPIO::write ( VLevel_t  level)
pure virtual

Writes the GPIO output voltage level.

Parameters
[in]levelVoltage level
Returns
GPIO error code
Return values
OKif success
WRITE_ERRORif write error

Implemented in GPIOWiced, GPIOMtb, and GPIOIno.

◆ enable()

virtual Error_t GPIO::enable ( )
pure virtual

Enables the GPIO output according to the GPIO logic.

  • Low if negative
  • High if positive
    Returns
    GPIO interrupt event
    Return values
    OKif success
    WRITE_ERRORif write error

Implemented in GPIOWiced, GPIOMtb, and GPIOIno.

◆ disable()

virtual Error_t GPIO::disable ( )
pure virtual

Disables the GPIO output according to the GPIO logic.

  • Low if positive
  • High if negative
    Returns
    GPIO error code
    Return values
    OKif success
    WRITE_ERRORif write error

Implemented in GPIOWiced, GPIOMtb, and GPIOIno.

◆ checkErrorStatus()

GPIO::Error_t GPIO::checkErrorStatus ( )

◆ SPIC

class SPIC
Inheritance diagram for SPIC:

Public Types

enum  Error_t {
  OK = 0 , INTF_ERROR = -1 , CONF_ERROR = -2 , READ_ERROR = -3 ,
  WRITE_ERROR = -4
}
 

Public Member Functions

virtual Error_t init ()=0
 Initializes the SPIC. More...
 
virtual Error_t deinit ()=0
 Deinitializes the SPIC. More...
 
virtual Error_t triggerUpdate ()=0
 Sends a trigger through out the SPI bus. More...
 
virtual Error_t sendReceive (uint16_t *sent_data, uint16_t size_of_sent_data, uint16_t *received_data, uint16_t size_of_received_data)=0
 Function which allows 3wire SPI (SSC) by sending and receiving data in the same function. More...
 
Error_t checkErrorStatus ()
 

Member Enumeration Documentation

◆ Error_t

Enumerator
OK 

No error

INTF_ERROR 

Interface error

CONF_ERROR 

Configuration error

READ_ERROR 

Read error

WRITE_ERROR 

Write error

Member Function Documentation

◆ init()

virtual Error_t SPIC::init ( )
pure virtual

Initializes the SPIC.

Returns
SPIC error code
Return values
OKif success
INIT_ERRORif initialization error

Implemented in SPICWiced, SPICMtb, and SPICIno.

◆ deinit()

virtual Error_t SPIC::deinit ( )
pure virtual

Deinitializes the SPIC.

Returns
SPIC error code
Return values
OKif success
INIT_ERRORif deinitialization error

Implemented in SPICWiced, SPICMtb, and SPICIno.

◆ triggerUpdate()

virtual Error_t SPIC::triggerUpdate ( )
pure virtual

Sends a trigger through out the SPI bus.

Returns
SPIC error code
Return values
OKif success
INIT_ERRORif deinitialization error

Implemented in SPICWiced, and SPICIno.

◆ sendReceive()

virtual Error_t SPIC::sendReceive ( uint16_t *  sent_data,
uint16_t  size_of_sent_data,
uint16_t *  received_data,
uint16_t  size_of_received_data 
)
pure virtual

Function which allows 3wire SPI (SSC) by sending and receiving data in the same function.

Parameters
sent_datapointer two 2*unit16_t value for one command word and one data word if something should be written
size_of_sent_datathe size of the command word default 1 = only command 2 = command and data word
received_datapointer to data structure buffer for the read data
size_of_received_datasize of data words to be read
Returns
SPIC error code
Return values
OKif success
INIT_ERRORif transfer fails

Implemented in SPICWiced, and SPICIno.

◆ checkErrorStatus()

SPIC::Error_t SPIC::checkErrorStatus ( )

◆ Timer

class Timer
Inheritance diagram for Timer:

Public Types

enum  Error_t { OK = 0 , ERROR = 1 }
 

Public Member Functions

virtual Error_t init ()=0
 Initialize the timer. More...
 
virtual Error_t deinit ()=0
 Deinitialize the timer. More...
 
virtual Error_t start ()=0
 Starts the timer. More...
 
virtual Error_t elapsed (uint32_t &elapsed)=0
 Elapsed time since the timer was started. More...
 
virtual Error_t stop ()=0
 Stops the timer. More...
 
virtual Error_t delayMilli (uint32_t timeout)=0
 Introduces a delay during the specified time. More...
 
virtual Error_t delayMicro (uint32_t timeout)=0
 Introduces a delay during the specified time. More...
 

Member Enumeration Documentation

◆ Error_t

Enumerator
OK 

No error

ERROR 

Error

Member Function Documentation

◆ init()

virtual Error_t Timer::init ( )
pure virtual

Initialize the timer.

Returns
Timer error code
Return values
OKif success
INIT_ERRORif hardware interface error

Implemented in TimerWiced, and TimerMtb.

◆ deinit()

virtual Error_t Timer::deinit ( )
pure virtual

Deinitialize the timer.

Returns
Timer error code
Return values
OKif success
INIT_ERRORif hardware interface error

Implemented in TimerWiced, and TimerMtb.

◆ start()

virtual Error_t Timer::start ( )
pure virtual

Starts the timer.

Returns
Timer error code
Return values
OKif success
INIT_ERRORif hardware interface error

Implemented in TimerWiced, and TimerMtb.

◆ elapsed()

virtual Error_t Timer::elapsed ( uint32_t &  elapsed)
pure virtual

Elapsed time since the timer was started.

Parameters
[out]elapsedTime in milliseconds
Returns
Timer error code
Return values
OKif success
INIT_ERRORif hardware interface error

◆ stop()

virtual Error_t Timer::stop ( )
pure virtual

Stops the timer.

Returns
Timer error code
Return values
OKif success
INIT_ERRORif hardware interface error

Implemented in TimerWiced, and TimerMtb.

◆ delayMilli()

virtual Error_t Timer::delayMilli ( uint32_t  timeout)
pure virtual

Introduces a delay during the specified time.

Parameters
[in]timeoutDelay time in milliseconds
Returns
Timer error code
Return values
OKif success
INIT_ERRORif hardware interface error

Implemented in TimerWiced, and TimerMtb.

◆ delayMicro()

virtual Error_t Timer::delayMicro ( uint32_t  timeout)
pure virtual

Introduces a delay during the specified time.

Parameters
[in]timeoutDelay time in microseconds
Returns
Timer error code
Return values
OKif success
INIT_ERRORif hardware interface error

Implemented in TimerWiced, and TimerMtb.