Documentation
¶
Overview ¶
Package pru-rp provides a Go library to access the Programmable Real-time Units (PRU) of the TI AM335x (https://www.ti.com/processors/sitara-arm/applications/industrial-communications.html) The commonly available product with this part is the Beaglebone Black (https://beagleboard.org/black)
The RemoteProc (https://software-dl.ti.com/processor-sdk-linux/esd/docs/08_00_00_21/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/RemoteProc.html) framework is used, which is standard on recent Linux kernels, and optional on earlier (<4.19) kernels
This package does not include any support for developing or building the PRU firmware; for that, the standard TI PRU S/W support package should be used (https://git.ti.com/cgit/pru-software-support-package).
Complete documentation is available via https://github.com/aamcrae/pru-rp, and through godoc at https://pkg.go.dev/github.com/aamcrae/pru-rp
Index ¶
- Constants
- Variables
- func Duration(ticks int) time.Duration
- func MicroSeconds2Ticks(m int) int
- func Ticks(d time.Duration) int
- type PRU
- func (p *PRU) Callback(f func([]byte)) error
- func (p *PRU) Close()
- func (p *PRU) Load(name string) error
- func (p *PRU) Ram() (*RamIO, error)
- func (p *PRU) Send(buf []byte) error
- func (p *PRU) SharedRam() (*RamIO, error)
- func (p *PRU) Start(rpmsg bool) error
- func (p *PRU) Status() Status
- func (p *PRU) Stop() error
- type RamIO
- func (r *RamIO) Read(p []byte) (int, error)
- func (r *RamIO) ReadAt(p []byte, offs int64) (int, error)
- func (r *RamIO) ReadByte() (byte, error)
- func (r *RamIO) Seek(offs int64, whence int) (int64, error)
- func (r *RamIO) Write(p []byte) (int, error)
- func (r *RamIO) WriteAt(p []byte, offs int64) (int, error)
- func (r *RamIO) WriteByte(b byte) error
- type Status
Constants ¶
const (
RpBufSize = 512
)
Device paths etc.
Variables ¶
var Order = binary.LittleEndian
Functions ¶
func MicroSeconds2Ticks ¶
Return the number of instruction cycles for the microseconds specified.
Types ¶
type PRU ¶
type PRU struct {
// contains filtered or unexported fields
}
func (*PRU) Callback ¶
Callback sets the callback for any events This must be set before the PRU is started.
func (*PRU) Load ¶
Load writes the name of the firmware to be loaded. This is a file that resides in /lib/firmware. If the PRU is currently running, it is stopped first.
func (*PRU) Ram ¶
Ram creates a type that can use a Reader/Writer interface to the underlying byte array of this PRU's RAM.
func (*PRU) SharedRam ¶
SharedRam creates a type that can use a Reader/Writer interface to the underlying byte array for the shared PRU RAM.
type RamIO ¶
type RamIO struct { Memory []byte // contains filtered or unexported fields }
RamIO implements various io interfaces, using an underlying byte array.