/* Sets the designated bits in a 16/32-bit data word at the remote CPU system address */
uint16_t IPCLiteLtoRClearBits(uint32_t ulFlag, uint32_t ulAddress, uint32_t ulMask, uint16_t usLength, uint32_t ulStatusFlag)
/* Sets the designated bits in a 16/32-bit data word at the remote CPU system address */
uint16_t IPCLiteLtoRClearBits(uint32_t ulFlag, uint32_t ulAddress, uint32_t ulMask, uint16_t usLength, uint32_t ulStatusFlag)
{
    uint16_t returnStatus;
    if (IpcRegs.IPCFLG.all & (ulFlag | ulStatusFlag))
    {
        returnStatus = STATUS_FAIL;
    }
    else
    {
        if (usLength == IPC_LENGTH_16_BITS)
        {
            IpcRegs.IPCSENDCOM = IPC_CLEAR_BITS_16;
            IpcRegs.IPCSENDADDR = ulAddress;
            IpcRegs.IPCSENDDATA = ulMask & (0x0000FFFF);
        }
        else if (usLength == IPC_LENGTH_32_BITS)
        {
            IpcRegs.IPCSENDCOM = IPC_CLEAR_BITS_32;
            IpcRegs.IPCSENDADDR = ulAddress;
            IpcRegs.IPCSENDDATA = ulMask;
        }
        IpcRegs.IPCSET.all |= (ulFlag | ulStatusFlag);
        returnStatus = STATUS_PASS;
    }
    return returnStatus;
}