AM64x MCU+ SDK  08.02.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 /* ========================================================================== */
37 /* Include Files */
38 /* ========================================================================== */
39 #include <stdint.h>
40 #include "iRtcDrv2.h"
41 #include "iPtcpDrv.h"
42 #include "PN_Handle.h"
43 /* ========================================================================== */
44 /* Macros & Typedefs */
45 /* ========================================================================== */
47 #define INTERFACE_MAC 0
48 
49 #define PORT1_MAC 1
50 
51 #define PORT2_MAC 2
52 /* ========================================================================== */
53 /* Function Declarations */
54 /* ========================================================================== */
55 
60 void PN_setHandle(PN_Handle pnHandle);
61 
67 
77 uint8_t PN_EmacSocMACAddrGet(PN_Handle pnHandle, uint8_t instance,
78  uint8_t *macId);
79 
101 int32_t setStaticFilterTable(const uint8_t *macAddr, uint8_t ctrl,
102  uint8_t portNumber, uint8_t table);
103 
119 int32_t setRtc3PortStatus(uint8_t portNumber, uint8_t status);
120 
126 uint8_t *getLastCpm(t_rtcPacket *pkt);
127 
139 int32_t setRedGuard(uint16_t validLowerFrameId, uint16_t validUpperFrameId);
140 
153 int32_t setMaxLineRxDelay(uint8_t portNumber, int32_t maxLineRxDelayValue);
154 
163 int32_t setMaxBridgeDelay(int32_t maxBridgeDelayValue);
164 
172 int32_t setYellowPeriod(int32_t yellowPeriodTime);
173 
191 int32_t mapPhaseToProfile(int32_t portNumber, int32_t phaseNumber,
192  int32_t profileNumberRx, int32_t profileNumberTx);
193 
210 int32_t setProfile(int32_t portNumber, int32_t profileNumber,
211  int32_t rxSoGValue, int32_t txSoGValue);
212 
222 int32_t setDcpFilterStationName(const uint8_t *dcpNameOfStation,
223  uint8_t lengthOfStationName);
224 
238 int32_t TxPacketOS(const uint8_t *srcAddress, int32_t portNumber,
239  int32_t queuePriority, int32_t lengthOfPacket);
240 
249 int32_t PN_RxPktInfo(int32_t *portNumber, int32_t *queueNumber);
250 
262 int32_t PN_RxPktGet(uint32_t destAddress, int32_t queueNumber, int32_t *port,
263  int32_t *more);
264 
272 uint8_t PN_findMAC(uint8_t *macId);
273 
285 int32_t setCpmDHT(uint16_t dht, uint8_t pos);
286 
296 int32_t setBaseClock(uint16_t factor);
297 
309 int32_t clearList(uint8_t list);
310 
315 int32_t iRtcEnableIsr();
316 
327 int32_t delPmList(t_rtcPacket *pmPkt);
328 
341 int32_t insPpmList(t_rtcPacket *ppmPkt, uint8_t legMode);
342 
357 int32_t insCpmList(t_rtcPacket *cpmPkt);
358 
364 
371 
378 void PN_EmacRegisterProtocolCallback(void *callBackPtr, void *userArg);
379 
387 
395 
401 void PN_purgeTable(uint8_t portNum);
402 
409 int32_t setMrpPortState(uint8_t portNumber, uint8_t pState);
410 
417 int32_t getMrpPortState(uint8_t portNumber, uint8_t *pState);
418 
441 int32_t cfgRtcMem(uint8_t ar, uint16_t size);
442 
451 int32_t allocPkt(t_rtcPacket **pPkt, uint8_t type);
452 
457 
462 
467 
471 void ptcpSetPllWindow(uint32_t pllWindowSize);
472 
476 void ptcpSetSyncTimeoutFactor(uint32_t syncTimeoutFactor);
477 
481 void ptcpSetSyncUUID(uint8_t *subdomainUUID);
482 
487 
492 
496 uint8_t *relPpmBuff(t_rtcPacket *pkt);
497 
501 int32_t rtcDisableISR();
502 
503 #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:96
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:178
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:101
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:411
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:61
ptcpCallBack_t
void(* ptcpCallBack_t)(uint32_t arg, uint32_t arg2)
Definition: iPtcpDrv.h:151
PN_setHandle
void PN_setHandle(PN_Handle pnHandle)
Stores the local copy of handle to support legacy APIs.