/* * Copyright (C) 2003 Texas Instruments Incorporated * All Rights Reserved */ /* *---------main_mcbsp1.c--------- * * mcbsp1 Example configures the serial port for digital loopback mode. * We then use the CPU to write/read from the port. In loopback mode, we * should read back the same value as written, which is checked for in a loop */ #include <stdio.h> #include <csl.h> #include <csl_mcbsp.h> //---------Global data definition--------- /* create a MCBSP config structure for digital loopback mode */ static MCBSP_Config ConfigLoopback = { MCBSP_SPCR_RMK //Serial Port Control Register (SPCR) ( MCBSP_SPCR_FREE_YES, // Serial clock free running mode(FREE) MCBSP_SPCR_SOFT_YES, // Serial clock emulation mode(SOFT) // During emulation halt, serial clocks continue to run 仿真模式开启 // Soft mode is enabled. During emulation halt, serial port clock stops after completion // of current transmission. MCBSP_SPCR_FRST_YES, // Frame sync generator reset(FRST) MCBSP_SPCR_GRST_YES, // Sample rate generator reset(GRST) MCBSP_SPCR_XINTM_XRDY, // Transmit interrupt mode(XINTM) MCBSP_SPCR_XSYNCERR_NO, // Transmit synchronization error MCBSP_SPCR_XRST_YES, // Transmitter