SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::lib::bsp::dummy_gpio Class Reference

A dummy GPIO implementation with no effect. Can be used for CI testing or default construction of gpio objects. More...

#include <gpio.hpp>

Inheritance diagram for satnogs::comms::lib::bsp::dummy_gpio:
satnogs::comms::lib::bsp::gpio

Public Member Functions

 dummy_gpio ()
void toggle ()
 Toggles the GPIO pin if it is configured as output. Has no effect if it is conigured as input.
bool get ()
 Gets the logical level of the GPIO pin. For example, if the pin has been configured as active low, and the input level is 0V, this method will return true.
bool get_raw ()
 Gets the physical level of the GPIO pin. For example, if the input level is 0V, this method will return false.
void set (bool s)
 Sets the logical output of the pin. For example, if the pin has been configured as active low, setting s to true will set the output pin to 0V.
void set_raw (bool s)
 Sets the physical output of the pin.
void set_direction (direction dir)
 Set the direction of the GPIO.
Public Member Functions inherited from satnogs::comms::lib::bsp::gpio
 gpio (direction dir=direction::INPUT)
 Construct a new GPIO object.

Additional Inherited Members

Public Types inherited from satnogs::comms::lib::bsp::gpio
enum class  direction : uint8_t { INPUT = 0 , OUTPUT = 1 }

Detailed Description

A dummy GPIO implementation with no effect. Can be used for CI testing or default construction of gpio objects.

Definition at line 118 of file gpio.hpp.

Constructor & Destructor Documentation

◆ dummy_gpio()

satnogs::comms::lib::bsp::dummy_gpio::dummy_gpio ( )
inline

Definition at line 121 of file gpio.hpp.

Member Function Documentation

◆ get()

bool satnogs::comms::lib::bsp::dummy_gpio::get ( )
inlinevirtual

Gets the logical level of the GPIO pin. For example, if the pin has been configured as active low, and the input level is 0V, this method will return true.

Returns
true if the logical level is 1
false if the logical level is 0

Implements satnogs::comms::lib::bsp::gpio.

Definition at line 130 of file gpio.hpp.

◆ get_raw()

bool satnogs::comms::lib::bsp::dummy_gpio::get_raw ( )
inlinevirtual

Gets the physical level of the GPIO pin. For example, if the input level is 0V, this method will return false.

Returns
true if the physical level is > 0V
false if the physical level is 0V

Implements satnogs::comms::lib::bsp::gpio.

Definition at line 136 of file gpio.hpp.

◆ set()

void satnogs::comms::lib::bsp::dummy_gpio::set ( bool s)
inlinevirtual

Sets the logical output of the pin. For example, if the pin has been configured as active low, setting s to true will set the output pin to 0V.

Has no effect if the pin is not configured as output.

Parameters
sthe logical level of the output pin

Implements satnogs::comms::lib::bsp::gpio.

Definition at line 142 of file gpio.hpp.

◆ set_direction()

void satnogs::comms::lib::bsp::dummy_gpio::set_direction ( direction dir)
inlinevirtual

Set the direction of the GPIO.

Parameters
dirthe desired direction

Implements satnogs::comms::lib::bsp::gpio.

Definition at line 154 of file gpio.hpp.

◆ set_raw()

void satnogs::comms::lib::bsp::dummy_gpio::set_raw ( bool s)
inlinevirtual

Sets the physical output of the pin.

Has no effect if the pin is not configured as output.

Parameters
sthe physical level of the output pin

Implements satnogs::comms::lib::bsp::gpio.

Definition at line 148 of file gpio.hpp.

◆ toggle()

void satnogs::comms::lib::bsp::dummy_gpio::toggle ( )
inlinevirtual

Toggles the GPIO pin if it is configured as output. Has no effect if it is conigured as input.

Implements satnogs::comms::lib::bsp::gpio.

Definition at line 124 of file gpio.hpp.


The documentation for this class was generated from the following file:
  • libsatnogs-comms/include/satnogs-comms-lib/bsp/gpio.hpp