Example: minimal code for PRUSS firmware. More...
#include "stdio.h"
#include "string.h"
#include "libpruio/pruio.h"
#include "libpruio/pruio_pins.h"
#include "libpruio/pruio_prussdrv.h"
Go to the source code of this file.
Functions | |
int32 | load_firmware (uint32 IRam) |
load firmware to PRU More... | |
int | main (int argc, char **argv) |
The main function. More... | |
Example: minimal code for PRUSS firmware.
This file contains an short and simple example for parallel usage of the other PRUSS. Find a functional description in section pruss_add.
Licence: GPLv3, Copyright 2018-2023 by Thomas{ doT ]Freiherr[ At ]gmx[ DoT }net
Compile by: gcc -Wall -o pruss_add pruss_add.c -lpruio
Definition in file pruss_add.c.
load firmware to PRU
IRam | The IRam ID for the PRU to use |
The instructions are compiled by command
pasm -V3 -c pruss_add.p
from source code (named pruss_add.p)
.origin 0 LDI r0, 0 start: LBBO r1, r0, 4, 16 // load parameters in r1 (start value), r2 (add value), r3 (count), r4 (interrupt) LOOP finished, r3.w0 ADD r1, r1, r2 // compute result finished: SBBO r1, r0, 0, 4 // store result MOV r31.b0, r4.b0 // send notification to host HALT JMP start
Definition at line 49 of file pruss_add.c.
int main | ( | int | argc, |
char ** | argv | ||
) |
The main function.
create new driver structure
Definition at line 68 of file pruss_add.c.