Hack in support for other boards/microcontrollers, add GpioDriver
There's definitely plenty of cleanup work to be done (see: "ifdefs").
This commit is contained in:
@@ -23,17 +23,19 @@
|
||||
|
||||
#include "Bsp/ReturnCode.h"
|
||||
#include "Bsp/TaskScheduler.h"
|
||||
#include "Bsp/Drivers/GpioDriver.h"
|
||||
|
||||
// TODO: Find a better include for this
|
||||
#include "stm32l0xx.h"
|
||||
#include "Mcu.h"
|
||||
|
||||
namespace BSP {
|
||||
|
||||
class SpiDriver : public BSP::Schedule::Task {
|
||||
|
||||
public:
|
||||
// TODO: Add configurability / provide a real abstraction
|
||||
SpiDriver(BSP::Schedule::TaskScheduler &scheduler);
|
||||
// TODO: Allow other CS pins of either polaritu
|
||||
// TODO: Allow configurable CPHA, CPOL
|
||||
// TODO: Allow other SPI instances (not just SPI1)
|
||||
SpiDriver(BSP::Schedule::TaskScheduler &scheduler, BSP::GpioPin &nss);
|
||||
|
||||
void init();
|
||||
BSP::Schedule::NextTime execute() override;
|
||||
@@ -42,6 +44,7 @@ public:
|
||||
private:
|
||||
BSP::Schedule::TaskScheduler &m_scheduler;
|
||||
SPI_TypeDef *m_spi;
|
||||
BSP::GpioPin &m_nss;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user