Wiring language Delay in AURIX™

After having defined the port mapping (Aurix board TC275 lite kit to Arduino) and the Wiring language Digital Pins in AURIX™, it's time to define the functions. Also in refenrece to delay() (Wiring Framework). Such can be easily defined by making use of the low level drivers (iLLD for TC275x), such as:

as:
[..]
//****************************************************************************
// @Function delay
//
//----------------------------------------------------------------------------
// @Description Pauses the program for the amount of time (in miliseconds)
// specified as parameter.
// There are 1000 milliseconds in a second.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Link http://arduino.cc/en/Reference/Delay
//----------------------------------------------------------------------------
// @Date 15/04/2021
//
//****************************************************************************

void delay(uint32 dwMs)
{
waitTime(IfxStm_getTicksFromMilliseconds(BSP_DEFAULT_TIMER, dwMs));
}
and similarly for the delayMicroseconds() (Wiring Framework):
[..]
//****************************************************************************
// @Function delayMicroseconds
//
//----------------------------------------------------------------------------
// @Description Pauses the program for the amount of time (in microseconds)
// specified as parameter.
// There are a thousand microseconds in a millisecond, and
// a million microseconds in a second.
//
//----------------------------------------------------------------------------
// @Returnvalue None
//
//----------------------------------------------------------------------------
// @Parameters None
//
//----------------------------------------------------------------------------
// @Link http://arduino.cc/en/Reference/DelayMicroseconds
//----------------------------------------------------------------------------
// @Date 15/04/2021
//
//****************************************************************************

void delayMicroseconds(uint32 dwUs)
{
waitTime(IfxStm_getTicksFromMicroseconds(BSP_DEFAULT_TIMER, dwUs));
}
Finally we can implement the classical LED Blink sketch as:
[..]
void loop() {

// Create a small delay to permit to observe the LED toggling
delay(750);

// Now toggle the LED status
toggleLED();
toggleLED2();
}

Comments