LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
pru.h File Reference
#include "tistdtypes.h"
#include "csl/cslr_prucore.h"

Go to the source code of this file.

Data Structures

struct  arm_pru_iomap
 

Macros

#define PRU_NUM0   (0)
 
#define PRU_NUM1   (1)
 
#define PRU0_DATA_RAM_START   (0x01C30000)
 
#define PRU0_PROG_RAM_START   (0x01C38000)
 
#define PRU1_DATA_RAM_START   (0x01C32000)
 
#define PRU1_PROG_RAM_START   (0x01C3C000)
 
#define PRU_DATA_RAM_SIZE   (0x200)
 
#define PRU_PROG_RAM_SIZE   (0x1000)
 
#define PRU_PRU0_BASE_ADDRESS   0
 
#define PRU_INTC_BASE_ADDRESS   (PRU_PRU0_BASE_ADDRESS + 0x4000)
 
#define PRU_INTC_REVID   (PRU_INTC_BASE_ADDRESS + 0)
 
#define PRU_INTC_CONTROL   (PRU_INTC_BASE_ADDRESS + 0x4)
 
#define PRU_INTC_GLBLEN   (PRU_INTC_BASE_ADDRESS + 0x10)
 
#define PRU_INTC_GLBLNSTLVL   (PRU_INTC_BASE_ADDRESS + 0x1C)
 
#define PRU_INTC_STATIDXSET   (PRU_INTC_BASE_ADDRESS + 0x20)
 
#define PRU_INTC_STATIDXCLR   (PRU_INTC_BASE_ADDRESS + 0x24)
 
#define PRU_INTC_ENIDXSET   (PRU_INTC_BASE_ADDRESS + 0x28)
 
#define PRU_INTC_ENIDXCLR   (PRU_INTC_BASE_ADDRESS + 0x2C)
 
#define PRU_INTC_HSTINTENIDXSET   (PRU_INTC_BASE_ADDRESS + 0x34)
 
#define PRU_INTC_HSTINTENIDXCLR   (PRU_INTC_BASE_ADDRESS + 0x38)
 
#define PRU_INTC_GLBLPRIIDX   (PRU_INTC_BASE_ADDRESS + 0x80)
 
#define PRU_INTC_STATSETINT0   (PRU_INTC_BASE_ADDRESS + 0x200)
 
#define PRU_INTC_STATSETINT1   (PRU_INTC_BASE_ADDRESS + 0x204)
 
#define PRU_INTC_STATCLRINT0   (PRU_INTC_BASE_ADDRESS + 0x280)
 
#define PRU_INTC_STATCLRINT1   (PRU_INTC_BASE_ADDRESS + 0x284)
 
#define PRU_INTC_ENABLESET0   (PRU_INTC_BASE_ADDRESS + 0x300)
 
#define PRU_INTC_ENABLESET1   (PRU_INTC_BASE_ADDRESS + 0x304)
 
#define PRU_INTC_ENABLECLR0   (PRU_INTC_BASE_ADDRESS + 0x380)
 
#define PRU_INTC_ENABLECLR1   (PRU_INTC_BASE_ADDRESS + 0x384)
 
#define PRU_INTC_CHANMAP0   (PRU_INTC_BASE_ADDRESS + 0x400)
 
#define PRU_INTC_CHANMAP1   (PRU_INTC_BASE_ADDRESS + 0x404)
 
#define PRU_INTC_CHANMAP2   (PRU_INTC_BASE_ADDRESS + 0x408)
 
#define PRU_INTC_CHANMAP3   (PRU_INTC_BASE_ADDRESS + 0x40C)
 
#define PRU_INTC_CHANMAP4   (PRU_INTC_BASE_ADDRESS + 0x410)
 
#define PRU_INTC_CHANMAP5   (PRU_INTC_BASE_ADDRESS + 0x414)
 
#define PRU_INTC_CHANMAP6   (PRU_INTC_BASE_ADDRESS + 0x418)
 
