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).
PAL Arduino

Arduino SPIClass extension to use 3wire SSC SPI interfaces. More...

Collaboration diagram for PAL Arduino:

Data Structures

class  GPIOIno
 Arduino GPIO class. More...
 
class  SPIClass3W
 
class  SPICIno
 Arduino SPIC class This function is setting the basics for a SPIC and the default spi. More...
 
class  Tle5012Ino
 represents a basic TLE5012b Arduino class. More...
 

Macros

#define SPI3W_ARD   1
 Arduino SPIClass3W extends the default SPIClass The extension allows the use of 3wire SSC SPI interfaces for default Arduino/Genuino and for XMC, special for the Sensor2go kit Therefore via the correct code is loaded via SPI3W_INO macro settings. More...
 
#define SPI3W_XMC   2
 
#define MAX_SLAVE_NUM   4
 Maximum numbers of slaves on one SPI bus. More...
 
#define SPEED   1000000U
 default speed of SPI transfer More...
 

Functions

 Tle5012Ino::Tle5012Ino ()
 
 Tle5012Ino::Tle5012Ino (uint8_t csPin, slaveNum slave=TLE5012B_S0)
 Construct a new Tle5012Ino::Tle5012Ino object with chipselect and sensor slave Use this constructor if: More...
 
 Tle5012Ino::Tle5012Ino (SPIClass3W &bus, uint8_t csPin, uint8_t misoPin, uint8_t mosiPin, uint8_t sckPin, slaveNum slave=TLE5012B_S0)
 
errorTypes Tle5012Ino::begin ()
 begin method with default assignments for the SPI bus and pin setting. The EN pin is only available for the Sensor2go kit, therefore we only set it in that case, otherwise it will be NULL. More...
 
 SPIClass3W::SPIClass3W ()
 Construct a new SPIClass3W::SPIClass3W object. More...
 
 SPIClass3W::~SPIClass3W ()
 Destroy the SPIClass3W::SPIClass3W object. More...
 
void SPIClass3W::begin (uint8_t miso, uint8_t mosi, uint8_t sck, uint8_t cs)
 New for fetching SPI parameter. More...
 
void SPIClass3W::setCSPin (uint8_t cs)
 Set the chipselect pin. This function is needed if more than one sensor is in the SPI bus. More...
 
void SPIClass3W::sendReceiveSpi (uint16_t *sent_data, uint16_t size_of_sent_data, uint16_t *received_data, uint16_t size_of_received_data)
 Main SPI three wire communication functions for sending and receiving data. More...
 
 SPICIno::SPICIno (uint8_t csPin=PIN_SPI_SS)
 Construct a new SPICIno::SPICIno object. More...
 
 SPICIno::SPICIno (SPIClass3W &port, uint8_t csPin=PIN_SPI_SS, uint8_t misoPin=PIN_SPI_MISO, uint8_t mosiPin=PIN_SPI_MOSI, uint8_t sckPin=PIN_SPI_SCK)
 Construct a new SPICIno::SPICIno object of the Arduino SPIC class. More...
 
Error_t SPICIno::init ()
 Initialize the SPIC. More...
 
Error_t SPICIno::deinit ()
 Deinitialize the SPIC. More...
 
Error_t SPICIno::triggerUpdate ()
 Triggers an update in the register buffer. This function should be triggered once before UPD registers where read as it generates a snapshot of the UPD register values at trigger point. More...
 
Error_t SPICIno::sendReceive (uint16_t *sent_data, uint16_t size_of_sent_data, uint16_t *received_data, uint16_t size_of_received_data)
 

Variables

SPIClass3W SPI3W
 define a new SPI3W macro for handling more than the default SPI channel More...
 
uint8_t Tle5012Ino::mSpiNum = 0
 Number of used SPI channel. More...
 

TLE5012-pal-ino.hpp - Arduino Hardware Abstraction Layer

Author
Infineon Technologies AG
Version
3.1.0 PAL Arduino

SPDX-License-Identifier: MIT

#define PIN_SPI_EN   UNUSED_PIN
 Check for XMC mcu family *‍/. More...
 

Detailed Description

Arduino SPIClass extension to use 3wire SSC SPI interfaces.


Data Structure Documentation

◆ GPIOIno

class GPIOIno

Arduino GPIO class.

