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

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

Go to the source code of this file.

Functions

def pruss_add.load_firmware (IRam)
 Load firmware into PRUSS instruction ram. More...
 

Variables

 pruss_add.io = pruio_new(PRUIO_DEF_ACTIVE, 4, 0x98, 0)
 Create a ctypes pointer to the pruio structure.
 
 pruss_add.IO = io.contents
 The pointer dereferencing, using contents member.
 
int pruss_add.pru_num = 0
 The PRU subsystem we use.
 
 pruss_add.pru_iram = PRUSS0_PRU0_IRAM
 The instruction ram ID of PRU subsystem.
 
 pruss_add.pru_dram = PRUSS0_PRU0_DRAM
 The direct access ram ID of PRU subsystem.
 
 pruss_add.pru_intr = PRU0_ARM_INTERRUPT
 The interrupt we use.
 
 pruss_add.dram = pointer(c_uint32(0))
 The pointer to the PRU direct access 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

Run by: python pruss_add.py

Since
0.6.4

Definition in file pruss_add.py.

Function Documentation

◆ load_firmware()

def pruss_add.load_firmware (   IRam)

Load firmware into PRUSS instruction ram.

Parameters
IRamThe IRam ID for the PRU to use
Returns
Zero on success, otherwise error raising

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 41 of file pruss_add.py.