Data Structures | |
class | GPIOWiced |
class | SPICWiced |
Wiced SPIC class. More... | |
class | TimerWiced |
class | Tle5012Wiced |
represents a basic TLE5012b Wiced class. More... | |
Functions | |
Tle5012Wiced::Tle5012Wiced () | |
Tle5012Wiced::Tle5012Wiced (wiced_gpio_t csPin, slaveNum slave=TLE5012B_S0) | |
Construct a new Tle5012Wiced::Tle5012Wiced object with chipselect and sensor slave Use this constructor if: More... | |
errorTypes | Tle5012Wiced::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... | |
Variables | |
uint8_t | Tle5012Wiced::mSpiNum = 0 |
Number of used SPI channel. More... | |
TLE5012-pal-wiced.hpp - Wiced Hardware Abstraction Layer | |
SPDX-License-Identifier: MIT | |
#define | PIN_SPI_EN UNUSED_PIN |
Check for XMC mcu family */. More... | |
#define | TLE94112_PIN_CS1 WICED_GPIO_7 |
class GPIOWiced |
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 | |
GPIOWiced () | |
GPIO WICED default constructor. More... | |
GPIOWiced (wiced_gpio_t pin, wiced_gpio_config_t config, VLogic_t logic) | |
GPIO WICED default constructor. More... | |
~GPIOWiced () | |
GPIO WICED destructor. More... | |
Error_t | init () |
Initializes the WICED GPIO. More... | |
Error_t | deinit () |
Initializes the WICED GPIO. More... | |
VLevel_t | read () |
Reads the WICED GPIO voltage level. More... | |
Error_t | write (VLevel_t level) |
Writes the WICED GPIO output voltage level. More... | |
Error_t | enable () |
Enables the WICED output according to the GPIO logic. More... | |
Error_t | disable () |
Disables the WICED output according to the GPIO logic. More... | |
virtual Error_t | changeMode (uint8_t mode)=0 |
Changes the IN/OUT mode. More... | |
Error_t | checkErrorStatus () |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
GPIOWiced::GPIOWiced | ( | ) |
GPIO WICED default constructor.
GPIOWiced::GPIOWiced | ( | wiced_gpio_t | pin, |
wiced_gpio_config_t | config, | ||
VLogic_t | logic | ||
) |
GPIO WICED default constructor.
GPIOWiced::~GPIOWiced | ( | ) |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
pure virtualinherited |
|
inherited |
class SPICWiced |
Wiced SPIC class.
Public Types | |
enum | Error_t { OK = 0 , INTF_ERROR = -1 , CONF_ERROR = -2 , READ_ERROR = -3 , WRITE_ERROR = -4 } |
Public Member Functions | |
SPICWiced (wiced_gpio_t csPin) | |
Constructor of the WICED SPIC class. More... | |
SPICWiced (wiced_spi_t port, wiced_gpio_t csPin, wiced_gpio_t misoPin, wiced_gpio_t mosiPin, wiced_gpio_t sckPin) | |
Construct a new SPICWiced::SPICWiced object. More... | |
~SPICWiced () | |
Destructor of the WICED SPIC class. More... | |
Error_t | init () |
Initialize the SPIC. More... | |
Error_t | deinit () |
Deinitialize the SPIC. More... | |
Error_t | transfer16 (uint16_t send, uint16_t &received) |
transfers a data package via the spi bus 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 () |
|
inherited |
SPICWiced::SPICWiced | ( | wiced_gpio_t | csPin | ) |
Constructor of the WICED SPIC class.
This function is setting the basics for a SPIC and the default spi on Arduino which is implemented as WICED_SPI_0 by patching the following:
csPin | Number of the desired ChipSelect pin |
SPICWiced::SPICWiced | ( | wiced_spi_t | port, |
wiced_gpio_t | csPin, | ||
wiced_gpio_t | misoPin, | ||
wiced_gpio_t | mosiPin, | ||
wiced_gpio_t | sckPin | ||
) |
Construct a new SPICWiced::SPICWiced object.
This function allows to set all parameters of the SPI master.
port | SPI channel to be used |
csPin | Number of the desired ChipSelect pin |
misoPin | miso pin number |
mosiPin | mosi pin number |
sckPin | systemclock pin number |
SPICWiced::~SPICWiced | ( | ) |
|
virtual |
Initialize the SPIC.
This function is initializing the chosen spi channel with the given values for lsb,clock and mode
Implements SPIC.
|
virtual |
Deinitialize the SPIC.
This function is deinitializing the chosen spi channel.
Implements SPIC.
SPICWiced::Error_t SPICWiced::transfer16 | ( | uint16_t | send, |
uint16_t & | received | ||
) |
transfers a data package via the spi bus
send | address and/or command to send as 16bit |
received | received data from spi bus as 16bit |
|
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.
Implements SPIC.
|
virtual |
Main SPI three wire communication functions for sending and receiving data
sent_data | pointer two 2*unit16_t value for one command word and one data word if something should be written |
size_of_sent_data | the size of the command word default 1 = only command 2 = command and data word |
received_data | pointer to data structure buffer for the read data |
size_of_received_data | size of data words to be read |
Implements SPIC.
|
inherited |
class TimerWiced |
Public Types | |
enum | Error_t { OK = 0 , ERROR = 1 } |
Public Member Functions | |
TimerWiced () | |
Constructor of the WICED Timer class. More... | |
~TimerWiced () | |
Destructor of the WICED Timer class. More... | |
Error_t | init () |
Initialization of the Timer. More... | |
Error_t | deinit () |
Deinitialize the Timer. More... | |
Error_t | start () |
Start the timer. More... | |
Error_t | elapsed (wiced_time_t &elapsed) |
Calculate the elapsed time. More... | |
Error_t | stop () |
Stop the timer. More... | |
Error_t | delayMilli (uint32_t timeout) |
Time delay. More... | |
Error_t | delayMicro (uint32_t timeout) |
Time delay. More... | |
virtual Error_t | elapsed (uint32_t &elapsed)=0 |
Elapsed time since the timer was started. More... | |
|
inherited |
TimerWiced::TimerWiced | ( | ) |
Constructor of the WICED Timer class.
TimerWiced::~TimerWiced | ( | ) |
Destructor of the WICED Timer class.
|
virtual |
Initialization of the Timer.
This function is initializing the Timer and sets the elapsed time to zero.
Implements Timer.
|
virtual |
Deinitialize the Timer.
This function deinitialize the Timer and also resets the elapsed time variable.
Implements Timer.
|
virtual |
TimerWiced::Error_t TimerWiced::elapsed | ( | wiced_time_t & | elapsed | ) |
Calculate the elapsed time.
This function is calculating the elapsed time since the start of the timer. The value stored in the given variable is in milliseconds.
[in] | &elapsed | Address of a value where the elapsed time should be stored |
|
virtual |
Stop the timer.
This function stops the timer and resets the start time variable.
Implements Timer.
|
virtual |
Time delay.
This function is causing a desired delay of the application. The input value is given in milliseconds.
[in] | timeout | Desired timeout in ms |
Implements Timer.
|
virtual |
Time delay.
This function is causing a desired delay of the application. The input value is given in microseconds.
[in] | timeout | Desired timeout in us |
Implements Timer.
class Tle5012Wiced |
represents a basic TLE5012b Wiced class.
represents the TLE5012 base class
This class provides a simple API for connecting Wiced/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.
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).
Public Types | |
enum | slaveNum { TLE5012B_S0 = 0x0000 , TLE5012B_S1 = 0x2000 , TLE5012B_S2 = 0x4000 , TLE5012B_S3 = 0x6000 } |
Public Member Functions | |
Tle5012Wiced () | |
Tle5012Wiced (wiced_gpio_t csPin, slaveNum slave=TLE5012B_S0) | |
Construct a new Tle5012Wiced::Tle5012Wiced object with chipselect and sensor slave Use this constructor if: More... | |
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... | |
SPIC * | sBus |
SPI cover class as representation of the SPI bus. More... | |
GPIO * | en |
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
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 () |
#define PIN_SPI_EN UNUSED_PIN |
Check for XMC mcu family */.
TLE5012 with any other PCB has no switch on/off
#define TLE94112_PIN_CS1 WICED_GPIO_7 |
Standard chip select pin for first TLE5012 sensor on Arduino header
Tle5012Wiced::Tle5012Wiced | ( | ) |
Construct a new Tle5012Wiced::Tle5012Wiced object with default SPI and pin assignment. Use this if:
Tle5012Wiced::Tle5012Wiced | ( | wiced_gpio_t | csPin, |
slaveNum | slave = TLE5012B_S0 |
||
) |
Construct a new Tle5012Wiced::Tle5012Wiced object with chipselect and sensor slave Use this constructor if:
csPin | pin number of the CS pin |
slave | optional sensor slave setting |
errorTypes Tle5012Wiced::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.
uint8_t Tle5012Wiced::mSpiNum = 0 |
Number of used SPI channel.