X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=ucs2-interface%2Fucs_interface.h;h=5f02851dd0ed46b61511e12a278ca339dc603648;hb=81124d50004ee8c0a141771c4b59a79b1a9ec4f1;hp=b7dda35e4165ef008faa76c2a50c76eeb47bcb07;hpb=f4b34a4b00dc0983ae8f9a56828c2bc86ac11c7f;p=apps%2Fagl-service-unicens.git diff --git a/ucs2-interface/ucs_interface.h b/ucs2-interface/ucs_interface.h index b7dda35..5f02851 100644 --- a/ucs2-interface/ucs_interface.h +++ b/ucs2-interface/ucs_interface.h @@ -41,18 +41,6 @@ extern "C" { /* Public API */ /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ -// Fulup interface added to support ucs2vol -typedef const struct { - char* name; - int numid; -} UCSI_channelsT; - -typedef void (*UCSI_VolumeServiceCB_t)(uint16_t timeout); -UCSI_channelsT *UCSI_Vol_Init (UCSI_Data_t *pPriv, UCSI_VolumeServiceCB_t serviceCB); -uint8_t UCSI_Vol_Set (UCSI_Data_t *pPriv, int numId, uint8_t volume); -void UCSI_Vol_Service (UCSI_Data_t *pPriv); - - /** * \brief Initializes Unicens Integration module. * \note Must be called before any other function of this component @@ -160,13 +148,47 @@ void UCSI_ReleaseAmsMessage(UCSI_Data_t *my); * \note Call this function only from single context (not from ISR) * * \param pPriv - private data section of this instance - * \param routeId - identifier as given in XML file along with MOST socket + * \param routeId - identifier as given in XML file along with MOST socket (unique) * \param isActive - true, route will become active. false, route will be deallocated * * \return true, if route was found and the specific command was enqueued to Unicens. */ bool UCSI_SetRouteActive(UCSI_Data_t *pPriv, uint16_t routeId, bool isActive); +/** + * \brief Enables or disables a route by the given routeId + * \note Call this function only from single context (not from ISR) + * + * \param pPriv - private data section of this instance + * \param targetAddress - targetAddress - The node / group target address + * \param isBurst - true, write blockCount I2C telegrams dataLen with a single call. false, write a single I2C message. + * \param blockCount - amount of blocks to write. Only used when isBurst is set to true. + * \param slaveAddr - The I2C address. + * \param timeout - Timeout in milliseconds. + * \param dataLen - Amount of bytes to send via I2C + * \param pData - The payload to be send. + * \param result_fptr - Callback function notifying the asynchronous result. + * \param request_ptr - User reference which is provided for the asynchronous result. + * + * \return true, if route command was enqueued to Unicens. + */ +bool UCSI_I2CWrite(UCSI_Data_t *pPriv, uint16_t targetAddress, bool isBurst, uint8_t blockCount, + uint8_t slaveAddr, uint16_t timeout, uint8_t dataLen, uint8_t *pData, + Ucsi_ResultCb_t result_fptr, void *request_ptr); + +/** + * \brief Enables or disables a route by the given routeId + * \note Call this function only from single context (not from ISR) + * + * \param pPriv - private data section of this instance + * \param targetAddress - targetAddress - The node / group target address + * \param gpioPinId - INIC GPIO PIN starting with 0 for the first GPIO. + * \param isHighState - true, high state = 3,3V. false, low state = 0V. + * + * \return true, if GPIO command was enqueued to Unicens. + */ +bool UCSI_SetGpioState(UCSI_Data_t *pPriv, uint16_t targetAddress, uint8_t gpioPinId, bool isHighState); + /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ /* CALLBACK SECTION */ /*>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/ @@ -239,6 +261,35 @@ extern void UCSI_CB_OnStop(void *pTag); */ extern void UCSI_CB_OnAmsMessageReceived(void *pTag); +/** + * \brief Callback when a route become active / inactive. + * \note This function must be implemented by the integrator + * \param pTag - Pointer given by the integrator by UCSI_Init + * \param routeId - identifier as given in XML file along with MOST socket (unique) + * \param isActive - true, if the route is now in use. false, the route is not established. + */ +extern void UCSI_CB_OnRouteResult(void *pTag, uint16_t routeId, bool isActive); + +/** + * \brief Callback when a INIC GPIO changes its state + * \note This function must be implemented by the integrator + * \param pTag - Pointer given by the integrator by UCSI_Init + * \param nodeAddress - Node Address of the INIC sending the update. + * \param gpioPinId - INIC GPIO PIN starting with 0 for the first GPIO. + * \param isHighState - true, high state = 3,3V. false, low state = 0V. + */ +extern void UCSI_CB_OnGpioStateChange(void *pTag, uint16_t nodeAddress, uint8_t gpioPinId, bool isHighState); + +/** + * \brief Callback when nodes are discovered or disappear + * \note This function must be implemented by the integrator + * \param pTag - Pointer given by the integrator by UCSI_Init + * \param code - Report code + * \param nodeAddress - Node Address of the INIC sending the update. + * \param pNode - Reference to the node structure or NULL. + */ +extern void UCSI_CB_OnMgrReport(void *pTag, Ucs_MgrReport_t code, uint16_t nodeAddress, Ucs_Rm_Node_t *pNode); + #ifdef __cplusplus } #endif