picolibrary

GPIO Facilities

GPIO facilities are defined in the include/picolibrary/gpio.h/source/picolibrary/gpio.cc header/source file pair.

Table of Contents

  1. Initial Internal Pull-Up Resistor State Identification
  2. Initial Internal Pull-Down Resistor State Identification
  3. Initial Pin State Identification
  4. Input Pin
  5. Internally Pulled-Up Input Pin
  6. Internally Pulled-Down Input Pin
  7. Internally Pulled Input Pin
  8. Output Pin
  9. I/O Pin

Initial Internal Pull-Up Resistor State Identification

The ::picolibrary::GPIO::Initial_Pull_Up_State enum class is used to identify initial internal pull-up resistor states.

A std::ostream insertion operator is defined for ::picolibrary::GPIO::Initial_Pull_Up_State if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The insertion operator is defined in the include/picolibrary/testing/automated/gpio.h/source/picolibrary/testing/automated/gpio.cc header/source file pair.

Initial Internal Pull-Down Resistor State Identification

The ::picolibrary::GPIO::Initial_Pull_Down_State enum class is used to identify initial internal pull-down resistor states.

A std::ostream insertion operator is defined for ::picolibrary::GPIO::Initial_Pull_Down_State if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The insertion operator is defined in the include/picolibrary/testing/automated/gpio.h/source/picolibrary/testing/automated/gpio.cc header/source file pair.

Initial Pin State Identification

The ::picolibrary::GPIO::Initial_Pin_State enum class is used to identify initial pin states.

A std::ostream insertion operator is defined for ::picolibrary::GPIO::Initial_Pin_State if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The insertion operator is defined in the include/picolibrary/testing/automated/gpio.h/source/picolibrary/testing/automated/gpio.cc header/source file pair.

Input Pin

The ::picolibrary::GPIO::Input_Pin_Concept concept class defines the expected interface of a GPIO input pin.

picolibrary assumes that the high pin/signals state is the active pin/signal state. All input pin implementations should use this assumption. If the high pin/signal state is not the active pin/signal state, the ::picolibrary::GPIO::Active_Low_Input_Pin template class can be used to invert an input pin implementation’s behavior. ::picolibrary::GPIO::Active_Low_Input_Pin automated tests are defined in the test/automated/picolibrary/gpio/active_low_input_pin/main.cc source file.

The ::picolibrary::Testing::Automated::GPIO::Mock_Input_Pin mock GPIO input pin class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/gpio.h/source/picolibrary/testing/automated/gpio.cc header/source file pair.

The ::picolibrary::Testing::Interactive::GPIO::state() interactive test helper is available if the PICOLIBRARY_ENABLE_INTERACTIVE_TESTING project configuration option is ON. The interactive test helper is defined in the include/picolibrary/testing/interactive/gpio.h/source/picolibrary/testing/interactive/gpio.cc header/source file pair.

Internally Pulled-Up Input Pin

The ::picolibrary::GPIO::Internally_Pulled_Up_Input_Pin_Concept concept class defines the expected interface of a GPIO internally pulled-up input pin.

picolibrary assumes that the high pin/signals state is the active pin/signal state. All internally pulled-up input pin implementations should use this assumption. If the high pin/signal state is not the active pin/signal state, the ::picolibrary::GPIO::Active_Low_Input_Pin template class can be used to invert an internally pulled-up input pin implementation’s behavior. ::picolibrary::GPIO::Active_Low_Input_Pin automated tests are defined in the test/automated/picolibrary/gpio/active_low_input_pin/main.cc source file.

The ::picolibrary::Testing::Automated::GPIO::Mock_Internally_Pulled_Up_Input_Pin mock GPIO internally pulled-up input pin class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/gpio.h/source/picolibrary/testing/automated/gpio.cc header/source file pair.

The ::picolibrary::Testing::Interactive::GPIO::state() interactive test helper is available if the PICOLIBRARY_ENABLE_INTERACTIVE_TESTING project configuration option is ON. The interactive test helper is defined in the include/picolibrary/testing/interactive/gpio.h/source/picolibrary/testing/interactive/gpio.cc header/source file pair.

Internally Pulled-Down Input Pin

The ::picolibrary::GPIO::Internally_Pulled_Down_Input_Pin_Concept concept class defines the expected interface of a GPIO internally pulled-down input pin.

