Sus handler complete
This commit is contained in:
@ -13,16 +13,24 @@
|
||||
*
|
||||
* @details Datasheet of MAX1227: https://datasheets.maximintegrated.com/en/ds/MAX1227-MAX1231.pdf
|
||||
*
|
||||
* @note When adding a SusHandler to the polling sequence table make sure to add a slot with
|
||||
* the executionStep FIRST_WRITE. Otherwise the communication sequence will never be
|
||||
* started.
|
||||
*
|
||||
* @author J. Meier
|
||||
*/
|
||||
class SusHandler: public DeviceHandlerBase {
|
||||
public:
|
||||
|
||||
static const uint8_t FIRST_WRITE = 7;
|
||||
|
||||
SusHandler(object_id_t objectId, object_id_t comIF,
|
||||
CookieIF * comCookie, LinuxLibgpioIF* gpioComIF, gpioId_t chipSelectId);
|
||||
virtual ~SusHandler();
|
||||
|
||||
virtual ReturnValue_t initialize();
|
||||
virtual ReturnValue_t performOperation(uint8_t counter) override;
|
||||
|
||||
virtual ReturnValue_t initialize() override;
|
||||
|
||||
protected:
|
||||
void doStartUp() override;
|
||||
@ -49,6 +57,7 @@ private:
|
||||
static const ReturnValue_t ERROR_LOCK_MUTEX = MAKE_RETURN_CODE(0xA1);
|
||||
|
||||
enum class CommunicationStep {
|
||||
IDLE,
|
||||
WRITE_SETUP,
|
||||
START_CONVERSIONS,
|
||||
READ_CONVERSIONS
|
||||
@ -61,7 +70,7 @@ private:
|
||||
SUS::SusDataset dataset;
|
||||
|
||||
uint8_t cmdBuffer[SUS::MAX_CMD_SIZE];
|
||||
CommunicationStep communicationStep = CommunicationStep::WRITE_SETUP;
|
||||
CommunicationStep communicationStep = CommunicationStep::IDLE;
|
||||
|
||||
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING;
|
||||
uint32_t timeoutMs = 20;
|
||||
|
Reference in New Issue
Block a user