|
Open Model Railroad Network (OpenMRN)
|
General Purpose Input (GPI) instance on the MCP2515. More...
#include <MCP2515Can.hxx>
Public Member Functions | |
| MCP2515GPI (MCP2515Can *instance, uint8_t bit) | |
| Constructor. | |
| Value | read () const override |
| Retrieves the current Value of a GPI input pin. | |
| void | set_direction (Gpio::Direction dir) const override |
| Sets the GPI direction (does nothing). | |
| Direction | direction () const override |
| Gets the GPI direction. | |
Public Member Functions inherited from Gpio | |
| constexpr | Gpio () |
| Constructor. | |
| virtual void | write (Value new_state) const =0 |
| Writes a GPIO output pin (set or clear to a specific state). | |
| 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. | |
| virtual void | set () const =0 |
| Sets the GPIO output pin to high. | |
| virtual void | clr () const =0 |
| Clears the GPIO output pin to low. | |
Private Member Functions | |
| DISALLOW_COPY_AND_ASSIGN (MCP2515GPI) | |
Private Attributes | |
| MCP2515Can * | instance_ |
| reference to chip instance | |
| uint8_t | bit_ |
| bit number representative of the bit | |
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... | |
General Purpose Input (GPI) instance on the MCP2515.
Definition at line 777 of file MCP2515Can.hxx.
|
inline |
Constructor.
| instance | parrent MCP2515Can instance that "owns" the interface. |
| bit | bit index (0 through 2) of the input. |
Definition at line 784 of file MCP2515Can.hxx.
|
inlineoverridevirtual |
Gets the GPI direction.
Implements Gpio.
Definition at line 812 of file MCP2515Can.hxx.
|
inlineoverridevirtual |
Retrieves the current Value of a GPI input pin.
Implements Gpio.
Definition at line 795 of file MCP2515Can.hxx.
|
inlineoverridevirtual |
Sets the GPI direction (does nothing).
| dir | INPUT or OUTPUT |
Implements Gpio.
Definition at line 804 of file MCP2515Can.hxx.
|
private |
bit number representative of the bit
Definition at line 822 of file MCP2515Can.hxx.
|
private |
reference to chip instance
Definition at line 819 of file MCP2515Can.hxx.