weAut_01 / weAutSys    R 2.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Functions
Software instrumentation
+ + Low level system services + +

Overview

weAutSys' target hardware — mainly weAut_01 and comparable boards — often allow two LEDs and two Ports (test pins) to be used for monitoring software activity.

LEDs are limited to the human eye if no extra hardware adaption is made. Additionally the two LEDs in question are seldom really free to use. The red one e.g. is used by weAutSys to signal "low load voltage" (LV, "Lastspannung") on weAut_01.

On the other hand unused ports are really free for software instrumentation use. If neither UART flow control nor counter / generator nor I2C / twoWire is used weAut_01 4 ports are free and easily accessible on jumper pins.

Software activities indicated by outputs to those ports can be monitored and measured at CPU clock accuracy by relative simple and inexpensive equipment. One use case is is marking the CPU usage of application threads to demonstrate them to stay within their rightful limits.

As port output can be done in one CPU cycle this type of instrumentation may in most cases very well remain production software (in contrast to debugging instructions and calls).

Functions

void initTestPins (uint8_t TP0start, uint8_t TP1start)
 Initialisation of the (potential) test pins.
void setStatusLedGn (uint8_t state)
 Set the state of the green (test) LED.
void setStatusLedRd (uint8_t state)
 Set the state of the red (test) LED.
void setTestPin0 (uint8_t state) __attribute__((always_inline))
 Set the state of Test-Pin 0.
void setTestPin1 (uint8_t state) __attribute__((always_inline))
 Set the state of Test-Pin 1.
void toggleStatusLedGn (void)
 Change the state of the green (test) LED.
void toggleStatusLedRd (void)
 Change the state of the red (test) LED.

Function Documentation

void setStatusLedGn ( uint8_t  state)

Set the state of the green (test) LED.

If no green test LED is available on the respective platform but a yellow one (Arduinos e.g.) the latter is used.

If neither green nor yellow single status / test LED is available this procedure does nothing.

Parameters:
state0 / false: turn off; != 0: turn on
Examples:
main.c.
void toggleStatusLedGn ( void  )

Change the state of the green (test) LED.

If no such test LED is available on the respective platform this procedure does nothing. Otherwise the LED's state is toggled.

See also:
setStatusLedGn
Examples:
main.c.
void setStatusLedRd ( uint8_t  state)

Set the state of the red (test) LED.

If no red test LED is available on the respective platform, this procedure does nothing.

Parameters:
state0 / false: turn off; != 0: turn on
void toggleStatusLedRd ( void  )

Change the state of the red (test) LED.

If no red test LED is available on the respective platform, this procedure does nothing. Otherwise the LED's state is toggled.

See also:
setStatusLedRd
void initTestPins ( uint8_t  TP0start,
uint8_t  TP1start 
)

Initialisation of the (potential) test pins.

This function sets Port C1 / testPin0 and Port C0 / testPin1 as output and does setTestPin0(ON) and setTestPin1(OFF).

Hint: Using the testpins 0 & 1 with the module weAut_01 inhibits the usage of Port C1 / C0 for other purposes like I²C / twowire. Testpin0 JP3pin1 (would be twoWire SDA) and Testpin1 is JP3pin4 (would be SCL).

Hint: If the hardware is not weAut_01 the test pins may be assigned to other ports and pins.

Parameters:
TP0startinitial value for Testpin 0 (On or OFF)
TP1startinitial value for Testpin 1 (On or OFF)
Examples:
main.c.
void setTestPin0 ( uint8_t  state)

Set the state of Test-Pin 0.

This is to be used to measure the behaviour resp. timing of software by digital analysers, oscilloscopes or other instruments.

Parameters:
state0 / false for off; != 0 for on
void setTestPin1 ( uint8_t  state)

Set the state of Test-Pin 1.

This is to be used to measure the behaviour resp. timing of software by digital analysers, oscilloscopes or other instruments.

Parameters:
state0 / false for off; != 0 for on