Ejemplo n.º 1
0
/**
 * @brief   Low level serial driver initialization.
 *
 * @notapi
 */
void sd_lld_init(void) {

#if USE_LPC214x_UART0
  sdObjectInit(&SD1, NULL, notify1);
  SD1.uart = U0Base;
  SetVICVector(UART0IrqHandler, LPC214x_UART0_PRIORITY, SOURCE_UART0);
#endif
#if USE_LPC214x_UART1
  sdObjectInit(&SD2, NULL, notify2);
  SD2.uart = U1Base;
  SetVICVector(UART1IrqHandler, LPC214x_UART1_PRIORITY, SOURCE_UART1);
#endif
}
Ejemplo n.º 2
0
/**
 * @brief   Low level SPI driver initialization.
 *
 * @notapi
 */
void spi_lld_init(void) {

#if LPC214x_SPI_USE_SSP
  spiObjectInit(&SPID1);
  SPID1.spd_ssp = SSPBase;
  SetVICVector(SPI1IrqHandler, LPC214x_SPI_SSP_IRQ_PRIORITY, SOURCE_SPI1);
#endif
}
Ejemplo n.º 3
0
/*
 * Board-specific initialization code.
 */
void boardInit(void) {

    /*
     * System Timer initialization, 1ms intervals.
     */
    SetVICVector(T0IrqHandler, 0, SOURCE_Timer0);
    VICIntEnable = INTMASK(SOURCE_Timer0);
    TC *timer = T0Base;
    timer->TC_PR = VAL_TC0_PRESCALER;
    timer->TC_MR0 = (PCLK / CH_FREQUENCY) / (VAL_TC0_PRESCALER + 1);
    timer->TC_MCR = 3;    /* Interrupt and clear TC on match MR0. */
    timer->TC_TCR = 2;    /* Reset counter and prescaler. */
    timer->TC_TCR = 1;    /* Timer enabled. */
}