/******************************************************************************* * Function Name: Cy_IPC_Drv_SendMsgWord ****************************************************************************//** * * This function is used to send a 32-bit word message through an IPC channel. * The function also has an associated notification field that will let the * message notify one or multiple IPC interrupts. The IPC channel is locked and * remains locked after the function returns. The receiver of the message should * release the channel. * * \param base * This parameter is a handle that represents the base address of the registers * of the IPC channel. * The parameter is generally returned from a call to the \ref * Cy_IPC_Drv_GetIpcBaseAddress. * * \param notifyEventIntr * Bit encoded list of IPC interrupt lines that are triggered by a notification. * * \param message * The message word that is the data placed in the IPC data register. * * \return Status of the operation: * \retval CY_IPC_DRV_SUCCESS: The send operation was successful. * \retval CY_IPC_DRV_ERROR: The IPC channel is unavailable because it is already locked. * * \funcusage * \snippet IPC_sut_01.cydsn/main_cm4.c snippet_Cy_IPC_Drv_SendMsgWord * *******************************************************************************/ cy_en_ipcdrv_status_t Cy_IPC_Drv_SendMsgWord (IPC_STRUCT_Type* base, uint32_t notifyEventIntr, uint32_t message) { cy_en_ipcdrv_status_t retStatus; if( CY_IPC_DRV_SUCCESS == Cy_IPC_Drv_LockAcquire(base) ) { /* If the channel was acquired, send the message. */ Cy_IPC_Drv_WriteDataValue(base, message); Cy_IPC_Drv_AcquireNotify(base, notifyEventIntr); retStatus = CY_IPC_DRV_SUCCESS; } else { /* Channel was already acquired, return Error */ retStatus = CY_IPC_DRV_ERROR; } return (retStatus); }
void spm_hal_mailbox_notify(void) { CY_ASSERT(ipc_channel_handle != NULL); Cy_IPC_Drv_AcquireNotify(ipc_channel_handle, (1uL << SPM_IPC_NOTIFY_CM4_INTR)); }