AM64x MCU+ SDK  08.04.00
iPNLegacy.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef IPNLEGACY_H_
34 #define IPNLEGACY_H_
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
41 
42 /* ========================================================================== */
43 /* Include Files */
44 /* ========================================================================== */
45 #include <stdint.h>
46 #include "iRtcDrv2.h"
47 #include "iPtcpDrv.h"
48 #include "PN_Handle.h"
49 /* ========================================================================== */
50 /* Macros & Typedefs */
51 /* ========================================================================== */
53 #define INTERFACE_MAC 0
54 
55 #define PORT1_MAC 1
56 
57 #define PORT2_MAC 2
58 /* ========================================================================== */
59 /* Function Declarations */
60 /* ========================================================================== */
61 
66 void PN_setHandle(PN_Handle pnHandle);
67 
73 
83 uint8_t PN_EmacSocMACAddrGet(PN_Handle pnHandle, uint8_t instance,
84  uint8_t *macId);
85 
107 int32_t setStaticFilterTable(const uint8_t *macAddr, uint8_t ctrl,
108  uint8_t portNumber, uint8_t table);
109 
125 int32_t setRtc3PortStatus(uint8_t portNumber, uint8_t status);
126 
132 uint8_t *getLastCpm(t_rtcPacket *pkt);
133 
145 int32_t setRedGuard(uint16_t validLowerFrameId, uint16_t validUpperFrameId);
146 
159 int32_t setMaxLineRxDelay(uint8_t portNumber, int32_t maxLineRxDelayValue);
160 
169 int32_t setMaxBridgeDelay(int32_t maxBridgeDelayValue);
170 
178 int32_t setYellowPeriod(int32_t yellowPeriodTime);
179 
197 int32_t mapPhaseToProfile(int32_t portNumber, int32_t phaseNumber,
198  int32_t profileNumberRx, int32_t profileNumberTx);
199 
216 int32_t setProfile(int32_t portNumber, int32_t profileNumber,
217  int32_t rxSoGValue, int32_t txSoGValue);
218 
228 int32_t setDcpFilterStationName(const uint8_t *dcpNameOfStation,
229  uint8_t lengthOfStationName);
230 
244 int32_t TxPacketOS(const uint8_t *srcAddress, int32_t portNumber,
245  int32_t queuePriority, int32_t lengthOfPacket);
246 
255 int32_t PN_RxPktInfo(int32_t *portNumber, int32_t *queueNumber);
256 
268 int32_t PN_RxPktGet(uint32_t destAddress, int32_t queueNumber, int32_t *port,
269  int32_t *more);
270 
278 uint8_t PN_findMAC(uint8_t *macId);
279 
291 int32_t setCpmDHT(uint16_t dht, uint8_t pos);
292 
302 int32_t setBaseClock(uint16_t factor);
303 
315 int32_t clearList(uint8_t list);
316 
321 int32_t iRtcEnableIsr();
322 
333 int32_t delPmList(t_rtcPacket *pmPkt);
334 
347 int32_t insPpmList(t_rtcPacket *ppmPkt, uint8_t legMode);
348 
363 int32_t insCpmList(t_rtcPacket *cpmPkt);
364 
370 
377 
384 void PN_EmacRegisterProtocolCallback(void *callBackPtr, void *userArg);
385 
393 
401 
407 void PN_purgeTable(uint8_t portNum);
408 
415 int32_t setMrpPortState(uint8_t portNumber, uint8_t pState);
416 
423 int32_t getMrpPortState(uint8_t portNumber, uint8_t *pState);
424 
447 int32_t cfgRtcMem(uint8_t ar, uint16_t size);
448 
457 int32_t allocPkt(t_rtcPacket **pPkt, uint8_t type);
458 
463 
468 
473 
477 void ptcpSetPllWindow(uint32_t pllWindowSize);
478 
482 void ptcpSetSyncTimeoutFactor(uint32_t syncTimeoutFactor);
483 
487 void ptcpSetSyncUUID(uint8_t *subdomainUUID);
488 
493 
498 
502 uint8_t *relPpmBuff(t_rtcPacket *pkt);
503 
507 int32_t rtcDisableISR();
508 
509 
510 #ifdef __cplusplus
511 }
512 #endif
513 
514 #endif /* IPNLEGACY_H_ */
PN_EmacRegisterPort0ISRCallback
void PN_EmacRegisterPort0ISRCallback(ICSS_EMAC_CallBack callBack, void *userArg)
Legacy API, Used to register Link ISR Callback.
setDcpFilterStationName
int32_t setDcpFilterStationName(const uint8_t *dcpNameOfStation, uint8_t lengthOfStationName)
Legacy API. Calls PN_setDcpFilterStationName.
ptcpConfigureSyncFwd
void ptcpConfigureSyncFwd(ptcpPortStatus_t state)
Legacy API, calls PN_PTCP_configureSyncFwd.
getLastCpm
uint8_t * getLastCpm(t_rtcPacket *pkt)
Legacy API. Calls PN_getLastCpm.
setProfile
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 ...
size
uint16_t size
Definition: tisci_boardcfg.h:1
rtcDisableISR
int32_t rtcDisableISR()
Legacy API, Used to call PN_RTC_disableISR.
ptcpGetSyncInfo
void ptcpGetSyncInfo(ptcpSyncInfo_t *syncInfo)
Legacy API, Used to call PN_PTCP_getSyncInfo.
setBaseClock
int32_t setBaseClock(uint16_t factor)
Legacy API, calls PN_setBaseClock.
allocPkt
int32_t allocPkt(t_rtcPacket **pPkt, uint8_t type)
Legacy API, Used to call PN_allocPkt.
delPmList
int32_t delPmList(t_rtcPacket *pmPkt)
Legacy API. Calls PN_delPmList.
ptcpRegisterSyncStatusCall
void ptcpRegisterSyncStatusCall(ptcpCallBack_t callBack)
Legacy API, Used to call PN_PTCP_registerSyncStatusCall.
PN_Handle
struct PN_Config_s * PN_Handle
Alias for Profinet Handle containing base addresses and modules.
Definition: PN_Handle.h:102
setRtc3PortStatus
int32_t setRtc3PortStatus(uint8_t portNumber, uint8_t status)
Legacy API, calls PN_setRtc3PortStatus.
registerStatCall
void registerStatCall(pnCallBack_t callBack)
Legacy API, Used to call PN_registerStatCall.
cfgRtcMem
int32_t cfgRtcMem(uint8_t ar, uint16_t size)
Legacy API. Calls PN_cfgRtcMem.
iPtcpDrv.h
setMaxLineRxDelay
int32_t setMaxLineRxDelay(uint8_t portNumber, int32_t maxLineRxDelayValue)
Legacy API. Calls PN_setMaxLineRxDelay.
mapPhaseToProfile
int32_t mapPhaseToProfile(int32_t portNumber, int32_t phaseNumber, int32_t profileNumberRx, int32_t profileNumberTx)
Legacy API. Calls PN_mapPhaseToProfile.
iRtcDrv2.h
ptcpSetPllWindow
void ptcpSetPllWindow(uint32_t pllWindowSize)
Legacy API, Used to call PN_PTCP_setPllWindow.
state
uint8_t state
Definition: tisci_pm_clock.h:3
type
uint16_t type
Definition: tisci_rm_core.h:1
registerCpmCall
void registerCpmCall(pnCallBack_t callBack)
Legacy API, Used to call PN_registerCpmCall.
ICSS_EMAC_CallBack
int32_t(* ICSS_EMAC_CallBack)(void *arg0, void *arg1, void *arg2)
Definition for a generic callback function used in ICSS-EMAC. While calling this,...
Definition: icss_emac.h:376
iRtcEnableIsr
int32_t iRtcEnableIsr()
Enables the PN interrupts. Legacy API. Calls PN_RTC_enableISR.
ptcpRegisterDelayUpdateCall
void ptcpRegisterDelayUpdateCall(ptcpCallBack_t callBack)
Legacy API, Used to call PN_PTCP_registerDelayUpdateCall.
setMaxBridgeDelay
int32_t setMaxBridgeDelay(int32_t maxBridgeDelayValue)
Legacy API. Calls PN_setMaxBridgeDelay.
setYellowPeriod
int32_t setYellowPeriod(int32_t yellowPeriodTime)
Legacy API. Calls PN_setYellowPeriod.
configureSync0Pin
void configureSync0Pin()
ptcpSetSyncTimeoutFactor
void ptcpSetSyncTimeoutFactor(uint32_t syncTimeoutFactor)
Legacy API, Used to call PN_PTCP_registerSyncStatusCall.
PN_RxPktInfo
int32_t PN_RxPktInfo(int32_t *portNumber, int32_t *queueNumber)
PN_EmacRegisterProtocolCallback
void PN_EmacRegisterProtocolCallback(void *callBackPtr, void *userArg)
Legacy API, Used to register RX Callback.
clearList
int32_t clearList(uint8_t list)
PN_EmacRegisterPort1ISRCallback
void PN_EmacRegisterPort1ISRCallback(ICSS_EMAC_CallBack callBack, void *userArg)
Legacy API, Used to register Link ISR Callback.
PN_purgeTable
void PN_purgeTable(uint8_t portNum)
Legacy API, Used to purgeTable.
PN_Handle.h
t_rtcPacket
real-time packet structure
Definition: iRtcDrv2.h:184
relPpmBuff
uint8_t * relPpmBuff(t_rtcPacket *pkt)
Legacy API, Used to call PN_relPpmBuff.
PN_EmacSocMACAddrGet
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.
ptcpSetSyncUUID
void ptcpSetSyncUUID(uint8_t *subdomainUUID)
Legacy API, Used to call PN_PTCP_setSyncUUID.
PN_findMAC
uint8_t PN_findMAC(uint8_t *macId)
Legacy API calls findMAC.
PN_RxPktGet
int32_t PN_RxPktGet(uint32_t destAddress, int32_t queueNumber, int32_t *port, int32_t *more)
ptcpSyncInfo_t
Structure containing current sync info.
Definition: iPtcpDrv.h:107
insPpmList
int32_t insPpmList(t_rtcPacket *ppmPkt, uint8_t legMode)
Legacy API. Calls PN_insPpmList.
getMrpPortState
int32_t getMrpPortState(uint8_t portNumber, uint8_t *pState)
Legacy API, Used to call PN_MRP_getPortState.
pnCallBack_t
void(* pnCallBack_t)(void *arg, uint8_t arg2)
Callback function for processing Profinet IRQs.
Definition: iRtcDrv2.h:417
setRedGuard
int32_t setRedGuard(uint16_t validLowerFrameId, uint16_t validUpperFrameId)
Legacy API. Calls PN_setRedGuard.
insCpmList
int32_t insCpmList(t_rtcPacket *cpmPkt)
Legacy API. Calls PN_insCpmList.
setCpmDHT
int32_t setCpmDHT(uint16_t dht, uint8_t pos)
Legacy API. Calls PN_setCpmDHT.
setMrpPortState
int32_t setMrpPortState(uint8_t portNumber, uint8_t pState)
Legacy API, Used to call PN_MRP_setPortState.
TxPacketOS
int32_t TxPacketOS(const uint8_t *srcAddress, int32_t portNumber, int32_t queuePriority, int32_t lengthOfPacket)
Legacy API. Calls PN_OS_txPacket.
PN_getPnHandle
PN_Handle PN_getPnHandle()
Returns the ICSS EMAC LLD handle. This is used to maintain the old APIs that doesn't use the Handle b...
setStaticFilterTable
int32_t setStaticFilterTable(const uint8_t *macAddr, uint8_t ctrl, uint8_t portNumber, uint8_t table)
Legacy API. Calls PN_setStaticFilterTable.
ptcpPortStatus_t
ptcpPortStatus_t
Enum for enable/disable states.
Definition: iPtcpDrv.h:67
ptcpCallBack_t
void(* ptcpCallBack_t)(uint32_t arg, uint32_t arg2)
Definition: iPtcpDrv.h:157
PN_setHandle
void PN_setHandle(PN_Handle pnHandle)
Stores the local copy of handle to support legacy APIs.