Inheritance diagram for GPIOIno:
Collaboration diagram for GPIOIno:

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

 GPIOIno ()
 Constructor of the Arduino GPIO class. More...
 
 GPIOIno (uint8_t pin, uint8_t mode, VLogic_t logic)
 Constructor of the Arduino GPIO class. More...
 
 ~GPIOIno ()
 
Error_t init ()
 Initialize the GPIO. More...
 
Error_t changeMode (uint8_t mode)
 Changes the GPIO mode. More...
 
Error_t deinit ()
 Deinitialize the GPIO. More...
 
VLevel_t read ()
 Read GPIO logic level. More...
 
Error_t write (VLevel_t level)
 Set GPIO logic level. More...
 
Error_t enable ()
 Enable the GPIO. More...
 
Error_t disable ()
 Disable the GPIO. More...
 
Error_t checkErrorStatus ()
 

Member Enumeration Documentation

◆ Error_t

enum GPIO::Error_t
inherited
Enumerator
OK 

No error

INTF_ERROR 

Interface error

CONF_ERROR 

Configuration error

READ_ERROR 

Read error

WRITE_ERROR 

Write error

◆ IntEvent_t

enum GPIO::IntEvent_t
inherited
Enumerator
INT_FALLING_EDGE 

Interrupt on falling edge

INT_RISING_EDGE 

Interrupt on rising edge

◆ VLevel_t

enum GPIO::VLevel_t
inherited
Enumerator
GPIO_LOW 

Level low

GPIO_HIGH 

Level high

◆ VLogic_t

enum GPIO::VLogic_t
inherited
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

Constructor & Destructor Documentation

◆ GPIOIno() [1/2]

GPIOIno::GPIOIno ( )

Constructor of the Arduino GPIO class.

This function is setting the basics for a GPIO.

◆ GPIOIno() [2/2]

GPIOIno::GPIOIno ( uint8_t  pin,
uint8_t  mode,
VLogic_t  logic 
)

Constructor of the Arduino GPIO class.

This function is setting the basics for a GPIO. It allows to set the pin number, mode of the pin and the logic level.

Parameters
[in]pinNumber of the desired pin
[in]modeDefines the mode of the pin (INPUT, OUTPUT, etc.)
[in]logicDefines the logic level of the pin

◆ ~GPIOIno()

GPIOIno::~GPIOIno ( )

Member Function Documentation

◆ init()

GPIOIno::Error_t GPIOIno::init ( )
virtual

Initialize the GPIO.

This function is initializing the chosen pin.

Returns
GPIOIno::Error_t

Implements GPIO.

◆ changeMode()

GPIOIno::Error_t GPIOIno::changeMode ( uint8_t  mode)
virtual

Changes the GPIO mode.

This function changes the mode of the chosen pin.

Returns
GPIOIno::Error_t

Implements GPIO.

◆ deinit()

GPIOIno::Error_t GPIOIno::deinit ( )
virtual

Deinitialize the GPIO.

This function is deinitializing the chosen pin.

Returns
GPIOIno::Error_t

Implements GPIO.

◆ read()

GPIOIno::VLevel_t GPIOIno::read ( )
virtual

Read GPIO logic level.

This function reads the logic level of the chosen pin and returns the logic level value.

Returns
GPIOIno::VLevel_t
Return values
0= GPIO_LOW
1= GPIO_HIGH

Implements GPIO.

◆ write()

GPIOIno::Error_t GPIOIno::write ( VLevel_t  level)
virtual

Set GPIO logic level.

This functions sets the logic level of the chosen pin.

Parameters
[in]levelDesired logic level of the pin
Returns
GPIOIno::Error_t

Implements GPIO.

◆ enable()

GPIOIno::Error_t GPIOIno::enable ( )
virtual

Enable the GPIO.

This functions enable the chosen pin. Depending on the chosen logic of the pin it sets the right logic level of the pin.

Returns
GPIOIno::Error_t

Implements GPIO.

◆ disable()

GPIOIno::Error_t GPIOIno::disable ( )
virtual

Disable the GPIO.

This functions disables the chosen pin. Depending on the chosen logic of the pin it sets the right logic level of the pin.

Returns
GPIOIno::Error_t

Implements GPIO.

◆ checkErrorStatus()

GPIO::Error_t GPIO::checkErrorStatus ( )
inherited

◆ SPIClass3W

