|
In these very simple example we are switching 3 leds on and off.
Scheme of connecting the 3 leds to the connector of the RaspberryPI.
Test PCB with RaspberryPI A+ and 3 leds.
Example switching LEDs for RaspberryPI (A, B, A+, B+): RPI_switching_leds.zip
Example switching LEDs for RaspberryPI 2: RPI2_switching_leds.zip
The unit "PReg.pas" ist a low level basic unit to read and write the peripheral register of the RaspberryPI. The two procedures based on the ultibo core unit "Platform.pas".
URL:https://github.com/ultibohub/Core
The list of constants are based of the "R_PI.INC" on the folowing Project:
RaspberryPi ===========
Raspberry Pi &
Raspberry Pi 2 Bare Metal Code by krom (Peter Lemon).
All code
compiles out of box with the FASMARM assembler by revolution:
http://arm.flatassembler.net
I have included binaries of all the demos.
URL:https://github.com/PeterLemon/RaspberryPi
The unit "RGPIO.pas" is the next level and build up the unit "PReg.pas". With this unit can be:
"procedure GPIO_OUT_Init(GPIO_pin : LongWord);" - initializing the GPIOs for write access
"procedure GPIO0_Set;" ... "procedure GPIO53_Set;" - set the GPIOs to "1"
"procedure GPIO0_Clear;" ... "procedure GPIO53_Clear;" - clear the GPIOs to "0"
"procedure GPIO_IN_Init(GPIO_pin : LongWord);" - initializing the GPIOs for read access
"function GPIO0_Read : Boolean;" ... "function GPIO53_Read : Boolean;" - read one GPIO-pin