AM64x MCU+ SDK  08.02.00
pruicss/g_v0/pruicss.h File Reference

Go to the source code of this file.

Data Structures

struct  PRUICSS_SysevtToChannelMap
 Data structure used for system event to channel mapping in PRUICSS. More...
 
struct  PRUICSS_ChannelToHostMap
 Data structure used for channel to host map in PRUICSS. More...
 
struct  PRUICSS_IntcInitData
 PRUICSS Interrupt controller initialisation data structure. More...
 
struct  PRUICSS_IrqFunMap
 PRUICSS IRQ handler mapping structure. More...
 
struct  PRUICSS_Object
 PRUICSS Object. More...
 
struct  PRUICSS_HwAttrs
 PRUICSS Hardware Attributes. More...
 
struct  PRUICSS_Config
 PRUICSS Global configuration structure. More...
 

Macros

#define PRUICSS_NUM_CORES   (6U)
 Number of different cores present in PRUICSS. More...
 
#define PRUICSS_INTC_NUM_HOST_INTERRUPTS   (20U)
 Number of Host Interrupts supported in PRUICSS Local INTC. More...
 
#define PRUICSS_INTC_NUM_CHANNELS   (20U)
 Number of Output Interrupt channels supported in PRUICSS Local INTC. More...
 
#define PRUICSS_INTC_NUM_SYS_EVTS   (160U)
 Number of Events that can be captured in PRUICSS Local INTC. More...
 
#define PRUICSS_NUM_GP_MUX_SEL_MODES   (4U)
 Number of different GP MUX Selections modes. More...
 
#define PRUICSS_NUM_GPI_MODES   (4U)
 Number of different GPI modes. More...
 
#define PRUICSS_NUM_SA_MUX_MODES   (2U)
 Number of different PRUICSS SA MUX Modes. More...
 
#define PRUICSS_NUM_ICSS_CFG_MII_MODES   (3U)
 Number of different ICSS_G_CFG MII Modes. More...
 
PRUICSS Cores

Different cores present in PRUICSS

#define PRUICSS_PRU0   (0U)
 
#define PRUICSS_PRU1   (1U)
 
#define PRUICSS_RTU_PRU0   (2U)
 
#define PRUICSS_RTU_PRU1   (3U)
 
#define PRUICSS_TX_PRU0   (4U)
 
#define PRUICSS_TX_PRU1   (5U)
 
PRUICSS Memory Offsets

Offsets for different memory inside each PRUICSS instance.

#define PRUICSS_DATARAM(n)   (0x00000U + ((n) * 0x02000U))
 Data RAM0/RAM1. n = 0 for RAM0, n = 1 for RAM1. More...
 
#define PRUICSS_IRAM_RTU_PRU(n)   (0x04000U + ((n) * 0x02000U))
 IRAM for RTU_PRU0/RTU_PRU1. n = 0 for RTU_PRU0,n = 1 for RTU_PRU1. More...
 
#define PRUICSS_IRAM_TX_PRU(n)   (0x0A000U + ((n) * 0x02000U))
 IRAM for TX_PRU0/TX_PRU1. n = 0 for TX_PRU0,n = 1 for TX_PRU1. More...
 
#define PRUICSS_SHARED_RAM   (0x10000U)
 Data RAM2 (shared) More...
 
#define PRUICSS_IRAM_PRU(n)   (0x34000U + ((n) * 0x04000U))
 IRAM for PRU0/PRU1. n = 0 for PRU0,n = 1 for PRU1. More...
 
Index for PRU Constant Table Entries

Index to be used while making calls to PRUICSS_setConstantTblEntry()

#define PRUICSS_CONST_TBL_ENTRY_C24   (0U)
 
#define PRUICSS_CONST_TBL_ENTRY_C25   (1U)
 
#define PRUICSS_CONST_TBL_ENTRY_C26   (2U)
 
#define PRUICSS_CONST_TBL_ENTRY_C27   (3U)
 
#define PRUICSS_CONST_TBL_ENTRY_C28   (4U)
 
#define PRUICSS_CONST_TBL_ENTRY_C29   (5U)
 