#define PRU_INTC_CHANMAP7   (PRU_INTC_BASE_ADDRESS + 0x41C)
 
#define PRU_INTC_CHANMAP8   (PRU_INTC_BASE_ADDRESS + 0x420)
 
#define PRU_INTC_CHANMAP9   (PRU_INTC_BASE_ADDRESS + 0x424)
 
#define PRU_INTC_CHANMAP10   (PRU_INTC_BASE_ADDRESS + 0x428)
 
#define PRU_INTC_CHANMAP11   (PRU_INTC_BASE_ADDRESS + 0x42C)
 
#define PRU_INTC_CHANMAP12   (PRU_INTC_BASE_ADDRESS + 0x430)
 
#define PRU_INTC_CHANMAP13   (PRU_INTC_BASE_ADDRESS + 0x434)
 
#define PRU_INTC_CHANMAP14   (PRU_INTC_BASE_ADDRESS + 0x438)
 
#define PRU_INTC_CHANMAP15   (PRU_INTC_BASE_ADDRESS + 0x43C)
 
#define PRU_INTC_HOSTMAP0   (PRU_INTC_BASE_ADDRESS + 0x800)
 
#define PRU_INTC_HOSTMAP1   (PRU_INTC_BASE_ADDRESS + 0x804)
 
#define PRU_INTC_HOSTMAP2   (PRU_INTC_BASE_ADDRESS + 0x808)
 
#define PRU_INTC_HOSTINTPRIIDX0   (PRU_INTC_BASE_ADDRESS + 0x900)
 
#define PRU_INTC_HOSTINTPRIIDX1   (PRU_INTC_BASE_ADDRESS + 0x904)
 
#define PRU_INTC_HOSTINTPRIIDX2   (PRU_INTC_BASE_ADDRESS + 0x908)
 
#define PRU_INTC_HOSTINTPRIIDX3   (PRU_INTC_BASE_ADDRESS + 0x90C)
 
#define PRU_INTC_HOSTINTPRIIDX4   (PRU_INTC_BASE_ADDRESS + 0x910)
 
#define PRU_INTC_HOSTINTPRIIDX5   (PRU_INTC_BASE_ADDRESS + 0x914)
 
#define PRU_INTC_HOSTINTPRIIDX6   (PRU_INTC_BASE_ADDRESS + 0x918)
 
#define PRU_INTC_HOSTINTPRIIDX7   (PRU_INTC_BASE_ADDRESS + 0x91C)
 
#define PRU_INTC_HOSTINTPRIIDX8   (PRU_INTC_BASE_ADDRESS + 0x920)
 
#define PRU_INTC_HOSTINTPRIIDX9   (PRU_INTC_BASE_ADDRESS + 0x924)
 
#define PRU_INTC_POLARITY0   (PRU_INTC_BASE_ADDRESS + 0xD00)
 
#define PRU_INTC_POLARITY1   (PRU_INTC_BASE_ADDRESS + 0xD04)
 
#define PRU_INTC_TYPE0   (PRU_INTC_BASE_ADDRESS + 0xD80)
 
#define PRU_INTC_TYPE1   (PRU_INTC_BASE_ADDRESS + 0xD84)
 
#define PRU_INTC_HOSTINTNSTLVL0   (PRU_INTC_BASE_ADDRESS + 0x1100)
 
#define PRU_INTC_HOSTINTNSTLVL1   (PRU_INTC_BASE_ADDRESS + 0x1104)
 
#define PRU_INTC_HOSTINTNSTLVL2   (PRU_INTC_BASE_ADDRESS + 0x1108)
 
#define PRU_INTC_HOSTINTNSTLVL3   (PRU_INTC_BASE_ADDRESS + 0x110C)
 
#define PRU_INTC_HOSTINTNSTLVL4   (PRU_INTC_BASE_ADDRESS + 0x1110)
 
#define PRU_INTC_HOSTINTNSTLVL5   (PRU_INTC_BASE_ADDRESS + 0x1114)
 
