diff options
author | tjahnk <tjahnk@users.noreply.github.com> | 2017-07-27 10:55:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 10:55:47 +0200 |
commit | 4d190f69cc90143c4de1b0d474cbf552fa165b78 (patch) | |
tree | f03139fa7dd9a791bb17a897d29e176bd9ee85d8 /ucs2-interface/ucs_config.h | |
parent | cccb9d85b0e94a9716e82aa055beb101c4de8781 (diff) | |
parent | b472aba95f7fbbfd61e9b8830dd30a4fe73af86f (diff) |
Merge pull request #14 from tkummermehr/I2C_and_GPIO_Support
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; |