spiCfg.ClkDiv = 0x000B;// 12Mhz clk spiCfg.Mode = SPI_MODE_MASTER; spiCfg.ClockMode = SPI_CLOCK_MODE0;//Mode spiCfg.DataOrder = SPI_DATA_MSB_FIRST;//MSB first spiCfg.SSELPol = (SPI_CFG_SPOL0_LO | SPI_CFG_SPOL1_LO | SPI_CFG_SPOL2_LO | SPI_CFG_SPOL3_LO); //active LOW Chip_SPI_SetConfig(LPC_SPI1, &spiCfg); spiDelayCfg.PreDelay = 1; spiDelayCfg.PostDelay = 0; spiDelayCfg.FrameDelay = 0;//2 spiDelayCfg.TransferDelay = 0; Chip_SPI_DelayConfig(LPC_SPI1, &spiDelayCfg); Chip_SPI_EnableLoopBack(LPC_SPI1); Chip_SPI_Enable(LPC_SPI1); ////////////////////////////////////////////////////////////////////// uint16_t sample[]={0x00,0xAA,0xBB}; DACSpiout(sample,3); |