Commit 4f6ddc0f authored by Joshua Supra's avatar Joshua Supra
Browse files

.

parent 7d3bde1f
......@@ -28,10 +28,7 @@
int thread_nr;
/**
* Starting main below
*
*/
int main (int argc, char *argv[]){
// sleep(10);
......@@ -43,7 +40,6 @@ int main (int argc, char *argv[]){
zmq_data *zmq_recive_data[2];
int NrOfBytesReceived[2];
//NrOfBytesReceived[0] = -1;
pilcIOGpioStruct PilcIoGpios;
STOP = false;
signal(SIGINT, sigint_handler);
......@@ -52,9 +48,6 @@ int main (int argc, char *argv[]){
* access */
initpilc2(IOCards);
/* read the GPIO config and project parameters */
GetGpioConfig(&PilcIoGpios);
/* Initialize the IO data direction and set the corresponding IO component
* */
IOMuxAutoConfig(IOCards);
......
......@@ -5,9 +5,5 @@
void sigint_handler(int sig);
int getNRofGates(char *nrofgatesASCII);
#endif
......@@ -31,13 +31,15 @@
/****************************************************************************/
/**
*
* @brief Initialisation function for the PiLC 2. Calling the function will
* initialize the SPI to the pripherie e.g. IO cards. It also
* initializes the connection to the FPGA Register space. After
* success the inserted IO cards will be checked.
* Initialisation function for the PiLC 2. Calling the function will initialize
* the SPI to the pripherie e.g. IO cards. It also initializes the connection
* to the FPGA Register space. After success the inserted IO cards will be
* checked.
*
* @return None
*
* @note None.
*
*****************************************************************************/
void initpilc2(IOCardStruct *IOCard){
int status;
......@@ -58,8 +60,6 @@ void initpilc2(IOCardStruct *IOCard){
InitIOCards(IOCard);
//pthread_t thread_id;
//pthread_create(&thread_id, NULL, CheckIOCards, NULL);
}
......@@ -73,8 +73,6 @@ void initpilc2(IOCardStruct *IOCard){
*
* @return None
*
* @note None.
*
*****************************************************************************/
void deinitpilc2(void){
int status;
......@@ -96,8 +94,8 @@ void deinitpilc2(void){
* @param *pilcIOcfg pointer to project config struct
*
* @return 0 on success
*
* @note None.
*
* @note maybe deprecated
*
*****************************************************************************/
int GetGpioConfig(pilcIOGpioStruct *pilcIOcfg){
......@@ -117,15 +115,13 @@ int GetGpioConfig(pilcIOGpioStruct *pilcIOcfg){
/*****************************************************************************/
/**
*
* @brief This function reads every IO card slot via SPI and stores the card
* infomation in the IO card struct.
* This function reads every IO card slot via SPI and stores the card infomation
* in the IO card struct.
*
* @param *IOCard is the pointer to the IOCardStruct array
*
* @return The number of found IO cards.
*
* @note None.
*
******************************************************************************/
void setIODDR(unsigned int channel, unsigned int config) {
......@@ -139,39 +135,7 @@ void setIODDR(unsigned int channel, unsigned int config) {
}
/****************************************************************************/
/**
*
* This function formats the over SPI read card ID to a printable ASCII string.
*
*
* @param IOCard_ID is the ID of the inserted card
*
* @return The name of the inserted card as ASCII string
*
* @note None.
*
*****************************************************************************/
const char* IOCardType(unsigned char IOCard_ID){
const char* Card_Name;
/* check for card type */
switch (IOCard_ID) {
case 0x01: Card_Name = "IO NIM/TTL card"; break;
case 0x02: Card_Name = "ADC card"; break;
case 0x03: Card_Name = "DAC card"; break;
case 0x04: Card_Name = "PT resistor card"; break;
case 0x05: Card_Name = "Adapter Card"; break;
case 0x06: Card_Name = "Potential-free card"; break;
case 0x07: Card_Name = "Differential ADC card"; break;
case 0x08: Card_Name = "Thermocouple card"; break;
default: Card_Name = 0; break;
}
/* return card name */
return Card_Name;
}
/*****************************************************************************/
/**
......@@ -183,7 +147,6 @@ const char* IOCardType(unsigned char IOCard_ID){
*
* @return The number of found IO cards.
*
* @note None.
*
******************************************************************************/
int InitIOCards (IOCardStruct *IOCard){
......@@ -233,7 +196,6 @@ int InitIOCards (IOCardStruct *IOCard){
*
* @return 0
*
* @note None.
*
******************************************************************************/
int GetIOCardStatus(IOCardStruct *IOCard)
......@@ -256,14 +218,13 @@ int GetIOCardStatus(IOCardStruct *IOCard)
/*****************************************************************************/
/**
*
* @brief This function reads the register of each card depending on their
* purpose.
* This function reads the register of each inserted card depending on their
* type and stores the value in the IOCardStruct.
*
* @param *IOCard is the pointer to the IOCardStruct array
*
* @return The number of found IO cards.
*
* @note None.
*
******************************************************************************/
int GetIOCardRegister(IOCardStruct *IOCard)
......@@ -302,21 +263,19 @@ int GetIOCardRegister(IOCardStruct *IOCard)
}
/*****************************************************************************/
/**
*
* @brief This function sets the IO config of the selected channel, including
* data direction, function and level and configuring the inserted IO
* card.
* This function sets the IO config of the selected channel, including data
* direction, function and level and configuring the inserted IO card.
*
* @param channel is the channel to be addressed
* @param - channel is the channel to be addressed
*
* direction is the set direction, 0: input 1: output
* - direction is the set direction, 0: input 1: output
*
* function sets the IO multiplexer
* - function sets the IO multiplexer
*
* level can be either NIM or TTL
* - level can be either NIM or TTL
*
* @return 0
*
......
......@@ -45,7 +45,6 @@
void deinitpilc2(void);
const char* IOCardType(unsigned char IOCard_HW_vers);
int IOCardSelftest (void);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment