AM64x MCU+ SDK  08.02.00
iPnOs.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 IPNOS_H_
34 #define IPNOS_H_
35 
36 /* ========================================================================== */
37 /* Doxygen */
38 /* ========================================================================== */
39 
55 /* ========================================================================== */
56 /* Include Files */
57 /* ========================================================================== */
58 
59 #include "PN_Handle.h"
60 #include "iRtcDrv2.h"
61 
62 /* ========================================================================== */
63 /* Function Declarations */
64 /* ========================================================================== */
77 uint8_t *PN_getPpmBuff(t_rtcPacket *pkt);
78 
89 uint8_t *PN_relPpmBuff(PN_Handle pnHandle, t_rtcPacket *pkt);
90 
105 int32_t PN_checkLastPPM(PN_Handle pnHandle, t_rtcPacket *pkt);
106 
122 int32_t PN_nextCpmRdy(PN_Handle pnHandle,
123  t_rtcPacket *pkt);
124 
125 
138 uint8_t *PN_getLastCpm(PN_Handle pnHandle, t_rtcPacket *pkt);
139 
154 uint32_t PN_enterFlushMode(PN_Handle pnHandle);
159 typedef enum
160 {
165  MRPEXIT
181 
189 void PN_setLegState(void *arg, void *arg2);
190 
198 void PN_setLegPkt(void *arg, void *arg2);
209 int32_t PN_initOs(PN_Handle pnHandle);
210 
217 int32_t PN_RTC_setupIsr(PN_Handle pnHandle);
218 
225 int32_t PN_RTC_enableISR(PN_Handle pnHandle);
226 
233 int32_t PN_RTC_disableISR(PN_Handle pnHandle);
234 
249 int32_t PN_OS_txPacket(ICSS_EMAC_Handle icssEmacHandle,
250  const uint8_t *srcAddress, int32_t portNumber, int32_t queuePriority,
251  int32_t lengthOfPacket);
252 
253 #endif /* IPNOS_H_ */
PN_nextCpmRdy
int32_t PN_nextCpmRdy(PN_Handle pnHandle, t_rtcPacket *pkt)
Swap CPM NEXT with LAST and set validLast flag.
ICSS_EMAC_Handle
struct ICSS_EMAC_Config_s * ICSS_EMAC_Handle
Alias for ICSS EMAC Handle containing base addresses and modules.
Definition: icss_emac.h:368
MRPEXIT
@ MRPEXIT
Definition: iPnOs.h:165
PN_Handle
struct PN_Config_s * PN_Handle
Alias for Profinet Handle containing base addresses and modules.
Definition: PN_Handle.h:96
PN_RTC_setupIsr
int32_t PN_RTC_setupIsr(PN_Handle pnHandle)
Interrupt management function Initializes PPM/CPM/DHT interrupts. (OS dependent!)
MRPCHECK
@ MRPCHECK
Definition: iPnOs.h:164
iRtcDrv2.h
PN_getPpmBuff
uint8_t * PN_getPpmBuff(t_rtcPacket *pkt)
Return a pointer to buffer indicated by NEXT This will be the next available free buffer(in the trip...
PN_OS_txPacket
int32_t PN_OS_txPacket(ICSS_EMAC_Handle icssEmacHandle, const uint8_t *srcAddress, int32_t portNumber, int32_t queuePriority, int32_t lengthOfPacket)
Switch driver extension of TxPacket.
MRPREADY
@ MRPREADY
Definition: iPnOs.h:161
PN_setLegState
void PN_setLegState(void *arg, void *arg2)
Sets the state of legacy state machine This API is registered as a callback in PN_registerSetState.
tLegStates
tLegStates
possible states for legacy suppport state machine
Definition: iRtcDrv2.h:535
PN_RTC_disableISR
int32_t PN_RTC_disableISR(PN_Handle pnHandle)
Disables the PN interrupts.
PN_checkLastPPM
int32_t PN_checkLastPPM(PN_Handle pnHandle, t_rtcPacket *pkt)
Update proc pointer in paket object and udpate descriptor if there is a new last buffer.
tMrpStates
tMrpStates
Definition: iPnOs.h:160
PN_getLastCpm
uint8_t * PN_getLastCpm(PN_Handle pnHandle, t_rtcPacket *pkt)
Swap CPM LAST with PROC if validLast is true, clear validLast flag.
PN_Handle.h
PN_RTC_enableISR
int32_t PN_RTC_enableISR(PN_Handle pnHandle)
Enables the PN interrupts.
MRPENTER
@ MRPENTER
Definition: iPnOs.h:162
PN_setLegPkt
void PN_setLegPkt(void *arg, void *arg2)
Sets the Ethernet packet to output during legacy startup Usually a copy of RTC3 PPM....
t_rtcPacket
real-time packet structure
Definition: iRtcDrv2.h:178
PN_initOs
int32_t PN_initOs(PN_Handle pnHandle)
Initialization function for all PN driver tasks, mutexes.
PN_getLegState
tLegStates PN_getLegState(void)
Returns the IRT Legacy mode state.
MRPWAIT
@ MRPWAIT
Definition: iPnOs.h:163
PN_relPpmBuff
uint8_t * PN_relPpmBuff(PN_Handle pnHandle, t_rtcPacket *pkt)
Swap NEXT with LAST and return new NEXT address .
PN_enterFlushMode
uint32_t PN_enterFlushMode(PN_Handle pnHandle)
Used to signal topology change to MRP state machine.