QuadroCopter  0.1.4
overlayBase.h
Go to the documentation of this file.
1 //
2 // Created by Michael Brookes on 21/05/2016.
3 /*
4 Copyright (C) 2017 Michael Brookes
5 
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #include <iostream>
21 #include <exception>
22 #include <sstream>
23 #include <string>
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <fcntl.h>
27 #include <unistd.h>
28 #include <sys/stat.h>
29 #include <pthread.h>
30 
31 #ifndef ANALOGDEVICE_OVERLAYS_H
32 #define ANALOGDEVICE_OVERLAYS_H
33 
34 #define RETRIES 99
35 //#define DEBUG
36 
37 #define SLOTS_DIR "/sys/devices/bone_capemgr.9/slots"
38 
39 namespace quadro {
40 
41  namespace overlays {
42 
43  enum pinBlocks {
44  BLOCK_P9 = 9,
45  BLOCK_P8 = 8,
46  };
47 
51  enum PWMPins {
52  PIN_42 = 42,
53  PIN_22 = 22,
54  PIN_19 = 19,
55  PIN_14 = 14,
56  };
57 
58  using namespace std;
59 
60  class overlayBase {
61  public:
62  overlayBase();
63 
64  bool isLoaded( const char* searchFile );
65 
66  bool load( const char* Overlay );
67 
69 
70  char errMessage[1024];
71 
72  struct stat sb;
73 
74  };
75 
76  }
77 
78 }
79 
80 #endif //ANALOGDEVICE_OVERLAYS_H
P8 on your BBB | USB facing you, P8 is the pin block on the right hand side.
Definition: overlayBase.h:45
Definition: overlayBase.h:60
int fileHandle
Definition: overlayBase.h:68
GPIO PWM Pin Number 42.
Definition: overlayBase.h:52
pinBlocks
Definition: overlayBase.h:43
GPIO PWM Pin Number 22.
Definition: overlayBase.h:53
GPIO PWM Pin Number 19.
Definition: overlayBase.h:54
GPIO PWM Pin Number 14.
Definition: overlayBase.h:55
Definition: aeronautics.h:23
P9 on your BBB | USB facing you, P9 is the pin block on the left hand side.
Definition: overlayBase.h:44
PWMPins
PinNum refers to a exposed PWM Pin on your BBB, this enum can be expanded to include more if required...
Definition: overlayBase.h:51