class SPIClass3W
Inheritance diagram for SPIClass3W:
Collaboration diagram for SPIClass3W:

Public Member Functions

 SPIClass3W ()
 Construct a new SPIClass3W::SPIClass3W object. More...
 
 ~SPIClass3W ()
 Destroy the SPIClass3W::SPIClass3W object. More...
 
void begin (uint8_t miso, uint8_t mosi, uint8_t sck, uint8_t cs)
 New for fetching SPI parameter. More...
 
void setCSPin (uint8_t cs)
 Set the chipselect pin. This function is needed if more than one sensor is in the SPI bus. More...
 
void sendReceiveSpi (uint16_t *sent_data, uint16_t size_of_sent_data, uint16_t *received_data, uint16_t size_of_received_data)
 Main SPI three wire communication functions for sending and receiving data. More...
 

Data Fields

uint8_t mCS
 Pin for chip select. More...
 
uint8_t mSpiNum
 Number of used SPI channel. More...
 

Field Documentation

◆ mCS

uint8_t SPIClass3W::mCS

Pin for chip select.

◆ mSpiNum

uint8_t SPIClass3W::mSpiNum

Number of used SPI channel.

◆ SPICIno

class SPICIno

Arduino SPIC class This function is setting the basics for a SPIC and the default spi.

Inheritance diagram for SPICIno:
Collaboration diagram for SPICIno:

Public Types

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

Public Member Functions

 SPICIno (uint8_t csPin=PIN_SPI_SS)
 Construct a new SPICIno::SPICIno object. More...
 
 SPICIno (SPIClass3W &port, uint8_t csPin=PIN_SPI_SS, uint8_t misoPin=PIN_SPI_MISO, uint8_t mosiPin=PIN_SPI_MOSI, uint8_t sckPin=PIN_SPI_SCK)
 Construct a new SPICIno::SPICIno object of the Arduino SPIC class. More...
 
 ~SPICIno ()
 
Error_t init ()
 Initialize the SPIC. More...
 
Error_t deinit ()
 Deinitialize the SPIC. More...
 
Error_t triggerUpdate ()
 Triggers an update in the register buffer. This function should be triggered once before UPD registers where read as it generates a snapshot of the UPD register values at trigger point. More...
 
Error_t sendReceive (uint16_t *sent_data, uint16_t size_of_sent_data, uint16_t *received_data, uint16_t size_of_received_data)
 
Error_t checkErrorStatus ()
 

Member Enumeration Documentation

◆ Error_t

enum SPIC::Error_t
inherited
Enumerator
OK 

No error

INTF_ERROR 

Interface error

CONF_ERROR 

Configuration error

READ_ERROR 

Read error

WRITE_ERROR 

Write error

Constructor & Destructor Documentation

◆ ~SPICIno()

SPICIno::~SPICIno ( )

Member Function Documentation

◆ checkErrorStatus()

SPIC::Error_t SPIC::checkErrorStatus ( )
inherited

◆ Tle5012Ino

class Tle5012Ino

represents a basic TLE5012b Arduino class.

represents the TLE5012 base class This file is only a startup wrapper for Arduino IDE so that the framework setup can be handeld without any special setup.

represents the TLE5012 base class

This class provides a simple API for connecting Arduino/Genuio and compatible MCUs. As the default interface for the sensor is the 3wire SSC SPI interface, the default SPIClass is extended by the SPIclass3W.

See also
Tle5012

This class provides a simple API for connecting the TLE5012 via SSC interface, which is included into all flavours the TLE5012 sensor. This setup also works with the Sens2Kit (Sensor including XMC1100 mcu), breakout board (only the Sensor from the Sens2Kit) and bulk chip (read the section on how to connect the bulk chip via 3wire SPI).

Inheritance diagram for Tle5012Ino:
Collaboration diagram for Tle5012Ino:

Public Types

enum  slaveNum { TLE5012B_S0 = 0x0000 , TLE5012B_S1 = 0x2000 , TLE5012B_S2 = 0x4000 , TLE5012B_S3 = 0x6000 }
 

Public Member Functions

 Tle5012Ino ()
 
 Tle5012Ino (uint8_t csPin, slaveNum slave=TLE5012B_S0)
 Construct a new Tle5012Ino::Tle5012Ino object with chipselect and sensor slave Use this constructor if: More...
 
 Tle5012Ino (SPIClass3W &bus, uint8_t csPin, uint8_t misoPin, uint8_t mosiPin, uint8_t sckPin, slaveNum slave=TLE5012B_S0)
 
