|
CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
|
A Simple Driver for the Sonata's GPIO. More...
#include <platform-gpio.hh>
Public Member Functions | |
| void | led_on (uint32_t index) volatile |
| Switches off the LED at the given user LED index. | |
| void | led_off (uint32_t index) volatile |
| Switches on the LED at the given user LED index. | |
| void | led_toggle (uint32_t index) volatile |
| Toggles the LED at the given user LED index. | |
| bool | read_switch (uint32_t index) volatile |
| Returns the value of the switch at the given user switch index. | |
| SonataJoystick | read_joystick () volatile |
| Returns the state of the joystick. | |
Static Public Member Functions | |
| static constexpr uint32_t | led_bit (uint32_t index) |
| The output bit mask for a given user LED index. | |
| static constexpr uint32_t | switch_bit (uint32_t index) |
| The input bit mask for a given user switch index. | |
Public Attributes | |
| uint32_t | output |
| uint32_t | input |
| uint32_t | debouncedInput |
| uint32_t | debouncedThreshold |
| uint32_t | raspberryPiHeader |
| uint32_t | raspberryPiMask |
| uint32_t | arduinoShieldHeader |
| uint32_t | arduinoShieldMask |
Static Public Attributes | |
| static constexpr uint32_t | FirstLED = 4 |
| The bit index of the first GPIO pin connected to a user LED. | |
| static constexpr uint32_t | LastLED = 11 |
| The bit index of the last GPIO pin connected to a user LED. | |
| static constexpr uint32_t | LEDCount = LastLED - FirstLED + 1 |
| The number of user LEDs. | |
| static constexpr uint32_t | LEDMask = ((1 << LEDCount) - 1) << FirstLED |
| The mask covering the GPIO pins used for user LEDs. | |
| static constexpr uint32_t | FirstSwitch = 5 |
| The bit index of the first GPIO pin connected to a user switch. | |
| static constexpr uint32_t | LastSwitch = 13 |
| The bit index of the last GPIO pin connected to a user switch. | |
| static constexpr uint32_t | SwitchCount = LastSwitch - FirstSwitch + 1 |
| The number of user switches. | |
| static constexpr uint32_t | SwitchMask |
| The mask covering the GPIO pins used for user switches. | |
A Simple Driver for the Sonata's GPIO.
Documentation source can be found at: https://github.com/lowRISC/sonata-system/blob/1a59633d2515d4fe186a07d53e49ff95c18d9bbf/doc/ip/gpio.md
Rendered documentation is served from: https://lowrisc.org/sonata-system/doc/ip/gpio.html
Definition at line 31 of file platform-gpio.hh.
|
inlinestaticconstexpr |
The output bit mask for a given user LED index.
Definition at line 62 of file platform-gpio.hh.
References FirstLED, and LEDMask.
Referenced by led_off(), led_on(), and led_toggle().
|
inline |
Switches on the LED at the given user LED index.
Definition at line 78 of file platform-gpio.hh.
References led_bit().
|
inline |
Switches off the LED at the given user LED index.
Definition at line 70 of file platform-gpio.hh.
References led_bit().
|
inline |
Toggles the LED at the given user LED index.
Definition at line 86 of file platform-gpio.hh.
References led_bit().
|
inline |
Returns the state of the joystick.
Definition at line 128 of file platform-gpio.hh.
|
inline |
Returns the value of the switch at the given user switch index.
Definition at line 120 of file platform-gpio.hh.
References switch_bit().
|
inlinestaticconstexpr |
The input bit mask for a given user switch index.
Definition at line 112 of file platform-gpio.hh.
References FirstSwitch, and SwitchMask.
Referenced by read_switch().
| uint32_t SonataGPIO::arduinoShieldHeader |
Definition at line 39 of file platform-gpio.hh.
| uint32_t SonataGPIO::arduinoShieldMask |
Definition at line 40 of file platform-gpio.hh.
| uint32_t SonataGPIO::debouncedInput |
Definition at line 35 of file platform-gpio.hh.
| uint32_t SonataGPIO::debouncedThreshold |
Definition at line 36 of file platform-gpio.hh.
|
staticconstexpr |
The bit index of the first GPIO pin connected to a user LED.
Definition at line 45 of file platform-gpio.hh.
Referenced by led_bit().
|
staticconstexpr |
The bit index of the first GPIO pin connected to a user switch.
Definition at line 94 of file platform-gpio.hh.
Referenced by switch_bit().
| uint32_t SonataGPIO::input |
Definition at line 34 of file platform-gpio.hh.
|
staticconstexpr |
The bit index of the last GPIO pin connected to a user LED.
Definition at line 49 of file platform-gpio.hh.
|
staticconstexpr |
The bit index of the last GPIO pin connected to a user switch.
Definition at line 98 of file platform-gpio.hh.
The number of user LEDs.
Definition at line 53 of file platform-gpio.hh.
The mask covering the GPIO pins used for user LEDs.
Definition at line 57 of file platform-gpio.hh.
Referenced by led_bit().
| uint32_t SonataGPIO::output |
Definition at line 33 of file platform-gpio.hh.
| uint32_t SonataGPIO::raspberryPiHeader |
Definition at line 37 of file platform-gpio.hh.
| uint32_t SonataGPIO::raspberryPiMask |
Definition at line 38 of file platform-gpio.hh.
|
staticconstexpr |
The number of user switches.
Definition at line 102 of file platform-gpio.hh.
|
staticconstexpr |
The mask covering the GPIO pins used for user switches.
Definition at line 106 of file platform-gpio.hh.
Referenced by switch_bit().