#define PRU_INTC_HOSTINTNSTLVL6   (PRU_INTC_BASE_ADDRESS + 0x1118)
 
#define PRU_INTC_HOSTINTNSTLVL7   (PRU_INTC_BASE_ADDRESS + 0x111C)
 
#define PRU_INTC_HOSTINTNSTLVL8   (PRU_INTC_BASE_ADDRESS + 0x1120)
 
#define PRU_INTC_HOSTINTNSTLVL9   (PRU_INTC_BASE_ADDRESS + 0x1124)
 
#define PRU_INTC_HOSTINTEN   (PRU_INTC_BASE_ADDRESS + 0x1500)
 
#define PRU_INTC_HOSTINTLVL_MAX   9
 

Typedefs

typedef struct arm_pru_iomap arm_pru_iomap
 

Functions

__FAR__ Uint32 pru_enable (Uint8 pruNum, arm_pru_iomap *pru_arm_iomap)
 
__FAR__ Uint32 pru_load (Uint8 pruNum, Uint32 *pruCode, Uint32 codeSizeInWords, arm_pru_iomap *pru_arm_iomap)
 
__FAR__ Uint32 pru_run (Uint8 pruNum, arm_pru_iomap *pru_arm_iomap)
 
__FAR__ Uint32 pru_waitForHalt (Uint8 pruNum, Int32 timeout, arm_pru_iomap *pru_arm_iomap)
 
__FAR__ Uint32 pru_disable (arm_pru_iomap *pru_arm_iomap)
 
short pru_ram_write_data (Uint32 u32offset, Uint8 *pu8datatowrite, Uint16 u16wordstowrite, arm_pru_iomap *pru_arm_iomap)
 pru_ram_write_data() Download the data into data RAM of PRU0 or PRU1 of OMAP L138. More...
 
short pru_ram_read_data (Uint32 u32offset, Uint8 *pu8datatoread, Uint16 u16wordstoread, arm_pru_iomap *pru_arm_iomap)
 pru_ram_read_data() Download the data into data RAM of PRU0 or PRU1 of OMAP L138. More...
 
short pru_ram_read_data_4byte (unsigned int u32offset, unsigned int *pu32datatoread, short u16wordstoread)
 pru_ram_read_data_4byte() Download the data into data RAM of PRU0 or PRU1 of OMAP L138. More...
 
short pru_ram_write_data_4byte (unsigned int u32offset, unsigned int *pu32datatoread, short u16wordstoread)
 pru_ram_write_data_4byte() Download the data into data RAM of PRU0 or PRU1 of OMAP L138. More...
 

Macro Definition Documentation

#define PRU0_DATA_RAM_START   (0x01C30000)

Definition at line 25 of file pru.h.

#define PRU0_PROG_RAM_START   (0x01C38000)

Definition at line 26 of file pru.h.

#define PRU1_DATA_RAM_START   (0x01C32000)

Definition at line 28 of file pru.h.

#define PRU1_PROG_RAM_START   (0x01C3C000)

Definition at line 29 of file pru.h.

#define PRU_DATA_RAM_SIZE   (0x200)

Definition at line 31 of file pru.h.

#define PRU_INTC_BASE_ADDRESS   (PRU_PRU0_BASE_ADDRESS + 0x4000)

Definition at line 35 of file pru.h.

#define PRU_INTC_CHANMAP0   (PRU_INTC_BASE_ADDRESS + 0x400)

Definition at line 56 of file pru.h.

#define PRU_INTC_CHANMAP1   (PRU_INTC_BASE_ADDRESS + 0x404)

Definition at line 57 of file pru.h.

#define PRU_INTC_CHANMAP10   (PRU_INTC_BASE_ADDRESS + 0x428)

Definition at line 66 of file pru.h.

#define PRU_INTC_CHANMAP11   (PRU_INTC_BASE_ADDRESS + 0x42C)

Definition at line 67 of file pru.h.

#define PRU_INTC_CHANMAP12   (PRU_INTC_BASE_ADDRESS + 0x430)

