Programmable Real-Time Unit and Industrial Communication Subsystem(PRUICSS) driver provides a well-defined API layer which allows applications to use the PRUICSS. PRUICSS is firmware programmable and can take on various personalities like Industrial Protocol Switch (for protocols like EtherCAT, Profinet, EtherNet/IP), Ethernet Switch, Ethernet MAC, Industrial Drives, etc.
Features Supported
- PRU control features: like enabling/disabling/resetting a Programmable Real-Time Units (PRU0 and PRU1), Auxiliary Programmable Real-Time Units (RTU_PRU0 and RTU_PRU1) or Transmit Programmable Real-Time Units (TX_PRU0 and TX_PRU1) core
- Loading the firmware in PRU cores
- Read/Write/Reset different memories inside PRUICSS
- PRU and Host Event management. It does mapping of sys_evt/channel/hosts in the INTC module. APIs to register interrupt handler for events, generate an event, wait for occurrence of an event, and clear an event.
- Basic configurations in registers like GPCFG, MII_RT_G_CFG, ICSSG_SA_MX
- IEP clock selection, IEP counter enable/disable, IEP counter increment configuration
- PRU Constant Table Configuration
SysConfig Features
- Note
- It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
- Option to select the PRU-ICSS instance
- Option to select the Core Clock Frequency
- Based on above parameters, the SysConfig generated code does following:
- Call PRUICSS_init in System_init, and PRUICSS_deinit in System_deinit
- Enable the Core Clock and set the selected frequency
- Create macros like
CONFIG_PRU_ICSSG1
using the name passed in SysConfig. This is used as an input to PRUICSS_open API.
Example Usage
Include the below file to access the APIs
Instance Open Example
Sequence for loading a firmware on PRU and running the PRU core
pruEvtoutNum,
intrNum,
eventNum,
waitEnable,
irqHandler);
0,
(uint32_t *) pruFirmware,
pruFirmwareLength);
API
APIs for PRUICSS