18 #include "libpruio/pruio.h"
19 #include "libpruio/pruio_pins.h"
20 #include "libpruio/pruio_prussdrv.h"
62 {printf(
"failed loading instructions\n");
return -1;}
68 int main(
int argc,
char **argv)
77 printf(
"initialisation failed (%s)\n",
io->Errr);
break;}
93 printf(
"prussdrv_open failed\n");
break;}
109 printf(
"instructions loaded, starting PRU-%d\n",
pru_num);
117 {printf(
"Test OK %d == %d + (%d * %d)\n",
dram[0],
dram[1],
dram[2],
dram[3]);}
119 {printf(
"Test failed: %d != %d + (%d * %d)\n",
dram[0],
dram[1],
dram[2],
dram[3]);}
VAR io
create new driver UDT
unsigned int uint32
32 bit unsigned integer data type.
int int32
32 bit signed integer data type.
pruIo * pruio_new(uint16 Act, uint8 Av, uint32 OpD, uint8 SaD)
Wrapper function for the constructor PruIo::PruIo().
void pruio_destroy(pruIo *Io)
Wrapper function for the destructor PruIo::~PruIo().
@ PRUIO_ACT_PRU1
Activate PRU-1 (= default, instead of PRU-0).
#define PRU1_ARM_INTERRUPT
System event PRU-1 -> ARM.
#define PRUSS0_PRU0_IRAM
ID for PRU-0 instruction ram.
#define PRUSS0_PRU1_DRAM
ID for PRU-1 data ram.
#define PRU_EVTOUT_0
ID for host interrupt 0.
#define PRU0_ARM_INTERRUPT
System event PRU-0 -> ARM.
#define PRUSS0_PRU1_IRAM
ID for PRU-1 instruction ram.
#define PRUSS0_PRU0_DRAM
ID for PRU-0 data ram.
int32 prussdrv_pru_disable(uint32 prunum)
See prussdrv_pru_disable(BYVAL_AS_UInt32 PruId)
#define prussdrv_pru_enable(N)
Macro for variadic parameter list.
void prussdrv_pru_clear_event(uint32 host_interrupt, uint32 sysevent)
See prussdrv_pru_clear_event(BYVAL_AS_UInt32 Irq, BYVAL_AS_UInt32 Event)
uint32 prussdrv_pru_wait_event(uint32 host_interrupt)
See prussdrv_pru_wait_event(BYVAL_AS_UInt32 Irq)
int32 prussdrv_open(uint32 host_interrupt)
See prussdrv_open(BYVAL_AS_UInt32 Irq)
int32 prussdrv_pru_write_memory(uint32 pru_ram_id, uint32 wordoffset, const uint32 *memarea, uint32 bytelength)
See prussdrv_pru_write_memory(BYVAL_AS_UInt32 RamId, BYVAL_AS_UInt32 Offs, BYVAL_AS_CONST_UInt32_PTR ...
int32 prussdrv_map_prumem(uint32 pru_ram_id, void **address)
See prussdrv_map_prumem(BYVAL_AS_UInt32 RamId, BYVAL_AS_ANY_PTR_PTR Addr)
UInt32 pru_intr
ID of its interrupt.
UInt32_PTR dram
a pointer to PRU data ram
UInt32 pru_num
which pru to use
UInt32 pru_iram
ID of its instruction ram.
UInt32 pru_dram
ID of its data ram.
int main(int argc, char **argv)
The main function.
int32 load_firmware(uint32 IRam)
load firmware to PRU
Wrapper structure for PruIo.