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
702 B
30 lines
702 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;
|
|
printf("Please input gpio pin number: \n");
|
|
scanf("%d", &gpiopinNum);
|
|
int pingroup = gpiopinNum / 32;
|
|
int pinsubgroup = gpiopinNum % 32 / 8;
|
|
char pinsubgroup_c = 'A' + pinsubgroup;
|
|
int pinoff = gpiopinNum % 8;
|
|
|
|
printf("GPIO%d -> GPIO%d-%c%d\n", gpiopinNum, pingroup, pinsubgroup_c, pinoff);
|
|
}
|
|
|
|
return 0;
|
|
}
|