You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
724 B
30 lines
724 B
#include <fstream>
|
|
#include <functional>
|
|
#include <iostream>
|
|
#include <list>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <set>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <vector>
|
|
using namespace std;
|
|
|
|
int main(int argc, char const *argv[]) {
|
|
//
|
|
cout << "============== Rockchip gpio computer ==============" << endl;
|
|
|
|
while (true) {
|
|
int gpiopinNum = 0;
|
|
int pingroup = 0;
|
|
char pinsubgroup = 0;
|
|
int pinoff = 0;
|
|
printf("Please input gpio pin name: GPIO");
|
|
fflush(stdout);
|
|
scanf("%d-%c%d", &pingroup, &pinsubgroup, &pinoff);
|
|
gpiopinNum = pingroup * 32 + (pinsubgroup - 'A') * 8 + pinoff;
|
|
printf("GPIO%d-%c%d -> GPIO%d\n", pingroup, pinsubgroup, pinoff, gpiopinNum);
|
|
}
|
|
|
|
return 0;
|
|
}
|