예제 #1
0
void I2Sinit()
{
    I2S_1_Start();

    
    /* Configure DMA */ 
    DmaTxConfiguration();
    I2S_1_EnableTx();
}
예제 #2
0
파일: main.c 프로젝트: bill-he/jackbill350
/*******************************************************************************
* Function Name: main
********************************************************************************
* Summary:
*  Main function performs following functions:
*   1. Starts Character LCD and print project info
*   2. Starts SPI Master component
*   3. Configures the DMA transfer for RX and TX directions
*   4. Displays the results on Character LCD
*   
* Parameters:
*  None.
*
* Return:
*  None.
*
*******************************************************************************/
int main()
{
    uint8 i;
    
    LCD_Start();
    LCD_Position(0u,0u);
    LCD_PrintString("SPI Master");
    LCD_Position(1u,0u);
    LCD_PrintString("example");
    CyDelay(2000u);
    
    DmaTxConfiguration();
    DmaRxConfiguration();
    
    SPIM_Start();
    
    CyDmaChEnable(rxChannel, STORE_TD_CFG_ONCMPLT);
    CyDmaChEnable(txChannel, STORE_TD_CFG_ONCMPLT);

    while (0u == (SPIM_ReadTxStatus() & SPIM_STS_SPI_DONE))
    {
    }
    
    LCD_ClearDisplay();
    LCD_PrintString("Master Rx data:");
    LCD_Position(1u,0u);
    
    for(i=0u; i<BUFFER_SIZE; i++)
    {
        LCD_PrintHexUint8(rxBuffer[i]);
    }

    for(;;)
    {
    }
}