AM263Px MCU+ SDK: APIs for PRUICSS

| AM263Px MCU+ SDK 26.00.00 |

Data Structures | Functions | Typedefs | Macros
APIs for PRUICSS
APIs for SOC Specific Device Drivers

## Introduction

This module contains APIs to program and use the PRUICSS module. Programmable Real-Time Unit and Industrial Communication Subsystem(PRUICSS) allows implementation of various high-performance industrial control algorithms and industrial interface standards.

## 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...

## 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 ICSSM 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 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 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_M_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_HwAttrs * | PRUICSS_getAttrs (uint32_t instance)
| Return PRUICSS attributes. More...
int32_t | PRUICSS_loadFirmware (PRUICSS_Handle handle, uint8_t pruIcssCore, const uint32_t pruFirmware[], uint32_t byteLength)
| This API disables pruIcssCore, loads IMEM, resets pruIcssCore, enables pruIcssCore. More...

## 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...

## Macros
#define | PRUICSS_NUM_CORES (2U)
| Number of different cores present in PRUICSS. More...
#define | PRUICSS_INTC_NUM_HOST_INTERRUPTS (10U)
| Number of Host Interrupts supported in PRUICSS Local INTC. More...
#define | PRUICSS_INTC_NUM_CHANNELS (10U)
| Number of Output Interrupt channels supported in PRUICSS Local INTC. More...
#define | PRUICSS_INTC_NUM_SYS_EVTS (64U)
| 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 (2U)
| Number of different ICSS_M_CFG MII Modes. More...

## PRUICSS Cores
Different cores present in PRUICSS
#define | PRUICSS_PRU0 (0U)
#define | PRUICSS_PRU1 (1U)

## 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_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_M_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...

## PRUICSS TX FIFO Modes
#define | PRUICSS_TX_L1_FIFO (0U)
#define | PRUICSS_TX_L2_FIFO (1U)

## Macro Definition Documentation

## ◆ PRUICSS_PRU0

#define PRUICSS_PRU0 (0U)

## ◆ PRUICSS_PRU1

#define PRUICSS_PRU1 (1U)

## ◆ PRUICSS_NUM_CORES

#define PRUICSS_NUM_CORES (2U)

Number of different cores present in PRUICSS.

## ◆ PRUICSS_DATARAM

#define PRUICSS_DATARAM | ( |  | n | ) | (0x00000U + ((n) * 0x02000U))

Data RAM0/RAM1. n = 0 for RAM0, n = 1 for RAM1.

## ◆ PRUICSS_SHARED_RAM

#define PRUICSS_SHARED_RAM (0x10000U)

Data RAM2 (shared)

## ◆ PRUICSS_IRAM_PRU

#define PRUICSS_IRAM_PRU | ( |  | n | ) | (0x34000U + ((n) * 0x04000U))

IRAM for PRU0/PRU1. n = 0 for PRU0,n = 1 for PRU1.

## ◆ PRUICSS_INTC_NUM_HOST_INTERRUPTS

#define PRUICSS_INTC_NUM_HOST_INTERRUPTS (10U)

Number of Host Interrupts supported in PRUICSS Local INTC.

## ◆ PRUICSS_INTC_NUM_CHANNELS

#define PRUICSS_INTC_NUM_CHANNELS (10U)

Number of Output Interrupt channels supported in PRUICSS Local INTC.

## ◆ PRUICSS_INTC_NUM_SYS_EVTS

#define PRUICSS_INTC_NUM_SYS_EVTS (64U)

Number of Events that can be captured in PRUICSS Local INTC.

## ◆ PRUICSS_CONST_TBL_ENTRY_C24

#define PRUICSS_CONST_TBL_ENTRY_C24 (0U)

## ◆ PRUICSS_CONST_TBL_ENTRY_C25

#define PRUICSS_CONST_TBL_ENTRY_C25 (1U)

## ◆ PRUICSS_CONST_TBL_ENTRY_C26

#define PRUICSS_CONST_TBL_ENTRY_C26 (2U)

## ◆ PRUICSS_CONST_TBL_ENTRY_C27

#define PRUICSS_CONST_TBL_ENTRY_C27 (3U)

## ◆ PRUICSS_CONST_TBL_ENTRY_C28

#define PRUICSS_CONST_TBL_ENTRY_C28 (4U)

## ◆ PRUICSS_CONST_TBL_ENTRY_C29

