AM64x MCU+ SDK  08.02.00
iRtcDrv2.h File Reference

Go to the source code of this file.

Data Structures

struct  t_listIndex
 
struct  t_rtcMemBuff
 
struct  t_ppmBlock
 
struct  t_cpmBlock
 
struct  t_rtcPacket
 real-time packet structure More...
 
struct  t_descList
 
struct  t_cfgPN
 

Macros

#define SHADOW_LIST   0
 
#define ACTIVE_LIST   1
 
#define HALFSIZE   4
 

Typedefs

typedef void(* pnCallBack_t) (void *arg, uint8_t arg2)
 Callback function for processing Profinet IRQs. More...
 
typedef void(* pnLegCallBack_t) (void *arg, void *arg2)
 Callback function for processing Profinet IRQs. More...
 

Enumerations

enum  buffLocks { BUFF1 = 0, BUFF2, BUFF3, NOBUFF }
 Enumerates the Buffer indexes of Triple buffers. Buffer lock needs to be aligned with firmware. More...
 
enum  tLegStates { NOINIT, READY, SENDPPM, ABORT }
 possible states for legacy suppport state machine More...
 

Functions

int32_t PN_cfgRtcMem (PN_Handle pnHandle, uint8_t ar, uint16_t size)
 Configures the driver memory. More...
 
int32_t PN_deCfgRtcMem (PN_Handle pnHandle)
 De-configures the driver memory. More...
 
int32_t PN_initPacket (t_rtcPacket *pPkt, uint8_t type)
 Initialize packet according to type Utility API for stack. Doesn't update anything in driver. More...
 
int32_t PN_allocPkt (PN_Handle pnHandle, t_rtcPacket **pPkt, uint8_t type)
 Allocate a packet object from internal array Initializes pPkt with PN_initPacket Find the next freeslot in t_ppmBlock t_cpmBlock, update the pBuffer address. More...
 
int32_t PN_freePkt (t_rtcPacket *pPkt)
 Free a packet object for re-use Utility API for stack. Doesn't update anything in driver. More...
 
int32_t PN_insPpmList (PN_Handle pnHandle, t_rtcPacket *ppmPkt, uint8_t legMode)
 Inserts PPM descriptor data into the lists. More...
 
int32_t PN_delPmList (PN_Handle pnHandle, t_rtcPacket *pmPkt)
 Deletes a descriptor from PPM or CPM list. More...
 
int32_t PN_insCpmList (PN_Handle pnHandle, t_rtcPacket *cpmPkt)
 Insert a packet into descriptor list and lock this buffer, indicating that ARM is consuming this buffer
. More...
 
int32_t PN_setCpmState (PN_Handle pnHandle, t_rtcPacket *pPkt, uint8_t val)
 
int32_t PN_setPpmState (PRUICSS_HwAttrs const *pruicssHwAttrs, t_rtcPacket *pPkt)
 
int32_t PN_chgPpmBuffer (PN_Handle pnHandle, t_rtcPacket *ppmPkt)
 Update PPM descriptor to new buffer address (based on ARM buffer address) More...
 
t_cfgPNPN_getConfig (void)
 
int32_t PN_initRtcDrv (PN_Handle pnHandle)
 Initializes RTC driver. More...
 
int32_t PN_getList (t_descList **pList, uint8_t dir)
 
int32_t PN_clearList (PN_Handle pnHandle, uint8_t list)
 
int32_t PN_resetARlink (PRUICSS_HwAttrs const *pruicssHwAttrs, uint8_t ARgroup, uint8_t pmNum, uint8_t dir)
 
int32_t PN_cpmBuffLock (PRUICSS_HwAttrs const *pruicssHwAttrs, uint8_t pos, buffLocks buff)
 Locks CPM Buffer indicating that ARM is consuming the particular buffer. PRU cannot write to this buffer. More...
 
void PN_registerPpmCall (PN_Handle pnHandle, pnCallBack_t callBack)
 Registers callback function required for PPM processing. More...
 
void PN_registerCpmCall (PN_Handle pnHandle, pnCallBack_t callBack)
 Registers callback function required for CPM processing. More...
 
void PN_registerStatCall (PN_Handle pnHandle, pnCallBack_t callBack)
 Registers callback function required for Stat processing. More...
 
void PN_registerSetState (PN_Handle pnHandle, pnLegCallBack_t callBack)
 Registers callback function for legacy state This callback is used to change the Legacy state machine. More...
 
void PN_registerSetPkt (PN_Handle pnHandle, pnLegCallBack_t callBack)
 Registers callback function for packet pointer This callback is used to configure the packet send by the IRT state machine. More...
 
void PN_clearPruIRQ (PRUICSS_HwAttrs const *pruicssHwAttrs, uint8_t irq_num)
 
int32_t PN_setBaseClock (PN_Handle pnHandle, uint16_t factor)
 Sets Profinet base clock in multiples of 31.25us. More...
 

Variables

uint32_t pRtcConfig
 
uint32_t ocmcBaseAddress