/*
 *  ======== EUSCI_A1_graceInit ========
 *  Initialize Config for the MSP430 EUSCI_A1
 */
void EUSCI_A1_graceInit(void)
{

    /* USER CODE START (section: EUSCI_A1_graceInit_prologue) */
    /* User initialization code */
    /* USER CODE END (section: EUSCI_A1_graceInit_prologue) */

    /* initialize eUSCI SPI master mode */
    EUSCI_A_SPI_masterInit(EUSCI_A1_BASE, EUSCI_A_SPI_CLOCKSOURCE_SMCLK, 8000000, 1000000,
                    EUSCI_A_SPI_MSB_FIRST, EUSCI_A_SPI_PHASE_DATA_CAPTURED_ONFIRST_CHANGED_ON_NEXT, EUSCI_A_SPI_CLOCKPOLARITY_INACTIVITY_LOW, EUSCI_A_SPI_3PIN);

    /* enable eUSCI SPI */
    EUSCI_A_SPI_enable(EUSCI_A1_BASE);

    /* disable eUSCI SPI transmit interrupt */
    EUSCI_A_SPI_disableInterrupt(EUSCI_A1_BASE, EUSCI_A_SPI_TRANSMIT_INTERRUPT);

    /* disable eUSCI SPI receive interrupt */
    EUSCI_A_SPI_disableInterrupt(EUSCI_A1_BASE, EUSCI_A_SPI_RECEIVE_INTERRUPT);

    /* USER CODE START (section: EUSCI_A1_graceInit_epilogue) */
    /* User code */
    /* USER CODE END (section: EUSCI_A1_graceInit_epilogue) */

}
Пример #2
0
void SPI_disableInterrupt(uint32_t moduleInstance, uint_fast8_t mask)
{
    if (is_A_Module(moduleInstance))
    {
        EUSCI_A_SPI_disableInterrupt(moduleInstance, mask);
    } else
    {
        EUSCI_B_SPI_disableInterrupt(moduleInstance, mask);
    }

}