agl-service-unicens: fix streaming alignment issue
[apps/agl-service-unicens.git] / ucs2-interface / ucs_config.h
index 93bba34..b23d169 100644 (file)
@@ -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,7 @@
 #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 <string.h>
@@ -52,7 +52,7 @@
 /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
 
 /**
- * \brief Internal enum for Unicens Integration
+ * \brief Internal enum for UNICENS Integration
  */
 typedef enum
 {
@@ -73,7 +73,7 @@ typedef enum
 typedef void (*Ucsi_ResultCb_t)(void *result_ptr, void *request_ptr);
 
 /**
- * \brief Internal enum for Unicens Integration
+ * \brief Internal enum for UNICENS Integration
  */
 typedef enum
 {
@@ -84,11 +84,12 @@ typedef enum
     UnicensCmd_NsRun,
     UnicensCmd_GpioCreatePort,
     UnicensCmd_GpioWritePort,
-    UnicensCmd_I2CWrite
+    UnicensCmd_I2CWrite,
+    UnicensCmd_SendAmsMessage
 } UnicensCmd_t;
 
 /**
- * \brief Internal struct for Unicens Integration
+ * \brief Internal struct for UNICENS Integration
  */
 typedef struct
 {
@@ -96,7 +97,7 @@ typedef struct
 } UnicensCmdInit_t;
 
 /**
- * \brief Internal struct for Unicens Integration
+ * \brief Internal struct for UNICENS Integration
  */
 typedef struct
 {
@@ -105,7 +106,7 @@ typedef struct
 } UnicensCmdRmSetRoute_t;
 
 /**
- * \brief Internal struct for Unicens Integration
+ * \brief Internal struct for UNICENS Integration
  */
 typedef struct
 {
@@ -113,7 +114,7 @@ typedef struct
 } UnicensCmdNsRun_t;
 
 /**
- * \brief Internal struct for Unicens Integration
+ * \brief Internal struct for UNICENS Integration
  */
 typedef struct
 {
@@ -122,7 +123,7 @@ typedef struct
 } UnicensCmdGpioCreatePort_t;
 
 /**
- * \brief Internal struct for Unicens Integration
+ * \brief Internal struct for UNICENS Integration
  */
 typedef struct
 {
@@ -132,7 +133,7 @@ typedef struct
 } UnicensCmdGpioWritePort_t;
 
 /**
- * \brief Internal struct for Unicens Integration
+ * \brief Internal struct for UNICENS Integration
  */
 typedef struct
 {
@@ -143,14 +144,25 @@ typedef struct
     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
+ * \brief Internal struct for UNICENS Integration
+ */
+typedef struct
+{
+    uint16_t msgId;
+    uint16_t targetAddress;
+    uint8_t pPayload[UCS_AMS_SIZE_TX_MSG];
+    uint32_t payloadLen;
+} UnicensCmdSendAmsMessage_t;
+
+/**
+ * \brief Internal struct for UNICENS Integration
  */
 typedef struct
 {
@@ -163,11 +175,12 @@ typedef struct
         UnicensCmdGpioCreatePort_t GpioCreatePort;
         UnicensCmdGpioWritePort_t GpioWritePort;
         UnicensCmdI2CWrite_t I2CWrite;
+        UnicensCmdSendAmsMessage_t SendAms;
     } 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 {
@@ -181,7 +194,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!