Minimum calculations at run time
Maximum calculations at and before compile time
C++
GPIO scripts
Board and CPU definitions
Definitions generator for each CPU and Board
(calculations before compile time)
Example usung for each CPU and Board
Example of using GPIO for all CPUs and Boards
Template for new CPUs and boards
Allwinner H2+ (Datasheet) (Example)
Broadcom BCM2835 (Datasheet) (Example)
Texas Instruments AM335x (Manual)
BananaPi P2 Zero (BPI-P2 Zero) (Datasheet) (Example)
BeagleBone Black (Datasheet)
Raspberry Pi Zero rev 1.3 (Datasheet) (Example)
https://github.com/cortl0/device
make
make clean
make install
make uninstall
Qt build
#include "board/bpi_p2_zero/bpi_p2_zero.h"
int main()
{
gpio::cpu _cpu(BASE_ADDRESS_GPIO);
_cpu.write_bits(CON2_P10_CFG_REG, CON2_P10_CFG_BIT, P_SELECT_INPUT, P_SELECT_LENGTH);
_cpu.write_bits(CON2_P10_PUL_REG, CON2_P10_PUL_BIT, P_PULL_DOWN, P_PULL_LENGTH);
bool state_CON2_P10 = _cpu.read_bit(CON2_P10_DAT_REG, CON2_P10_DAT_BIT);
_cpu.write_bits(CON2_P07_CFG_REG, CON2_P07_CFG_BIT, P_SELECT_OUTPUT, P_SELECT_LENGTH);
bool state_CON2_P07 = HIGH;
_cpu.write_bit (CON2_P07_DAT_REG, CON2_P07_DAT_BIT, state_CON2_P07);
return 0;
}
Ilya Shishkin
mailto:cortl@8iter.ru
https://github.com/cortl0/gpio
This project is licensed under the GPL v3.0 - see the LICENSE file for details