X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=ucs2-interface%2Fucs_config.h;h=0a47ae41d4b1254f800deec9d796a53048eb18f3;hb=1e24766a5685951f6f66f9c545a987573851dbb9;hp=74c82c6001499350e18b5a587f07767fb1b497ad;hpb=fe0ce6f9892d29da52a4ed5024ebe9d5964c0171;p=apps%2Fagl-service-unicens.git diff --git a/ucs2-interface/ucs_config.h b/ucs2-interface/ucs_config.h index 74c82c6..0a47ae4 100644 --- a/ucs2-interface/ucs_config.h +++ b/ucs2-interface/ucs_config.h @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------------------------------*/ -/* Unicens Integration Helper Component */ +/* UNICENS Integration Helper Component */ /* Copyright 2017, Microchip Technology Inc. and its subsidiaries. */ /* */ /* Redistribution and use in source and binary forms, with or without */ @@ -38,7 +38,8 @@ #define ENABLE_AMS_LIB (true) #define DEBUG_XRM #define BOARD_PMS_TX_SIZE (72) -#define CMD_QUEUE_LEN (6) +#define CMD_QUEUE_LEN (40) +#define I2C_WRITE_MAX_LEN (32) #include #include @@ -51,7 +52,7 @@ /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ /** - * \brief Internal enum for Unicens Integration + * \brief Internal enum for UNICENS Integration */ typedef enum { @@ -64,7 +65,15 @@ typedef enum } UnicensCmdResult_t; /** - * \brief Internal enum for Unicens Integration + * \brief Asynchronous callback notifiying a command result + * \param result_ptr The asynchronous result of the command + * \param request_ptr User reference, typically points to the afb_req + * object. + */ +typedef void (*Ucsi_ResultCb_t)(void *result_ptr, void *request_ptr); + +/** + * \brief Internal enum for UNICENS Integration */ typedef enum { @@ -72,11 +81,14 @@ typedef enum UnicensCmd_Init, UnicensCmd_Stop, UnicensCmd_RmSetRoute, - UnicensCmd_NsRun + UnicensCmd_NsRun, + UnicensCmd_GpioCreatePort, + UnicensCmd_GpioWritePort, + UnicensCmd_I2CWrite } UnicensCmd_t; /** - * \brief Internal struct for Unicens Integration + * \brief Internal struct for UNICENS Integration */ typedef struct { @@ -84,7 +96,7 @@ typedef struct } UnicensCmdInit_t; /** - * \brief Internal struct for Unicens Integration + * \brief Internal struct for UNICENS Integration */ typedef struct { @@ -93,13 +105,50 @@ typedef struct } UnicensCmdRmSetRoute_t; /** - * \brief Internal struct for Unicens Integration + * \brief Internal struct for UNICENS Integration */ typedef struct { Ucs_Rm_Node_t * node_ptr; } UnicensCmdNsRun_t; +/** + * \brief Internal struct for UNICENS Integration + */ +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]; + + Ucsi_ResultCb_t result_fptr; + void *request_ptr; + +} UnicensCmdI2CWrite_t; + /** * \brief Internal struct for Unicens Integration */ @@ -111,11 +160,14 @@ typedef struct UnicensCmdInit_t Init; UnicensCmdRmSetRoute_t RmSetRoute; UnicensCmdNsRun_t NsRun; + UnicensCmdGpioCreatePort_t GpioCreatePort; + UnicensCmdGpioWritePort_t GpioWritePort; + UnicensCmdI2CWrite_t I2CWrite; } val; } UnicensCmdEntry_t; /** - * \brief Internal variables for one instance of Unicens Integration + * \brief Internal variables for one instance of UNICENS Integration * \note Never touch any of this fields! */ typedef struct { @@ -129,7 +181,7 @@ typedef struct { } RB_t; /** - * \brief Internal variables for one instance of Unicens Integration + * \brief Internal variables for one instance of UNICENS Integration * \note Allocate this structure for each instance (static or malloc) * and pass it to UCSI_Init() * \note Never touch any of this fields!