Line data Source code
1 : #ifndef I_HARDWARE_HPP
2 : #define I_HARDWARE_HPP
3 :
4 : #include <stdint.h>
5 :
6 : namespace FreeRTOS_Cpp {
7 : class IHardware {
8 : public:
9 8 : virtual ~IHardware() = default;
10 :
11 : // --- Basic Hardware ---
12 : virtual void toggleLed(uint16_t ledId) = 0;
13 : virtual uint32_t watchdog_Init(void * handle) = 0;
14 : virtual uint8_t watchdog_refresh(void *handle) = 0;
15 :
16 : // --- UART / Logging Interface ---
17 : virtual void printLog(const uint8_t* data, uint16_t size) = 0;
18 : virtual void startCommandReceiveIT(volatile uint8_t* rxBuffer) = 0;
19 :
20 : // --- QSPI / Storage Interface ---
21 : // Uses pointers to return hardware specs to the application
22 : virtual bool storageInit(uint32_t* flashSize, uint32_t* eraseSectorSize, uint32_t* progPageSize) = 0;
23 : virtual bool storageRead(uint8_t* pData, uint32_t readAddr, uint32_t size) = 0;
24 : virtual bool storageWrite(uint8_t* pData, uint32_t writeAddr, uint32_t size) = 0;
25 : virtual bool storageEraseSector(uint32_t sectorAddress) = 0;
26 : virtual bool storageBulkErase() = 0;
27 : virtual bool storageIsBusy() = 0;
28 : };
29 : }
30 : #endif
|