Definition at line 68 of file pru.h.

#define PRU_INTC_CHANMAP13   (PRU_INTC_BASE_ADDRESS + 0x434)

Definition at line 69 of file pru.h.

#define PRU_INTC_CHANMAP14   (PRU_INTC_BASE_ADDRESS + 0x438)

Definition at line 70 of file pru.h.

#define PRU_INTC_CHANMAP15   (PRU_INTC_BASE_ADDRESS + 0x43C)

Definition at line 71 of file pru.h.

#define PRU_INTC_CHANMAP2   (PRU_INTC_BASE_ADDRESS + 0x408)

Definition at line 58 of file pru.h.

#define PRU_INTC_CHANMAP3   (PRU_INTC_BASE_ADDRESS + 0x40C)

Definition at line 59 of file pru.h.

#define PRU_INTC_CHANMAP4   (PRU_INTC_BASE_ADDRESS + 0x410)

Definition at line 60 of file pru.h.

#define PRU_INTC_CHANMAP5   (PRU_INTC_BASE_ADDRESS + 0x414)

Definition at line 61 of file pru.h.

#define PRU_INTC_CHANMAP6   (PRU_INTC_BASE_ADDRESS + 0x418)

Definition at line 62 of file pru.h.

#define PRU_INTC_CHANMAP7   (PRU_INTC_BASE_ADDRESS + 0x41C)

Definition at line 63 of file pru.h.

#define PRU_INTC_CHANMAP8   (PRU_INTC_BASE_ADDRESS + 0x420)

Definition at line 64 of file pru.h.

#define PRU_INTC_CHANMAP9   (PRU_INTC_BASE_ADDRESS + 0x424)

Definition at line 65 of file pru.h.

#define PRU_INTC_CONTROL   (PRU_INTC_BASE_ADDRESS + 0x4)

Definition at line 38 of file pru.h.

#define PRU_INTC_ENABLECLR0   (PRU_INTC_BASE_ADDRESS + 0x380)

Definition at line 54 of file pru.h.

#define PRU_INTC_ENABLECLR1   (PRU_INTC_BASE_ADDRESS + 0x384)

Definition at line 55 of file pru.h.

#define PRU_INTC_ENABLESET0   (PRU_INTC_BASE_ADDRESS + 0x300)

Definition at line 52 of file pru.h.

#define PRU_INTC_ENABLESET1   (PRU_INTC_BASE_ADDRESS + 0x304)

Definition at line 53 of file pru.h.

#define PRU_INTC_ENIDXCLR   (PRU_INTC_BASE_ADDRESS + 0x2C)

Definition at line 44 of file pru.h.

#define PRU_INTC_ENIDXSET   (PRU_INTC_BASE_ADDRESS + 0x28)

Definition at line 43 of file pru.h.

#define PRU_INTC_GLBLEN   (PRU_INTC_BASE_ADDRESS + 0x10)

Definition at line 39 of file pru.h.

#define PRU_INTC_GLBLNSTLVL   (PRU_INTC_BASE_ADDRESS + 0x1C)

Definition at line 40 of file pru.h.

#define PRU_INTC_GLBLPRIIDX   (PRU_INTC_BASE_ADDRESS + 0x80)

Definition at line 47 of file pru.h.

#define PRU_INTC_HOSTINTEN   (PRU_INTC_BASE_ADDRESS + 0x1500)

Definition at line 99 of file pru.h.

#define PRU_INTC_HOSTINTLVL_MAX   9

Definition at line 102 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL0   (PRU_INTC_BASE_ADDRESS + 0x1100)

Definition at line 89 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL1   (PRU_INTC_BASE_ADDRESS + 0x1104)

Definition at line 90 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL2   (PRU_INTC_BASE_ADDRESS + 0x1108)

Definition at line 91 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL3   (PRU_INTC_BASE_ADDRESS + 0x110C)

Definition at line 92 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL4   (PRU_INTC_BASE_ADDRESS + 0x1110)

