diff options
author | Thorsten Kummermehr <thorsten.kummermehr@k2l.de> | 2017-07-26 16:54:13 +0200 |
---|---|---|
committer | Thorsten Kummermehr <thorsten.kummermehr@k2l.de> | 2017-07-26 16:54:13 +0200 |
commit | b472aba95f7fbbfd61e9b8830dd30a4fe73af86f (patch) | |
tree | 95c6ca7c59856056cdbc25254f6e61ea815008ed /ucs2-interface/ucs_config.h | |
parent | 734e76786c52b832e702a113a0583e51ea433f23 (diff) |
Implement handling of GPIO, I2C, Routes
Diffstat (limited to 'ucs2-interface/ucs_config.h')
-rw-r--r-- | ucs2-interface/ucs_config.h | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/ucs2-interface/ucs_config.h b/ucs2-interface/ucs_config.h index 74c82c6..16210af 100644 --- a/ucs2-interface/ucs_config.h +++ b/ucs2-interface/ucs_config.h @@ -39,6 +39,7 @@ #define DEBUG_XRM #define BOARD_PMS_TX_SIZE (72) #define CMD_QUEUE_LEN (6) +#define I2C_WRITE_MAX_LEN (32) #include <string.h> #include <stdarg.h> @@ -72,7 +73,10 @@ typedef enum UnicensCmd_Init, UnicensCmd_Stop, UnicensCmd_RmSetRoute, - UnicensCmd_NsRun + UnicensCmd_NsRun, + UnicensCmd_GpioCreatePort, + UnicensCmd_GpioWritePort, + UnicensCmd_I2CWrite } UnicensCmd_t; /** @@ -105,12 +109,48 @@ typedef struct */ typedef struct { + uint16_t destination; + uint16_t debounceTime; +} UnicensCmdGpioCreatePort_t; + +/** + * \brief Internal struct for Unicens Integration + */ +typedef struct +{ + uint16_t destination; + uint16_t mask; + uint16_t data; +} UnicensCmdGpioWritePort_t; + +/** + * \brief Internal struct for Unicens Integration + */ +typedef struct +{ + uint16_t destination; + bool isBurst; + uint8_t blockCount; + uint8_t slaveAddr; + uint16_t timeout; + uint8_t dataLen; + uint8_t data[I2C_WRITE_MAX_LEN]; +} UnicensCmdI2CWrite_t; + +/** + * \brief Internal struct for Unicens Integration + */ +typedef struct +{ UnicensCmd_t cmd; union { UnicensCmdInit_t Init; UnicensCmdRmSetRoute_t RmSetRoute; UnicensCmdNsRun_t NsRun; + UnicensCmdGpioCreatePort_t GpioCreatePort; + UnicensCmdGpioWritePort_t GpioWritePort; + UnicensCmdI2CWrite_t I2CWrite; } val; } UnicensCmdEntry_t; |