AM64x MCU+ SDK  08.00.00
iPNDrv.h File Reference

Go to the source code of this file.

Macros

#define ERR_STATION_NAME_LENGTH   -1
 
#define ERR_FIRMWARE_VERSION_BAD   -2
 
#define ERR_FIRMWARE_LOAD_FAIL   -3
 
#define ERR_DRIVER_INIT_FAIL   -4
 
#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
 

Functions

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

◆ ERR_STATION_NAME_LENGTH

#define ERR_STATION_NAME_LENGTH   -1

Error code for Wrong station name length

◆ ERR_FIRMWARE_VERSION_BAD

#define ERR_FIRMWARE_VERSION_BAD   -2

Error code for Wrong firmware version

◆ ERR_FIRMWARE_LOAD_FAIL

#define ERR_FIRMWARE_LOAD_FAIL   -3

Error code for failure in firmware loading

◆ ERR_DRIVER_INIT_FAIL

#define ERR_DRIVER_INIT_FAIL   -4

Error code for failure in initializing driver

◆ PRU_IEP_CMP_CFG_EN_SOG_EVENTS

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

◆ NO_RCV_NO_FWD

#define NO_RCV_NO_FWD   0

No receive and no forward

◆ RCV_NO_FWD

#define RCV_NO_FWD   1

Receive but no forward

◆ NO_RCV_FWD

#define NO_RCV_FWD   2

No receive but forward

◆ RCV_FWD

#define RCV_FWD   3

Receive and forward

◆ OFF

#define OFF   0

RTClass3 status values of a port

◆ UP

#define UP   2

RTClass3 status values of a port

◆ RUN

#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

Parameters
pnHandleProfinet Handle
Return values
0on success
Error codes :
ERR_DRIVER_INIT_FAIL
ERR_FIRMWARE_VERSION_BAD

◆ 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.

Parameters
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.

Parameters
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.

Parameters
[in]pruicssHwAttrsPRUICSS HW Attributes for base addresses
[in]portNumberPort for which MRP state has to be configured
ICSS_EMAC_PORT_1 (1)
ICSS_EMAC_PORT_2 (2)
[in]pStateThere are three valid values of the MRP port state
DISABLED
BLOCKING
FORWARDING
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.

Parameters
[in]pruicssHwAttrsPRUICSS HW Attributes for base addresses
[in]portNumberPort number whose MRP port state has to be returned
ICSS_EMAC_PORT_1 (1)
ICSS_EMAC_PORT_2 (2)
[in]pStateReference to the MRP port state of the port
Return values
0on success