#define PRUICSS_CONST_TBL_ENTRY_C29 (5U)

## ◆ PRUICSS_CONST_TBL_ENTRY_C30

#define PRUICSS_CONST_TBL_ENTRY_C30 (6U)

## ◆ PRUICSS_CONST_TBL_ENTRY_C31

#define PRUICSS_CONST_TBL_ENTRY_C31 (7U)

## ◆ PRUICSS_NUM_CONST_TBL_ENTRY

#define PRUICSS_NUM_CONST_TBL_ENTRY (8U)

## ◆ PRUICSS_GP_MUX_SEL_MODE_GP

#define PRUICSS_GP_MUX_SEL_MODE_GP (0U)

## ◆ PRUICSS_GP_MUX_SEL_MODE_ENDAT

#define PRUICSS_GP_MUX_SEL_MODE_ENDAT (1U)

## ◆ PRUICSS_GP_MUX_SEL_MODE_MII

#define PRUICSS_GP_MUX_SEL_MODE_MII (2U)

## ◆ PRUICSS_GP_MUX_SEL_MODE_SD

#define PRUICSS_GP_MUX_SEL_MODE_SD (3U)

## ◆ PRUICSS_NUM_GP_MUX_SEL_MODES

#define PRUICSS_NUM_GP_MUX_SEL_MODES (4U)

Number of different GP MUX Selections modes.

## ◆ PRUICSS_GPI_MODE_DIRECT_R31_STATUS

#define PRUICSS_GPI_MODE_DIRECT_R31_STATUS (0U)

Direct connect of PRU[0/1]_r31_status[29:0].

## ◆ PRUICSS_GPI_MODE_PARALLEL_16_BIT_CAPTURE

#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].

## ◆ PRUICSS_GPI_MODE_29_BIT_SHIFT

#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

## ◆ PRUICSS_GPI_MODE_MII_RT

#define PRUICSS_GPI_MODE_MII_RT (3U)

mii_rt mode. Selects mii_rt PRU[0/1] bus

## ◆ PRUICSS_NUM_GPI_MODES

#define PRUICSS_NUM_GPI_MODES (4U)

Number of different GPI modes.

## ◆ PRUICSS_SA_MUX_MODE_DEFAULT

#define PRUICSS_SA_MUX_MODE_DEFAULT (0U)

Default/Legacy Mode.

## ◆ PRUICSS_SA_MUX_MODE_SD_ENDAT

#define PRUICSS_SA_MUX_MODE_SD_ENDAT (1U)

Few SD and EnDAT pins get remapped to enable different usecase.

## ◆ PRUICSS_NUM_SA_MUX_MODES

#define PRUICSS_NUM_SA_MUX_MODES (2U)

Number of different PRUICSS SA MUX Modes.

## ◆ PRUICSS_ICSS_CFG_MII_MODE_MII

#define PRUICSS_ICSS_CFG_MII_MODE_MII (0U)

MII Mode.

## ◆ PRUICSS_ICSS_CFG_MII_MODE_RGMII

#define PRUICSS_ICSS_CFG_MII_MODE_RGMII (1U)

RGMII Mode.

## ◆ PRUICSS_NUM_ICSS_CFG_MII_MODES

#define PRUICSS_NUM_ICSS_CFG_MII_MODES (2U)

Number of different ICSS_M_CFG MII Modes.

## ◆ PRUICSS_TX_L1_FIFO

#define PRUICSS_TX_L1_FIFO (0U)

## ◆ PRUICSS_TX_L2_FIFO

#define PRUICSS_TX_L2_FIFO (1U)

## Typedef Documentation

## ◆ PRUICSS_IrqHandler

typedef void(* PRUICSS_IrqHandler) (void *buf)

## ◆ PRUICSS_Handle

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.

## Function Documentation

## ◆ PRUICSS_init()

int32_t PRUICSS_init | ( | void |  | ) |

This function initializes the PRUICSS module.

Returns
  SystemP_SUCCESS in case of success, SystemP_FAILURE otherwise

## ◆ PRUICSS_deinit()

int32_t PRUICSS_deinit | ( | void |  | ) |

This function de-initializes the PRUICSS module.

Returns
  SystemP_SUCCESS in case of success, SystemP_FAILURE otherwise

## ◆ PRUICSS_open()

PRUICSS_Handle PRUICSS_open | ( | uint32_t | instance | ) |

This function creates the handle for a PRUICSS instance.

Parameters

  instance | PRUICSS instance number

