Go to the source code of this file.
Macros | |
#define | INTERFACE_MAC 0 |
#define | PORT1_MAC 1 |
#define | PORT2_MAC 2 |
Functions | |
void | PN_setHandle (PN_Handle pnHandle) |
Stores the local copy of handle to support legacy APIs. More... | |
PN_Handle | PN_getPnHandle () |
Returns the ICSS EMAC LLD handle. This is used to maintain the old APIs that doesn't use the Handle based scheme. More... | |
uint8_t | PN_EmacSocMACAddrGet (PN_Handle pnHandle, uint8_t instance, uint8_t *macId) |
Returns the MAC Addr for ports. User can implement this as required. More... | |
int32_t | setStaticFilterTable (const uint8_t *macAddr, uint8_t ctrl, uint8_t portNumber, uint8_t table) |
Legacy API. Calls PN_setStaticFilterTable. More... | |
int32_t | setRtc3PortStatus (uint8_t portNumber, uint8_t status) |
Legacy API, calls PN_setRtc3PortStatus. More... | |
uint8_t * | getLastCpm (t_rtcPacket *pkt) |
Legacy API. Calls PN_getLastCpm. More... | |
int32_t | setRedGuard (uint16_t validLowerFrameId, uint16_t validUpperFrameId) |
Legacy API. Calls PN_setRedGuard. More... | |
int32_t | setMaxLineRxDelay (uint8_t portNumber, int32_t maxLineRxDelayValue) |
Legacy API. Calls PN_setMaxLineRxDelay. More... | |
int32_t | setMaxBridgeDelay (int32_t maxBridgeDelayValue) |
Legacy API. Calls PN_setMaxBridgeDelay. More... | |
int32_t | setYellowPeriod (int32_t yellowPeriodTime) |
Legacy API. Calls PN_setYellowPeriod. More... | |
int32_t | mapPhaseToProfile (int32_t portNumber, int32_t phaseNumber, int32_t profileNumberRx, int32_t profileNumberTx) |
Legacy API. Calls PN_mapPhaseToProfile. More... | |
int32_t | setProfile (int32_t portNumber, int32_t profileNumber, int32_t rxSoGValue, int32_t txSoGValue) |
Legacy API. Calls PN_setProfile In a profile the start of green time in a cycle for Receive (Rx) and Transmit (Tx) is set for a port. More... | |
int32_t | setDcpFilterStationName (const uint8_t *dcpNameOfStation, uint8_t lengthOfStationName) |
Legacy API. Calls PN_setDcpFilterStationName. More... | |
int32_t | TxPacketOS (const uint8_t *srcAddress, int32_t portNumber, int32_t queuePriority, int32_t lengthOfPacket) |
Legacy API. Calls PN_OS_txPacket. More... | |
int32_t | PN_RxPktInfo (int32_t *portNumber, int32_t *queueNumber) |
int32_t | PN_RxPktGet (uint32_t destAddress, int32_t queueNumber, int32_t *port, int32_t *more) |
uint8_t | PN_findMAC (uint8_t *macId) |
Legacy API calls findMAC. More... | |
int32_t | setCpmDHT (uint16_t dht, uint8_t pos) |
Legacy API. Calls PN_setCpmDHT. More... | |
int32_t | setBaseClock (uint16_t factor) |
Legacy API, calls PN_setBaseClock. More... | |
int32_t | clearList (uint8_t list) |
int32_t | iRtcEnableIsr () |
Enables the PN interrupts. Legacy API. Calls PN_RTC_enableISR. More... | |
int32_t | delPmList (t_rtcPacket *pmPkt) |
Legacy API. Calls PN_delPmList. More... | |
int32_t | insPpmList (t_rtcPacket *ppmPkt, uint8_t legMode) |
Legacy API. Calls PN_insPpmList. More... | |
int32_t | insCpmList (t_rtcPacket *cpmPkt) |
Legacy API. Calls PN_insCpmList. More... | |
void | configureSync0Pin () |
void | ptcpConfigureSyncFwd (ptcpPortStatus_t state) |
Legacy API, calls PN_PTCP_configureSyncFwd. More... | |
void | PN_EmacRegisterProtocolCallback (void *callBackPtr, void *userArg) |
Legacy API, Used to register RX Callback. More... | |
void | PN_EmacRegisterPort0ISRCallback (ICSS_EMAC_CallBack callBack, void *userArg) |
Legacy API, Used to register Link ISR Callback. More... | |
void | PN_EmacRegisterPort1ISRCallback (ICSS_EMAC_CallBack callBack, void *userArg) |
Legacy API, Used to register Link ISR Callback. More... | |
void | PN_purgeTable (uint8_t portNum) |
Legacy API, Used to purgeTable. More... | |
int32_t | setMrpPortState (uint8_t portNumber, uint8_t pState) |
Legacy API, Used to call PN_MRP_setPortState. More... | |
int32_t | getMrpPortState (uint8_t portNumber, uint8_t *pState) |
Legacy API, Used to call PN_MRP_getPortState. More... | |
int32_t | cfgRtcMem (uint8_t ar, uint16_t size) |
Legacy API. Calls PN_cfgRtcMem. More... | |
int32_t | allocPkt (t_rtcPacket **pPkt, uint8_t type) |
Legacy API, Used to call PN_allocPkt. More... | |
void | ptcpGetSyncInfo (ptcpSyncInfo_t *syncInfo) |
Legacy API, Used to call PN_PTCP_getSyncInfo. More... | |
void | ptcpRegisterDelayUpdateCall (ptcpCallBack_t callBack) |
Legacy API, Used to call PN_PTCP_registerDelayUpdateCall. More... | |
void | ptcpRegisterSyncStatusCall (ptcpCallBack_t callBack) |
Legacy API, Used to call PN_PTCP_registerSyncStatusCall. More... | |
void | ptcpSetPllWindow (uint32_t pllWindowSize) |
Legacy API, Used to call PN_PTCP_setPllWindow. More... | |
void | ptcpSetSyncTimeoutFactor (uint32_t syncTimeoutFactor) |
Legacy API, Used to call PN_PTCP_registerSyncStatusCall. More... | |
void | ptcpSetSyncUUID (uint8_t *subdomainUUID) |
Legacy API, Used to call PN_PTCP_setSyncUUID. More... | |
void | registerCpmCall (pnCallBack_t callBack) |
Legacy API, Used to call PN_registerCpmCall. More... | |
void | registerStatCall (pnCallBack_t callBack) |
Legacy API, Used to call PN_registerStatCall. More... | |
uint8_t * | relPpmBuff (t_rtcPacket *pkt) |
Legacy API, Used to call PN_relPpmBuff. More... | |
int32_t | rtcDisableISR () |
Legacy API, Used to call PN_RTC_disableISR. More... | |
#define INTERFACE_MAC 0 |
Interface macid index
#define PORT1_MAC 1 |
Port1 macid index
#define PORT2_MAC 2 |
Port2 macid index
void PN_setHandle | ( | PN_Handle | pnHandle | ) |
Stores the local copy of handle to support legacy APIs.
pnHandle | Profinet Handle |
PN_Handle PN_getPnHandle | ( | ) |
Returns the ICSS EMAC LLD handle. This is used to maintain the old APIs that doesn't use the Handle based scheme.
returns | Profinet Handle |
uint8_t PN_EmacSocMACAddrGet | ( | PN_Handle | pnHandle, |
uint8_t | instance, | ||
uint8_t * | macId | ||
) |
Returns the MAC Addr for ports. User can implement this as required.
pnHandle | Profinet Handle | |
instance | Port ID - INTERFACE_MAC, PORT1_MAC, PORT2_MAC | |
[out] | macId | stores the MACID in the pointer |
E_FAIL | on failure, S_PASS on success |
int32_t setStaticFilterTable | ( | const uint8_t * | macAddr, |
uint8_t | ctrl, | ||
uint8_t | portNumber, | ||
uint8_t | table | ||
) |
Legacy API. Calls PN_setStaticFilterTable.
[in] | macAddr | MAC Address for which the reception or forward has to be enabled or disabled Following are the valid ranges of multicast addresses: (01-0E-CF-00-00-00 TO 01-0E-CF-00-05-FF) (01-15-4E-00-00-00 TO 01-15-4E-00-00-1F) (01-80-C2-00-00-00 TO 01-80-C2-00-00-1F) |
[in] | ctrl | A MAC address can be configured using one of four valid configuration for reception and foward For example, if MAC address is called with NO_RCV_NO_FWD then it's reception and forwarding will be disabled NO_RCV_NO_FWD RCV_NO_FWD NO_RCV_FWD RCV_FWD |
[in] | portNumber | Port on which reception and forwarding is configured for a MAC address PORT1 (1) PORT2 (2) |
[in] | table | There are two sets of table one for BLOCKING state and second one for FORWARDING state BLOCKING FORWARDING |
0 | on success |
int32_t setRtc3PortStatus | ( | uint8_t | portNumber, |
uint8_t | status | ||
) |
Legacy API, calls PN_setRtc3PortStatus.
If the status of a port is set to UP or RUN then firmware internally enables Phase Management on that port.
[in] | portNumber | Port whose status has to be configured PORT1 (1) PORT2 (2) |
[in] | status | There are three valid values of the RTClass3 port status OFF UP RUN |
0 | on success |
uint8_t* getLastCpm | ( | t_rtcPacket * | pkt | ) |
Legacy API. Calls PN_getLastCpm.
pkt | pointer to packet object |
int32_t setRedGuard | ( | uint16_t | validLowerFrameId, |
uint16_t | validUpperFrameId | ||
) |
Legacy API. Calls PN_setRedGuard.
Received RTC3 frames are dropped if their FID doesn't fall in the range set by the Red Guard.
[in] | validLowerFrameId | Lower value of RTC3 FID for the Red Guard Valid range is 0x0100 to 0x0FFF |
[in] | validUpperFrameId | Valid range is 0x0100 to 0x0FFF and equal or greater then validLowerFrameId |
0 | on success |
int32_t setMaxLineRxDelay | ( | uint8_t | portNumber, |
int32_t | maxLineRxDelayValue | ||
) |
Legacy API. Calls PN_setMaxLineRxDelay.
This value is provided by the PLC when it establishes connection with the device.
[in] | portNumber | Port for which receive line delay is configured PORT1 (1) PORT2 (2) |
[in] | maxLineRxDelayValue | Line delay as seen by the PLC at a port. This value is computed by the PLC/Engineering tool. |
0 | on success |
int32_t setMaxBridgeDelay | ( | int32_t | maxBridgeDelayValue | ) |
Legacy API. Calls PN_setMaxBridgeDelay.
[in] | maxBridgeDelayValue | Valid value for our device is 2900ns This value is defined in the GSD |
0 | on success |
int32_t setYellowPeriod | ( | int32_t | yellowPeriodTime | ) |
Legacy API. Calls PN_setYellowPeriod.
[in] | yellowPeriodTime | Length of the yellow period Valid value is 125 us as our device does not support fragmentation |
0 | on success |
int32_t mapPhaseToProfile | ( | int32_t | portNumber, |
int32_t | phaseNumber, | ||
int32_t | profileNumberRx, | ||
int32_t | profileNumberTx | ||
) |
Legacy API. Calls PN_mapPhaseToProfile.
A phase can be mapped to different profiles for Receive (Rx) and Transmit (Tx) on a port.
[in] | portNumber | Port on which phase to profile mapping has to be done PORT1 (1) PORT2 (2) |
[in] | phaseNumber | IRT Phase Number Valid values are from 1 to 16 |
[in] | profileNumberRx | Profile number mapped for Receive Valid values are from 1 to 5 |
[in] | profileNumberTx | Profile number mapped for Transmit Valid values are from 1 to 5 |
0 | on success |
int32_t setProfile | ( | int32_t | portNumber, |
int32_t | profileNumber, | ||
int32_t | rxSoGValue, | ||
int32_t | txSoGValue | ||
) |
Legacy API. Calls PN_setProfile In a profile the start of green time in a cycle for Receive (Rx) and Transmit (Tx) is set for a port.
[in] | portNumber | Port for which a profile is configured PORT1 (1) PORT2 (2) |
[in] | profileNumber | Five profiles can be defined for a port Valid values are from 1 to 5 |
[in] | rxSoGValue | Start of Green value for receive at the port Valid value can range from 0 to the max of cycle time |
[in] | txSoGValue | Start of Green value for transmit at the port Valid value can range from 0 to the max of cycle time |
0 | on success |
int32_t setDcpFilterStationName | ( | const uint8_t * | dcpNameOfStation, |
uint8_t | lengthOfStationName | ||
) |
Legacy API. Calls PN_setDcpFilterStationName.
[in] | dcpNameOfStation | Pointer to the array which contains the station name |
[in] | lengthOfStationName | Length of the station name. Valid values are from 0 to 240. If the length is configured as zero then all DCP Ident request are passed to host. |
0 | on success |
int32_t TxPacketOS | ( | const uint8_t * | srcAddress, |
int32_t | portNumber, | ||
int32_t | queuePriority, | ||
int32_t | lengthOfPacket | ||
) |
Legacy API. Calls PN_OS_txPacket.
this is using a critical section to protect re-entry of TX function the protection scheme is borrowed from NDK and we use their code too... this requires to adhere to NDK priority scheme
srcAddress | pointer to TX packet |
portNumber | output port number |
queuePriority | output queue priority |
lengthOfPacket | TX packet length (without CRC) |
int32_t PN_RxPktInfo | ( | int32_t * | portNumber, |
int32_t * | queueNumber | ||
) |
Legacy API. Calls ICSS_EmacRxPktInfo
[out] | portNumber | Return pointer of port number where frame was received |
[out] | queueNumber | Return pointer of host queue where the received frame is queued |
none |
int32_t PN_RxPktGet | ( | uint32_t | destAddress, |
int32_t | queueNumber, | ||
int32_t * | port, | ||
int32_t * | more | ||
) |
Legacy API. Calls ICSS_EmacRxPktGet
[in] | destAddress | Base address of data buffer where received frame has to be stored |
[in] | queueNumber | Receive queue from which frame has to be copied |
[in] | port | Returns port number on which frame was received |
[out] | more | Returns more which is set to 1 if there are more frames in the queue |
Length | of the frame received in number of bytes or -1 on Failure |
uint8_t PN_findMAC | ( | uint8_t * | macId | ) |
Legacy API calls findMAC.
macId | MAC ID which is to be found |
portNumber | where the MAC ID exists, 0 means not found 1 means port 0 and 2 means port 1 |
int32_t setCpmDHT | ( | uint16_t | dht, |
uint8_t | pos | ||
) |
Legacy API. Calls PN_setCpmDHT.
dht | Data hold timeout value (lost count * reduction ration)* |
pos | position of CPM descriptor Valid Range 0-7 |
0 | on success |
<0 | if failure |
int32_t setBaseClock | ( | uint16_t | factor | ) |
Legacy API, calls PN_setBaseClock.
factor | Clock send factor: min value 3, max value 128 |
Slot | number (>=0) |
<0 | if failure |
int32_t clearList | ( | uint8_t | list | ) |
int32_t iRtcEnableIsr | ( | ) |
Enables the PN interrupts. Legacy API. Calls PN_RTC_enableISR.
0 | on Success |
int32_t delPmList | ( | t_rtcPacket * | pmPkt | ) |
Legacy API. Calls PN_delPmList.
pmPkt | pointer to RTC packet to be deleted from list |
negative | value on error, zero on success |
int32_t insPpmList | ( | t_rtcPacket * | ppmPkt, |
uint8_t | legMode | ||
) |
Legacy API. Calls PN_insPpmList.
ppmPkt | pointer to PPM packet to be inserted in list |
legMode | TRUE(1): enables legacy mode support (same packet sent as RTC1 with RR=128 during startup) |
negative | value on error, zero on success |
this now manages single RED packet and index list processing in general it will call toggleList() in case of a good setup
int32_t insCpmList | ( | t_rtcPacket * | cpmPkt | ) |
Legacy API. Calls PN_insCpmList.
cpmPkt | pointer to CPM packet to be inserted in list |
negative | value on error, zero on success |
processes list toggling no index list setup for CPM so far
currently we do not distinguish between green and red packets also there are no checks on receive at correct time or phase so that fields are currently not set!
void configureSync0Pin | ( | ) |
void ptcpConfigureSyncFwd | ( | ptcpPortStatus_t | state | ) |
Legacy API, calls PN_PTCP_configureSyncFwd.
[in] | state | disable /enable |
void PN_EmacRegisterProtocolCallback | ( | void * | callBackPtr, |
void * | userArg | ||
) |
Legacy API, Used to register RX Callback.
[in] | callBackPtr | Function pointer for RX Callback |
[in] | userArg | User params for callBackPtr |
void PN_EmacRegisterPort0ISRCallback | ( | ICSS_EMAC_CallBack | callBack, |
void * | userArg | ||
) |
Legacy API, Used to register Link ISR Callback.
[in] | callBack | Function pointer for Link ISR Callback |
[in] | userArg | User params for callBack |
void PN_EmacRegisterPort1ISRCallback | ( | ICSS_EMAC_CallBack | callBack, |
void * | userArg | ||
) |
Legacy API, Used to register Link ISR Callback.
[in] | callBack | Function pointer for Link ISR Callback |
[in] | userArg | User params for callBack |
void PN_purgeTable | ( | uint8_t | portNum | ) |
Legacy API, Used to purgeTable.
[in] | portNum | Port number to purge learning table |
int32_t setMrpPortState | ( | uint8_t | portNumber, |
uint8_t | pState | ||
) |
Legacy API, Used to call PN_MRP_setPortState.
[in] | portNumber | Port number to purge learning table |
[in] | pState | Set MRP state |
int32_t getMrpPortState | ( | uint8_t | portNumber, |
uint8_t * | pState | ||
) |
Legacy API, Used to call PN_MRP_getPortState.
[in] | portNumber | Port number to purge learning table |
[out] | pState | Return MRP state |
int32_t cfgRtcMem | ( | uint8_t | ar, |
uint16_t | size | ||
) |
Legacy API. Calls PN_cfgRtcMem.
ar | number of allowed number of ARs (symmetrical PPM/CPM) valid values only: 1, 2, 4, 8 |
size | RTC payload size (see below) |
negative | value on error, zero on success |
configuration function for static PPM buffer allocation currently only supports symmetric PPM config with same max size e.g.
PPM buffers will be allocated in buffer blocks 0/1 evenly distributed Start addresses are only valid for PRU1/Port 1 TX... Port 2 PPM needs to be adapted with correct offset at creation of PPM descriptor as the port is not known yet.
int32_t allocPkt | ( | t_rtcPacket ** | pPkt, |
uint8_t | type | ||
) |
Legacy API, Used to call PN_allocPkt.
index | in the list on success |
<0 | if failure |
void ptcpGetSyncInfo | ( | ptcpSyncInfo_t * | syncInfo | ) |
Legacy API, Used to call PN_PTCP_getSyncInfo.
void ptcpRegisterDelayUpdateCall | ( | ptcpCallBack_t | callBack | ) |
Legacy API, Used to call PN_PTCP_registerDelayUpdateCall.
void ptcpRegisterSyncStatusCall | ( | ptcpCallBack_t | callBack | ) |
Legacy API, Used to call PN_PTCP_registerSyncStatusCall.
void ptcpSetPllWindow | ( | uint32_t | pllWindowSize | ) |
Legacy API, Used to call PN_PTCP_setPllWindow.
void ptcpSetSyncTimeoutFactor | ( | uint32_t | syncTimeoutFactor | ) |
Legacy API, Used to call PN_PTCP_registerSyncStatusCall.
void ptcpSetSyncUUID | ( | uint8_t * | subdomainUUID | ) |
Legacy API, Used to call PN_PTCP_setSyncUUID.
void registerCpmCall | ( | pnCallBack_t | callBack | ) |
Legacy API, Used to call PN_registerCpmCall.
void registerStatCall | ( | pnCallBack_t | callBack | ) |
Legacy API, Used to call PN_registerStatCall.
uint8_t* relPpmBuff | ( | t_rtcPacket * | pkt | ) |
Legacy API, Used to call PN_relPpmBuff.
int32_t rtcDisableISR | ( | ) |
Legacy API, Used to call PN_RTC_disableISR.