Class GPIOControllerInterface

Inheritance Relationships

Derived Type

Class Documentation

class GPIOControllerInterface

Subclassed by husarion_ugv_hardware_interfaces::GPIOController

Public Functions

virtual ~GPIOControllerInterface() = default
virtual void Start() = 0
virtual void EStopTrigger() = 0
virtual void EStopReset() = 0
virtual bool MotorPowerEnable(const bool enable) = 0
virtual bool FanEnable(const bool enable) = 0
virtual bool AUXPowerEnable(const bool enable) = 0
virtual bool DigitalPowerEnable(const bool enable) = 0
virtual bool ChargerEnable(const bool enable) = 0
virtual bool LEDControlEnable(const bool enable) = 0
virtual std::unordered_map<GPIOPin, bool> QueryControlInterfaceIOStates() const = 0
inline virtual void InterruptEStopReset()
void RegisterGPIOEventCallback(const std::function<void(const GPIOInfo&)> &callback)

This method sets the provided callback function to be executed upon GPIO edge events.

Example

An example of using this method to bind a member function as a callback:

class MyClass {
public:
  void HandleGPIOEvent(const GPIOInfo & gpio_info) {
    // Handle GPIO event here, i.e:
    std::cout << gpio_info.offset << ":    " << gpio_info.value << std::endl;
  }
};

MyClass my_obj;
GPIOController gpio_controller;
gpio_controller.RegisterGPIOEventCallback(
    std::bind(&MyClass::HandleGPIOEvent, &my_obj, std::placeholders::_1));

Parameters:

callback – The callback function to handle GPIO edge events.

bool IsPinActive(const GPIOPin pin) const
bool IsPinAvailable(const GPIOPin pin) const

Protected Attributes

std::shared_ptr<GPIODriverInterface> gpio_driver_