errorTypes begin ()
 begin method with default assignments for the SPI bus and pin setting. The EN pin is only available for the Sensor2go kit, therefore we only set it in that case, otherwise it will be NULL. More...
 
errorTypes begin (uint8_t csPin, slaveNum slave=TLE5012B_S0)
 begin method with default assignments for the SPI bus and the slave setting. Only the csPin is needed. More...
 
errorTypes readActiveStatus (uint16_t &data)
 read register offset 0x01 More...
 

Data Fields

uint8_t mSpiNum = 0
 Number of used SPI channel. More...
 
SPICsBus
 SPI cover class as representation of the SPI bus. More...
 
GPIOen
 shield enable GPIO to switch sensor2go on/off More...
 
Reg reg
 Register map. More...
 
slaveNum mSlave
 actual set slave number More...
 
struct Tle5012b::safetyWord safetyWord_t
 constructor for the Sensor More...
 
safetyWord safetyStatus
 
uint16_t safetyWord
 the last fetched safety word More...
 

Protected Attributes

uint16_t _command [2]
 command write data [0] = command [1] = data to write More...
 
uint16_t _received [MAX_REGISTER_MEM]
 fetched data from sensor with last word = safety word More...
 
uint16_t _registers [CRC_NUM_REGISTERS+1]
 keeps track of the values stored in the 8 _registers, for which the CRC is calculated More...
 

TLE5012b.cpp - core library for the TLE5012B angle sensor.

GMR-based angle sensor for angular position sensing in automotive applications Core Library

Author
Infineon Technologies AG
Version
3.1.0

SPDX-License-Identifier: MIT

void end ()
 
void enableSensor ()
 
void disableSensor ()
 
errorTypes readBlockCRC ()
 
errorTypes readFromSensor (uint16_t command, uint16_t &data, updTypes upd=UPD_low, safetyTypes safe=SAFE_high)
 
errorTypes readMoreRegisters (uint16_t command, uint16_t data[], updTypes upd=UPD_low, safetyTypes safe=SAFE_high)
 
errorTypes readStatus (uint16_t &data, updTypes upd=UPD_low, safetyTypes safe=SAFE_high)
 
errorTypes readActivationStatus (uint16_t &data, updTypes upd=UPD_low, safetyTypes safe=SAFE_high)
 
errorTypes readIntMode1 (uint16_t &data)
 read register offset 0x06 More...
 
errorTypes readSIL (uint16_t &data)
 read register offset 0x07 More...
 
errorTypes readIntMode2 (uint16_t &data)
 read register offset 0x08 More...
 
errorTypes readIntMode3 (uint16_t &data)
 read register offset 0x09 More...
 
errorTypes readOffsetX (uint16_t &data)
 read register offset 0x0A More...
 
errorTypes readOffsetY (uint16_t &data)
 read register offset 0x0B More...
 
errorTypes readSynch (uint16_t &data)
 read register offset 0x0C More...
 
errorTypes readIFAB (uint16_t &data)
 read register offset 0x0D More...
 
errorTypes readIntMode4 (uint16_t &data)
 read register offset 0x0E More...
 
errorTypes readTempCoeff (uint16_t &data)
 read register offset 0x0F More...
 
errorTypes readTempDMag (uint16_t &data)
 read register offset 0x14 More...
 
errorTypes readTempRaw (uint16_t &data)
 read register offset 0x15 More...
 
errorTypes readTempIIFCnt (uint16_t &data)
 read register offset 0x20 More...
 
errorTypes readTempT25 (uint16_t &data)
 read register offset 0x30 More...
 
errorTypes readRawX (int16_t &data)
 
errorTypes readRawY (int16_t &data)
 
errorTypes getAngleRange (double &angleRange)
 
errorTypes getAngleValue (double &angleValue)
 
errorTypes getAngleValue (double &angleValue, int16_t &rawAnglevalue, updTypes upd=UPD_low, safetyTypes safe=SAFE_high)
 
errorTypes getNumRevolutions (int16_t &numRev, updTypes upd=UPD_low, safetyTypes safe=SAFE_high)
 
errorTypes getTemperature (double &temp)
 
