ArPiRobot-CoreLib C++
C++ library for ArPiRobot robots
Public Types | Public Member Functions | Protected Member Functions | List of all members
arpirobot::GPIOPin Class Reference

#include <arpirobot/devices/gpio/GPIOPin.hpp>

Inheritance diagram for arpirobot::GPIOPin:
arpirobot::BaseDevice arpirobot::IoDevice

Public Types

enum class  Mode { Input = 0 , Output = 1 }
 
enum class  Level { Low = 0 , High = 1 }
 

Public Member Functions

 GPIOPin (unsigned int pin)
 
 GPIOPin (const GPIOPin &other)=delete
 
GPIOPinoperator= (const GPIOPin &other)=delete
 
void setMode (Mode mode)
 
void setLevel (Level level)
 
Level getLevel ()
 
void setPwmValue (uint8_t val)
 
uint8_t getPwmValue ()
 
void setPwmFrequency (unsigned int freq)
 
unsigned int getPwmFrequency ()
 
- Public Member Functions inherited from arpirobot::BaseDevice
virtual std::string getDeviceName ()
 
bool isLockedByAction (std::shared_ptr< Action > action=nullptr)
 Check if a given action locks the device. More...
 
bool isLockedByAction (Action &action)
 Check if a given action locks the device. More...
 

Protected Member Functions

void close () override
 
void begin () override
 
bool isEnabled () override
 
bool shouldMatchRobotState () override
 
bool shouldDisableWithWatchdog () override
 
void enable () override
 
void disable () override
 

Additional Inherited Members

- Protected Attributes inherited from arpirobot::BaseDevice
bool initialized = false
 
std::string deviceName
 

Detailed Description

Use this device to directly control a GPIO pin This allows using the pin either as an input or an output Supported operations:


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