Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
MCP2515GPI Class Reference

General Purpose Input (GPI) instance on the MCP2515. More...

#include <MCP2515Can.hxx>

Inheritance diagram for MCP2515GPI:
Gpio

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

MCP2515Caninstance_
 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...
 

Detailed Description

General Purpose Input (GPI) instance on the MCP2515.

Definition at line 777 of file MCP2515Can.hxx.

Constructor & Destructor Documentation

◆ MCP2515GPI()

MCP2515GPI::MCP2515GPI ( MCP2515Can instance,
uint8_t  bit 
)
inline

Constructor.

Parameters
instanceparrent MCP2515Can instance that "owns" the interface.
bitbit index (0 through 2) of the input.

Definition at line 784 of file MCP2515Can.hxx.

Member Function Documentation

◆ direction()

Direction MCP2515GPI::direction ( ) const
inlineoverridevirtual

Gets the GPI direction.

Returns
always returns INPUT

Implements Gpio.

Definition at line 812 of file MCP2515Can.hxx.

◆ read()

Value MCP2515GPI::read ( ) const
inlineoverridevirtual

Retrieves the current Value of a GPI input pin.

Returns
SET if currently high, CLR if currently low

Implements Gpio.

Definition at line 795 of file MCP2515Can.hxx.

◆ set_direction()

void MCP2515GPI::set_direction ( Gpio::Direction  dir) const
inlineoverridevirtual

Sets the GPI direction (does nothing).

Parameters
dirINPUT or OUTPUT

Implements Gpio.

Definition at line 804 of file MCP2515Can.hxx.

Member Data Documentation

◆ bit_

uint8_t MCP2515GPI::bit_
private

bit number representative of the bit

Definition at line 822 of file MCP2515Can.hxx.

◆ instance_

MCP2515Can* MCP2515GPI::instance_
private

reference to chip instance

Definition at line 819 of file MCP2515Can.hxx.


The documentation for this class was generated from the following file: