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

VB: Ret = AioSetAoCallBackProc(Id, AddressOf CallBackProc, AOE_END, 0)
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 factors that can be used differ between the device buffer and user buffer.

Event Factor

When Using Device Buffer

When Using User Buffer

Macro

Value

Event that DA conversion start

OK

OK

AOE_START

00000002H

Event that repeat end

OK

OK

AOE_RPTEND

00000010H

Event that device operation end

OK

OK

AOE_END

00000020H

Event that the specified number of data are outputted

OK

NG

AOE_DATA_NUM

00000080H

Event that the specified number of data are transferred

NG

OK

AOE_DATA_TSF

00000100H

Event that generating clock period error

OK

OK

AOE_SCERR

00020000H

Event that DA conversion error

OK

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 the specified number of data are transferred
This event occurs each time the number of data are transferred, which is set by function AioSetAoEventTransferTimes.
When using [Event that the specified number of data are transferred], use function AioSetAoEventTransferTimes to set the number of transfer times for generating event.

Ret = AioSetAoEventTransferTimes ( Id , AoTransferTimes )

In AoTransferTimes, set the number of transfer times for generating event.

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.