Skip to content

GpioManager: adding digital output devices

gregorydayao12 edited this page Jan 9, 2020 · 1 revision

This year, Sensors is adding GpioManager to handle digital output devices. Please note that digital input will not be handled by this manager. From Summer 2019, we saw that many physical devices are actuated using GPIO in response to the state machine and module statuses. These devices range from battery shutoffs (SSR switches), embrakes, cooling pumps, safe-to-approach LEDs, etc.. GpioManager allows for easy addition of these devices for people from different submodules. The GPIO utility interface is not used by anyone other than Sensors (at the moment) and this manager allows members to easily add devices that respond to current pod states and/or module statuses.

How GpioManager is set up:

  1. GPIO pointer class variables are added to the header file
  2. Variables initialised in source file parsing pin number from Config in kOut direction
  3. Switch statements are added to GpioManager::run() for device actuation based on current states or current module statuses.

If any submodule needs to access GPIO pins (for input or output), they should consult a member from Sensors to ensure correct functionality and implementation. Keeping this manager within the Sensors submodule ensure the modularity of our system.

Clone this wiki locally