AM64x MCU+ SDK  08.02.00
iPNDrv.h File Reference

Go to the source code of this file.


#define PRU_IEP_CMP_CFG_EN_SOG_EVENTS   0x000001cf /*sets cmp0, cmp2/5/6/7*/
#define NO_RCV_NO_FWD   0
#define RCV_NO_FWD   1
#define NO_RCV_FWD   2
#define RCV_FWD   3
#define OFF   0
#define UP   2
#define RUN   4
#define DISABLED   0
#define BLOCKING   1
#define FORWARDING   2
#define watchDogExpireDuration   100


int32_t PN_initDrv (PN_Handle pnHandle)
 Initializes the Profinet Driver. More...
void PN_getFirmwareVersion (uint32_t *version_major, uint32_t *version_minor, uint32_t *version_build, uint32_t *version_release_type)
 Get the details on version of firmware. More...
void PN_getFirmwareReleaseInfoAndFeatures (uint32_t *firmware_release_1, uint32_t *firmware_release_2, uint32_t *firmware_feature_mask)
 Get the details on release information and features of firmware. More...
int32_t PN_setDcpFilterStationName (PRUICSS_HwAttrs const *pruicssHwAttrs, const uint8_t *dcpNameOfStation, uint8_t lengthOfStationName)
 API to configure the station name and length of station name of device for filtering DCP Identify requests. More...
int32_t PN_MRP_setPortState (PRUICSS_HwAttrs const *pruicssHwAttrs, uint8_t portNumber, uint8_t pState)
 API to set the MRP state for a port. More...
int32_t PN_MRP_getPortState (PRUICSS_HwAttrs const *pruicssHwAttrs, uint8_t portNumber, uint8_t *pState)
 Returns the MRP state of a port. More...
int32_t PN_mapPhaseToProfile (PRUICSS_HwAttrs const *pruicssHwAttrs, int32_t portNumber, int32_t phaseNumber, int32_t profileNumberRx, int32_t profileNumberTx)
 API to map a Phase to start of green Profile. More...
int32_t PN_setMaxLineRxDelay (PRUICSS_HwAttrs const *pruicssHwAttrs, uint8_t portNumber, int32_t maxLineRxDelayValue)
 API to configure the maximum line receive delay. More...
int32_t PN_setMaxBridgeDelay (PRUICSS_HwAttrs const *pruicssHwAttrs, int32_t maxBridgeDelayValue)
 API to configure the maximum bridge delay. This value comes from the GSD file. More...
int32_t PN_setYellowPeriod (PRUICSS_HwAttrs const *pruicssHwAttrs, int32_t yellowPeriodTime)
 API to configure the yellow period. More...
int32_t PN_setProfile (PRUICSS_HwAttrs const *pruicssHwAttrs, int32_t portNumber, int32_t profileNumber, int32_t rxSoGValue, int32_t txSoGValue)
 API to configure a Profile. In a profile the start of green time in a cycle for Receive (Rx) and Transmit (Tx) is set for a port. More...
void PN_setCompensationValue (PRUICSS_HwAttrs const *pruicssHwAttrs, uint16_t compensationValue)
 API to configure the compensation value which is used while computing the forward FSO for a RTC3 frame which has to be forwarded. More...
int32_t PN_setRedGuard (PRUICSS_HwAttrs const *pruicssHwAttrs, uint16_t validLowerFrameId, uint16_t validUpperFrameId)
 API to set the Red Guard for the device. More...
int32_t PN_setRtc3PortStatus (PRUICSS_HwAttrs const *pruicssHwAttrs, uint8_t portNumber, uint8_t status)
 API to set the RTClass3 port status of a port. More...
int32_t PN_setStaticFilterTable (PRUICSS_HwAttrs const *pruicssHwAttrs, const uint8_t *macAddr, uint8_t ctrl, uint8_t portNumber, uint8_t table)
 API to enable/disable the reception & forward for a Multicast address in port multicast filter tables. More...
int32_t PN_setWatchDogTimer (PN_Handle pnHandle, int32_t timerPeriod)
 API to configure the ICSS watchdog expiry duration. More...
int32_t PN_loadStaticTable (PRUICSS_HwAttrs const *pruicssHwAttrs, const uint32_t *staticTable, uint8_t staticTableLength, uint8_t staticTableType, uint8_t portNumber)
 PN_loadStaticTable API to load multicast static table to ICSS memory. More...
void PN_cpmIsrHandler (void *arg)
 Profinet CPM ISR handler. More...
void PN_ppmIsrHandler (void *arg)
 Profinet PPM ISR handler. More...
void PN_dhtIsrHandler (void *arg)
 Profinet DHT ISR handler. More...
void PN_PTCP_isrHandler (void *arg)
 Profinet PTCP ISR handler. More...

Macro Definition Documentation



Error code for Wrong station name length



Error code for Wrong firmware version



Error code for failure in firmware loading



Error code for failure in initializing driver


#define PRU_IEP_CMP_CFG_EN_SOG_EVENTS   0x000001cf /*sets cmp0, cmp2/5/6/7*/


#define NO_RCV_NO_FWD   0

No receive and no forward


#define RCV_NO_FWD   1

Receive but no forward


#define NO_RCV_FWD   2

No receive but forward


#define RCV_FWD   3

Receive and forward


#define OFF   0

RTClass3 status values of a port

◆ UP

#define UP   2

RTClass3 status values of a port


#define RUN   4

RTClass3 status values of a port

Function Documentation

◆ PN_initDrv()

int32_t PN_initDrv ( PN_Handle  pnHandle)

Initializes the Profinet Driver.

Sets the Port MAC addresses
Sets the Compensation value
Initialize the RTC driver
Initialize the PTCP driver
Set MRP port state
Loads the forward and receive multicast tables
Loads the Profinet firmware

pnHandleProfinet Handle
Return values
0on success
Error codes :

◆ PN_getFirmwareVersion()

void PN_getFirmwareVersion ( uint32_t *  version_major,
uint32_t *  version_minor,
uint32_t *  version_build,
uint32_t *  version_release_type 

Get the details on version of firmware.

version_majorReference to get the major version number
version_minorReference to get the minor version number
version_buildReference to get the version build number
version_release_typeReference to get the firmware release type

◆ PN_getFirmwareReleaseInfoAndFeatures()

void PN_getFirmwareReleaseInfoAndFeatures ( uint32_t *  firmware_release_1,
uint32_t *  firmware_release_2,
uint32_t *  firmware_feature_mask 

Get the details on release information and features of firmware.

firmware_release_1Reference to get the details from ICSS_FIRMWARE_RELEASE_1
firmware_release_2Reference to get the details from ICSS_FIRMWARE_RELEASE_2
firmware_feature_maskReference to get the firmware feature mask

◆ PN_MRP_setPortState()

int32_t PN_MRP_setPortState ( PRUICSS_HwAttrs const *  pruicssHwAttrs,
uint8_t  portNumber,
uint8_t  pState 

API to set the MRP state for a port.

[in]pruicssHwAttrsPRUICSS HW Attributes for base addresses
[in]portNumberPort for which MRP state has to be configured
[in]pStateThere are three valid values of the MRP port state
Return values
0on success

◆ PN_MRP_getPortState()

int32_t PN_MRP_getPortState ( PRUICSS_HwAttrs const *  pruicssHwAttrs,
uint8_t  portNumber,
uint8_t *  pState 

Returns the MRP state of a port.

[in]pruicssHwAttrsPRUICSS HW Attributes for base addresses
[in]portNumberPort number whose MRP port state has to be returned
[in]pStateReference to the MRP port state of the port
Return values
0on success