Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
BlinkerGPIO.hxx
Go to the documentation of this file.
1
35#ifndef _FREERTOS_DRIVERS_COMMON_BLINKER_GPIO_HXX_
36#define _FREERTOS_DRIVERS_COMMON_BLINKER_GPIO_HXX_
37
38#include "utils/blinker.h"
39#include "os/Gpio.hxx"
40#include "GpioWrapper.hxx"
41
46{
48 static void hw_init()
49 {
50 }
52 static void hw_set_to_safe()
53 {
54 }
56 static void set(bool value)
57 {
58 resetblink(value ? 1 : 0);
59 }
61 static void toggle()
62 {
63 resetblink(get() ? 0 : 1);
64 }
66 static bool get()
67 {
68 return blinker_pattern;
69 }
71 static bool is_output()
72 {
73 return true;
74 }
76 static constexpr const Gpio *instance()
77 {
79 }
80};
81
82#endif // _FREERTOS_DRIVERS_COMMON_BLINKER_GPIO_HXX_
uint32_t blinker_pattern
Stores the canonical pattern for the blinker.
void resetblink(uint32_t pattern)
Changes the blinking pattern.
static constexpr const Gpio * instance()
OS-independent abstraction for GPIO.
Definition Gpio.hxx:43
GPIO-abstraction implementation for the blinker bit.
static void toggle()
Toggle the pin (set to opposite value than previously).
static constexpr const Gpio * instance()
static void hw_init()
Initialize the hardware (noop).
static void hw_set_to_safe()
Set the hardware to safe setting (noop).
static void set(bool value)
Set the pin to a specific value.
static bool get()
static bool is_output()