picolibrary

SPI Facilities

SPI facilities are defined in the include/picolibrary/spi.h/source/picolibrary/spi.cc header/source file pair.

Table of Contents

  1. Controller
  2. Device Selection
  3. Device

Controller

The ::picolibrary::SPI::Basic_Controller_Concept concept class defines the expected interface of an SPI basic controller.

The ::picolibrary::Testing::Automated::SPI::Mock_Basic_Controller mock SPI basic controller class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/spi.h/source/picolibrary/testing/automated/spi.cc header/source file pair.

The ::picolibrary::SPI::Controller_Concept concept class defines the expected interface of an SPI controller.

To add SPI controller functionality to an SPI basic controller implementation, use the ::picolibrary::SPI::Controller template class. ::picolibrary::SPI::Controller automated tests are defined in the test/automated/picolibrary/spi/controller/main.cc source file.

The ::picolibrary::Testing::Automated::SPI::Mock_Controller mock SPI controller class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/spi.h/source/picolibrary/testing/automated/spi.cc header/source file pair.

The ::picolibrary::Testing::Interactive::SPI::echo() 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/spi.h/source/picolibrary/testing/interactive/spi.cc header/source file pair.

Device Selection

The ::picolibrary::SPI::Device_Selector_Concept concept class defines the expected interface of an SPI device selector.

The ::picolibrary::SPI::GPIO_Output_Pin_Device_Selector template class is a GPIO output pin based SPI device selector implementation. ::picolibrary::SPI::GPIO_Output_Pin_Device_Selector automated tests are defined in the test/automated/picolibrary/spi/gpio_output_pin_device_selector/main.cc source file.

The ::picolibrary::Testing::Automated::SPI::Mock_Device_Selector mock SPI device selector class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/spi.h/source/picolibrary/testing/automated/spi.cc header/source file pair.

To ensure that SPI devices are deselected, use the ::picolibrary::SPI::Device_Selection_Guard RAII device selection guard template class to select and deselect devices. ::picolibrary::SPI::Device_Selection_Guard automated tests are defined in the test/automated/picolibrary/spi/device_selection_guard/main.cc source file.

Device

The ::picolibrary::SPI::Device template class implements low level functionality for interacting with an SPI device.

::picolibrary::SPI::Device automated tests are defined in the test/automated/picolibrary/spi/device/main.cc source file.

The ::picolibrary::Testing::Automated::SPI::Mock_Device mock SPI device class is available if the PICOLIBRARY_ENABLE_AUTOMATED_TESTING project configuration option is ON. The mock is defined in the include/picolibrary/testing/automated/spi.h/source/picolibrary/testing/automated/spi.cc header/source file pair.