Пример #1
0
/*
 *  ======== Board_openSPI ========
 */
SPI_Handle Board_openSPI(UInt spiPortIndex, SPI_Params *spiParams)
{
    /* Initialize the SPI driver */
    /* By design, SPI_init() is idempotent */
    SPI_init();

    /* initialize the pins associated with the respective UART */
    switch(spiPortIndex) {
        /*
         * NOTE: TI-RTOS examples configure EUSCIB0 as either SPI or I2C.  Thus,
         * a conflict occurs when the I2C & SPI drivers are used simultaneously in
         * an application.  Modify the pin mux settings in this file and resolve the
         * conflict before running your the application.
         */

        case 0:
            /*
             * Configure LaunchPad P1.7 as a SPI pin: SPI CLK
             *     device pin: 5 (GSPI_CLK)
             *     Wiring id : 7
             */
            MAP_PinTypeSPI(PIN_05, PIN_MODE_7);

            /*
             * Configure LaunchPad P2.6 as a SPI pin: SPI MOSI
             *     device pin: 7 (GSPI_MOSI)
             *     Wiring id : 15
             */
            MAP_PinTypeSPI(PIN_07, PIN_MODE_7);

            /*
             * Configure LaunchPad P2.7 as a SPI pin: SPI MISO
             *     device pin: 6 (GSPI_MISO)
             *     Wiring id : 14
             */
            MAP_PinTypeSPI(PIN_06, PIN_MODE_7);
            break;
            
        default:
            return(NULL);
    }
    
    Board_initDMA();

    /* open the SPI port */
    return (SPI_open(spiPortIndex, spiParams));
}
Пример #2
0
/*
 *  ======== Board_initSPI ========
 */
void Board_initSPI(void)
{
    Board_initDMA();
    SPI_init();
}