Git Product home page Git Product logo

gopru's Introduction

gopru

Pure go implementation of pru app loader for beaglebone black. C source of Pruss app loader (the inspiration for this)

The quality of this code is hacked at best (at the moment). See prussdrv_test.go for usage.

gopru is licensed under the two-clause BSD license. See LICENSE.txt.

example usage

package main

import (
	"github.com/mikelikespie/gopru"
	"log"
)

func main() {

	drv, err := pruss.InitDrv()
	if err != nil {
		log.Panicln("Error initializing:", err)
	}

	defer func() {
		err := drv.Close()
		if err != nil {
			log.Panicln("Error closing:", err)
		}
	}()

	// Open the interrupt.  One needs the listener to wait on them later
	listener, err := drv.OpenInterrupt(pruss.PRU_EVTOUT_0); 
	if err != nil {
		log.Panicln("Error opening interrupt:", err)
	}

	if err = drv.InitInterrupts(); err != nil {
		log.Panicln("Error initializing interrupts:", err)
	}

	pru := drv.Pru(0)
	if err = pru.ExecProgram("my_program.bin"); err != nil {
		log.Panicln("Error executing image:", err)
	}
	defer pru.Disable()


	// Wait for the program to send an interrupt
	listener.Wait()
	drv.ClearEvent(pruss.PRU0_ARM_INTERRUPT)
}

pasm wrapper

the pasm directory contains a port of the pasm assembler (from https://github.com/beagleboard/am335x_pru_package/tree/master/pru_sw/utils/pasm_source). It is modified to be callable via cgo. This allows for testing to be much easier for gopru. (see prussdrv_test.go for example)

pasm's license can be found in pasm/LICENSE.txt

gopru's People

Contributors

mikelikespie avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.