/* --------------------------------------------------------------------------- * protocolfunctions.h - v0.1 (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, Jun 2, 2008, MMi * Creation. * --------------------------------------------------------------------------- */ #ifndef __PROTOCOLTEST_H__ #define __PROTOCOLTEST_H__ /* --------------------------------------------------------------------------- * System include files. * --------------------------------------------------------------------------- */ #include "LPC23xx.h" #include "types.h" /* FreeRTOS includes */ #include "FreeRTOS.h" #include "task.h" #include "semphr.h" /* --------------------------------------------------------------------------- * Application include files. * --------------------------------------------------------------------------- */ #include "Bus.h" /* --------------------------------------------------------------------------- * Constant and macro definitions. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Type definitions. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Variable declarations. * --------------------------------------------------------------------------- */ int handleBus1; UINT8 remoteDeviceNumber; UINT8 thisDeviceNumber; xSemaphoreHandle generalSemaphore; xSemaphoreHandle slaveRestartSemaphore; /* --------------------------------------------------------------------------- * Function declarations. * --------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------- * Function: protocolInit * * Function to calibrate slaves Voltage Output * * Parameters: t_bus_devices BUS_ID - ID of the BUS system * UINT32 DEV_ID - ID of the local Device * UINT32 MAX_ID - Max ID in System * * Return: void * --------------------------------------------------------------------------- */ void protocolInit (t_bus_devices BUS_ID, UINT32 DEV_ID, UINT32 MAX_ID); /* --------------------------------------------------------------------------- * Function: availableBusID * * Function that just calls a Result on the Caller. It's just a Handshake * * Parameters: UINT8 senderId - ID of Caller * UINT8 targetId - ID of Target * UINT8 requestNr - Number of the request * UINT8 functionId - Numer of function to call * UINT8 nrOfParams - Number of attached Paramters * UINT32 *params - Attached Paramters * * Return: void * --------------------------------------------------------------------------- */ void availableBusID (UINT8 senderId, UINT8 targetId, UINT8 requestNr, UINT8 functionId, UINT8 nrOfParams, UINT32 *params); /* --------------------------------------------------------------------------- * Function: generalResultfunction * * Function that is called be Slave on the Master to release a Semaphore * * Parameters: UINT8 requestNr - number of the request * UINT8 nrOfResult - Number of Attached Results * UIN32 *results - Attached Results * * Return: void * --------------------------------------------------------------------------- */ void generalResultFunction (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results); /* --------------------------------------------------------------------------- * Function: testResultfunction * * Function that is called be Slave for telling a Test Result * * Parameters: UINT8 requestNr - number of the request * UINT8 nrOfResult - Number of Attached Results * UIN32 *results - Attached Results * * Return: void * --------------------------------------------------------------------------- */ void testResultFunction (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results); /* --------------------------------------------------------------------------- * Function: slaveRestartfunction * * Function that is called be Slave on the Master to tell about a Restart * * Parameters: UINT8 requestNr - number of the request * UINT8 nrOfResult - Number of Attached Results * UIN32 *results - Attached Results * * Return: void * --------------------------------------------------------------------------- */ void slaveRestartFunction (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results); /* --------------------------------------------------------------------------- * Function: UINT32ResultFunction * * Function to receive a UINT32 Result from Slave. Result is stored then in * the global variable UINT32 UINT32result * * Parameters: UINT8 requestNr - number of the request * UINT8 nrOfResult - Number of Attached Results * UIN32 *results - Attached Results * * Return: void * --------------------------------------------------------------------------- */ void UINT32ResultFunction (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results); /* --------------------------------------------------------------------------- * Function: receiveRemoteAttachedFunctions * * Function to receive and print the name of a attached remote function * * Parameters: UINT8 requestNr - number of the request * UINT8 nrOfResult - Number of Attached Results * UIN32 *results - Attached Results * * Return: void * --------------------------------------------------------------------------- */ void receiveRemoteAttachedFunctions (UINT8 requestNr, UINT8 nrOfResults, UINT32 *results); #endif /* __PROTOCOLTEST_H__ */