AT91SAM7X Framework
|
external interface of AT91SAM7X ADC peripheral driver More...
Functions | |
UCHAR | AdcInitUnit (UCHAR ucUnit, UCHAR ucChannel, OS_ID oiSemMsgNew, USHORT usChannelMask, ULONG ulMsgMask, ULONG ulMsgChangeMask) |
initialize a unit | |
UCHAR | AdcInitChannel (UCHAR ucUnit, UCHAR ucChannel, struct _SAdcCfgChannel *pSCfgChannel, UCHAR ucCfgChannelCnt) |
initialize a channel of a previously initialized unit | |
USHORT | AdcMsgUnit (UCHAR ucUnit, UCHAR ucChannel, ULONG ulMsg, USHORT usDecrement, U16 u16Timeout) |
retrieve message counters of a unit | |
USHORT | AdcMsgChannel (UCHAR ucUnit, UCHAR ucChannel, ULONG ulMsg, USHORT usDecrement, U16 u16Timeout) |
retrieve message counters of a channel | |
USHORT | AdcRx (UCHAR ucUnit, UCHAR ucChannel, void *pvData, USHORT usCount, U16 u16Timeout) |
retrieve (and remove) data of a channel | |
UCHAR | AdcWait (UCHAR ucUnit, UCHAR ucChannel, U16 u16Timeout) |
pend for ready data of a channel |
external interface of AT91SAM7X ADC peripheral driver
UCHAR AdcInitChannel | ( | UCHAR | ucUnit, |
UCHAR | ucChannel, | ||
struct _SAdcCfgChannel * | pSCfgChannel, | ||
UCHAR | ucCfgChannelCnt | ||
) |
initialize a channel of a previously initialized unit
ucUnit | number of the unit (descriptor array index [not the hardware index] of adcdev.h) |
ucChannel | (optional, set to 0 as default) offset to add to channel number in array element of struct _SAdcCfgChannel |
*pSCfgChannel | pointer to array of struct _SAdcCfgChannel which contains the channel(s)s configuration |
ucCfgChannelCnt | count of channels to configure from array of struct _SAdcCfgChannel |
Example: send/give the specified semaphore for every limit band change to below/above and min/max but for every sampled value when inside the normal band:
Example: send/give the specified semaphore for every sampled value when outside the normal band but for normal band itsself only when changed to it:
UCHAR AdcInitUnit | ( | UCHAR | ucUnit, |
UCHAR | ucChannel, | ||
OS_ID | oiSemMsgNew, | ||
USHORT | usChannelMask, | ||
ULONG | ulMsgMask, | ||
ULONG | ulMsgChangeMask | ||
) |
initialize a unit
ucUnit | number of the unit (descriptor array index [not the hardware index] of adcdev.h) |
ucChannel | (unused, set 0) number of the sub-channel for units tree(s) |
oiSemMsgNew | (optional, set to NULL as default) OS_ID of pre-initialized (to 0!) semaphore to send/give for matching messages |
usChannelMask | (optional, set to 0 as default) triggered channels to take into account for unit semaphore triggering |
ulMsgMask | (optional, set to NULL as default) and-mask to include triggered channels' messages for unit semaphore triggering |
ulMsgChangeMask | (optional, set to NULL as default) mask to suppress (bit set) same message triggering and to trigger only for a message change |
Example: merge all channel semaphores to a single unit semaphore you need:
Manual reference(s):
AT91SAM7X manual 35.6.6 page 498: ADC_SR
USHORT AdcMsgChannel | ( | UCHAR | ucUnit, |
UCHAR | ucChannel, | ||
ULONG | ulMsg, | ||
USHORT | usDecrement, | ||
U16 | u16Timeout | ||
) |
retrieve message counters of a channel
ucUnit | number of the unit (descriptor array index [not the hardware index] of adcdev.h) |
ucChannel | number of the channel |
ulMsg | message bits to retrieve count for (refer to AT91SAM7X manual 35.6.6 page 498: ADC_SR and trigger message bits of adc.h) |
usDecrement | decrement count (0 for no decrement) for selected message bits (var type's max value #USHRT_MAX just clears the counter(s)) |
u16Timeout | maximum cpu-load free resource pending time before any resource claim is canceled by the rtos (in ticks) |
Manual reference(s):
AT91SAM7X manual 35.6.6 page 498: ADC_SR
USHORT AdcMsgUnit | ( | UCHAR | ucUnit, |
UCHAR | ucChannel, | ||
ULONG | ulMsg, | ||
USHORT | usDecrement, | ||
U16 | u16Timeout | ||
) |
retrieve message counters of a unit
ucUnit | number of the unit (descriptor array index [not the hardware index] of adcdev.h) |
ucChannel | (unused, set 0) number of the sub-channel for units tree(s) |
ulMsg | message bits to retrieve (refer to AT91SAM7X manual 35.6.6 page 498: ADC_SR and trigger message bits of adc.h) |
usDecrement | decrement count (0 for no decrement) for selected message bits (var type's max value #USHRT_MAX just clears the counter(s)) |
u16Timeout | maximum cpu-load free resource pending time before any resource claim is canceled by the rtos (in ticks) |
Manual reference(s):
AT91SAM7X manual 35.6.6 page 498: ADC_SR
USHORT AdcRx | ( | UCHAR | ucUnit, |
UCHAR | ucChannel, | ||
void * | pvData, | ||
USHORT | usCount, | ||
U16 | u16Timeout | ||
) |
retrieve (and remove) data of a channel
ucUnit | number of the unit (descriptor array index [not the hardware index] of adcdev.h) |
ucChannel | number of the channel |
pvData | pointer to data storage (type ADC_MEMITEMTYPE of adc.h) |
usCount | count of data to retrieve (only 1 allowed here) |
u16Timeout | maximum cpu-load free resource pending time before any resource claim is canceled by the rtos (in ticks) |
UCHAR AdcWait | ( | UCHAR | ucUnit, |
UCHAR | ucChannel, | ||
U16 | u16Timeout | ||
) |
pend for ready data of a channel
ucUnit | number of the unit (descriptor array index [not the hardware index] of adcdev.h) |
ucChannel | number of the channel |
u16Timeout | maximum cpu-load free resource pending time before any resource claim is canceled by the rtos (in ticks) |