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
|
|
|
|
2023-12-31 19:39:51 +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
|
|
|
};
|