/* --------------------------------------------------------------------------- * analogue_test.c (c) 2008 Micro-key bv * --------------------------------------------------------------------------- * Micro-key bv * Industrieweg 28, 9804 TG Noordhorn * Postbus 92, 9800 AB Zuidhorn * The Netherlands * Tel: +31 594 503020 * Fax: +31 594 505825 * Email: support@microkey.nl * Web: www.microkey.nl * --------------------------------------------------------------------------- * Description: * --------------------------------------------------------------------------- * Version(s): 0.1, Dez 11, 2008, MMi * Creation. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * System include files * --------------------------------------------------------------------------- */ #include /* --------------------------------------------------------------------------- * Application include files * --------------------------------------------------------------------------- */ #include "analogue_test.h" #include "smc4000io.h" #include "BusProtocol.h" #include "protocolfunctions.h" /* --------------------------------------------------------------------------- * Local constant and macro definitions * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Global variable definitions * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Local variable definitions * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Local function definitions * --------------------------------------------------------------------------- */ void analogueWrite (UINT8 senderId, UINT8 targetId, UINT8 requestNr, UINT8 functionId, UINT8 nrOfParams, UINT32 *params) { /* nrOfParams = 2 * params[0]: analogue output channel number * params[1]: analogue output value */ printf ("Called function: analogueWrite"); // system ("cat aioWrite0_0); } void analogueWriteAll (UINT8 senderId, UINT8 targetId, UINT8 requestNr, UINT8 functionId, UINT8 nrOfParams, UINT32 *params) { /* nrOfParams = 2 * params[0]: board type (0: MB, 1: EB) * params[1]: digital output value (0: LOW, !0: HIGH) */ printf ("Called function: analogueWriteAll"); /* Release analogue semaphore on calling device with result function */ bpSendRpcResult(bushandler, REMOTEDEVICENUMBER, 21, 1, 0, NULL); } void analogueRead (UINT8 senderId, UINT8 targetId, UINT8 requestNr, UINT8 functionId, UINT8 nrOfParams, UINT32 *params) { INT32 dioReadResult; /* nrOfParams = 1 * params[0]: analogue output channel number */ printf ("Called function: analogueRead"); // system ("echo dioWrite0_0); bpSendRpcResult(bushandler, REMOTEDEVICENUMBER, 11, 1, 1, &dioReadResult); } void analogueReadAll (UINT8 senderId, UINT8 targetId, UINT8 requestNr, UINT8 functionId, UINT8 nrOfParams, UINT32 *params) { /* nrOfParams = 1 * params[0]: board type (0: MB, 1: EB) */ INT32 aioReadAllResult[NUMBEROFAI_MB]; UINT8 channelcnt; if (params[0] == 0) { channelcnt = NUMBEROFAI_MB; } else if (params[0] == 1) { channelcnt = NUMBEROFAI_EB; } printf ("Called function: analogueReadAll"); // system ("echo dioWrite0_0); bpSendRpcResult(bushandler, REMOTEDEVICENUMBER, 14, 1, channelcnt, aioReadAllResult); } void analogueMB_test_execute (void) { printf ("THIS IS THE ANALOGUE TEST SEQUENCE"); } void analogueEB_test_execute (void) { printf ("THIS IS THE ANALOGUE TEST SEQUENCE"); }