errorTypes getTemperature (double &temp, int16_t &rawTemp, updTypes upd=UPD_low, safetyTypes safe=SAFE_high)
 
errorTypes getAngleSpeed (double &angleSpeed)
 
errorTypes getAngleSpeed (double &angleSpeed, int16_t &rawSpeed, updTypes upd=UPD_low, safetyTypes safe=SAFE_high)
 
errorTypes writeSlaveNumber (uint16_t dataToWrite)
 
errorTypes writeToSensor (uint16_t command, uint16_t dataToWrite, bool changeCRC)
 
errorTypes writeTempCoeffUpdate (uint16_t dataToWrite)
 
errorTypes writeActivationStatus (uint16_t dataToWrite)
 write register offset 0x01 More...
 
errorTypes writeIntMode1 (uint16_t dataToWrite)
 write register offset 0x06 More...
 
errorTypes writeSIL (uint16_t dataToWrite)
 write register offset 0x07 More...
 
errorTypes writeIntMode2 (uint16_t dataToWrite)
 write register offset 0x08 More...
 
errorTypes writeIntMode3 (uint16_t dataToWrite)
 write register offset 0x09 More...
 
errorTypes writeOffsetX (uint16_t dataToWrite)
 write register offset 0x0A More...
 
errorTypes writeOffsetY (uint16_t dataToWrite)
 write register offset 0x0B More...
 
errorTypes writeSynch (uint16_t dataToWrite)
 write register offset 0x0C More...
 
errorTypes writeIFAB (uint16_t dataToWrite)
 write register offset 0x0D More...
 
errorTypes writeIntMode4 (uint16_t dataToWrite)
 write register offset 0x0E More...
 
errorTypes writeTempCoeff (uint16_t dataToWrite)
 write register offset 0x0F More...
 
errorTypes resetFirmware ()
 
errorTypes readRegMap ()
 
errorTypes writeInterfaceType (Reg::interfaceType_t iface)
 
errorTypes setCalibration (Reg::calibrationMode_t calMode)
 
errorTypes regularCrcUpdate ()
 
errorTypes checkSafety (uint16_t safety, uint16_t command, uint16_t *readreg, uint16_t length)
 
void resetSafety ()
 

Macro Definition Documentation

◆ SPI3W_ARD

#define SPI3W_ARD   1

Arduino SPIClass3W extends the default SPIClass The extension allows the use of 3wire SSC SPI interfaces for default Arduino/Genuino and for XMC, special for the Sensor2go kit Therefore via the correct code is loaded via SPI3W_INO macro settings.

Attention
keep in mind, you can set more different chipselect pins, but you can not separate more than 4 sensors data streams from each other

◆ SPI3W_XMC

#define SPI3W_XMC   2

◆ MAX_SLAVE_NUM

#define MAX_SLAVE_NUM   4

Maximum numbers of slaves on one SPI bus.

◆ SPEED

#define SPEED   1000000U

default speed of SPI transfer

◆ PIN_SPI_EN

#define PIN_SPI_EN   UNUSED_PIN

Check for XMC mcu family *‍/.

TLE5012 with any other PCB has no switch on/off

Function Documentation

◆ Tle5012Ino() [1/3]

Tle5012Ino::Tle5012Ino ( )

Construct a new Tle5012Ino::Tle5012Ino object with default SPI and pin assignment. Use this if:

  • you have TLE5012B Sensor2go kit (all types)
  • attached the breakout board on the default SPI of your MCU
  • attached a bulk chip with the SSC interface to the default SPI of your MCU

◆ Tle5012Ino() [2/3]

Tle5012Ino::Tle5012Ino ( uint8_t  csPin,
slaveNum  slave = TLE5012B_S0 
)

Construct a new Tle5012Ino::Tle5012Ino object with chipselect and sensor slave Use this constructor if:

  • you use more than one sensor with one SPI channel (up to four are possible)
Parameters
csPinpin number of the CS pin
slaveoptional sensor slave setting

◆ Tle5012Ino() [3/3]

Tle5012Ino::Tle5012Ino ( SPIClass3W bus,
uint8_t  csPin,
uint8_t  misoPin,
uint8_t  mosiPin,
uint8_t  sckPin,
slaveNum  slave = TLE5012B_S0 
)

Construct a new Tle5012Ino::Tle5012Ino object with individual SPI and pin assignment Use this if:

  • you use different SPI channels than default
  • you use a software SPI with different pin settings than default
