Commit b7ac4280 authored by Joshua Supra's avatar Joshua Supra
Browse files

changed led inhibit to write reg function

parent ddd67b57
......@@ -56,42 +56,7 @@ int main (int argc, char *argv[]){
* */
IOMuxAutoConfig(IOCards);
/*setIOMuxCfg(PILC_IO_MUX_CFG_CH_0, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_1, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_2, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_3, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_4, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_5, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_6, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_7, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_8, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_9, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_10, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_11, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_12, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_13, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_14, IO_MUX_CFG_ENCODER);
setIOMuxCfg(PILC_IO_MUX_CFG_CH_15, IO_MUX_CFG_ENCODER);*/
setIOConfig(0, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(1, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(2, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(3, 1, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_OUT);
setIOConfig(4, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(5, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(6, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(7, 1, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_OUT);
setIOConfig(8, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(9, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(10, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(11, 1, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_OUT);
setIOConfig(12, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(13, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(14, 0, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_IN);
setIOConfig(15, 1, IO_MUX_CFG_LOGIC, IOCARD_NIMTTL_TTL_OUT);
InitIOCards(IOCards);
zmq_recive_data[1] = malloc (sizeof(zmq_data));
......@@ -109,10 +74,7 @@ int main (int argc, char *argv[]){
* TEST Functions
**************************************************************************/
setLogicCfg(LOGIC_CFG_CH_0, 0x000100) ;
setLogicCfg(LOGIC_CFG_CH_3, 0x010100) ;
//setLogicCfg(unsigned int channel, unsigned int config)
/**************************************************************************
......
......@@ -441,6 +441,12 @@ void getNIMTTLcolour(int card_slot, led_color_struct *led_color) {
muxcfg = getIOMuxCfg(card_slot);
switch (muxcfg) {
case IO_MUX_CFG_CTR:
led_color->Green = 8;
break;
case IO_MUX_CFG_ENCODER:
led_color->Green = 8;
break;
case IO_MUX_CFG_LOGIC:
if (card_slot < 16) logicfg = GetLogicCfg(LOGIC_CFG_CH_3);
if (card_slot < 12) logicfg = GetLogicCfg(LOGIC_CFG_CH_2);
......
......@@ -89,7 +89,6 @@ int FunctionCall(zmq_data *zmq_data_struct){
case GET_DATA:value = PiLC2GetRamData(funcArg[0],funcArg[1],zmq_data_struct->socket);break;
case GET_IO_CARDS:value = PiLC2GetIOCards(zmq_data_struct);break;
case GET_PILC_INET:value = getPiLCinet(zmq_data_struct);break;
case LED_SET_INHIBIT: LedSetInhibit(zmq_data_struct);break;
case INIT_IO_CARDS: PiLC2InitIOCards();break;
}
if(value == 1){
......@@ -459,27 +458,6 @@ int getPiLCinet(zmq_data *zmq_data_struct){
}
/*
* Function: LedSetInhibit
* --------------------
* Network function for calling the front panel led inhibit.
*
* * zmq_data_struct: pointer to the zmq struct of the calling socket.
*
*/
void LedSetInhibit(zmq_data *zmq_data_struct) {
unsigned int inhibit;
/* Extract LED inhibit mask */
inhibit = zmq_data_struct->data[2];
/* Write LED inhibit register */
InhibitFrontLED(inhibit);
}
/*
* Function: PiLC2InitIOCards
* --------------------
......
......@@ -18,7 +18,7 @@
#define GET_DATA 0x5
#define GET_IO_CARDS 0x6
#define GET_PILC_INET 0x7
#define LED_SET_INHIBIT 0x8
#define INIT_IO_CARDS 0x9
typedef struct {
......@@ -43,7 +43,6 @@ int GetNrOfData(zmq_data *zmq_data_struct);
int PiLC2GetRamData(unsigned int RAMBaseAddress, unsigned int numofdata, void *socket);
int PiLC2GetIOCards(zmq_data *zmq_data_struct);
int getPiLCinet(zmq_data *zmq_data_struct);
void LedSetInhibit(zmq_data *zmq_data_struct);
void PiLC2InitIOCards(void);
void *context;
......
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