Returns
  A PRUICSS_Handle on success or a NULL on an error

## ◆ PRUICSS_close()

int32_t PRUICSS_close | ( | PRUICSS_Handle | handle | ) |

This function deletes the handle for a PRUICSS instance.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()

Returns
  SystemP_SUCCESS in case of success, SystemP_FAILURE otherwise

## ◆ PRUICSS_intcInit()

int32_t PRUICSS_intcInit | ( | PRUICSS_Handle | handle,
|  | const PRUICSS_IntcInitData * | intcInitData
| ) |  |

This function does Interrupt-Channel-host mapping.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  intcInitData | Pointer to structure of type PRUICSS_IntcInitData containing mapping information

Returns
  SystemP_SUCCESS in case of success, SystemP_FAILURE otherwise

## ◆ PRUICSS_registerIrqHandler()

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.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruEvtoutNum | The ARM side event number
  intrNum | Interrupt number of R5F
  eventNum | Event number of PRUICSS
  waitEnable | Flag specifying whether application can wait on this interrupt using PRUICSS_waitEvent() function. 1 for enable, 0 for disable
  irqHandler | Pointer to a function which will be called on interrupt

Returns
  SystemP_SUCCESS in case of successful registration, SystemP_FAILURE otherwise

## ◆ PRUICSS_resetCore()

int32_t PRUICSS_resetCore | ( | PRUICSS_Handle | handle,
|  | uint8_t | pruNum
| ) |  |

This function resets the PRU.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruNum | PRU core number from PRUICSS_Cores

Returns
  SystemP_SUCCESS in case of successful reset, SystemP_FAILURE otherwise

## ◆ PRUICSS_disableCore()

int32_t PRUICSS_disableCore | ( | PRUICSS_Handle | handle,
|  | uint8_t | pruNum
| ) |  |

This function disables the PRU.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruNum | PRU core number from PRUICSS_Cores

Returns
  SystemP_SUCCESS in case of successful disable, SystemP_FAILURE otherwise

## ◆ PRUICSS_enableCore()

int32_t PRUICSS_enableCore | ( | PRUICSS_Handle | handle,
|  | uint8_t | pruNum
| ) |  |

This function enables the PRU.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruNum | PRU core number from PRUICSS_Cores

Returns
  SystemP_SUCCESS in case of successful enable, SystemP_FAILURE otherwise

## ◆ PRUICSS_initMemory()

uint32_t PRUICSS_initMemory | ( | PRUICSS_Handle | handle,
|  | uint32_t | pruicssMem
| ) |  |

This function initializes the PRU memory to zero.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruicssMem | PRUICSS Memory macro from PRUICSS_MemoryOffsets

Returns
  Word length written or 0 on error

## ◆ PRUICSS_writeMemory()

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.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruicssMem | PRUICSS Memory macro from PRUICSS_MemoryOffsets
  wordoffset | Offset at which the write will happen
  source_mem | Source memory[ Array of uint32_t integers ]
  bytelength | Total number of bytes to be writen

Returns
  Word length written or 0 on error

## ◆ PRUICSS_readMemory()

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.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruicssMem | PRUICSS Memory macro from PRUICSS_MemoryOffsets
  wordoffset | Offset at which the read will happen
  dest_mem | Destination memory[ Array of uint32_t integers ]
  bytelength | Total number of bytes to be read

Returns
  Word length read or 0 on error

## ◆ PRUICSS_sendEvent()

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().

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  eventnum | The INTC Event number

Returns
  SystemP_SUCCESS in case of successful transition, SystemP_FAILURE otherwise

## ◆ PRUICSS_waitEvent()

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().

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruEvtoutNum | The AINTC Event number

Returns
  SystemP_SUCCESS in case of successful transition, SystemP_FAILURE otherwise

## ◆ PRUICSS_clearEvent()

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().

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  eventnum | The INTC Event number

Returns
  SystemP_SUCCESS in case of successful transition, SystemP_FAILURE otherwise

## ◆ PRUICSS_sendWaitClearEvent()

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.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  sendEventNum | Event number
  pruEvtoutNum | PRU Event number
  ackEventNum | Acknowledgement event number

Returns
  SystemP_SUCCESS in case of successful transition, SystemP_FAILURE otherwise

## ◆ PRUICSS_getVersion()

uint32_t PRUICSS_getVersion | ( | PRUICSS_Handle | handle | ) |

