Skip to content

Arduino abstraction layer #22

@noah1510

Description

@noah1510

One of the features that could increase compatibility to almost 100% would be to write a custom SPI Arduino layer.
Except for Arduino.h and SPI.h are the only dependencies, but they do not exist for a lot of board (eq. raspberry PI).
A custom Arduino layer would always use 'software' SPI if there is no hardware support or try to use another SPI implementation.
Like the rest of the LedController v2+, it should be implemented as header only code, maybe even as singleton.
This Layer should be the only place that is depended on Hardware specific code.
In the future this layer may be used to allow more frameworks/boards to work with this library.

The header of this layer should define a generic interface, while the source files handle the platform specific implementation of that generic interface.
The library will not be portable from one platform to the next without recompiling but this makes a lot of code simpler

The features it needs to implement are the following:

  • have a generic Arduino header which provides all of the functions of Arduino.h
  • provide a generic interface to output SPI data with the following functions
    • initilize SPI
    • start transmission
    • send data
    • receive data
    • end transmission
    • uninitilize SPI
    • check for non 0 MOSI and MISO, to have read-only or write only functionality
  • enable hardware SPI if possible
  • provide software SPI as fallback
  • use software SPI for custom pins
  • support raspberry pi
  • write documentation
  • write unit tests
  • move this layer into a separate library and use it as dependency

Help with this appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions