/*******************************************************************************
* Filename: main.c
* Description: This program acts as a bridge from SPI to PC and PC
* to SPI.
* Note:
*******************************************************************************/
void delay_ms(unsigned int n) //---->ms延时函数
{
unsigned int i;
while(n--)
{
for(i=1333;i>0;i--) asm("nop"); //1时钟周期
}
}
//时钟16MHz 周期62.5ns
/*******************************************************************************
* Name: uart_to_spi(void)
* Description: Transmits the bytes from uart buffer to spi buffer.