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

General Purpose Output (GPO) instance on the MCP2515. More...

#include <MCP2515Can.hxx>

Inheritance diagram for MCP2515GPO:
Gpio

Public Member Functions

 MCP2515GPO (MCP2515Can *instance, uint8_t bit)
 Constructor.
 
void write (Value new_state) const override
 Writes a GPO pin (set or clear to a specific state).
 
Value read () const override
 Retrieves the current Value of a GPO output sate (requested).
 
void set () const override
 Sets the GPO pin to high.
 
void clr () const override
 Clears the GPO pin to low.
 
void set_direction (Gpio::Direction dir) const override
 Sets the GPO direction (does nothing).
 
Direction direction () const override
 Gets the GPO 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

 DISALLOW_COPY_AND_ASSIGN (MCP2515GPO)
 

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 Output (GPO) instance on the MCP2515.

Definition at line 692 of file MCP2515Can.hxx.

Constructor & Destructor Documentation

◆ MCP2515GPO()

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

Constructor.

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

Definition at line 699 of file MCP2515Can.hxx.

Member Function Documentation

◆ clr()

void MCP2515GPO::clr ( ) const
inlineoverridevirtual

Clears the GPO pin to low.

Implements Gpio.

Definition at line 738 of file MCP2515Can.hxx.

◆ direction()

Direction MCP2515GPO::direction ( ) const
inlineoverridevirtual

Gets the GPO direction.

Returns
always returns OUTPUT

Implements Gpio.

Definition at line 760 of file MCP2515Can.hxx.

◆ read()

Value MCP2515GPO::read ( ) const
inlineoverridevirtual

Retrieves the current Value of a GPO output sate (requested).

Returns
SET if currently high, CLR if currently low

Implements Gpio.

Definition at line 718 of file MCP2515Can.hxx.

◆ set()

void MCP2515GPO::set ( ) const
inlineoverridevirtual

Sets the GPO pin to high.

Implements Gpio.

Definition at line 725 of file MCP2515Can.hxx.

◆ set_direction()

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

Sets the GPO direction (does nothing).

Parameters
dirINPUT or OUTPUT

Implements Gpio.

Definition at line 752 of file MCP2515Can.hxx.

◆ write()

void MCP2515GPO::write ( Value  new_state) const
inlineoverridevirtual

Writes a GPO pin (set or clear to a specific state).

Parameters
new_statethe desired output state. See Value.

Implements Gpio.

Definition at line 710 of file MCP2515Can.hxx.

Member Data Documentation

◆ bit_

uint8_t MCP2515GPO::bit_
private

bit number representative of the bit

Definition at line 770 of file MCP2515Can.hxx.

◆ instance_

MCP2515Can* MCP2515GPO::instance_
private

reference to chip instance

Definition at line 767 of file MCP2515Can.hxx.


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