beautypg.com

Acrosser AR-B104D User Manual

Page 8

background image

AR-B104D Software Programming Guide

4

XXX_SetCallbackFunc (i16 CardNum, agc_callback_t func)

Argument

CardNum: The card number of AR-B104D. Range from 1~4.

func: The callback function pointer.

Example

void IOIST(event Event)

{

switch( Event.Type )

{

case INPUT:

printf("Get input event: Channel %d is %s.\n", Event.Channel,

(Event.Value)? "high":"low");

break;

case COUNTER_TO:

printf("Get counter timeout event: Counter %d, value = %d.\n",

Event.Channel, Event.Value);

break;

case COUNTER_OF:

printf("Get counter overflow event: Counter %d.\n", Event.Channel);

break;

case PG_FIN:

printf("Get pluse generator finish event: PG %d.\n", Event.Channel);

break;

case TIMER_FIN:

printf("Get timer finish event: Timer %d.\n", Event.Channel);

break;

case COUNTER_REACH:

printf("Get counter reach event: Counter %d.\n", Event.Channel,

Event.Value);

}