picolibrary assumes that the high pin/signals state is the active pin/signal state. All internally pulled-down input pin implementations should use this assumption. If the high pin/signal state is not the active pin/signal state, the ::picolibrary::GPIO::Active_Low_Input_Pin template class can be used to invert an internally pulled-down input pin implementation’s behavior. ::picolibrary::GPIO::Active_Low_Input_Pin automated tests are defined in the test/automated/picolibrary/gpio/active_low_input_pin/main.cc source file.

The ::picolibrary::Testing::Automated::GPIO::Mock_Internally_Pulled_Down_Input_Pin mock GPIO internally pulled-down input pin class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/gpio.h/source/picolibrary/testing/automated/gpio.cc header/source file pair.

The ::picolibrary::Testing::Interactive::GPIO::state() interactive test helper is available if the PICOLIBRARY_ENABLE_INTERACTIVE_TESTING project configuration option is ON. The interactive test helper is defined in the include/picolibrary/testing/interactive/gpio.h/source/picolibrary/testing/interactive/gpio.cc header/source file pair.

Internally Pulled Input Pin

The ::picolibrary::GPIO::Internally_Pulled_Input_Pin_Concept concept class defines the expected interface of a GPIO internally pulled input pin. This interface assumes that a pin’s internal pull-up resistor and internal pull-down resistor cannot be enabled at the same time (e.g. enabling a pin’s internal pull-down resistor implicitly disables the pin’s internal pull-up resistor).

picolibrary assumes that the high pin/signals state is the active pin/signal state. All internally pulled input pin implementations should use this assumption. If the high pin/signal state is not the active pin/signal state, the ::picolibrary::GPIO::Active_Low_Input_Pin template class can be used to invert an internally pulled input pin implementation’s behavior. ::picolibrary::GPIO::Active_Low_Input_Pin automated tests are defined in the test/automated/picolibrary/gpio/active_low_input_pin/main.cc source file.

The ::picolibrary::Testing::Automated::GPIO::Mock_Internally_Pulled_Input_Pin mock GPIO internally pulled input pin class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/gpio.h/source/picolibrary/testing/automated/gpio.cc header/source file pair.

The ::picolibrary::Testing::Interactive::GPIO::state() interactive test helper is available if the PICOLIBRARY_ENABLE_INTERACTIVE_TESTING project configuration option is ON. The interactive test helper is defined in the include/picolibrary/testing/interactive/gpio.h/source/picolibrary/testing/interactive/gpio.cc header/source file pair.

Output Pin

The ::picolibrary::GPIO::Output_Pin_Concept concept class defines the expected interface of a GPIO output pin.

picolibrary assumes that the high pin/signals state is the active pin/signal state. All output pin implementations should use this assumption. If the high pin/signal state is not the active pin/signal state, the ::picolibrary::GPIO::Active_Low_Output_Pin template class can be used to invert an output pin implementation’s behavior. ::picolibrary::GPIO::Active_Low_Output_Pin automated tests are defined in the test/automated/picolibrary/gpio/active_low_output_pin/main.cc source file.

The ::picolibrary::Testing::Automated::GPIO::Mock_Output_Pin mock GPIO output pin class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/gpio.h/source/picolibrary/testing/automated/gpio.cc header/source file pair.

The ::picolibrary::Testing::Interactive::GPIO::toggle() interactive test helper is available if the PICOLIBRARY_ENABLE_INTERACTIVE_TESTING project configuration option is ON. The interactive test helper is defined in the include/picolibrary/testing/interactive/gpio.h/source/picolibrary/testing/interactive/gpio.cc header/source file pair.

I/O Pin

The ::picolibrary::GPIO::IO_Pin_Concept concept class defines the expected interface of a GPIO I/O pin.

picolibrary assumes that the high pin/signals state is the active pin/signal state. All I/O pin implementations should use this assumption. If the high pin/signal state is not the active pin/signal state, the ::picolibrary::GPIO::Active_Low_IO_Pin template class can be used to invert an I/O pin implementation’s behavior.

The ::picolibrary::Testing::Automated::GPIO::Mock_IO_Pin mock GPIO I/O pin class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/gpio.h/source/picolibrary/testing/automated/gpio.cc header/source file pair.

The ::picolibrary::Testing::Interactive::GPIO::toggle() interactive test helper is available if the PICOLIBRARY_ENABLE_INTERACTIVE_TESTING project configuration option is ON. The interactive test helper is defined in the include/picolibrary/testing/interactive/gpio.h/source/picolibrary/testing/interactive/gpio.cc header/source file pair.