Callback Function

Use function AioSetAoCallBackProc to register the callback function.

Ret = AioSetAoCallBackProc ( Id , CallBackProc , AoEvent , Param)

In CallBackProc, specify the pointer of the created callback function.
Please set for each language as follows.

When callback function name is CallBackProc
VC: Ret = AioSetAoCallBackProc(Id, CallBackProc, AOE_END, this);

In AoEvent, specify the event factor by macro or numeric value from the following range.
AoEvent has the following meaning in bit units, and can be specified by combined them.

Event Factor

When Using Device Buffer

Macro

Value

Event that DA conversion start

OK

AOE_START

00000002H

Event that repeat end

OK

AOE_RPTEND

00000010H

Event that device operation end

OK

AOE_END

00000020H

Event that the specified number of data are outputted

OK

AOE_DATA_NUM

00000080H

Event that generating clock period error

OK

AOE_SCERR

00020000H

Event that DA conversion error

OK

AOE_ADERR

00040000H

Event that DA conversion start
This event occurs when the start condition of DA conversion is satisfied.
This event is invalid when the conversion start condition is [Software].

 

Event that repeat end
This event occurs each time the repeat operation ends.

 

Event that device operation end
This event occurs when all operations including repeat are completed.

 

Event that the specified number of data are outputted
For FIFO memory, an event occurs when the number of generating times in memory decreases the value set by the function AioSetAoEventSamplingTimes.
An event occurs each time the condition is satisfied.

For RING memory, an event occurs when the number of generating times output from memory matches the value set by the function AioSetAoEventSamplingTimes.
Events corresponding to the number of repeat times are generated.

Ret = AioSetAoEventSamplingTimes ( Id , AoSamplingTimes )

In AoSamplingTimes, set the number of generating times for generating event.

For FIFO memory, an event occurs each time the condition is satisfied.
For RING memory, events corresponding to the number of repeat times are generated.

 

Event that generating clock period error
This event occurs when the generating clock period is too fast and the conversion stops.

 

Event that DA conversion error
This event occurs when conversion stops due to an DA conversion error.

 

In Param, set a parameter to be passed to the callback function with a pointer.