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

added Fifoser Status/Gate left register

parent 31d5b9d1
......@@ -63,6 +63,7 @@ int main (int argc, char *argv[]){
PiLC2CounterEnableCounter();
setFifoSerCfg(0);
initContCounter();
init_network();
......@@ -145,17 +146,11 @@ int main (int argc, char *argv[]){
free(zmq_recive_data[0]);
pthread_mutex_destroy(&lock);
/* Deinit the continous counter mode only when it has been initialized */
if(initContCounterDone == 1){
deinitContCounter();
}
free(zmq_recive_data[1]->data);
free(zmq_recive_data[1]);
deinit_network();
deinitContCounter();
deinit_IOleds();
deinitpilc2();
......
......@@ -25,6 +25,7 @@
#include "pilc2_pt100.h"
#include "pilc2_IO_mux.h"
#include "pilc2_logic.h"
#include "pilc2_fifoser.h"
/******************************************************************************/
/**
......@@ -305,15 +306,22 @@ void *updateIOLeds(void *vargp) {
WorkLEDcounter ++;
unsigned int run_status;
run_status = FifoSerGetStatus();
if (WorkLEDcounter == 2) {
WorkLEDcounter = 0;
}
if (WorkLEDcounter < 1){
WriteFrontLED(16, 0,5,0);
WriteFrontLED(17, 0,0,0);
if (run_status == 0) WriteFrontLED(16, 0,0,0);
if (run_status == 6) WriteFrontLED(16, 0,0,0);
if (run_status == 10) WriteFrontLED(16, 0,3,0);
WriteFrontLED(17, 0,3,0);
}else {
WriteFrontLED(16, 0,0,0);
WriteFrontLED(17, 0,5,0);
if (run_status == 0) WriteFrontLED(16, 0,3,0);
if (run_status == 6) WriteFrontLED(16, 3,3,0);
if (run_status == 10) WriteFrontLED(16, 3,3,0);
WriteFrontLED(17, 0,0,0);
}
unsigned int led_brightness;
......
......@@ -22,14 +22,16 @@
char *uiod_cdma;
/*************************** Function Prototypes ******************************/
unsigned int dma_set(unsigned int* dma_virtual_address, int offset,
unsigned int value);
unsigned int dma_get(unsigned int* dma_virtual_address, int offset);
void dma_status(unsigned int* dma_virtual_address);
/*************************** Function Prototypes ******************************/
int PiLC2CDMAInit(char *uiod, void **cdma_ptr);
void PiLC2CDMAWrite(void *cdma_base, unsigned int offset,
unsigned int value);
......
......@@ -43,3 +43,8 @@ int setFifoSerChCfg(unsigned int channel, unsigned int config)
return 0;
}
int FifoSerGetStatus(void)
{
return ReadFPGA(PILC_FIFOSER_OFFSET+FIFOSER_STATUS_REG);
}
\ No newline at end of file
......@@ -15,6 +15,8 @@
#define FIFOSER_CTRL_REG 0x0
#define FIFOSER_GATETHR 0x1
#define FIFOSER_STATUS_REG 0x2 //r
#define FIFOSER_GATELFT 0x3 //r
#define FIFOSER_CH_0 0x0
#define FIFOSER_CH_1 0x1
......@@ -43,3 +45,4 @@
/*************************** Function Prototypes ******************************/
int setFifoSerCfg(unsigned int config);
int setFifoSerChCfg(unsigned int channel, unsigned int config);
int FifoSerGetStatus(void);
\ No newline at end of file
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