-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPIOControl.cpp
More file actions
30 lines (24 loc) · 741 Bytes
/
Copy pathPIOControl.cpp
File metadata and controls
30 lines (24 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <iostream>
#include "DE1SoCfpga.h"
#include "PIOControl.h"
#include <unistd.h>
using namespace std;
PIOControl::PIOControl():DE1SoCfpga() {
cout << "made PIOControl Object" << endl;
in_regValue = RegisterRead(IN_BASE);
out_regValue = RegisterRead(OUT_BASE);
}
int PIOControl::ReadAllPIOin() {
int sws = RegisterRead(IN_BASE); //use the object to access registerread
in_regValue = sws;
//cout << "IN_BASE: " << IN_BASE << "int: " << sws << endl;
return sws;
}
void PIOControl::WritePIOout(int value) {
//write the specified value to the board's led
RegisterWrite(OUT_BASE, value);
out_regValue = value;
}
PIOControl::~PIOControl() {
cout << "Closing PIOs......." << endl;
}