Definition at line 93 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL5   (PRU_INTC_BASE_ADDRESS + 0x1114)

Definition at line 94 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL6   (PRU_INTC_BASE_ADDRESS + 0x1118)

Definition at line 95 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL7   (PRU_INTC_BASE_ADDRESS + 0x111C)

Definition at line 96 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL8   (PRU_INTC_BASE_ADDRESS + 0x1120)

Definition at line 97 of file pru.h.

#define PRU_INTC_HOSTINTNSTLVL9   (PRU_INTC_BASE_ADDRESS + 0x1124)

Definition at line 98 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX0   (PRU_INTC_BASE_ADDRESS + 0x900)

Definition at line 75 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX1   (PRU_INTC_BASE_ADDRESS + 0x904)

Definition at line 76 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX2   (PRU_INTC_BASE_ADDRESS + 0x908)

Definition at line 77 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX3   (PRU_INTC_BASE_ADDRESS + 0x90C)

Definition at line 78 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX4   (PRU_INTC_BASE_ADDRESS + 0x910)

Definition at line 79 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX5   (PRU_INTC_BASE_ADDRESS + 0x914)

Definition at line 80 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX6   (PRU_INTC_BASE_ADDRESS + 0x918)

Definition at line 81 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX7   (PRU_INTC_BASE_ADDRESS + 0x91C)

Definition at line 82 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX8   (PRU_INTC_BASE_ADDRESS + 0x920)

Definition at line 83 of file pru.h.

#define PRU_INTC_HOSTINTPRIIDX9   (PRU_INTC_BASE_ADDRESS + 0x924)

Definition at line 84 of file pru.h.

#define PRU_INTC_HOSTMAP0   (PRU_INTC_BASE_ADDRESS + 0x800)

Definition at line 72 of file pru.h.

#define PRU_INTC_HOSTMAP1   (PRU_INTC_BASE_ADDRESS + 0x804)

Definition at line 73 of file pru.h.

#define PRU_INTC_HOSTMAP2   (PRU_INTC_BASE_ADDRESS + 0x808)

Definition at line 74 of file pru.h.

#define PRU_INTC_HSTINTENIDXCLR   (PRU_INTC_BASE_ADDRESS + 0x38)

Definition at line 46 of file pru.h.

#define PRU_INTC_HSTINTENIDXSET   (PRU_INTC_BASE_ADDRESS + 0x34)

Definition at line 45 of file pru.h.

#define PRU_INTC_POLARITY0   (PRU_INTC_BASE_ADDRESS + 0xD00)

Definition at line 85 of file pru.h.

#define PRU_INTC_POLARITY1   (PRU_INTC_BASE_ADDRESS + 0xD04)

Definition at line 86 of file pru.h.

#define PRU_INTC_REVID   (PRU_INTC_BASE_ADDRESS + 0)

Definition at line 37 of file pru.h.

#define PRU_INTC_STATCLRINT0   (PRU_INTC_BASE_ADDRESS + 0x280)

Definition at line 50 of file pru.h.

#define PRU_INTC_STATCLRINT1   (PRU_INTC_BASE_ADDRESS + 0x284)

Definition at line 51 of file pru.h.

#define PRU_INTC_STATIDXCLR   (PRU_INTC_BASE_ADDRESS + 0x24)

Definition at line 42 of file pru.h.

#define PRU_INTC_STATIDXSET   (PRU_INTC_BASE_ADDRESS + 0x20)

Definition at line 41 of file pru.h.

#define PRU_INTC_STATSETINT0   (PRU_INTC_BASE_ADDRESS + 0x200)

Definition at line 48 of file pru.h.

#define PRU_INTC_STATSETINT1   (PRU_INTC_BASE_ADDRESS + 0x204)

Definition at line 49 of file pru.h.

#define PRU_INTC_TYPE0   (PRU_INTC_BASE_ADDRESS + 0xD80)

Definition at line 87 of file pru.h.

#define PRU_INTC_TYPE1   (PRU_INTC_BASE_ADDRESS + 0xD84)