#define PRUICSS_CONST_TBL_ENTRY_C30   (6U)
 
#define PRUICSS_CONST_TBL_ENTRY_C31   (7U)
 
#define PRUICSS_NUM_CONST_TBL_ENTRY   (8U)
 
GP MUX Select Modes

#define PRUICSS_GP_MUX_SEL_MODE_GP   (0U)
 
#define PRUICSS_GP_MUX_SEL_MODE_ENDAT   (1U)
 
#define PRUICSS_GP_MUX_SEL_MODE_MII   (2U)
 
#define PRUICSS_GP_MUX_SEL_MODE_SD   (3U)
 
GPI Modes

#define PRUICSS_GPI_MODE_DIRECT_R31_STATUS   (0U)
 Direct connect of PRU[0/1]_r31_status[29:0]. More...
 
#define PRUICSS_GPI_MODE_PARALLEL_16_BIT_CAPTURE   (1U)
 Parallel 16-bit capture mode. PRU[0/1]_r31_status [15:0] is captured using PRU[0/1]_r31_status [16]. More...
 
#define PRUICSS_GPI_MODE_29_BIT_SHIFT   (2U)
 29-bit shift. PRU[0/1]_r31_status[0] -> r31_status[0] -> r31_status[1] -> r_status[28] -> bit bucket More...
 
#define PRUICSS_GPI_MODE_MII_RT   (3U)
 mii_rt mode. Selects mii_rt PRU[0/1] bus More...
 
PRUICSS SA MUX Modes

#define PRUICSS_SA_MUX_MODE_DEFAULT   (0U)
 Default/Legacy Mode. More...
 
#define PRUICSS_SA_MUX_MODE_SD_ENDAT   (1U)
 Few SD and EnDAT pins get remapped to enable different usecase. More...
 
ICSS_G_CFG MII Modes

#define PRUICSS_ICSS_CFG_MII_MODE_MII   (0U)
 MII Mode. More...
 
#define PRUICSS_ICSS_CFG_MII_MODE_RGMII   (1U)
 RGMII Mode. More...
 
#define PRUICSS_ICSS_CFG_MII_MODE_SGMII   (2U)
 SGMII mode. It is supported only for PRU_ICSSG instance. More...
 
#define PRUICSS_TX_L1_FIFO   (0U)
 
#define PRUICSS_TX_L2_FIFO   (1U)
 

Typedefs

typedef void(* PRUICSS_IrqHandler) (void *buf)
 
typedef struct PRUICSS_Config_s * PRUICSS_Handle
 A handle that is returned from a PRUICSS_open() call. This handle is required for calling other APIs. More...
 

Functions

int32_t PRUICSS_init (void)
 This function initializes the PRUICSS module. More...
 
int32_t PRUICSS_deinit (void)
 This function de-initializes the PRUICSS module. More...
 
PRUICSS_Handle PRUICSS_open (uint32_t instance)
 This function creates the handle for a PRUICSS instance. More...
 
int32_t PRUICSS_close (PRUICSS_Handle handle)
 This function deletes the handle for a PRUICSS instance. More...
 
int32_t PRUICSS_intcInit (PRUICSS_Handle handle, const PRUICSS_IntcInitData *intcInitData)
 This function does Interrupt-Channel-host mapping. More...
 
int32_t PRUICSS_registerIrqHandler (PRUICSS_Handle handle, uint32_t pruEvtoutNum, int32_t intrNum, int32_t eventNum, uint8_t waitEnable, PRUICSS_IrqHandler irqHandler)
 This function registers an Interrupt Handler for an event. More...
 
int32_t PRUICSS_resetCore (PRUICSS_Handle handle, uint8_t pruNum)
 This function resets the PRU. More...
 
int32_t PRUICSS_disableCore (PRUICSS_Handle handle, uint8_t pruNum)
 This function disables the PRU. More...
 
int32_t PRUICSS_enableCore (PRUICSS_Handle handle, uint8_t pruNum)
 This function enables the PRU. More...
 
