These functions trigger the data conversion by software command. The driver provides two kinds of functions. One is for single channel reading, the other is for multiple channels reading. Both kinds of operations acquire the data only once. To sample multiple data periodically by these functions, a software timer can be used to call the functions periodically. For a more efficient and faster continuous data acquisition, interrupt or DMA mode transferring may be used.
DRV_AIConfig configures the input range for the specified channel. If the input range needs to be changed at runtime, use the DRV_AIConfig function again. The DRV_AIVoltageIn function reads the voltage of input channels. The Device Drivers also provide a binary data reading function, DRV_AIBinaryIn. The DRV_AIScale function can be used to convert the binary data into voltage.
The functions for multiple channel sampling are similar to those for single data reading, except the input channel is not limited to one.
The DRV_MAIConfig function configures the input ranges for the specified channels. The DRV_MAIVoltageIn function reads voltage data and keeps them in an array. DRV_MAIBinaryIn reads binary data. The DRV_AIScale function can be used to convert the binary data into voltage.