Parameters
busvoid pointer to the object representing the SPI class
csPinpin number of the CS pin
misoPinMISO pin for the SPI/SSC interface
mosiPinMOSI pin for the SPI/SSC interface
sckPinsystem clock pin for external sensor clock setting
slaveoptional sensor slave setting

◆ begin() [1/2]

errorTypes Tle5012Ino::begin ( void  )

begin method with default assignments for the SPI bus and pin setting. The EN pin is only available for the Sensor2go kit, therefore we only set it in that case, otherwise it will be NULL.

Returns
errorTypes
Here is the call graph for this function:

◆ SPIClass3W()

SPIClass3W::SPIClass3W ( )

Construct a new SPIClass3W::SPIClass3W object.

◆ ~SPIClass3W()

SPIClass3W::~SPIClass3W ( )

Destroy the SPIClass3W::SPIClass3W object.

◆ begin() [2/2]

void SPIClass3W::begin ( uint8_t  miso,
uint8_t  mosi,
uint8_t  sck,
uint8_t  cs 
)

New for fetching SPI parameter.

Parameters
miso[in] pin number for miso, on sensor2go boards the same than mosi
mosi[in] pin number for mosi, on sensor2go boards the same than miso
sck[in] the system clock pin for external clock driver
cs[in] chipselect pin, up to four different cs pins can be used together with the slave number
Here is the call graph for this function:

◆ setCSPin()

void SPIClass3W::setCSPin ( uint8_t  cs)

Set the chipselect pin. This function is needed if more than one sensor is in the SPI bus.

Parameters
cs[in] Pin number of the sensors chip select

◆ sendReceiveSpi()

void SPIClass3W::sendReceiveSpi ( uint16_t *  sent_data,
uint16_t  size_of_sent_data,
uint16_t *  received_data,
uint16_t  size_of_received_data 
)

Main SPI three wire communication functions for sending and receiving data.

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

◆ SPICIno() [1/2]

SPICIno::SPICIno ( uint8_t  csPin = PIN_SPI_SS)

Construct a new SPICIno::SPICIno object.

This function is setting the basics for a SPIC and the default spi. Use this call if:

  • you use the default SPI channel
  • if use the default SPI channel with up to four sensors
Parameters
csPinoptional chipselect pin. If not set it will be default PIN_SPI_SS

◆ SPICIno() [2/2]

SPICIno::SPICIno ( SPIClass3W port,
uint8_t  csPin = PIN_SPI_SS,
uint8_t  misoPin = PIN_SPI_MISO,
uint8_t  mosiPin = PIN_SPI_MOSI,
uint8_t  sckPin = PIN_SPI_SCK 
)

Construct a new SPICIno::SPICIno object of the Arduino SPIC class.

This function sets all pins for a given SPI port, allowing a free setting of the SPI interface Use this call of:

  • you want to use a different than this default SPI channel
  • also with up to four sensors per channel
Parameters
portSPI port if not default
csPinchipselect pin for the SPI port
misoPinmiso pin number
mosiPinmosi pin number
sckPinsystemclock pin number

◆ init()

SPICIno::Error_t SPICIno::init ( )
virtual

Initialize the SPIC.

This function is initializing the chosen spi channel with the given values for lsb, clock and mode

Returns
SPICIno::Error_t

Implements SPIC.

Here is the call graph for this function:

◆ deinit()

SPICIno::Error_t SPICIno::deinit ( )
virtual

Deinitialize the SPIC.

This function is deinitializing the chosen spi channel.

Returns
SPICIno::Error_t

Implements SPIC.

◆ triggerUpdate()

SPICIno::Error_t SPICIno::triggerUpdate ( )
virtual

Triggers an update in the register buffer. This function should be triggered once before UPD registers where read as it generates a snapshot of the UPD register values at trigger point.

Returns
SPICIno::Error_t

Implements SPIC.

◆ sendReceive()

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

Main SPI three wire communication functions for sending and receiving data

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

Implements SPIC.

Here is the call graph for this function:

Variable Documentation

◆ SPI3W

SPIClass3W SPI3W
extern

define a new SPI3W macro for handling more than the default SPI channel

◆ mSpiNum

uint8_t Tle5012Ino::mSpiNum = 0

Number of used SPI channel.