Output Functions
While one of the purposes of the Cow Pi boards is to teach memory-mapped I/O, the CowPi library provides functions that work with the peripheral input/output devices for bootstrapping/scaffolding purposes. These functions can, of course, also be used when memory-mapped I/O is not a required part of an assignment.
Note
LEDs are handled by the CowPi library, and their functions are described here.
Display modules are handled by the CowPi_stdio Library library.
-
void cowpi_illuminate_right_led(void)
Illuminates the right LED, aka the external LED.
This is a portable implementation, not a memory-mapped implementation.
Assumes the right LED is in Arduino pin D12 or Raspberry Pi Pico pin GP20. An LED illuminates when the pin is placed high, to match the semantics of the built-in LED.
-
void cowpi_illuminate_left_led(void)
Illuminates the left LED, aka the built-in LED, aka the internal LED.
This is a portable implementation, not a memory-mapped implementation.
Assumes the left LED is in Arduino pin D13 or Raspberry Pi Pico pin GP21. An LED illuminates when the pin is placed high, to match the semantics of the built-in LED.
-
void cowpi_deluminate_right_led(void)
Deluminates the right LED, aka the external LED.
This is a portable implementation, not a memory-mapped implementation.
Assumes the right LED is in Arduino pin D12 or Raspberry Pi Pico pin GP20. An LED deluminates when the pin is placed low, to match the semantics of the built-in LED.
-
void cowpi_deluminate_left_led(void)
Deluminates the left LED, aka the built-in LED, aka the internal LED.
This is a portable implementation, not a memory-mapped implementation.
Assumes the left LED is in Arduino pin D13 or Raspberry Pi Pico pin GP21. An LED deluminates when the pin is placed low, to match the semantics of the built-in LED.
-
void cowpi_illuminate_internal_led(void)
Illuminates the internal LED, aka the built-in LED, aka the left LED.
This is a portable implementation, not a memory-mapped implementation.
Assumes the built-in LED is in Arduino pin D13 or Raspberry Pi Pico pin GP25. An LED illuminates when the pin is placed high.
-
void cowpi_deluminate_internal_led(void)
Deluminates the internal LED, aka the built-in LED, aka the left LED.
This is a portable implementation, not a memory-mapped implementation.
Assumes the built-in LED is in Arduino pin D13 or Raspberry Pi Pico pin GP25. An LED deluminates when the pin is placed low.