|
Open Model Railroad Network (OpenMRN)
|
Generic GPIO class implementation. More...
#include <CC3200GPIO.hxx>
Public Member Functions | |
| constexpr | CC3200Gpio () |
| This constructor is constexpr which ensures that the object can be initialized in the data section. | |
| void | write (Value new_state) const OVERRIDE |
| Writes a GPIO output pin (set or clear to a specific state). | |
| void | set () const OVERRIDE |
| Sets the GPIO output pin to high. | |
| void | clr () const OVERRIDE |
| Clears the GPIO output pin to low. | |
| Value | read () const OVERRIDE |
| Retrieves the current Value of a GPIO input pin. | |
| void | set_direction (Direction dir) const OVERRIDE |
| Sets the GPIO direction. | |
| Direction | direction () const OVERRIDE |
| Gets the GPIO direction. | |
Public Member Functions inherited from Gpio | |
| constexpr | Gpio () |
| Constructor. | |
| void | write (bool new_state) const |
| Writes a GPIO output pin (set or clear to a specific state). | |
| bool | is_set () const |
| Tests the GPIO input pin to see if it is set. | |
| bool | is_clr () const |
| Tests the GPIO input pin to see if it is clear. | |
Private Member Functions | |
| constexpr volatile uint8_t * | pin_address () const |
| Computes the memory address where the bit referring to this pin can be accessed. | |
Static Private Attributes | |
| static const CC3200Gpio | instance_ |
| Static instance variable that can be used for libraries expectiong a generic Gpio pointer. | |
Friends | |
| template<class Defs , bool SAFE_VALUE> | |
| struct | GpioOutputPin |
| template<class Defs > | |
| struct | GpioInputPin |
Additional Inherited Members | |
Public Types inherited from Gpio | |
| enum | Value : bool { CLR = false , SET = true , VLOW = CLR , VHIGH = SET } |
| Defines the options for GPIO level. More... | |
| enum class | Direction { DINPUT , DOUTPUT } |
| Defines the options for GPIO direction. More... | |
Generic GPIO class implementation.
Definition at line 74 of file CC3200GPIO.hxx.
|
inlineconstexpr |
This constructor is constexpr which ensures that the object can be initialized in the data section.
Definition at line 79 of file CC3200GPIO.hxx.
|
inlinevirtual |
Clears the GPIO output pin to low.
See note at the top of the file about barriers.
Implements Gpio.
Definition at line 97 of file CC3200GPIO.hxx.
|
inlinevirtual |
Gets the GPIO direction.
Implements Gpio.
Definition at line 121 of file CC3200GPIO.hxx.
|
inlineconstexprprivate |
Computes the memory address where the bit referring to this pin can be accessed.
This address is bit-masked to the single individual pin, so only ever one bit can be read to be non-zero, and setting any other bit than the desired has no effect. This allows write with 0xff and 0x00 to set/clear and read != 0 to test.
Definition at line 150 of file CC3200GPIO.hxx.
|
inlinevirtual |
Retrieves the current Value of a GPIO input pin.
Implements Gpio.
Definition at line 104 of file CC3200GPIO.hxx.
|
inlinevirtual |
Sets the GPIO output pin to high.
See note at the top of the file about barriers.
Implements Gpio.
Definition at line 90 of file CC3200GPIO.hxx.
|
inlinevirtual |
Sets the GPIO direction.
| dir | INPUT or OUTPUT |
Implements Gpio.
Definition at line 109 of file CC3200GPIO.hxx.
|
inlinevirtual |
Writes a GPIO output pin (set or clear to a specific state).
| new_state | the desired output state. See Value. |
See note at the top of the file about barriers.
Implements Gpio.
Definition at line 83 of file CC3200GPIO.hxx.
|
friend |
Definition at line 137 of file CC3200GPIO.hxx.
|
friend |
Definition at line 136 of file CC3200GPIO.hxx.
|
staticprivate |
Static instance variable that can be used for libraries expectiong a generic Gpio pointer.
Defines the linker symbol for the wrapped Gpio instance.
This instance variable will be initialized by the linker and (assuming the application developer initialized the hardware pins in hw_preinit) is accessible, including virtual methods at static constructor time.
Definition at line 143 of file CC3200GPIO.hxx.