libpruio  0.6.8
Fast and easy Digital/Analog Input/Output for Beaglebones
pruss_add.bas File Reference

Example: minimal code for PRUSS firmware. More...

#include "BBB/pruio.bi"
#include "BBB/pruio_pins.bi"
#include "BBB/pruio_prussdrv.bi"
Include dependency graph for pruss_add.bas:

Go to the source code of this file.

Functions

FUNCTION_AS_Int32 load_firmware (BYVAL_AS_UInt32 IRam)
 load firmware to PRU More...
 
int main ()
 

Variables

VAR io = NEW PruIo(PRUIO_ACT_PRU1)
 create new driver structure
 
UInt32 pru_num
 which pru to use
 
UInt32 pru_iram
 ID of its instruction ram.
 
UInt32 pru_dram
 ID of its data ram.
 
UInt32 pru_intr
 ID of its interrupt.
 
UInt32_PTR dram
 a pointer to PRU data ram
 

Detailed Description

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: fbc -Wall pruss_add.bas

Since
0.6.2

Definition in file pruss_add.bas.

Function Documentation

◆ load_firmware()

FUNCTION_AS_Int32 load_firmware ( BYVAL_AS_UInt32  IRam)

load firmware to PRU

Parameters
IRamThe IRam ID for the PRU to use
Returns
Zero on success, otherwise -1

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
Since
0.6.2

Definition at line 46 of file pruss_add.bas.

Here is the call graph for this function:

◆ main()

int main ( )

The main function.

Definition at line 127 of file pruss_add.bas.

Here is the call graph for this function: