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

#include <bsp.hpp>

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

Public Member Functions

 gpio_bsp (const struct gpio_dt_spec *io, bool output=true)
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 (lib::bsp::gpio::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

Definition at line 107 of file bsp.hpp.

Constructor & Destructor Documentation

◆ gpio_bsp()

satnogs::comms::gpio_bsp::gpio_bsp ( const struct gpio_dt_spec * io,
bool output = true )
inline

Definition at line 110 of file bsp.hpp.

Member Function Documentation

◆ get()

bool satnogs::comms::gpio_bsp::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 127 of file bsp.hpp.

◆ get_raw()

bool satnogs::comms::gpio_bsp::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 134 of file bsp.hpp.

◆ set()

void satnogs::comms::gpio_bsp::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 141 of file bsp.hpp.

◆ set_direction()

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

Set the direction of the GPIO.

Parameters
dirthe desired direction

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

Definition at line 153 of file bsp.hpp.

◆ set_raw()

void satnogs::comms::gpio_bsp::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 147 of file bsp.hpp.

◆ toggle()

void satnogs::comms::gpio_bsp::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 121 of file bsp.hpp.


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