dSPACE DS1103 ERP I/O Driver : Handling I/O Signals : The stm_ds1103_init_ADC() Function

The stm_ds1103_init_ADC() Function

The stm_ds1103_init_ADC() function performs the following tasks:

The ADC channels are numbered from 1 to 20. If there is an invalid channel number, mapping is cancelled and the driver generates an error message. For example, in the Rational Statemate I/O mapping table, an element is specified as an input or output signal. Because the ADC signal is an input port, if there is a contradiction with the definition in Rational Statemate, an error message is generated and mapping is cancelled.

Model elements that are mapped to an ADC signal should be of type real or integer. In every other case, the driver generates an error message. Refer to Signal Types for information about Rational Statemate to dSPACE mapping.

Note that the first 16 channels are organized in 4 multiplexers. Every multiplexer has to be initialized with a selected channel. Multiplexer number 1 handles channels 1 to 4, multiplexer number 2 handles channels 5 to 8, and so on.