|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
A driver for the Sonata's RGB LED Controller. More...
#include <platform-rgbctrl.hh>


Public Types | |
| enum | ControlFields : uint32_t { ControlSet = 1 << 0 , ControlOff = 1 << 1 } |
| Control Register Fields. More... | |
| enum | StatusFields : uint32_t { StatusIdle = 1 << 0 } |
| Status Register Fields. More... | |
Public Member Functions | |
| void | wait_for_idle () volatile |
| Blocks until the controller is not busy. | |
| void | rgb (SonataRgbLed led, uint8_t red, uint8_t green, uint8_t blue) volatile |
| Set the desired Red, Green, and Blue value of an LED. | |
| void | update () volatile |
| Update the colours of the LEDs. | |
| void | off () volatile |
| Switch all of the RGB LEDs off. | |
Public Attributes | |
| uint32_t | ledColors [2] |
| Registers for setting the 8-bit red, green, and blue values for the two RGB Leds. | |
| uint32_t | control |
| Control Register. | |
| uint32_t | status |
| Status Register See SonataRgbLedController::StatusFields for the fields. | |
A driver for the Sonata's RGB LED Controller.
Definition at line 18 of file platform-rgbctrl.hh.
| enum SonataRgbLedController::ControlFields : uint32_t |
Control Register Fields.
| Enumerator | |
|---|---|
| ControlSet | Write 1 to set RGB LEDs to specified colours. |
| ControlOff | Write 1 to turn off RGB LEDs. Write to ControlSet to turn on again. |
Definition at line 37 of file platform-rgbctrl.hh.
| enum SonataRgbLedController::StatusFields : uint32_t |
Status Register Fields.
| Enumerator | |
|---|---|
| StatusIdle | When asserted controller is idle and new colours can be set, otherwise writes to regLed0, regLed1, and control are ignored. |
Definition at line 49 of file platform-rgbctrl.hh.
|
inline |
Switch all of the RGB LEDs off.
Definition at line 92 of file platform-rgbctrl.hh.
References control, ControlOff, and wait_for_idle().
|
inline |
Set the desired Red, Green, and Blue value of an LED.
To apply these changes, one needs to run SonataRgbLedController::update().
Definition at line 76 of file platform-rgbctrl.hh.
References ledColors, and wait_for_idle().
|
inline |
Update the colours of the LEDs.
Definition at line 85 of file platform-rgbctrl.hh.
References control, ControlSet, and wait_for_idle().
|
inline |
Blocks until the controller is not busy.
The controller can be busy when it is in the process of updating the LEDs. While busy, register writes will be ignored.
Definition at line 64 of file platform-rgbctrl.hh.
References status, and StatusIdle.
| uint32_t SonataRgbLedController::control |
Control Register.
See SonataRgbLedController::ControlFields for the fields.
Definition at line 29 of file platform-rgbctrl.hh.
| uint32_t SonataRgbLedController::ledColors[2] |
Registers for setting the 8-bit red, green, and blue values for the two RGB Leds.
Definition at line 24 of file platform-rgbctrl.hh.
Referenced by rgb().
| uint32_t SonataRgbLedController::status |
Status Register See SonataRgbLedController::StatusFields for the fields.
Definition at line 34 of file platform-rgbctrl.hh.
Referenced by wait_for_idle().