ESPMegaPRO-v3-SDK/ESPMegaPRO-firmware/lib/ESPMegaPRO/ExpansionCard.hpp

24 lines
825 B
C++
Raw Normal View History

2023-12-27 18:25:35 +00:00
#pragma once
2023-12-27 18:33:37 +00:00
#include <Arduino.h>
2023-12-27 18:25:35 +00:00
/**
* @brief The base class for all expansion cards
*
* In order to create a new expansion card, you should create a new class that inherits from this class.
* Your class should implement the following functions:
* - begin() : Initialize the card
* - loop() : A function that is called in the main loop
* - getType() : Get the type of the card, The type should be a unique number between 0 and 255
*
* @warning This class is abstract and should not be instantiated directly.
*/
2023-12-27 18:25:35 +00:00
class ExpansionCard {
public:
// Instantiate the card with the specified address
ExpansionCard() {}
2023-12-28 08:52:08 +00:00
virtual bool begin();
2023-12-27 18:25:35 +00:00
// Preform a loop to refresh the input buffers
2023-12-28 08:52:08 +00:00
virtual void loop();
2023-12-28 04:41:20 +00:00
// Get the card type
2023-12-28 08:52:08 +00:00
virtual uint8_t getType();
2023-12-27 18:25:35 +00:00
};