<< Chapter < Page | Chapter >> Page > |
The driver uses two EDMA channels. The first will read from a fixed location in the memory, which is the received data register (DRR) of the MCBSP port, to a buffer in the memory that will hold those samples. The second will write from a buffer in the memory to a fixed location that is the transmit register (DXR) of the MCBSP port.
Samples are send/received to/from the CODEC in an interleaved mode. The EDMA receive channel sorts the samples and place the samples of each channel placed in consecutive addresses in the data memory. A symmetric process occurs in the opposite direction. Figure 7 describes the process of receiving samples and Figure 8 describes the process of transmitting samples. Once a buffer is received/transmitted a Callback (please refer to section ) function is called, activating the signal processing procedures.
The driver consists of 4 files:
Those files should be integrated with a user file, explained in the next section.
The driver interface is implemented in the user defined file. This file consists of the main program and the callback processing function.
The driver allocates a handle to the chain of CODECs, initializes it and afterwards activates the components.
This file:
The user is required to create a callback function were the processing is implemented. This function receives pointers to two buffers as arguments; one buffer contains the latest information read from the CODECs, while the second will contain the data to be written to the CODECs. The callback function template is shown:
Notification Switch
Would you like to follow the 'From matlab and simulink to real-time with ti dsp's' conversation and receive update notifications?