EasyManua.ls Logo

Texas Instruments TMS320

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Stream I/O—Reading and Writing Streams
Streaming I/O and Device Drivers 7-11
Example 7.5. Basic SIO Function (continued)
* ======== doStreaming ========
* This function is the body of the pre-created TSK thread
* streamTask.
*/
Void doStreaming(Uns nloops)
{
Int i, j, nbytes;
Int *buf;
status = SIO_staticbuf(input, (Ptr *)&buf);
if (status ! = SYS_ok) {
SYS_abort(“could not acquire static frame:);
}
for (i = 0; i < nloops; i++) {
if ((nbytes = SIO_get(input, (Ptr *)&buf)) < 0) {
SYS_abort("Error reading buffer %d", i);
}
LOG_printf(&trace, "Read %d bytes\nBuffer %d data:",
nbytes, i);
for (j = 0; j < nbytes / sizeof(Int); j++) {
LOG_printf(&trace, "%d", buf[j]);
}
}
LOG_printf(&trace, "End SIO example #1");
}

Table of Contents

Other manuals for Texas Instruments TMS320

Related product manuals