Get PRUICSS version number from ICSSCFG_REVID register.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()

Returns
  PRU ICSS version

## ◆ PRUICSS_setConstantTblEntry()

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.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruNum | PRU number[0 or 1] for which constant table is being updated
  constantTblEntry | contant table entry being updated
  constantTblVal | contant table value to be written

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_setIepClkSrc()

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 ICSSM CORE CLK.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  source | source of the IEP clock (0 for IEP CLK, 1 for ICSSM CORE CLK)

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_setGpMuxSelect()

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.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruNum | PRUICSS_PRU0 or PRUICSS_PRU1
  mode | Mode from PRUICSS_GpMuxSelectModes

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_setGpiMode()

int32_t PRUICSS_setGpiMode | ( | PRUICSS_Handle | handle,
|  | uint8_t | pruNum,
|  | uint8_t | mode
| ) |  |

This API sets the GPI mode for a specific PRU.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruNum | PRUICSS_PRU0 or PRUICSS_PRU1
  mode | Mode from PRUICSS_GpiModes

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_setSaMuxMode()

int32_t PRUICSS_setSaMuxMode | ( | PRUICSS_Handle | handle,
|  | uint8_t | mode
| ) |  |

This API sets the G_MUX_EN mux field in SA_MX_REG register.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  mode | Mode from PRUICSS_SaMuxModes

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_configureCycleCounter()

int32_t PRUICSS_configureCycleCounter | ( | PRUICSS_Handle | handle,
|  | uint8_t | pruNum,
|  | uint8_t | enable
| ) |  |

This function enables/disables the PRU Cycle Counter for a core.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruNum | PRU core number from PRUICSS_Cores
  enable | 0 for disable, 1 for enable

Returns
  SystemP_SUCCESS in case of successful enable, SystemP_FAILURE otherwise

## ◆ PRUICSS_controlIepCounter()

int32_t PRUICSS_controlIepCounter | ( | PRUICSS_Handle | handle,
|  | uint8_t | iepInstance,
|  | uint8_t | enable
| ) |  |

This API enables/disables the counter in IEP module.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  iepInstance | 0 for IEP0
  enable | 0 for disabling the counter, 1 for enabling the counter

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_setIepCounterIncrementValue()

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.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  iepInstance | 0 for IEP0
  value | Increment value. Maximum value allowed is 15

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_readEfuse()

int32_t PRUICSS_readEfuse | ( | PRUICSS_Handle | handle,
|  | uint8_t * | data
| ) |  |

This API reads the state of efuse bits from HWDIS_REG register.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  data | data read from the register

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_setIcssCfgMiiMode()

int32_t PRUICSS_setIcssCfgMiiMode | ( | PRUICSS_Handle | handle,
|  | uint8_t | miiInstance,
|  | uint8_t | mode
| ) |  |

This API sets the MII mode in MII_G_RT_ICSS_M_CFG register.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  miiInstance | 0 for MII0_MODE, 1 for MII1_MODE
  mode | Mode from PRUICSS_IcssCfgMiiModes

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_setIcssCfgTxFifo()

int32_t PRUICSS_setIcssCfgTxFifo | ( | PRUICSS_Handle | handle,
|  | uint8_t | fifoInstance,
|  | uint8_t | enable
| ) |  |

This API configures the TX FIFO to be used.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  fifoInstance | FIFO from PRUICSS_TxFifos
  enable | 0 for disable, 1 for enable

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error

## ◆ PRUICSS_getAttrs()

const PRUICSS_HwAttrs* PRUICSS_getAttrs | ( | uint32_t | instance | ) |

Return PRUICSS attributes.

Parameters

  instance | PRUICSS instance

Returns
  PRUICSS_HwAttrs, else NULL if instance is invalid

## ◆ PRUICSS_loadFirmware()

int32_t PRUICSS_loadFirmware | ( | PRUICSS_Handle | handle,
|  | uint8_t | pruIcssCore,
|  | const uint32_t | pruFirmware[],
|  | uint32_t | byteLength
| ) |  |

This API disables pruIcssCore, loads IMEM, resets pruIcssCore, enables pruIcssCore.

Parameters

  handle | PRUICSS_Handle returned from PRUICSS_open()
  pruIcssCore | pruIcssCore from PRUICSS_Cores
  pruFirmware | firmware array
  byteLength | size of firmware array

Returns
  SystemP_SUCCESS on success, SystemP_FAILURE on error