ELEC-C7222
Libraries for ELEC C7222 Course Work
Loading...
Searching...
No Matches
c7222_pico_w_board.hpp File Reference

C++ board-level helper for the C7222 Pico W board. More...

#include <array>
#include <memory>
#include "button.hpp"
#include "led.hpp"
Include dependency graph for c7222_pico_w_board.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  c7222::PicoWBoard
 Board-level convenience wrapper for the C7222 Pico W board. More...
 

Namespaces

namespace  c7222
 C7222 course abstractions namespace.
 

Detailed Description

C++ board-level helper for the C7222 Pico W board.

This class provides a small, beginner-friendly API for accessing the board's LEDs and buttons through the higher-level Led and Button types. It hides GPIO pin numbers behind enums and ensures a consistent, simple access pattern across platforms.

Design intent:

  • Board-centric API: Use logical IDs (LedId, ButtonId) instead of raw GPIO numbers.
  • Simple lifecycle: Construction performs initialization; then retrieve references to LEDs/buttons using GetLed()/GetButton().
  • No accidental copies: Inherits from NonCopyableNonMovable to avoid copying the board abstraction.

Mapping assumptions (C7222 Pico W board):

  • LEDs are active-low and mapped to GPIOs 16–21.
  • Buttons are mapped to GPIOs 2–5 (active-low with pull-ups by convention).