Definition at line 88 of file pru.h.

#define PRU_NUM0   (0)

Definition at line 18 of file pru.h.

#define PRU_NUM1   (1)

Definition at line 19 of file pru.h.

#define PRU_PROG_RAM_SIZE   (0x1000)

Definition at line 32 of file pru.h.

#define PRU_PRU0_BASE_ADDRESS   0

Definition at line 34 of file pru.h.

Typedef Documentation

typedef struct arm_pru_iomap arm_pru_iomap

Function Documentation

__FAR__ Uint32 pru_disable ( arm_pru_iomap pru_arm_iomap)

Definition at line 104 of file pru.c.

__FAR__ Uint32 pru_enable ( Uint8  pruNum,
arm_pru_iomap pru_arm_iomap 
)

Definition at line 133 of file pru.c.

__FAR__ Uint32 pru_load ( Uint8  pruNum,
Uint32 *  pruCode,
Uint32  codeSizeInWords,
arm_pru_iomap pru_arm_iomap 
)

Definition at line 34 of file pru.c.

short pru_ram_read_data ( Uint32  u32offset,
Uint8 *  pu8datatoread,
Uint16  u16bytestoread,
arm_pru_iomap pru_arm_iomap 
)

pru_ram_read_data() Download the data into data RAM of PRU0 or PRU1 of OMAP L138.


This API will be called by the Application to read the data from data RAM of PRU0 or PRU1

Parameters
u32offsetOffset of the data RAM where the data has to be read
pu8datatoreadPointer to a buffer that would hold the data to be read from the RAM
u16bytestoreadNumber of bytes to be read from RAM
Returns
SUCCESS or FAILURE

Definition at line 251 of file pru.c.

short pru_ram_read_data_4byte ( unsigned int  u32offset,
unsigned int *  pu32datatoread,
short  u16wordstoread 
)

pru_ram_read_data_4byte() Download the data into data RAM of PRU0 or PRU1 of OMAP L138.


This API will be called by the Application to read the data from data RAM of PRU0 or PRU1

Parameters
u32offsetOffset of the data RAM where the data has to be read
pu32datatoreadPointer to a buffer that would hold the data to be read from the RAM
u16wordstoreadNumber of words to be read from RAM
Returns
SUCCESS or FAILURE

Definition at line 306 of file pru.c.

short pru_ram_write_data ( Uint32  u32offset,
Uint8 *  pu8datatowrite,
Uint16  u16bytestowrite,
arm_pru_iomap pru_arm_iomap 
)

pru_ram_write_data() Download the data into data RAM of PRU0 or PRU1 of OMAP L138.


This API will be called by the Application to download the data into data RAM of PRU0 or PRU1

Parameters
u32offsetOffset of the data RAM where the data has to be written
pu32datatowritePointer to a buffer that holds the data to be written into RAM
u16wordstowriteNumber of bytes to be written into that RAM
Returns
SUCCESS or FAILURE

Definition at line 225 of file pru.c.

short pru_ram_write_data_4byte ( unsigned int  u32offset,
unsigned int *  pu32datatowrite,
short  u16wordstowrite 
)

pru_ram_write_data_4byte() Download the data into data RAM of PRU0 or PRU1 of OMAP L138.


This API will be called by the Application to download the data into data RAM of PRU0 or PRU1

Parameters
u32offsetOffset of the data RAM where the data has to be written
pu32datatowritePointer to a buffer that holds the data to be written into RAM
u16wordstowriteNumber of words to be written into that RAM

//eturn SUCCESS or FAILURE

Definition at line 278 of file pru.c.

__FAR__ Uint32 pru_run ( Uint8  pruNum,
arm_pru_iomap pru_arm_iomap 
)

Definition at line 58 of file pru.c.

__FAR__ Uint32 pru_waitForHalt ( Uint8  pruNum,
Int32  timeout,
arm_pru_iomap pru_arm_iomap 
)

Definition at line 76 of file pru.c.