Logic Analyzer RPi
Logic Analyzer for the Raspberry Pi
 All Classes Files Functions Variables Pages
logic_input.h
1 #include <time.h>
2 //#include <stdio.h>
3 //#include <string.h>
4 //#include <stdlib.h>
5 #include <bcm2835.h>
6 //#include <mgl/mgl_fltk.h>
7 #include <mgl/mgl_zb.h>
8 //#include <unistd.h>
9 
10 #ifndef DEBUG_H
11 #define DEBUG_H
12 #include "debug.h"
13 #endif
14 
15 typedef enum
16 {
17  LOWV = 0,
18  HIGHR = 1,
19  ERR = 2,
20  HIGHV = 3,
21 }logic_state;
22 
24 class logic_input : public mglDraw
25 {
26 public:
28 
29  logic_input(uint8_t npin=0,uint8_t * pins=NULL,uint32_t npoint=0,float delay=0);
31 
33  void init_acquisition(uint8_t * pins, uint8_t npin=0);
35 
37  void acquire(uint32_t npoint=0,float delay=0);
39  ~logic_input();
41 
44  int Draw(mglGraph *gr,const char *label[]=NULL, uint8_t pin_stats=0);
46 
47  const void Save(const char *filename);
49 
50  void Load(const char *filename);
52  void Clean();
53 
54 //private:
56  uint32_t npoint;
58  uint8_t npin;
60  uint8_t *pins;
62 
63  mglData *rawdata;
65 
66  mglData t;
67 };
68