MATLAB EMBEDDED IDE LINK 4 - FOR USE WITH TEXAS INSTRUMENTS CODE COMPOSER STUDIO Especificaciones Pagina 109

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 126
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 108
Reviewing the C Source Code
Connecting to I/O Devices
7-5
while (TRUE) {
/* Read a new volume when the hosts send it */
if (!RTDX_channelBusy(&control_channel)){
RTDX_readNB(&control_channel, &volume, sizeof(volume));
}
while (!RTDX_isInputEnabled(&A2D_channel)){
RTDX_Poll(); /* poll comm channel for input */
}
/*
* A2D: get digitized input (get signal from the host through
* RTDX). If A2D_channel is enabled, read data from the host.
*/
RTDX_read(&A2D_channel, input, size*sizeof(sample));
/*
* Vector Scale: Scale the input signal by the volume factor to
* produce the output signal.
*/
while(size--){
*output++ = *input++ * volume;
}
size = BUFSIZE;
input = inp_buffer;
output = out_buffer;
/*
* D2A: produce analog output (send signal to the host through
* RTDX). If D2A_channel is enabled, write data to the host.
*/
RTDX_write(&D2A_channel, output, size*sizeof(sample));
while(RTDX_writing){
RTDX_Poll(); /* poll comm channel for output */
}
}
}
Vista de pagina 108
1 2 ... 104 105 106 107 108 109 110 111 112 113 114 ... 125 126

Comentarios a estos manuales

Sin comentarios