
/*  ---------------------------------------------------------------------------
    Configure the C8051F120 I/O

    Here's how we're using the I/O ports.  (I) and (O) indicate inputs and
    outputs.

    P0.0 (O) - UART 0 TxD
    P0.1 (I) - UART 0 RxD
    P0.2 (I) - PCA Channel 0 - looped back from P1.0
  
    P1.0 (O) - Output connected to PCA input
    P1.6 (O) - LED on evaluation board
      ------------------------------------------------------------------------ */

    SFRPAGE = CONFIG_PAGE;                      /* Address xbar registers */

    XBR0 = 0x04 |                               /* Enable UART 0 RxD and TxD */
           0x08;                                /* Enable CEX0 */
    XBR2 = 0x40;                                /* Enable the crossbar */

    P0MDOUT = 0x01;                             /* Set up push-pull outputs */
    P1MDOUT = 0x41;

/*  ---------------------------------------------------------------------------
    Configure the PCA.  See Section 24 of the data sheet for complete info
    ------------------------------------------------------------------------ */

    SFRPAGE = PCA0_PAGE;                        /* PCA configuration page */
    PCA0MD = 0x08;                              /* PCA clock = SYSCLK */
    PCA0CN = 0x40;                              /* Enable the PCA counter */

    PCA0CPM0 = 0x20;                            /* Put PCA Module 0 in rising-
                                                    edge capture mode */
