/* Sets the configuration of an LPC Channel as an endpoint. */
void LPCChannelConfigEPSet(unsigned long ulBase, unsigned long ulChannel, unsigned long ulConfig, unsigned long ulAddress, unsigned long ulOffset)
/* Sets the configuration of an LPC Channel as an endpoint. */
void LPCChannelConfigEPSet(unsigned long ulBase, unsigned long ulChannel, unsigned long ulConfig, unsigned long ulAddress, unsigned long ulOffset)
{
    ASSERT(ulBase == LPC0_BASE);
    ASSERT(LPCChannelValid(ulChannel));
    ASSERT((ulConfig & ~(LPC_CH0CTL_IRQSEL1_M | LPC_CH0CTL_IRQSEL0_M |
                         LPC_CH0CTL_IRQEN1 | LPC_CH0CTL_IRQEN0_M)) == 0);
    ASSERT((ulOffset & 3) == 0);
    ASSERT(ulOffset < ((((HWREG(ulBase + LPC_O_STS) & LPC_STS_POOLSZ_M) >>
              16) * 256) - 4));
    ulConfig |= (((ulOffset >> 1) << LPC_CH0CTL_OFFSET_S) &
                 LPC_CH0CTL_OFFSET_M);
    HWREG(ulBase + LPC_O_CH0CTL + (ulChannel * 0x10)) = ulConfig;
    HWREG(ulBase + LPC_O_CH0ADR + (ulChannel * 0x10)) = ulAddress;
}