ELEC-C7222
Libraries for ELEC C7222 Course Work
Loading...
Searching...
No Matches
c7222::PicoWBoard Class Reference

Board-level convenience wrapper for the C7222 Pico W board. More...

#include <c7222_pico_w_board.hpp>

Inheritance diagram for c7222::PicoWBoard:
Inheritance graph
Collaboration diagram for c7222::PicoWBoard:
Collaboration graph

Public Types

enum class  LedId : uint8_t {
  LED1_RED = 21 , LED1_GREEN = 20 , LED2_RED = 19 , LED2_GREEN = 18 ,
  LED3_RED = 17 , LED3_GREEN = 16
}
 Logical LED identifiers mapped to GPIO pins. More...
 
enum class  ButtonId : uint8_t { BUTTON_B1 = 2 , BUTTON_B2 = 3 , BUTTON_B3 = 4 , BUTTON_B4 = 5 }
 Logical button identifiers mapped to GPIO pins. More...
 

Public Member Functions

bool IsInitialized () const
 Return true if construction-time initialization has completed.
 
LedGetLed (LedId id)
 Retrieve a board LED by logical ID.
 
ButtonGetButton (ButtonId id)
 Retrieve a board button by logical ID.
 
- Public Member Functions inherited from c7222::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (NonCopyable &&)=default
 
- Public Member Functions inherited from c7222::NonMovable
 NonMovable (const NonMovable &)=default
 
NonMovableoperator= (const NonMovable &)=default
 
 NonMovable (NonMovable &&)=delete
 
NonMovableoperator= (NonMovable &&)=delete
 

Static Public Member Functions

static PicoWBoardGetInstance ()
 Access the singleton instance (if used).
 

Static Public Attributes

static constexpr size_t kLedCount = 6
 Number of board LEDs exposed by this API.
 
static constexpr size_t kButtonCount = 4
 Number of board buttons exposed by this API.
 

Additional Inherited Members

- Protected Member Functions inherited from c7222::NonCopyableNonMovable
 NonCopyableNonMovable ()=default
 
 ~NonCopyableNonMovable ()=default
 
- Protected Member Functions inherited from c7222::NonCopyable
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 
- Protected Member Functions inherited from c7222::NonMovable
 NonMovable ()=default
 
 ~NonMovable ()=default
 

Detailed Description

Board-level convenience wrapper for the C7222 Pico W board.

Construct the board to initialize IO objects, then access them by logical ID. This avoids scattering GPIO pin numbers through application code and keeps beginner code readable.

Member Enumeration Documentation

◆ ButtonId

enum class c7222::PicoWBoard::ButtonId : uint8_t
strong

Logical button identifiers mapped to GPIO pins.

Enumerator
BUTTON_B1 
BUTTON_B2 
BUTTON_B3 
BUTTON_B4 

◆ LedId

enum class c7222::PicoWBoard::LedId : uint8_t
strong

Logical LED identifiers mapped to GPIO pins.

Enumerator
LED1_RED 
LED1_GREEN 
LED2_RED 
LED2_GREEN 
LED3_RED 
LED3_GREEN 

Member Function Documentation

◆ GetButton()

Button & c7222::PicoWBoard::GetButton ( ButtonId  id)

Retrieve a board button by logical ID.

Here is the caller graph for this function:

◆ GetInstance()

static PicoWBoard * c7222::PicoWBoard::GetInstance ( )
static

Access the singleton instance (if used).

Here is the caller graph for this function:

◆ GetLed()

Led & c7222::PicoWBoard::GetLed ( LedId  id)

Retrieve a board LED by logical ID.

Here is the caller graph for this function:

◆ IsInitialized()

bool c7222::PicoWBoard::IsInitialized ( ) const
inline

Return true if construction-time initialization has completed.

Member Data Documentation

◆ kButtonCount

constexpr size_t c7222::PicoWBoard::kButtonCount = 4
staticconstexpr

Number of board buttons exposed by this API.

◆ kLedCount

constexpr size_t c7222::PicoWBoard::kLedCount = 6
staticconstexpr

Number of board LEDs exposed by this API.


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