uint32_t PRUICSS_initMemory (PRUICSS_Handle handle, uint32_t pruicssMem)
 This function initializes the PRU memory to zero. More...
 
uint32_t PRUICSS_writeMemory (PRUICSS_Handle handle, uint32_t pruicssMem, uint32_t wordoffset, const uint32_t *source_mem, uint32_t bytelength)
 This function writes the given data to PRU memory. More...
 
uint32_t PRUICSS_readMemory (PRUICSS_Handle handle, uint32_t pruicssMem, uint32_t wordoffset, uint32_t *dest_mem, uint32_t bytelength)
 This function reads from PRU memory and stores in block of memory. More...
 
int32_t PRUICSS_sendEvent (PRUICSS_Handle handle, uint32_t eventnum)
 This function generates an INTC event. It should be called only after successful execution of PRUICSS_intcInit(). More...
 
int32_t PRUICSS_waitEvent (PRUICSS_Handle handle, uint32_t pruEvtoutNum)
 This function waits for a system event to happen. It should be called only after successful execution of PRUICSS_intcInit(). More...
 
int32_t PRUICSS_clearEvent (PRUICSS_Handle handle, uint32_t eventnum)
 This function clears an INTC event. It should be called only after successful execution of PRUICSS_intcInit(). More...
 
int32_t PRUICSS_sendWaitClearEvent (PRUICSS_Handle handle, uint32_t sendEventNum, uint32_t pruEvtoutNum, uint32_t ackEventNum)
 This function generates an INTC event, waits for AINTC event and clears an INTC event. More...
 
uint32_t PRUICSS_getVersion (PRUICSS_Handle handle)
 Get PRUICSS version number from ICSSCFG_REVID register. More...
 
int32_t PRUICSS_setConstantTblEntry (PRUICSS_Handle handle, uint8_t pruNum, int32_t constantTblEntry, uint32_t constantTblVal)
 This API updates the constant table for specified constant table entry which have write permissions. More...
 
int32_t PRUICSS_setIepClkSrc (PRUICSS_Handle handle, uint32_t source)
 This API configures the source of the IEP clock to be either IEP CLK as the source or ICSSGn_CORE_CLK. More...
 
int32_t PRUICSS_setGpMuxSelect (PRUICSS_Handle handle, uint8_t pruNum, uint8_t mode)
 This API sets the GP Mux Select mode for a specific PRU. More...
 
int32_t PRUICSS_setGpiMode (PRUICSS_Handle handle, uint8_t pruNum, uint8_t mode)
 This API sets the GPI mode for a specific PRU. More...
 
int32_t PRUICSS_setSaMuxMode (PRUICSS_Handle handle, uint8_t mode)
 This API sets the G_MUX_EN mux field in ICSSG_SA_MX_REG register. More...
 
int32_t PRUICSS_configureCycleCounter (PRUICSS_Handle handle, uint8_t pruNum, uint8_t enable)
 This function enables/disables the PRU Cycle Counter for a core. More...
 
int32_t PRUICSS_controlIepCounter (PRUICSS_Handle handle, uint8_t iepInstance, uint8_t enable)
 This API enables/disables the counter in IEP module. More...
 
int32_t PRUICSS_setIepCounterIncrementValue (PRUICSS_Handle handle, uint8_t iepInstance, uint8_t value)
 This API sets the default increment value for counter in IEP module. This value is used when compensation is not active. More...
 
int32_t PRUICSS_readEfuse (PRUICSS_Handle handle, uint8_t *data)
 This API reads the state of efuse bits from ICSSG_HWDIS_REG register. More...
 
int32_t PRUICSS_setIcssCfgMiiMode (PRUICSS_Handle handle, uint8_t miiInstance, uint8_t mode)
 This API sets the MII mode in MII_G_RT_ICSS_G_CFG register. More...
 
int32_t PRUICSS_setIcssCfgTxFifo (PRUICSS_Handle handle, uint8_t fifoInstance, uint8_t enable)
 This API configures the TX FIFO to be used. More...
 
const PRUICSS_HwAttrsPRUICSS_getAttrs (uint32_t instance)
 Return PRUICSS attributes. More...