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:
2020-04-11 11:03:17 -07:00
parent 385402e7aa
commit 99317eb99b
17 changed files with 1156 additions and 99 deletions

View File

@@ -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;
};
}