How to use SPORT driver **************************************************************** 1. Introducation **************************************************************** The ADSP-21535 DSP has two identical synchronous serial ports, or SPORTs. These iports support a variety of serial data communications protocols and can provide a direct interconnection between processors in a multiprocessor system. The two SPORTs can be operated by opening /dev/sport0 and/or /dev/sport1. The driver supply typical character driver interface. **************************************************************** 2. The connection of two SPORT **************************************************************** These pins must be connected: Tx SPORT Rx SPORT TFS <-------> RFS DT <-------> DR TCLK <-------> RCLK **************************************************************** 3. Configuration of the communication **************************************************************** ioctl code comment CMD_SPORT_ENABLE enable sport CMD_SPORT_DISABLE disable sport CMD_SPORT_SET_TX_BAUDRATE change TFSDIV and TSCLKDIV CMD_SPORT_SET_RX_BAUDRATE change RFSDIV and RSCLKDIV CMD_SPORT_SET_WORD_LENGTH set serial word length (3~16 bit) SPxTCLK frequency = (SCLK frequency) / (2 x (SPORTx_TSCLDIV + 1)) SPxRCLK frequency = (SCLK frequency) / (2 x (SPORTx_RSCLDIV + 1)) SPxTFSCLK frequency = (CLKOUT frequency) / (SPORTx_TFSDIV + 1) SPxRFSCLK frequency = (CLKOUT frequency) / (SPORTx_RFSDIV + 1) **************************************************************** 4. Receive data **************************************************************** fd = open("/dev/sportx", O_RDONLY, 0); ... read(fd, buffer_rx, number_of_bytes); ... close(fd); **************************************************************** 5. Send data **************************************************************** fd = open("/dev/sportx", O_WRONLY, 0); ... write(fd, buffer_tx, number_of_bytes); ... close(fd);