Skip to content

FL0WL0W/EmbeddedIOServices

Repository files navigation

EmbeddedIOServices

This is a unit tested hardware abstraction for embedded systems. The timer service has a built in scheduling system that can be used to trigger callbacks at precise times. Testing with 32 callbacks being scheduled on a STM32F103, sub microsecond accuracy was observed.

Interfaces that need to be implemented when adding new hardware abstraction

  • IAnalogService
    • InitPin(uint16 pin)
    • ReadPin(uint16 pin)
  • IDigitalService
    • InitPin(uint16 pin, PinDirection direction)
    • ReadPin(uint16 pin)
    • WritePin(uint16 pin, bool value)
    • ScheduleRecurringInterrupt(uint16 pin, CallBack callBack)
    • ScheduleNextInterrupt(uint16 pin, CallBack callBack)
  • IPwmService
    • InitPin(uint16 pin, PinDirection direction, uint16 minFrequency)
    • ReadPin(uint16 pin)
    • WritePin(uint16 pin, PwmValue value)
  • ITimerService
    • GetTick()
    • GetTicksPerSecond()
    • ScheduleCallBack(tick_t tick) <= this is to call ReturnCallBack() at that tick
  • ICommunicationService (UART, TCP Socket, WebSocket, etc.)
    • Call Receive(void* data, size_t length) when data received
    • Send(void* data, size_t length)
  • ICANService (UART, TCP Socket, WebSocket, etc.)
    • Receive(CANIdentifier_t identifier, CANData_t data, uint8_t dataLength) when data received
    • Send(CANIdentifier_t identifier, CANData_t data, uint8_t dataLength)

Currently Supported Microcontroller

  • STM32F103Cx
  • STM32F401CC
  • Full Stm32 Line, just add Stm32HalConf.h
  • W806 and W801
  • ESP32

About

General Input/Output services for Embedded Systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages