Browse Source

initial commit

root 7 years ago
commit
1667f12757
  1. 10
      Linux_Workspace.vpw
  2. 828
      Projects/DirectMemo/DirectMemo.cpp
  3. 328
      Projects/DirectMemo/DirectMemo.vpj
  4. 109
      Projects/DirectMemo/adc1Window.cpp
  5. 31
      Projects/DirectMemo/adc1Window.h
  6. 48
      Projects/DirectMemo/config_can
  7. 130
      Projects/DirectMemo/devmem2.c
  8. BIN
      Projects/DirectMemo/elftest
  9. 43
      Projects/DirectMemo/elftest.c
  10. 92
      Projects/DirectMemo/gpioWindow.cpp
  11. 37
      Projects/DirectMemo/gpioWindow.h
  12. 71
      Projects/DirectMemo/mainWindow.cpp
  13. 34
      Projects/DirectMemo/mainWindow.h
  14. 329
      Projects/DirectMemo/makefile
  15. 179
      Projects/DirectMemo/motorWindow.cpp
  16. 34
      Projects/DirectMemo/motorWindow.h
  17. 2
      Projects/DirectMemo/out.txt
  18. 1
      Projects/DirectMemo/pindosia/gpio-ranges
  19. 75
      Projects/DirectMemo/pindosia/pinctrl-handles
  20. 227
      Projects/DirectMemo/pindosia/pingroups
  21. 30
      Projects/DirectMemo/pindosia/pinmux-functions
  22. 201
      Projects/DirectMemo/pindosia/pinmux-pins
  23. 200
      Projects/DirectMemo/pindosia/pins
  24. 1347
      Projects/DirectMemo/popa.txt
  25. 45
      Projects/DirectMemo/protocols.txt
  26. 53
      Projects/DirectMemo/pru0Window.cpp
  27. 23
      Projects/DirectMemo/pru0Window.h
  28. 53
      Projects/DirectMemo/pru1Window.cpp
  29. 23
      Projects/DirectMemo/pru1Window.h
  30. 285
      Projects/DirectMemo/pruCoresWindow.cpp
  31. 29
      Projects/DirectMemo/pruCoresWindow.h
  32. 185
      Projects/DirectMemo/pwmInfoWindow.cpp
  33. 28
      Projects/DirectMemo/pwmInfoWindow.h
  34. 101
      Projects/DirectMemo/tgz2Window.cpp
  35. 35
      Projects/DirectMemo/tgz2Window.h
  36. 98
      Projects/DirectMemo/tgzWindow.cpp
  37. 35
      Projects/DirectMemo/tgzWindow.h
  38. 42
      Projects/DirectMemo/tupus0_0Window.cpp
  39. 23
      Projects/DirectMemo/tupus0_0Window.h
  40. 41
      Projects/DirectMemo/tupus0_1Window.cpp
  41. 23
      Projects/DirectMemo/tupus0_1Window.h
  42. 41
      Projects/DirectMemo/tupus1_0Window.cpp
  43. 23
      Projects/DirectMemo/tupus1_0Window.h
  44. 41
      Projects/DirectMemo/tupus1_1Window.cpp
  45. 23
      Projects/DirectMemo/tupus1_1Window.h
  46. 244
      Projects/DirectPRU/DirectPRU.vpj
  47. 182
      Projects/DirectPRU/include/__prussdrv.h
  48. 62
      Projects/DirectPRU/include/csl/cslr.h
  49. 3072
      Projects/DirectPRU/include/csl/cslr_dspintc.h
  50. 1655
      Projects/DirectPRU/include/csl/cslr_gpio.h
  51. 4000
      Projects/DirectPRU/include/csl/cslr_mcasp.h
  52. 757
      Projects/DirectPRU/include/csl/cslr_prucore.h
  53. 3777
      Projects/DirectPRU/include/csl/cslr_pruintc.h
  54. 532
      Projects/DirectPRU/include/csl/cslr_psc_OMAPL138.h
  55. 2624
      Projects/DirectPRU/include/csl/cslr_syscfg0_OMAPL138.h
  56. 900
      Projects/DirectPRU/include/csl/soc_OMAPL138.h
  57. 70
      Projects/DirectPRU/include/edma.h
  58. 67
      Projects/DirectPRU/include/edmautils.h
  59. 61
      Projects/DirectPRU/include/omapl_suart_board.h
  60. 155
      Projects/DirectPRU/include/pru.h
  61. 95
      Projects/DirectPRU/include/pruss_intc_mapping.h
  62. 148
      Projects/DirectPRU/include/prussdrv.h
  63. 378
      Projects/DirectPRU/include/suart_api.h
  64. 76
      Projects/DirectPRU/include/suart_err.h
  65. 215
      Projects/DirectPRU/include/suart_pru_regs.h
  66. 106
      Projects/DirectPRU/include/suart_utils.h
  67. 203
      Projects/DirectPRU/include/tistdtypes.h
  68. 169
      Projects/DirectPRU/src/edma.c
  69. 329
      Projects/DirectPRU/src/edmautils.c
  70. 317
      Projects/DirectPRU/src/pru.c
  71. 538
      Projects/DirectPRU/src/prussdrv.c
  72. 1936
      Projects/DirectPRU/src/suart_api.c
  73. 443
      Projects/DirectPRU/src/suart_utils.c
  74. BIN
      Projects/JustADCTest/Debug/JustADCTest
  75. BIN
      Projects/JustADCTest/Debug/JustADCTest.o
  76. BIN
      Projects/JustADCTest/Debug/adc_ss.o
  77. BIN
      Projects/JustADCTest/Debug/am437x_cm.o
  78. BIN
      Projects/JustADCTest/Debug/am437x_prmcm.o
  79. BIN
      Projects/JustADCTest/Debug/basicDualThread.o
  80. BIN
      Projects/JustADCTest/Debug/basicLogCollection.o
  81. BIN
      Projects/JustADCTest/Debug/basicLoggingService.o
  82. BIN
      Projects/JustADCTest/Debug/basicRing.o
  83. BIN
      Projects/JustADCTest/Debug/basicThread.o
  84. BIN
      Projects/JustADCTest/Debug/basicTransport.o
  85. BIN
      Projects/JustADCTest/Debug/canbus.o
  86. BIN
      Projects/JustADCTest/Debug/classSOC.o
  87. BIN
      Projects/JustADCTest/Debug/cliClass.o
  88. 1908
      Projects/JustADCTest/Debug/my.log
  89. BIN
      Projects/JustADCTest/Debug/objectFileLoggingService.o
  90. BIN
      Projects/JustADCTest/Debug/pru_ss.o
  91. BIN
      Projects/JustADCTest/Debug/pwm_ss.o
  92. BIN
      Projects/JustADCTest/Debug/tupus_ext.o
  93. 94
      Projects/JustADCTest/JustADCTest.cpp
  94. 233
      Projects/JustADCTest/JustADCTest.vpj
  95. 207
      Projects/JustADCTest/makefile
  96. 61
      Projects/LRF_Server/Debug/3DLRF.conf
  97. 48
      Projects/LRF_Server/Debug/3DLRF.conf.backup
  98. BIN
      Projects/LRF_Server/Debug/PRU_0_0.bin
  99. BIN
      Projects/LRF_Server/Debug/PRU_0_1.bin
  100. BIN
      Projects/LRF_Server/Debug/PRU_1_0.bin

10
Linux_Workspace.vpw

@ -0,0 +1,10 @@
<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd">
<Workspace Version="10.0" VendorName="SlickEdit">
<Projects>
<Project File="Projects/argus/argus.vpj"/>
<Project File="Projects/DirectMemo/DirectMemo.vpj"/>
<Project File="Projects/DirectPRU/DirectPRU.vpj"/>
<Project File="Projects/JustADCTest/JustADCTest.vpj"/>
<Project File="Projects/LRF_Server/LRF_Server.vpj"/>
</Projects>
</Workspace>

828
Projects/DirectMemo/DirectMemo.cpp

@ -0,0 +1,828 @@
#include <stdio.h>
#include "../../source/lib/components/base/basicLogCollection.h"
#include "../../source/lib/components/object/objectCliLoggingServices.h"
#include "../../source/lib/components/object/objectFileLoggingService.h"
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/hardware/can/canbus.h"
#include "../../source/lib/data/protocol/protocolTGZ.h"
#include "mainWindow.h"
#include "tgzWindow.h"
#include "tgz2Window.h"
#include "pwmInfoWindow.h"
#include "pruCoresWindow.h"
#include "tupus1_0Window.h"
#include "tupus1_1Window.h"
#include "tupus0_1Window.h"
#include "tupus0_0Window.h"
#include "pru0Window.h"
#include "pru1Window.h"
#include "adc1Window.h"
#include "motorWindow.h"
#include "gpioWindow.h"
#define LOG( X ) LogEng->Log( "main", 0, X )
#define LOG_ERROR( X ) LogEng->Log( "main", 0, _LOG_ERROR, X )
#ifdef NEWT_CLI
#include <signal.h>
struct callbackInfo {
newtComponent en;
char * state;
};
void disableCallback(newtComponent co, void * data) {
struct callbackInfo * cbi = ( struct callbackInfo *) data;
if (*cbi->state == ' ') {
newtEntrySetFlags(cbi->en, NEWT_FLAG_DISABLED, NEWT_FLAGS_RESET);
} else {
newtEntrySetFlags(cbi->en, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET);
}
newtRefresh();
};
void suspend(void * d) {
newtSuspend();
raise( SIGTSTP );
newtResume();
};
#endif
int main (int argc, char *argv[]){
#ifdef TURBOVISION
WindowCLI *a;
a = new WindowCLI();
a->run();
#else
#ifdef NEWT_CLI
newtComponent mainMenuForm, checkbox, rb[3], button;
char cbValue;
int i;
newtInit();
newtCls();
newtSetSuspendCallback( suspend, NULL );
newtDrawRootText( 0, 0, "Direct Memory Tool" );
newtDrawRootText( -29, -2, "© Dr. Frucht Systems Ltd." );
canBus *mCanBus_OLD;
canBus *mCanBus_NEW;
protocolTGZ *mTGZdevice_OLD;
protocolTGZ *mTGZdevice_NEW;
mainWindow *my_win;
tgz1Window *tgz_oldWindow = NULL;
tgz2Window *tgz_newWindow = NULL;
pwmInfoWindow *pwmWindow0;
pruCoresWindow *coreWindow;
tupus0_0Window *t00W;
tupus0_1Window *t01W;
tupus1_0Window *t10W;
tupus1_1Window *t11W;
pru0Window *pPW0;
pru1Window *pPW1;
adc1Window *pADC;
motorWindow *mW;
basicLogCollection *LogEng;
classSOC *mSOC;
objectCliLoggingService *LogWND;
objectFileLoggingService *LogFile;
gpioWindow *gpioWND;
int ch;
my_win = new mainWindow();
LogEng = basicLogCollection::getInstance();
LogWND = new objectCliLoggingService();
LogFile = new objectFileLoggingService("my.log");
LogEng->addHandler( LogFile );
LogEng->addHandler( LogWND );
mSOC = classSOC::getInstance();
init_PRMCM();
//printf( "PRMCM Init Done\n" );
enable_ADC1_CLK();
//printf( "ADC1 CLK Enable Done\n" );
init_ADC_0();
init_ADC_1();
//prepareFSM1();
if(!init_GPIO_0())LOG("GPIO0 Init Error!");
if(!init_GPIO_1())LOG("GPIO1 Init Error!");
if(!init_GPIO_2())LOG("GPIO2 Init Error!");
if(!init_GPIO_3())LOG("GPIO3 Init Error!");
if(!init_GPIO_4())LOG("GPIO4 Init Error!");
if(!init_GPIO_5())LOG("GPIO5 Init Error!");
//mSOC->pru_load( 0, 0, "CORE0_0.bin" );
//mSOC->pru_load( 0, 1, "CORE0_1.bin" );
//mSOC->pru_load( 1, 0, "CORE1_0.bin" );
//mSOC->pru_load( 1, 1, "CORE1_1.bin" );
//mSOC->pru_run( 1, 1 );
//mSOC->pru_run( 1, 0 );
//mSOC->pru_run( 0, 1 );
//mSOC->pru_run( 0, 0 );
pwmWindow0 = new pwmInfoWindow();
coreWindow = new pruCoresWindow();
t11W = new tupus1_1Window();
t10W = new tupus1_0Window();
t01W = new tupus0_1Window();
t00W = new tupus0_0Window();
//pPW0 = new pru0Window();
//pPW1 = new pru1Window();
pADC = new adc1Window();
mW = new motorWindow();
mCanBus_OLD = new canBus( "can1", 0x200, 0x201 );
if( mCanBus_OLD != NULL ) {
LOG("CAN Bus creation success");
mTGZdevice_OLD = new protocolTGZ( mCanBus_OLD );
if( mTGZdevice_OLD == NULL ) {
LOG_ERROR("TGZ OLD protocol creation failure");
}else{
tgz_oldWindow = new tgz1Window( mTGZdevice_OLD );
LOG("TGZ OLD protocol creation success");
};
} else {
LOG_ERROR("CAN Bus creation failure");
};
mCanBus_NEW = new canBus( "can1", 0x300, 0x301 );
if( mCanBus_NEW != NULL ) {
LOG("CAN Bus creation success");
mTGZdevice_NEW = new protocolTGZ( mCanBus_NEW );
if( mTGZdevice_NEW == NULL ) {
LOG_ERROR("TGZ NEW protocol creation failure");
}else{
mTGZdevice_NEW->setSpeeds( 0, 0 );
tgz_newWindow = new tgz2Window( mTGZdevice_NEW );
LOG("TGZ NEW protocol creation success");
};
} else {
LOG_ERROR("CAN Bus creation failure");
};
gpioWND = new gpioWindow();
newtRefresh();
newtComponent answer;
int momo = 0;
do {
my_win->show();
answer = my_win->run();
my_win->hide();
momo = my_win->decodeEvent( answer );
if( momo ){
switch( momo ) {
case 1:{//ADC
pADC->show();
pADC->run();
pADC->hide();
break;
};
case 2:{//PWM
pwmWindow0->show();
pwmWindow0->run();
pwmWindow0->hide();
break;
};
case 3:{//Motors
mW->show();
mW->run();
mW->hide();
break;
};
case 4:{//PRUSS
pwmWindow0->show();
pwmWindow0->run();
pwmWindow0->hide();
break;
};
case 5:{//PRU
coreWindow->show();
coreWindow->run();
coreWindow->hide();
break;
};
case 6:{
mSOC->pru_sreset( 1, 1 );
mSOC->pru_sreset( 1, 0 );
mSOC->pru_sreset( 0, 1 );
mSOC->pru_sreset( 0, 0 );
LogWND->show();
LogWND->run();
LogWND->hide();
break;
};
case 7:{
mSOC->pru_stop( 0, 0 );
mSOC->pru_stop( 0, 1 );
mSOC->pru_stop( 1, 0 );
mSOC->pru_stop( 1, 1 );
LogWND->show();
LogWND->run();
LogWND->hide();
break;
};
case 8:{
mSOC->pru_run( 1, 1 );
mSOC->pru_run( 1, 0 );
mSOC->pru_run( 0, 1 );
mSOC->pru_run( 0, 0 );
LogWND->show();
LogWND->run();
LogWND->hide();
break;
};
case 9:{
mSOC->pru_save( 1, 0, "toto0.bin", true );
mSOC->pru_save( 1, 1, "toto1.bin", true );
LogWND->show();
LogWND->run();
LogWND->hide();
break;
};
case 10:{
mSOC->pru_save( 1, 0, "toto0.bin", false );
mSOC->pru_save( 1, 1, "toto1.bin", false );
LogWND->show();
LogWND->run();
LogWND->hide();
break;
};
case 11:{
mSOC->pru_load( 0, 0, "PRU_0_0.bin" );
mSOC->pru_load( 0, 1, "PRU_0_1.bin" );
mSOC->pru_load( 1, 0, "PRU_1_0.bin", false );
mSOC->pru_load( 1, 1, "PRU_1_1.bin", false );
mSOC->pru_run( 0, 0 );
mSOC->pru_run( 0, 1 );
mSOC->pru_run( 1, 0 );
mSOC->pru_run( 1, 1 );
LogWND->show();
LogWND->run();
LogWND->hide();
break;
};
case 12:{ // Old TGZ
if( tgz_oldWindow!= NULL ) {
newtComponent l_answer;
int l_momo = 0;
do{
tgz_oldWindow->show();
l_answer = tgz_oldWindow->run();
tgz_oldWindow->hide();
l_momo = tgz_oldWindow->decodeEvent( l_answer );
if( l_momo ){
switch( l_momo ) {
case 1: mTGZdevice_OLD->toggleRun(); break;
case 2: mTGZdevice_OLD->toggleErrorReset(); break;
case 3: mTGZdevice_OLD->togglePRF(); break;
case 4: mTGZdevice_OLD->toggleDivider(); break;
case 5: mTGZdevice_OLD->togleRatio(); break;
case 6: mTGZdevice_OLD->startDeviceStateInquiry(); break;
case 255: l_momo = 0; break;
};
newtRefresh();
};
} while( l_momo );
};
break;
};
case 13:{ // New TGZ
if( tgz_newWindow!= NULL ) {
newtComponent l_answer;
int l_momo = 0;
do{
tgz_newWindow->show();
l_answer = tgz_newWindow->run();
tgz_newWindow->hide();
l_momo = tgz_newWindow->decodeEvent( l_answer );
if( l_momo ){
switch( l_momo ) {
case 1: mTGZdevice_NEW->toggleRun(); break;
case 2: mTGZdevice_NEW->toggleErrorReset(); break;
case 3: mTGZdevice_NEW->toggleQSpeed(); break;
case 4: mTGZdevice_NEW->toggleBSpeed(); break;
case 5: mTGZdevice_NEW->startDeviceStateInquiry(); break;
case 255: l_momo = 0; break;
};
newtRefresh();
};
} while( l_momo );
};
break;
};
case 14:{//View LOG
LogWND->show();
LogWND->run();
LogWND->hide();
break;
};
case 15:{// View GPIO
gpioWND->show();
break;
};
case 255: momo = 0; break;
default:{
//momo = 0;
};
};
newtRefresh();
};
} while( momo );
delete( my_win );
newtFinished();
printf( "Momo: %d Ans: %p\n\n", momo, answer );
#else
canBus *mCanBus;
protocolTGZ *mTGZdevice;
basicNCursesEngine *MyCurses;
mainWindow *my_win;
//tgzWindow *pWindow;
pwmInfoWindow *pwmWindow0;
tupus0_0Window *t00W;
tupus0_1Window *t01W;
tupus1_0Window *t10W;
tupus1_1Window *t11W;
pru0Window *pPW0;
pru1Window *pPW1;
adc1Window *pADC;
motorWindow *mW;
basicLogCollection *LogEng;
objectCURSESLoggingService *LogWND;
classSOC *mSOC;
objectFileLoggingService *LogFile;
int ch;
MyCurses = basicNCursesEngine::getInstance();
LogEng = basicLogCollection::getInstance();
LogWND = new objectCURSESLoggingService();
LogFile = new objectFileLoggingService("my.log");
LogEng->addHandler( LogFile );
LogEng->addHandler( LogWND );
refresh();
mSOC = classSOC::getInstance();
init_PRMCM();
printf( "PRMCM Init Done\n" );
enable_ADC1_CLK();
printf( "ADC1 CLK Enable Done\n" );
init_ADC_0();
init_ADC_1();
printf( "ADC Init Done\n" );
printf( "Revision 0: 0x%08X\n", getRevisionADC0() );
printf( "Revision 1: 0x%08X\n", getRevisionADC1() );
//prepareFSM1();
//mSOC->pru_load( 0, 0, "CORE0_0.bin" );
//mSOC->pru_load( 0, 1, "CORE0_1.bin" );
//mSOC->pru_load( 1, 0, "CORE1_0.bin" );
//mSOC->pru_load( 1, 1, "CORE1_1.bin" );
//mSOC->pru_run( 1, 1 );
//mSOC->pru_run( 1, 0 );
//mSOC->pru_run( 0, 1 );
//mSOC->pru_run( 0, 0 );
my_win = new mainWindow();
pwmWindow0 = new pwmInfoWindow();
t11W = new tupus1_1Window();
t10W = new tupus1_0Window();
t01W = new tupus0_1Window();
t00W = new tupus0_0Window();
//pPW0 = new pru0Window();
//pPW1 = new pru1Window();
pADC = new adc1Window();
mW = new motorWindow();
mCanBus = new canBus( "can1", 0x200, 0x201 );
if( mCanBus != NULL ) {
LOG("CAN Bus creation success");
mTGZdevice = new protocolTGZ( mCanBus, 0x200, 0x201 );
if( mTGZdevice == NULL ) {
LOG_ERROR("TGZ protocol creation failure");
}else{
LOG("TGZ protocol creation success");
};
} else {
LOG_ERROR("CAN Bus creation failure");
};
//pWindow = new tgzWindow( mTGZdevice );
while((ch = getch()) != KEY_F(1) ) {
switch(ch){
case KEY_LEFT:
//MyCurses->destroy_win(my_win);
//my_win = MyCurses->create_win(height, width, starty,--startx);
break;
case KEY_RIGHT:
//MyCurses->destroy_win(my_win);
//my_win = MyCurses->create_win(height, width, starty,++startx);
break;
case KEY_UP:
break;
case KEY_DOWN:
//MyCurses->destroy_win(my_win);
//my_win = MyCurses->create_win(height, width, ++starty,startx);
break;
};
switch( ch ) {
case '1':
mTGZdevice->toggleErrorReset();
//pWindow->paint();
break;
case '2':
mTGZdevice->toggleRun();
//pWindow->paint();
break;
case '3':
mTGZdevice->togglePRF();
//pWindow->paint();
break;
case '4':
mTGZdevice->togleRatio();
//pWindow->paint();
break;
case '5':
mTGZdevice->toggleDivider();
//pWindow->paint();
break;
case '6':
mTGZdevice->stopPRF();
//pWindow->paint();
break;
case '7':
mTGZdevice->stopAzimuth();
//pWindow->paint();
break;
//case '0':{
// char *pName;
// pName = mTGZdevice->generateFileNameForStat();
// //mW->saveStatToFile( pName );
// free( pName );
// break;
// };
case 'q':
case 'Q': return 0;
case '9':
case 'r':
case 'R':
// mW->resetStat();
mSOC->pru_sreset( 1, 1 );
mSOC->pru_sreset( 1, 0 );
mSOC->pru_sreset( 0, 1 );
mSOC->pru_sreset( 0, 0 );
break;
case ' ':
my_win->paint();
pwmWindow0->paint();
//pWindow->paint();
//mW->paint();
t00W->paint();
t01W->paint();
t10W->paint();
t11W->paint();
//pPW0->paint();
//pPW1->paint();
pADC->paint();
LogWND->paint();
continue;
break;
case 's':
case 'S':
mSOC->pru_save( 1, 0, "toto0.bin" );
mSOC->pru_save( 1, 1, "toto1.bin" );
break;
case 'l':
case 'L':
mSOC->pru_load( 0, 0, "PRU_0_0.bin" );
mSOC->pru_load( 0, 1, "PRU_0_1.bin" );
mSOC->pru_load( 1, 0, "PRU_1_0.bin" );
mSOC->pru_load( 1, 1, "PRU_1_1.bin" );
mSOC->pru_run( 0, 0 );
mSOC->pru_run( 0, 1 );
mSOC->pru_run( 1, 0 );
mSOC->pru_run( 1, 1 );
break;
case '8':
case 'g':
case 'G':
mTGZdevice->startDeviceStateInquiry();
sleep(1);
break;
case 'c':
case 'C':
mSOC->cleanTUPUS( 0, 0 );
mSOC->cleanTUPUS( 1, 0 );
t00W->paint();
t01W->paint();
t10W->paint();
t11W->paint();
break;
case 'i':
case 'I':
//pWindow->paint();
break;
case 'o':
case 'O':
mSOC->setCoreOnLine( 0 );
t01W->paint();
t00W->paint();
t11W->paint();
t10W->paint();
break;
case 'p':
case 'P':
t00W->paint();
t01W->paint();
t11W->paint();
t10W->paint();
//pPW0->paint();
//pPW1->paint();
pADC->paint();
break;
case 'w':
case 'W':
mSOC->pru_run( 1, 1 );
mSOC->pru_run( 1, 0 );
mSOC->pru_run( 0, 1 );
mSOC->pru_run( 0, 0 );
break;
case 't':
case 'T':
mSOC->pru_stop( 0, 0 );
mSOC->pru_stop( 0, 1 );
mSOC->pru_stop( 1, 0 );
mSOC->pru_stop( 1, 1 );
break;
case 'z':
case 'Z':
pwmWindow0->paint();
break;
default:
break;
};
//pWindow->paint();
mW->paint();
usleep(50000);
};
#endif
#endif
// MyCurses->destroy_win( my_win );
/* return 0;
init_GPIO_0();
init_GPIO_1();
init_GPIO_2();
init_GPIO_3();
init_GPIO_4();
init_GPIO_5();
printf( " GPIO INIT DONE \n");
printf(" GPIO1 OE: 0x%08X\n", getOutputMode(1) );
//printf(" GPIO3 OE: 0x%08X\n", getOutputMode(3) );
setOutputMode( 1, 0x0 );
//setOutputMode( 3, 0x0 );
uint32_t index = 0;
uint32_t c_out = 0;
uint32_t b_out = 0;
uint32_t k = 0;
uint32_t Data = 0;
init_PRMCM();
printf( "PRMCM Init Done\n" );
enable_ADC1_CLK();
printf( "ADC1 CLK Enable Done\n" );
enable_EPWM_CLK();
printf( "EPWM CLK Enable Done\n" );
init_ADC_0();
init_ADC_1();
printf( "ADC Init Done\n" );
printf( "Revision 0: 0x%08X\n", getRevisionADC0() );
printf( "Revision 1: 0x%08X\n", getRevisionADC1() );
prepareFSM1();
//printf( "ADC FSM Ready\nStrike Enter\n" );
//char kaka;
//kaka = getchar();
//printf( "Starting Loop\n" );
uint16_t AD0_Data = 0;
uint8_t AD0_Channel = 0;
uint16_t AD1_Data = 0;
uint8_t AD1_Channel = 0;
while(0){
index++;
if( index > 15 ) index = 1;
c_out = 0x0F000000 & (~( index << 24 ));
b_out = 0x00000060 & (~( index << 5 ));
setOutputDirect( 1, c_out );
//setOutputDirect( 3, b_out );
usleep(10000);
//ADC
startADC1();
printf("ADC Cycle Started\n\n");
for( k = 0; k < 8; k++ ) {
Data = getDataADC1_FIFO0( 100 );
if( Data != ADC_VALUE_TIMEOUT ) {
#ifdef ADC_WORK_SIMULTANEOUS_MODE
AD0_Channel = ( Data >> 28 ) & 0xF;
AD0_Data = ( Data >> 16 ) & 0xFFF;
AD1_Channel = ( Data >> 12 ) & 0xF;
AD1_Data = Data & 0xFFF;
#else
AD0_Channel = 0;
AD0_Data = 0;//( Data >> 16 ) & 0xFFF;
AD1_Channel = ( Data >> 16 ) & 0xF;
AD1_Data = ( Data >> 0 ) & 0xFFF;
#endif
printf( " Data: 0x%08X ADC0[%d]: 0x%03X ADC1[%d]: 0x%03X\n", Data, AD0_Channel, AD0_Data, AD1_Channel, AD1_Data );
} else {
printf( " ADC FIFO 0 [%d]: TIMEOUT\n", k );
};
// Data = getDataADC1_FIFO1( 100 );
//if( Data != ADC_VALUE_TIMEOUT ) {
//printf( " ADC FIFO 1 [%d]: 0x%08X\n", k, Data );
//} else {
//printf( " ADC FIFO 1 [%d]: TIMEOUT\n", k );
//};
};
};
//pwm_run( 0, 2000 );
//pwm_run( 1, 2000 );
//pwm_run( 2, 2000 );
//print_PWM_info(0);
//printf( "PWM Running\nStrike Enter\n" );
//kaka = getchar();
//pwm_stop( 0 );
//pwm_stop( 1 );
//pwm_stop( 2 );
// */
return(0);
};
/*
* devmem2.c: Simple program to read/write from/to any location in memory.
*
* Copyright (C) 2000, Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl)
*
*
* This software has been developed for the LART computing board
* (http://www.lart.tudelft.nl/). The development has been sponsored by
* the Mobile MultiMedia Communications (http://www.mmc.tudelft.nl/)
* and Ubiquitous Communications (http://www.ubicom.tudelft.nl/)
* projects.
*
* The author can be reached at:
*
* Jan-Derk Bakker
* Information and Communication Theory Group
* Faculty of Information Technology and Systems
* Delft University of Technology
* P.O. Box 5031
* 2600 GA Delft
* The Netherlands
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/*
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
//#include <string.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <ctype.h>
#include <termios.h>
#include <sys/types.h>
#include <sys/mman.h>
#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
__LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
#define MAP_SIZE 4096UL
#define MAP_MASK (MAP_SIZE - 1)
int mainz(int argc, char **argv) {
int fd;
void *map_base, *virt_addr;
unsigned long read_result, writeval;
off_t target;
int access_type = 'w';
if(argc < 2) {
fprintf(stderr, "\nUsage:\t%s { address } [ type [ data ] ]\n"
"\taddress : memory address to act upon\n"
"\ttype : access operation type : [b]yte, [h]alfword, [w]ord\n"
"\tdata : data to be written\n\n",
argv[0]);
exit(1);
}
target = strtoul(argv[1], 0, 0);
if(argc > 2)
access_type = tolower(argv[2][0]);
if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL;
printf("/dev/mem opened.\n");
fflush(stdout);
// Map one page
map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, target & ~MAP_MASK);
if(map_base == (void *) -1) FATAL;
printf("Memory mapped at address %p.\n", map_base);
fflush(stdout);
virt_addr = map_base + (target & MAP_MASK);
switch(access_type) {
case 'b':
read_result = *((unsigned char *) virt_addr);
break;
case 'h':
read_result = *((unsigned short *) virt_addr);
break;
case 'w':
read_result = *((unsigned long *) virt_addr);
break;
default:
fprintf(stderr, "Illegal data type '%c'.\n", access_type);
exit(2);
}
printf("Value at address 0x08%X (%p): 0x%08X\n", target, virt_addr, read_result);
fflush(stdout);
if(argc > 3) {
writeval = strtoul(argv[3], 0, 0);
switch(access_type) {
case 'b':
*((unsigned char *) virt_addr) = writeval;
read_result = *((unsigned char *) virt_addr);
break;
case 'h':
*((unsigned short *) virt_addr) = writeval;
read_result = *((unsigned short *) virt_addr);
break;
case 'w':
*((unsigned long *) virt_addr) = writeval;
read_result = *((unsigned long *) virt_addr);
break;
}
printf("Written 0x%X; readback 0x%X\n", writeval, read_result);
fflush(stdout);
}
if(munmap(map_base, MAP_SIZE) == -1) FATAL;
close(fd);
return 0;
}
*/
#undef LOG
#undef LOG_ERROR

328
Projects/DirectMemo/DirectMemo.vpj

@ -0,0 +1,328 @@
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
<Project
Version="10.0"
VendorName="SlickEdit"
TemplateName="GNU C/C++"
WorkingDir="."
BuildSystem="automakefile"
BuildMakeFile="makefile">
<Config
Name="Debug"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdDirectMemo"
CompilerConfigName="Latest Version"
Defines="">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='c++ -c %xup -x c++ %defd -O0 -g -ggdb -w -o "%bd%n%oe" %i %f'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -O0 -g -ggdb -w -o "%o" %objs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" CFG=%b'/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
<Includes>
<Include Dir="/home/samba/shared/working_dir/source/lib/cli"/>
</Includes>
<Libs PreObjects="0">
<Lib File="-lelf"/>
<Lib File="-lcurses"/>
<Lib File="-lcdk"/>
<Lib File="-lpthread"/>
<Lib File="-lgpm"/>
<Lib File="-lnewt"/>
<Lib File="-lconfig"/>
</Libs>
</Config>
<Config
Name="Release"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdDirectMemo"
CompilerConfigName="Latest Version"
Defines="">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='c++ -c %xup -x c++ %defd -O0 -g -ggdb -w -o "%bd%n%oe" %i %f'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -O0 -g -ggdb -w -o "%o" %objs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" CFG=%b'/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
<Includes>
<Include Dir="/home/samba/shared/working_dir/source/lib/cli"/>
</Includes>
<Libs PreObjects="0">
<Lib File="-lelf"/>
<Lib File="-lcurses"/>
<Lib File="-lcdk"/>
<Lib File="-lpthread"/>
<Lib File="-lgpm"/>
<Lib File="-lnewt"/>
<Lib File="-lconfig"/>
</Libs>
</Config>
<Files>
<Folder
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
<F N="adc1Window.cpp"/>
<F N="../../source/lib/hardware/soc/modules/adc/adc_ss.c"/>
<F N="../../source/lib/hardware/soc/general/am437x_cm.c"/>
<F N="../../source/lib/hardware/soc/general/am437x_prmcm.c"/>
<F N="../../source/lib/components/base/basicDualThread.cpp"/>
<F N="../../source/lib/components/base/basicFunctionality.cpp"/>
<F N="../../source/lib/components/base/basicLogCollection.cpp"/>
<F N="../../source/lib/components/base/basicLoggingService.cpp"/>
<F N="../../source/lib/components/base/basicNCursesEngine.h"/>
<F N="../../source/lib/components/base/basicRing.cpp"/>
<F N="../../source/lib/components/base/basicSettingsProvider.cpp"/>
<F N="../../source/lib/components/base/basicThread.cpp"/>
<F N="../../source/lib/components/base/basicTransport.cpp"/>
<F N="../../source/lib/hardware/can/can_lib.c"/>
<F N="../../source/lib/hardware/can/canbus.cpp"/>
<F N="../../source/lib/hardware/soc/classSOC.cpp"/>
<F N="../../source/lib/cli/cliClass.cpp"/>
<F N="DirectMemo.cpp"/>
<F N="../../source/lib/hardware/soc/functionality/pruss/elf_loader.c"/>
<F N="../../source/lib/hardware/soc/modules/gpio/gpio_ss.c"/>
<F N="gpioWindow.cpp"/>
<F N="mainWindow.cpp"/>
<F N="motorWindow.cpp"/>
<F N="../../source/lib/components/object/objectCliLoggingServices.cpp"/>
<F N="../../source/lib/components/object/objectFileLoggingService.cpp"/>
<F N="../../source/lib/data/protocol/protocol.cpp"/>
<F N="../../source/lib/data/protocol/protocolTGZ.cpp"/>
<F N="pru0Window.cpp"/>
<F N="pru1Window.cpp"/>
<F N="../../source/lib/hardware/soc/modules/pru/pru_ss.c"/>
<F N="pruCoresWindow.cpp"/>
<F N="../../source/lib/hardware/soc/modules/pwmss/pwm_ss.c"/>
<F N="pwmInfoWindow.cpp"/>
<F N="tgz2Window.cpp"/>
<F N="tgzWindow.cpp"/>
<F N="../../source/lib/data/transport/transportSerial.cpp"/>
<F N="tupus0_0Window.cpp"/>
<F N="tupus0_1Window.cpp"/>
<F N="tupus1_0Window.cpp"/>
<F N="tupus1_1Window.cpp"/>
</Folder>
<Folder
Name="Header Files"
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
<F N="../../source/lib/hardware/soc/general/3DLRF.h"/>
<F N="adc1Window.h"/>
<F N="../../source/lib/hardware/soc/modules/adc/adc_ss.h"/>
<F N="../../source/lib/hardware/soc/general/am437x_cm.h"/>
<F N="../../source/lib/hardware/soc/general/am437x_prmcm.h"/>
<F N="../../source/lib/components/base/basicDualThread.h"/>
<F N="../../source/lib/components/base/basicLogCollection.h"/>
<F N="../../source/lib/components/base/basicNCursesEngine.cpp"/>
<F N="../../source/lib/components/base/basicThread.h"/>
<F N="../../source/lib/components/base/basicTransport.h"/>
<F N="../../source/lib/hardware/can/can_lib.h"/>
<F N="../../source/lib/hardware/can/canbus.h"/>
<F N="../../source/lib/hardware/soc/classSOC.h"/>
<F N="../../source/lib/cli/cli.h"/>
<F N="../../source/lib/cli/cliClass.h"/>
<F N="../../source/lib/hardware/soc/functionality/pruss/elf_loader.h"/>
<F N="../../source/lib/hardware/soc/modules/gpio/gpio_regs.h"/>
<F N="../../source/lib/hardware/soc/modules/gpio/gpio_ss.h"/>
<F N="gpioWindow.h"/>
<F N="mainWindow.h"/>
<F N="motorWindow.h"/>
<F N="../../source/lib/components/object/objectCliLoggingServices.h"/>
<F N="../../source/lib/components/object/objectFileLoggingService.h"/>
<F N="../../source/lib/data/protocol/protocol.h"/>
<F N="../../source/lib/data/protocol/protocolTGZ.h"/>
<F N="pru0Window.h"/>
<F N="pru1Window.h"/>
<F N="../../source/lib/hardware/soc/modules/pru/pru_cfg.h"/>
<F N="../../source/lib/hardware/soc/modules/pru/pru_ctrl.h"/>
<F N="../../source/lib/hardware/soc/modules/pru/pru_ss.h"/>
<F N="pruCoresWindow.h"/>
<F N="../../source/lib/hardware/soc/modules/pwmss/pwm_ss.h"/>
<F N="pwmInfoWindow.h"/>
<F N="../../source/lib/hardware/soc/general/sitara-am437x.h"/>
<F N="../../source/lib/hardware/soc/modules/adc/sys_adc0TscSs.h"/>
<F N="../../source/lib/hardware/soc/modules/adc/sys_adc1MagSs.h"/>
<F N="../../source/include/device/modules/pwmss/sys_pwmss.h"/>
<F N="tgz2Window.h"/>
<F N="tgzWindow.h"/>
<F N="../../source/lib/data/transport/transportSerial.h"/>
<F N="tupus0_0Window.h"/>
<F N="tupus0_1Window.h"/>
<F N="tupus1_0Window.h"/>
<F N="tupus1_1Window.h"/>
</Folder>
<Folder
Name="Resource Files"
Filters="*.ico;*.cur;*.dlg"/>
<Folder
Name="Bitmaps"
Filters="*.bmp"/>
<Folder
Name="Other Files"
Filters="">
<F
N="makefile"
Type="Makefile"/>
</Folder>
</Files>
</Project>

109
Projects/DirectMemo/adc1Window.cpp

@ -0,0 +1,109 @@
#include "adc1Window.h"
//#include "../../source/lib/hardware/soc/modules/adc/adc_ss.h"
#ifdef NEWT_CLI
adc1Window::adc1Window(){
m_pSOC = classSOC::getInstance();
m_x = 81;
m_y = 18;
m_w = 44;
m_h = 17;
m_l1 = newtLabel( 3, 1, "ADC1 Config:" );
m_t1 = newtTextbox( 3, 3, 38, 1, 0 );
m_t2 = newtTextbox( 3, 4, 38, 1, 0 );
m_t3 = newtTextbox( 3, 5, 38, 1, 0 );
m_t4 = newtTextbox( 3, 6, 38, 1, 0 );
m_t5 = newtTextbox( 3, 7, 38, 1, 0 );
m_t6 = newtTextbox( 3, 8, 38, 1, 0 );
m_t7 = newtTextbox( 3, 9, 38, 1, 0 );
m_t8 = newtTextbox( 3, 10, 38, 1, 0 );
m_t9 = newtTextbox( 3, 11, 38, 1, 0 );
m_t10 = newtTextbox( 3, 12, 38, 1, 0 );
m_t11 = newtTextbox( 3, 13, 38, 1, 0 );
m_b1 = newtCompactButton( 3, 15, "Close" );
newtFormAddComponents( m_oForm, m_l1, m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_t8, m_t9, m_t10, m_t11, m_b1, NULL );
//newtFormSetBackground( m_oForm, NEWT_COLORSET_CHECKBOX );
//paint();
};
adc1Window::~adc1Window(){
newtPopWindow();
};
void adc1Window::paint(){
volatile sysAdc1MagSs *c_pADC = NULL;
char tBuffer[245];
c_pADC = m_pSOC->getADC1_CTRL();
//newtOpenWindow( m_x, m_y, m_w, m_h, "ADC Info" );
newtCenteredWindow( m_w, m_h, "ADC Info" );
if( c_pADC != NULL ) {
sprintf( tBuffer, "ADC1 Revision ID: \t0x%08x", c_pADC->REVISION );
newtTextboxSetText( m_t1, tBuffer );
sprintf( tBuffer, "ADC CTRL: \t\t%08x", c_pADC->CTRL );
newtTextboxSetText( m_t2, tBuffer );
sprintf( tBuffer, "ADC STEPEN: \t\t%08x", c_pADC->STEPEN );
newtTextboxSetText( m_t3, tBuffer );
sprintf( tBuffer, "Seq[0]: \t\t%08x", c_pADC->STEPCONFIG1 );
newtTextboxSetText( m_t4, tBuffer );
sprintf( tBuffer, "Seq[1]: \t\t%08x", c_pADC->STEPCONFIG2 );
newtTextboxSetText( m_t5, tBuffer );
sprintf( tBuffer, "Seq[2]: \t\t%08x", c_pADC->STEPCONFIG3 );
newtTextboxSetText( m_t6, tBuffer );
sprintf( tBuffer, "Seq[3]: \t\t%08x", c_pADC->STEPCONFIG4 );
newtTextboxSetText( m_t7, tBuffer );
sprintf( tBuffer, "Seq[4]: \t\t%08x", c_pADC->STEPCONFIG5 );
newtTextboxSetText( m_t8, tBuffer );
sprintf( tBuffer, "Seq[5]: \t\t%08x", c_pADC->STEPCONFIG6 );
newtTextboxSetText( m_t9, tBuffer );
sprintf( tBuffer, "Seq[6]: \t\t%08x", c_pADC->STEPCONFIG7 );
newtTextboxSetText( m_t10, tBuffer );
sprintf( tBuffer, "Seq[7]: \t\t%08x", c_pADC->STEPCONFIG8 );
newtTextboxSetText( m_t11, tBuffer );
} else {
sprintf( tBuffer, "Not Initialized" );
newtTextboxSetText( m_t1, tBuffer );
}
newtDrawForm( m_oForm );
newtRefresh();
};
#else
// Constructor implementation
adc1Window::adc1Window() : WindowCLI( NULL ){
m_pSOC = classSOC::getInstance();
create( 81, 18, 40, 17 );
};
void adc1Window::paint( void ){
volatile sysAdc1MagSs *c_pADC = NULL;
c_pADC = m_pSOC->getADC1_CTRL();
createBox( true );
mvwprintw( m_pWND, 2,2, " ADC%d Config at: \t%p", 1, c_pADC );
if( c_pADC != NULL ) {
mvwprintw( m_pWND, 3,2, " ADC%d Revision ID: \t0x%08x", 1, c_pADC->REVISION );
} else {
mvwprintw( m_pWND, 3,2, " Not Init" );
}
if( c_pADC != NULL ) {
mvwprintw( m_pWND, 4,2, " ADC%d INFO:", 1 );
mvwprintw( m_pWND, 6,2, " ADC CTRL: \t\t%08x", c_pADC->CTRL );
mvwprintw( m_pWND, 7,2, " ADC STEPEN: \t\t%08x", c_pADC->STEPEN );
mvwprintw( m_pWND, 8,2, " Seq[0]: \t\t%08x", c_pADC->STEPCONFIG[0].CONFIG );
mvwprintw( m_pWND, 9,2, " Seq[1]: \t\t%08x", c_pADC->STEPCONFIG[1].CONFIG );
mvwprintw( m_pWND, 10,2, " Seq[2]: \t\t%08x", c_pADC->STEPCONFIG[2].CONFIG );
mvwprintw( m_pWND, 11,2, " Seq[3]: \t\t%08x", c_pADC->STEPCONFIG[3].CONFIG );
mvwprintw( m_pWND, 12,2, " Seq[4]: \t\t%08x", c_pADC->STEPCONFIG[4].CONFIG );
mvwprintw( m_pWND, 13,2, " Seq[5]: \t\t%08x", c_pADC->STEPCONFIG[5].CONFIG );
mvwprintw( m_pWND, 14,2, " Seq[6]: \t\t%08x", c_pADC->STEPCONFIG[6].CONFIG );
mvwprintw( m_pWND, 15,2, " Seq[7]: \t\t%08x", c_pADC->STEPCONFIG[7].CONFIG );
} else {
mvwprintw( m_pWND, 4,2, " NO ADC INFO" );
}
wrefresh( m_pWND );
};
#endif

31
Projects/DirectMemo/adc1Window.h

@ -0,0 +1,31 @@
#ifndef __ADC1WINDOW_H_INCL__
#define __ADC1WINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifdef NEWT_CLI
class adc1Window : public WindowCLI{
private:
classSOC *m_pSOC;
newtComponent m_l1, m_l2, m_b1;
newtComponent m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_t8, m_t9, m_t10, m_t11;
public:
adc1Window();
~adc1Window();
void paint( void );
};
#else
#include "../../source/lib/components/base/basicNCursesEngine.h"
class adc1Window : public WindowCLI {
private:
classSOC *m_pSOC;
public:
adc1Window();
virtual ~adc1Window();
void paint( void );
};
#endif // NEWT_CLI
#endif // __ADC1WINDOW_H_INCL__

48
Projects/DirectMemo/config_can

@ -0,0 +1,48 @@
#!/bin/bash
ifconfig can1 down
#ip link set can1 up type can bitrate 125000 loopback off triple-sampling on restart-ms 100 dbitrate 125000 berr-reporting on fd on
#
#Bit timing parameters for flexcan with 24.000000 MHz ref clock
#nominal real Bitrt nom real SampP
#Bitrate TQ[ns] PrS PhS1 PhS2 SJW BRP Bitrate Error SampP SampP Error CAN_CTRL
#1000000 83 4 4 3 1 2 1000000 0.0% 75.0% 75.0% 0.0% 0x011a0003
# 800000 83 5 6 3 1 2 800000 0.0% 80.0% 80.0% 0.0% 0x012a0004
# 500000 125 6 7 2 1 3 500000 0.0% 87.5% 87.5% 0.0% 0x02310005
# 250000 250 6 7 2 1 6 250000 0.0% 87.5% 87.5% 0.0% 0x05310005
# 125000 500 6 7 2 1 12 125000 0.0% 87.5% 87.5% 0.0% 0x0b310005
# 100000 625 6 7 2 1 15 100000 0.0% 87.5% 87.5% 0.0% 0x0e310005
# 50000 1250 6 7 2 1 30 50000 0.0% 87.5% 87.5% 0.0% 0x1d310005
# 20000 3125 6 7 2 1 75 20000 0.0% 87.5% 87.5% 0.0% 0x4a310005
# 10000 6250 6 7 2 1 150 10000 0.0% 87.5% 87.5% 0.0% 0x95310005
#
#
#[ bitrate BITRATE [ sample-point SAMPLE-POINT] ] |
# [ tq TQ prop-seg PROP_SEG phase-seg1 PHASE-SEG1
# phase-seg2 PHASE-SEG2 [ sjw SJW ] ]
#
# [ dbitrate BITRATE [ dsample-point SAMPLE-POINT] ] |
# [ dtq TQ dprop-seg PROP_SEG dphase-seg1 PHASE-SEG1
# dphase-seg2 PHASE-SEG2 [ dsjw SJW ] ]
#
# [ loopback { on | off } ]
# [ listen-only { on | off } ]
# [ triple-sampling { on | off } ]
# [ one-shot { on | off } ]
# [ berr-reporting { on | off } ]
# [ fd { on | off } ]
#
# [ restart-ms TIME-MS ]
# [ restart ]
#
ip link set can1 up type can bitrate 500000 restart-ms 100 loopback on triple-sampling on berr-reporting on
ip -details -statistics link show can1
ifconfig can1 up

130
Projects/DirectMemo/devmem2.c

@ -0,0 +1,130 @@
/*
* devmem2.c: Simple program to read/write from/to any location in memory.
*
* Copyright (C) 2000, Jan-Derk Bakker (J.D.Bakker@its.tudelft.nl)
*
*
* This software has been developed for the LART computing board
* (http://www.lart.tudelft.nl/). The development has been sponsored by
* the Mobile MultiMedia Communications (http://www.mmc.tudelft.nl/)
* and Ubiquitous Communications (http://www.ubicom.tudelft.nl/)
* projects.
*
* The author can be reached at:
*
* Jan-Derk Bakker
* Information and Communication Theory Group
* Faculty of Information Technology and Systems
* Delft University of Technology
* P.O. Box 5031
* 2600 GA Delft
* The Netherlands
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#include <ctype.h>
#include <termios.h>
#include <sys/types.h>
#include <sys/mman.h>
#define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
__LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
#define MAP_SIZE 4096UL
#define MAP_MASK (MAP_SIZE - 1)
int main(int argc, char **argv) {
int fd;
void *map_base, *virt_addr;
unsigned long read_result, writeval;
off_t target;
int access_type = 'w';
if(argc < 2) {
fprintf(stderr, "\nUsage:\t%s { address } [ type [ data ] ]\n"
"\taddress : memory address to act upon\n"
"\ttype : access operation type : [b]yte, [h]alfword, [w]ord\n"
"\tdata : data to be written\n\n",
argv[0]);
exit(1);
}
target = strtoul(argv[1], 0, 0);
if(argc > 2)
access_type = tolower(argv[2][0]);
if((fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1) FATAL;
printf("/dev/mem opened.\n");
fflush(stdout);
/* Map one page */
map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, target & ~MAP_MASK);
if(map_base == (void *) -1) FATAL;
printf("Memory mapped at address %p.\n", map_base);
fflush(stdout);
virt_addr = map_base + (target & MAP_MASK);
switch(access_type) {
case 'b':
read_result = *((unsigned char *) virt_addr);
break;
case 'h':
read_result = *((unsigned short *) virt_addr);
break;
case 'w':
read_result = *((unsigned long *) virt_addr);
break;
default:
fprintf(stderr, "Illegal data type '%c'.\n", access_type);
exit(2);
}
printf("Value at address 0x%X (%p): 0x%X\n", target, virt_addr, read_result);
fflush(stdout);
if(argc > 3) {
writeval = strtoul(argv[3], 0, 0);
switch(access_type) {
case 'b':
*((unsigned char *) virt_addr) = writeval;
read_result = *((unsigned char *) virt_addr);
break;
case 'h':
*((unsigned short *) virt_addr) = writeval;
read_result = *((unsigned short *) virt_addr);
break;
case 'w':
*((unsigned long *) virt_addr) = writeval;
read_result = *((unsigned long *) virt_addr);
break;
}
printf("Written 0x%X; readback 0x%X\n", writeval, read_result);
fflush(stdout);
}
if(munmap(map_base, MAP_SIZE) == -1) FATAL;
close(fd);
return 0;
}

BIN
Projects/DirectMemo/elftest

Binary file not shown.

43
Projects/DirectMemo/elftest.c

@ -0,0 +1,43 @@
#include <err.h>
#include <fcntl.h>
#include <libelf.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main ( int argc , char ** argv ) {
int fd;
Elf *e;
char *k;
Elf_Kind ek;
if( argc != 2) {
printf( " usage: %s file-name\n", argv[0] );
return -1;
};
if( elf_version ( EV_CURRENT ) == EV_NONE ){
errx( EXIT_FAILURE , "ELF library initialization failed : %s", elf_errmsg ( -1));
};
if(( fd=open( argv[1] , O_RDONLY , 0)) < 0) errx( EXIT_FAILURE , " open %s failed ", argv [1]);
if(( e=elf_begin (fd , ELF_C_READ, NULL )) == NULL ) errx ( EXIT_FAILURE , " elf_begin () failed : %s.", elf_errmsg ( -1));
ek = elf_kind (e);
switch (ek) {
case ELF_K_AR :
k = "ar (1) archive ";
break ;
case ELF_K_ELF :
k = "elf object ";
break ;
case ELF_K_NONE :
k = " data ";
break ;
default :
k = " unrecognized ";
};
printf ("%s: %s\n", argv [1] , k);
elf_end (e);
close (fd );
return 0;
}

92
Projects/DirectMemo/gpioWindow.cpp

@ -0,0 +1,92 @@
#include "gpioWindow.h"
gpioWindow::gpioWindow() : WindowCLI(NULL){
m_x = 1;
m_y = 18;
m_w = 80;
m_h = 17;
#ifdef NEWT_CLI
m_t1 = newtTextbox( 2, 1, 60, 1, 0 );
m_t2 = newtTextbox( 2, 2, 60, 1, 0 );
m_t3 = newtTextbox( 2, 3, 60, 1, 0 );
m_t4 = newtTextbox( 2, 4, 60, 1, 0 );
m_t5 = newtTextbox( 2, 5, 60, 1, 0 );
m_t6 = newtTextbox( 2, 6, 60, 1, 0 );
newtFormAddComponents( m_oForm, m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, NULL );
#else
//create( 41, 18, 80, 17 );
create( 1, 18, 80, 17 );
#endif
};
gpioWindow::~gpioWindow(){
newtPopWindow();
};
void gpioWindow::paint( void ){
char tBuffer[245];
m_nGPI0 = getInputsGPIO(0);
m_nGPI1 = getInputsGPIO(1);
m_nGPI2 = getInputsGPIO(2);
m_nGPI3 = getInputsGPIO(3);
m_nGPI4 = getInputsGPIO(4);
m_nGPI5 = getInputsGPIO(5);
m_nGPO0 = getOutputsGPIO(0);
m_nGPO1 = getOutputsGPIO(1);
m_nGPO2 = getOutputsGPIO(2);
m_nGPO3 = getOutputsGPIO(3);
m_nGPO4 = getOutputsGPIO(4);
m_nGPO5 = getOutputsGPIO(5);
#ifdef NEWT_CLI
newtCenteredWindow( m_w, m_h, "GPIO Info" );
sprintf( tBuffer, "GPIO[0] Input:\t0x%08x\tGPIO[0] Output:\t0x%08x", m_nGPI0, m_nGPO0 );
newtTextboxSetText( m_t1, tBuffer );
sprintf( tBuffer, "GPIO[1] Input:\t0x%08x\tGPIO[1] Output:\t0x%08x", m_nGPI1, m_nGPO1 );
newtTextboxSetText( m_t2, tBuffer );
sprintf( tBuffer, "GPIO[2] Input:\t0x%08x\tGPIO[2] Output:\t0x%08x", m_nGPI2, m_nGPO2 );
newtTextboxSetText( m_t3, tBuffer );
sprintf( tBuffer, "GPIO[3] Input:\t0x%08x\tGPIO[3] Output:\t0x%08x", m_nGPI3, m_nGPO3 );
newtTextboxSetText( m_t4, tBuffer );
sprintf( tBuffer, "GPIO[4] Input:\t0x%08x\tGPIO[4] Output:\t0x%08x", m_nGPI4, m_nGPO4 );
newtTextboxSetText( m_t5, tBuffer );
sprintf( tBuffer, "GPIO[5] Input:\t0x%08x\tGPIO[5] Output:\t0x%08x", m_nGPI5, m_nGPO5 );
newtTextboxSetText( m_t6, tBuffer );
newtDrawForm( m_oForm );
newtRefresh();
#else
createBox( true );
uint32_t KAKA = findInterleave();
mvwprintw( m_pWND, 2,2,"--- MOTOR STATUS ---" );
if( tTUPUS != NULL ) {
cur_P2P_HM = tTUPUS->HOST_data;
if( cur_P2P_HM < min_P2P_HM ) min_P2P_HM = cur_P2P_HM;
if( cur_P2P_HM > max_P2P_HM ) max_P2P_HM = cur_P2P_HM;
cur_P2P_VM = tTUPUS->PRU_data;
if( cur_P2P_VM < min_P2P_VM ) min_P2P_VM = cur_P2P_VM;
if( cur_P2P_VM > max_P2P_VM ) max_P2P_VM = cur_P2P_VM;
mvwprintw( m_pWND, 3,2,"Signature:\t0x%08x", tTUPUS->PRU_id );
mvwprintw( m_pWND, 4,2,"Host status:\t0x%08x Interleave:%d", tTUPUS->HOST_status, KAKA );
mvwprintw( m_pWND, 5,2,"Host cmd:\t0x%08x", tTUPUS->HOST_command );
mvwprintw( m_pWND, 6,2,"Motor Status: %s", (( tTUPUS->PRU_status & 0xFF000000)?"Synced":"Not Synced"));
mvwprintw( m_pWND, 7,2,"Vertical Pulses per Rotation:\t%08d", tTUPUS->PRU_address );
mvwprintw( m_pWND, 8,2,"Horizontal Pulses per Rotation:\t%08d", tTUPUS->HOST_address );
mvwprintw( m_pWND, 9,2,"Horizontal Freq:\t%.2f kHz. Max: %.2f Min: %.2f",
1000000.0/( cur_P2P_HM * 5.0 ),
1000000.0/( min_P2P_HM * 5.0 ),
1000000.0/( max_P2P_HM * 5.0 )
);
mvwprintw( m_pWND, 10,2,"Vertical Freq:\t%.2f kHz. Max: %.2f Min: %.2f",
1000000.0/( cur_P2P_VM * 5.0 ),
1000000.0/( min_P2P_VM * 5.0 ),
1000000.0/( max_P2P_VM * 5.0 )
);
mvwprintw( m_pWND, 12,2,"Stat File:\tNot Started Yet" );
mvwprintw( m_pWND, 13,2,"Harvesting Stat:\tNot Started Yet" );
mvwprintw( m_pWND, 14,2,"Harvesting Status:\t\t\t." );
tTUPUS->HOST_status = 0;
} else {
mvwprintw( m_pWND, 3,2,"Not Initialized");
};
wrefresh( m_pWND );
#endif
};

37
Projects/DirectMemo/gpioWindow.h

@ -0,0 +1,37 @@
#ifndef __GPIOWINDOW_H_INCL__
#define __GPIOWINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
#include <fcntl.h>
#include <sys/stat.h>
/**
* TODO: Add class description
*
* @author gagua
*/
class gpioWindow : public WindowCLI {
uint32_t m_nGPI0;
uint32_t m_nGPI1;
uint32_t m_nGPI2;
uint32_t m_nGPI3;
uint32_t m_nGPI4;
uint32_t m_nGPI5;
uint32_t m_nGPO0;
uint32_t m_nGPO1;
uint32_t m_nGPO2;
uint32_t m_nGPO3;
uint32_t m_nGPO4;
uint32_t m_nGPO5;
newtComponent m_t1, m_t2, m_t3, m_t4, m_t5, m_t6;
public:
gpioWindow();
~gpioWindow();
void paint( void );
};
#endif // __MOTORWINDOW_H_INCL__

71
Projects/DirectMemo/mainWindow.cpp

@ -0,0 +1,71 @@
#include "mainWindow.h"
#ifdef NEWT_CLI
mainWindow::mainWindow() : WindowCLI( NULL ){
m_x = 3;
m_y = 3;
m_w = 23;
m_h = 16;
m_oMenu = newtListbox( 1, 0, 17, NEWT_FLAG_RETURNEXIT | NEWT_FLAG_SCROLL );
newtListboxAppendEntry( m_oMenu, "ADC Info", (void *) 1 );
newtListboxAppendEntry( m_oMenu, "PWM Info", (void *) 2 );
newtListboxAppendEntry( m_oMenu, "Motors Info", (void *) 3 );
newtListboxAppendEntry( m_oMenu, "PRUSS Info", (void *) 4 );
newtListboxAppendEntry( m_oMenu, "PRU Cores", (void *) 5 );
newtListboxAppendEntry( m_oMenu, "Reset All PRU Cores", (void *) 6 );
newtListboxAppendEntry( m_oMenu, "Stop All PRU Cores", (void *) 7 );
newtListboxAppendEntry( m_oMenu, "Run All PRU Cores", (void *) 8 );
newtListboxAppendEntry( m_oMenu, "Save Cores 8Kb", (void *) 9 );
newtListboxAppendEntry( m_oMenu, "Save Cores 12Kb", (void *) 10 );
newtListboxAppendEntry( m_oMenu, "Load All PRU Cores", (void *) 11 );
newtListboxAppendEntry( m_oMenu, "Old TGZ CAN Commands",(void *) 12 );
newtListboxAppendEntry( m_oMenu, "New TGZ CAN Commands",(void *) 13 );
newtListboxAppendEntry( m_oMenu, "View Log Messages", (void *) 14 );
newtListboxAppendEntry( m_oMenu, "View GPIO", (void *) 15 );
newtListboxAppendEntry( m_oMenu, "EXIT", (void *) 255 );
newtFormAddComponents( m_oForm, m_oMenu, NULL );
newtFormSetBackground( m_oForm, 3 );
};
mainWindow::~mainWindow(){
newtPopWindow();
};
void mainWindow::paint( void ){
//newtOpenWindow( m_x, m_y, m_w, m_h, "Main Menu" );
newtCenteredWindow( m_w, m_h, "Main Menu" );
newtDrawForm( m_oForm );
};
int mainWindow::decodeEvent( newtComponent evt ){
if( evt == m_oMenu ) {
void *selected;
selected = newtListboxGetCurrent( m_oMenu );
return ( int )selected;
};
return 0;
};
#else
mainWindow::mainWindow() : WindowCLI( NULL ){
create( 0, 0, 40, 17 );
};
void mainWindow::paint( void ){
createBox( true );
mvwprintw( m_pWND, 2,2, "1 - Toggle Reset Error\tbit(0)");
mvwprintw( m_pWND, 3,2, "2 - Toggle Stop/Run\tbit(1)");
mvwprintw( m_pWND, 4,2, "3 - Toggle PRF [35,45,50] kHz");
mvwprintw( m_pWND, 5,2, "4 - Toggle M2M ratio [64,72,98,128]");
mvwprintw( m_pWND, 6,2, "5 - Toggle Feq Divider [1,2,4]");
mvwprintw( m_pWND, 7,2, "6 - Stop PRF Generator");
mvwprintw( m_pWND, 8,2, "7 - Stop Azimuth Motor");
mvwprintw( m_pWND, 9,2, "8 - Send Data to TGZ");
mvwprintw( m_pWND, 10,2, "9 - Reset Statistics");
mvwprintw( m_pWND, 10,2, "0 - Save Statistics to File");
mvwprintw( m_pWND, 11,2, "' ' - (Space) Refresh Screen");
mvwprintw( m_pWND, 13,2, "q - exit\n");
wrefresh( m_pWND );
};
#endif // NEWT_CLI

34
Projects/DirectMemo/mainWindow.h

@ -0,0 +1,34 @@
#ifndef __MAINWINDOW_H_INCL__
#define __MAINWINDOW_H_INCL__
#include "../../source/lib/cli/cliClass.h"
#ifdef NEWT_CLI
class mainWindow: public WindowCLI{
private:
newtComponent m_oMenu;
public:
mainWindow();
~mainWindow();
void paint( void );
int decodeEvent( newtComponent evt );
};
#else
#include "../../source/lib/components/base/basicNCursesEngine.h"
/**
* TODO: Add class description
*
* @author gagua
*/
class mainWindow : public WindowCLI {
public:
mainWindow();
virtual ~mainWindow();
void paint( void );
};
#endif // NEWT_CLI
#endif // __MAINWINDOW_H_INCL__

329
Projects/DirectMemo/makefile

@ -0,0 +1,329 @@
# SlickEdit generated file. Do not edit this file except in designated areas.
# Make command to use for dependencies
MAKE=make
RM=rm
MKDIR=mkdir
# -----Begin user-editable area-----
# -----End user-editable area-----
# If no configuration is specified, "Debug" will be used
ifndef CFG
CFG=Debug
endif
#
# Configuration: Debug
#
ifeq "$(CFG)" "Debug"
OUTDIR=Debug
OUTFILE=$(OUTDIR)/DirectMemo
CFG_INC=-I/home/samba/shared/working_dir/source/lib/cli
CFG_LIB=-lelf -lcurses -lcdk -lpthread -lgpm -lnewt -lconfig
CFG_OBJ=
COMMON_OBJ=$(OUTDIR)/adc1Window.o $(OUTDIR)/adc_ss.o \
$(OUTDIR)/am437x_cm.o $(OUTDIR)/am437x_prmcm.o \
$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicFunctionality.o \
$(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \
$(OUTDIR)/basicRing.o $(OUTDIR)/basicSettingsProvider.o \
$(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \
$(OUTDIR)/can_lib.o $(OUTDIR)/canbus.o $(OUTDIR)/classSOC.o \
$(OUTDIR)/cliClass.o $(OUTDIR)/DirectMemo.o $(OUTDIR)/elf_loader.o \
$(OUTDIR)/gpio_ss.o $(OUTDIR)/gpioWindow.o $(OUTDIR)/mainWindow.o \
$(OUTDIR)/motorWindow.o $(OUTDIR)/objectCliLoggingServices.o \
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \
$(OUTDIR)/protocolTGZ.o $(OUTDIR)/pru0Window.o \
$(OUTDIR)/pru1Window.o $(OUTDIR)/pru_ss.o $(OUTDIR)/pruCoresWindow.o \
$(OUTDIR)/pwm_ss.o $(OUTDIR)/pwmInfoWindow.o $(OUTDIR)/tgz2Window.o \
$(OUTDIR)/tgzWindow.o $(OUTDIR)/transportSerial.o \
$(OUTDIR)/tupus0_0Window.o $(OUTDIR)/tupus0_1Window.o \
$(OUTDIR)/tupus1_0Window.o $(OUTDIR)/tupus1_1Window.o \
$(OUTDIR)/basicNCursesEngine.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
ALL_OBJ=$(OUTDIR)/adc1Window.o $(OUTDIR)/adc_ss.o \
$(OUTDIR)/am437x_cm.o $(OUTDIR)/am437x_prmcm.o \
$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicFunctionality.o \
$(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \
$(OUTDIR)/basicRing.o $(OUTDIR)/basicSettingsProvider.o \
$(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \
$(OUTDIR)/can_lib.o $(OUTDIR)/canbus.o $(OUTDIR)/classSOC.o \
$(OUTDIR)/cliClass.o $(OUTDIR)/DirectMemo.o $(OUTDIR)/elf_loader.o \
$(OUTDIR)/gpio_ss.o $(OUTDIR)/gpioWindow.o $(OUTDIR)/mainWindow.o \
$(OUTDIR)/motorWindow.o $(OUTDIR)/objectCliLoggingServices.o \
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \
$(OUTDIR)/protocolTGZ.o $(OUTDIR)/pru0Window.o \
$(OUTDIR)/pru1Window.o $(OUTDIR)/pru_ss.o $(OUTDIR)/pruCoresWindow.o \
$(OUTDIR)/pwm_ss.o $(OUTDIR)/pwmInfoWindow.o $(OUTDIR)/tgz2Window.o \
$(OUTDIR)/tgzWindow.o $(OUTDIR)/transportSerial.o \
$(OUTDIR)/tupus0_0Window.o $(OUTDIR)/tupus0_1Window.o \
$(OUTDIR)/tupus1_0Window.o $(OUTDIR)/tupus1_1Window.o \
$(OUTDIR)/basicNCursesEngine.o -lelf -lcurses -lcdk -lpthread -lgpm \
-lnewt -lconfig
COMPILE=c++ -c -x c++ -O0 -g -ggdb -w -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
LINK=g++ -O0 -g -ggdb -w -o "$(OUTFILE)" $(ALL_OBJ)
# Pattern rules
$(OUTDIR)/%.o : %.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/adc/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/data/transport/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pwmss/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/base/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/can/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/gpio/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/data/protocol/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pru/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/general/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/cli/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/object/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/functionality/pruss/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : %.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/adc/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/data/transport/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pwmss/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/base/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/can/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/gpio/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/data/protocol/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pru/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/general/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/cli/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/object/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/functionality/pruss/%.c
$(COMPILE)
# Build rules
all: $(OUTFILE)
$(OUTFILE): $(OUTDIR) $(OBJ)
$(LINK)
$(OUTDIR):
$(MKDIR) -p "$(OUTDIR)"
# Rebuild this project
rebuild: cleanall all
# Clean this project
clean:
$(RM) -f $(OUTFILE)
$(RM) -f $(OBJ)
# Clean this project and all dependencies
cleanall: clean
endif
#
# Configuration: Release
#
ifeq "$(CFG)" "Release"
OUTDIR=Release
OUTFILE=$(OUTDIR)/DirectMemo
CFG_INC=-I/home/samba/shared/working_dir/source/lib/cli
CFG_LIB=-lelf -lcurses -lcdk -lpthread -lgpm -lnewt -lconfig
CFG_OBJ=
COMMON_OBJ=$(OUTDIR)/adc1Window.o $(OUTDIR)/adc_ss.o \
$(OUTDIR)/am437x_cm.o $(OUTDIR)/am437x_prmcm.o \
$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicFunctionality.o \
$(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \
$(OUTDIR)/basicRing.o $(OUTDIR)/basicSettingsProvider.o \
$(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \
$(OUTDIR)/can_lib.o $(OUTDIR)/canbus.o $(OUTDIR)/classSOC.o \
$(OUTDIR)/cliClass.o $(OUTDIR)/DirectMemo.o $(OUTDIR)/elf_loader.o \
$(OUTDIR)/gpio_ss.o $(OUTDIR)/gpioWindow.o $(OUTDIR)/mainWindow.o \
$(OUTDIR)/motorWindow.o $(OUTDIR)/objectCliLoggingServices.o \
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \
$(OUTDIR)/protocolTGZ.o $(OUTDIR)/pru0Window.o \
$(OUTDIR)/pru1Window.o $(OUTDIR)/pru_ss.o $(OUTDIR)/pruCoresWindow.o \
$(OUTDIR)/pwm_ss.o $(OUTDIR)/pwmInfoWindow.o $(OUTDIR)/tgz2Window.o \
$(OUTDIR)/tgzWindow.o $(OUTDIR)/transportSerial.o \
$(OUTDIR)/tupus0_0Window.o $(OUTDIR)/tupus0_1Window.o \
$(OUTDIR)/tupus1_0Window.o $(OUTDIR)/tupus1_1Window.o \
$(OUTDIR)/basicNCursesEngine.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
ALL_OBJ=$(OUTDIR)/adc1Window.o $(OUTDIR)/adc_ss.o \
$(OUTDIR)/am437x_cm.o $(OUTDIR)/am437x_prmcm.o \
$(OUTDIR)/basicDualThread.o $(OUTDIR)/basicFunctionality.o \
$(OUTDIR)/basicLogCollection.o $(OUTDIR)/basicLoggingService.o \
$(OUTDIR)/basicRing.o $(OUTDIR)/basicSettingsProvider.o \
$(OUTDIR)/basicThread.o $(OUTDIR)/basicTransport.o \
$(OUTDIR)/can_lib.o $(OUTDIR)/canbus.o $(OUTDIR)/classSOC.o \
$(OUTDIR)/cliClass.o $(OUTDIR)/DirectMemo.o $(OUTDIR)/elf_loader.o \
$(OUTDIR)/gpio_ss.o $(OUTDIR)/gpioWindow.o $(OUTDIR)/mainWindow.o \
$(OUTDIR)/motorWindow.o $(OUTDIR)/objectCliLoggingServices.o \
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/protocol.o \
$(OUTDIR)/protocolTGZ.o $(OUTDIR)/pru0Window.o \
$(OUTDIR)/pru1Window.o $(OUTDIR)/pru_ss.o $(OUTDIR)/pruCoresWindow.o \
$(OUTDIR)/pwm_ss.o $(OUTDIR)/pwmInfoWindow.o $(OUTDIR)/tgz2Window.o \
$(OUTDIR)/tgzWindow.o $(OUTDIR)/transportSerial.o \
$(OUTDIR)/tupus0_0Window.o $(OUTDIR)/tupus0_1Window.o \
$(OUTDIR)/tupus1_0Window.o $(OUTDIR)/tupus1_1Window.o \
$(OUTDIR)/basicNCursesEngine.o -lelf -lcurses -lcdk -lpthread -lgpm \
-lnewt -lconfig
COMPILE=c++ -c -x c++ -O0 -g -ggdb -w -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $<
LINK=g++ -O0 -g -ggdb -w -o "$(OUTFILE)" $(ALL_OBJ)
# Pattern rules
$(OUTDIR)/%.o : %.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/adc/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/data/transport/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pwmss/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/base/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/can/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/gpio/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/data/protocol/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pru/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/general/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/cli/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/object/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/functionality/pruss/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : %.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/adc/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/data/transport/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pwmss/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/base/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/can/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/gpio/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/data/protocol/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pru/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/general/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/cli/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/object/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/functionality/pruss/%.c
$(COMPILE)
# Build rules
all: $(OUTFILE)
$(OUTFILE): $(OUTDIR) $(OBJ)
$(LINK)
$(OUTDIR):
$(MKDIR) -p "$(OUTDIR)"
# Rebuild this project
rebuild: cleanall all
# Clean this project
clean:
$(RM) -f $(OUTFILE)
$(RM) -f $(OBJ)
# Clean this project and all dependencies
cleanall: clean
endif

179
Projects/DirectMemo/motorWindow.cpp

@ -0,0 +1,179 @@
#include "motorWindow.h"
motorWindow::motorWindow() : WindowCLI(NULL){
m_pSOC = classSOC::getInstance();
resetStat();
m_x = 1;
m_y = 18;
m_w = 80;
m_h = 17;
#ifdef NEWT_CLI
m_t1 = newtTextbox( 2, 1, 60, 1, 0 );
m_t2 = newtTextbox( 2, 2, 60, 1, 0 );
m_t3 = newtTextbox( 2, 3, 60, 1, 0 );
m_t4 = newtTextbox( 2, 4, 60, 1, 0 );
m_t5 = newtTextbox( 2, 5, 60, 1, 0 );
m_t6 = newtTextbox( 2, 6, 60, 1, 0 );
m_t7 = newtTextbox( 2, 7, 60, 1, 0 );
m_t8 = newtTextbox( 2, 8, 60, 1, 0 );
newtFormAddComponents( m_oForm, m_t1, m_t2, m_t3, m_t4, m_t5,
m_t6, m_t7, m_t8, NULL );
#else
//create( 41, 18, 80, 17 );
create( 1, 18, 80, 17 );
#endif
};
motorWindow::~motorWindow(){
newtPopWindow();
};
void motorWindow::paint( void ){
char tBuffer[245];
volatile structTUPUS *tTUPUS;
tTUPUS = m_pSOC->getTUPUS( 0 , 1 );
#ifdef NEWT_CLI
newtCenteredWindow( m_w, m_h, "Motor Info" );
if( tTUPUS != NULL ) {
tTUPUS->HOST_status = 0;
int cnt = 100;
while( cnt-- && !tTUPUS->HOST_status) usleep( 20 );
cur_P2P_HM = tTUPUS->HOST_data;
if( cur_P2P_HM < min_P2P_HM ) min_P2P_HM = cur_P2P_HM;
if( cur_P2P_HM > max_P2P_HM ) max_P2P_HM = cur_P2P_HM;
cur_P2P_VM = tTUPUS->PRU_data;
if( cur_P2P_VM < min_P2P_VM ) min_P2P_VM = cur_P2P_VM;
if( cur_P2P_VM > max_P2P_VM ) max_P2P_VM = cur_P2P_VM;
sprintf( tBuffer, "Signature:\t0x%08x", tTUPUS->PRU_id );
newtTextboxSetText( m_t1, tBuffer );
sprintf( tBuffer, "Host status:\t0x%08x", tTUPUS->HOST_status );
newtTextboxSetText( m_t2, tBuffer );
sprintf( tBuffer, "Host cmd:\t0x%08x", tTUPUS->HOST_command );
newtTextboxSetText( m_t3, tBuffer );
sprintf( tBuffer, "Motor Status: %s", (( tTUPUS->PRU_status & 0xFF000000)?"Synced":"Not Synced"));
newtTextboxSetText( m_t4, tBuffer );
sprintf( tBuffer, "Vertical Pulses per Rotation:\t%08d", tTUPUS->PRU_address );
newtTextboxSetText( m_t5, tBuffer );
sprintf( tBuffer, "Horizontal Pulses per Rotation:\t%08d", tTUPUS->HOST_address );
newtTextboxSetText( m_t6, tBuffer );
sprintf( tBuffer, "Horizontal Freq:\t%.2f kHz. Max: %.2f Min: %.2f",
1000000.0/( cur_P2P_HM * 5.0 ),
1000000.0/( min_P2P_HM * 5.0 ),
1000000.0/( max_P2P_HM * 5.0 )
);
newtTextboxSetText( m_t7, tBuffer );
sprintf( tBuffer, "Vertical Freq:\t%.2f kHz. Max: %.2f Min: %.2f",
1000000.0/( cur_P2P_VM * 5.0 ),
1000000.0/( min_P2P_VM * 5.0 ),
1000000.0/( max_P2P_VM * 5.0 )
);
newtTextboxSetText( m_t8, tBuffer );
} else {
sprintf( tBuffer, "Not Initialized");
newtTextboxSetText( m_t1, tBuffer );
};
newtDrawForm( m_oForm );
newtRefresh();
#else
createBox( true );
uint32_t KAKA = findInterleave();
mvwprintw( m_pWND, 2,2,"--- MOTOR STATUS ---" );
if( tTUPUS != NULL ) {
cur_P2P_HM = tTUPUS->HOST_data;
if( cur_P2P_HM < min_P2P_HM ) min_P2P_HM = cur_P2P_HM;
if( cur_P2P_HM > max_P2P_HM ) max_P2P_HM = cur_P2P_HM;
cur_P2P_VM = tTUPUS->PRU_data;
if( cur_P2P_VM < min_P2P_VM ) min_P2P_VM = cur_P2P_VM;
if( cur_P2P_VM > max_P2P_VM ) max_P2P_VM = cur_P2P_VM;
mvwprintw( m_pWND, 3,2,"Signature:\t0x%08x", tTUPUS->PRU_id );
mvwprintw( m_pWND, 4,2,"Host status:\t0x%08x Interleave:%d", tTUPUS->HOST_status, KAKA );
mvwprintw( m_pWND, 5,2,"Host cmd:\t0x%08x", tTUPUS->HOST_command );
mvwprintw( m_pWND, 6,2,"Motor Status: %s", (( tTUPUS->PRU_status & 0xFF000000)?"Synced":"Not Synced"));
mvwprintw( m_pWND, 7,2,"Vertical Pulses per Rotation:\t%08d", tTUPUS->PRU_address );
mvwprintw( m_pWND, 8,2,"Horizontal Pulses per Rotation:\t%08d", tTUPUS->HOST_address );
mvwprintw( m_pWND, 9,2,"Horizontal Freq:\t%.2f kHz. Max: %.2f Min: %.2f",
1000000.0/( cur_P2P_HM * 5.0 ),
1000000.0/( min_P2P_HM * 5.0 ),
1000000.0/( max_P2P_HM * 5.0 )
);
mvwprintw( m_pWND, 10,2,"Vertical Freq:\t%.2f kHz. Max: %.2f Min: %.2f",
1000000.0/( cur_P2P_VM * 5.0 ),
1000000.0/( min_P2P_VM * 5.0 ),
1000000.0/( max_P2P_VM * 5.0 )
);
mvwprintw( m_pWND, 12,2,"Stat File:\tNot Started Yet" );
mvwprintw( m_pWND, 13,2,"Harvesting Stat:\tNot Started Yet" );
mvwprintw( m_pWND, 14,2,"Harvesting Status:\t\t\t." );
tTUPUS->HOST_status = 0;
} else {
mvwprintw( m_pWND, 3,2,"Not Initialized");
};
wrefresh( m_pWND );
#endif
};
void motorWindow::resetStat( void ){
cur_P2P_HM = 0;
min_P2P_HM = 0x7FFFFFFF;
max_P2P_HM = 0;
cur_P2P_VM = 0;
min_P2P_VM = 0x7FFFFFFF;
max_P2P_VM = 0;
};
void motorWindow::saveStatToFile( char *FileName ){
FILE *fd;
int baseCounter = 0;
char Buffer[21];
volatile structTUPUS *tTUPUS;
tTUPUS = m_pSOC->getTUPUS( 0 , 1 );
memset( Buffer,32,20);
Buffer[20]=(char)0;
if( FileName != NULL ) {
#ifdef NEWT_CLI
#else
mvwprintw( m_pWND, 12,2,"Stat File:\t%s", FileName );
#endif
fd = fopen( FileName, "w+" );
if(fd!=NULL){
#ifdef NEWT_CLI
#else
mvwprintw( m_pWND, 14,2,"Harvesting Status:\tStarted." );
wrefresh( m_pWND );
#endif
//fprintf( fd,"Base Rotation ID, Time ticks between Pulses of Mirror Block, Time ticks between Pulses of Base, Pulses per Revolution of Mirror Block, Pulses per Revolution of Base, Mirror Block Pulses per Base Pulse, Motors are Synced\r\n");
fprintf( fd,"Base Rotation ID, Time ticks between Pulses of Mirror Block, Pulses per Revolution of Mirror Block, Mirror Block Revolutions per Base Revolution, Motors are in Sync\r\n");
while( baseCounter< 20 ) {
tTUPUS->HOST_status = 0;
while( tTUPUS->HOST_status == 0 ) usleep(10);
fprintf( fd,"%d,%d,%d,%d,%s\r\n",
baseCounter,
tTUPUS->PRU_data,
//tTUPUS->HOST_data,
tTUPUS->PRU_address,
//tTUPUS->HOST_address,
tTUPUS->HOST_command,
((tTUPUS->PRU_status & 0xFF000000 )?"YES":"NO")
);
if( tTUPUS->PRU_status & 0xFF0000 ){// Base Rotation Complete
Buffer[baseCounter]='*';
baseCounter++; //?
#ifdef NEWT_CLI
#else
mvwprintw( m_pWND, 13,2,"Harvesting Stat:\t[%s]", Buffer );
wrefresh( m_pWND );
#endif
tTUPUS->PRU_status &=0xFF00FFFF;
};
};
#ifdef NEWT_CLI
#else
mvwprintw( m_pWND, 14,2,"Harvesting Status:\t\tDone." );
wrefresh( m_pWND );
#endif
fclose(fd);
chmod( FileName, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH );
};
};
};

34
Projects/DirectMemo/motorWindow.h

@ -0,0 +1,34 @@
#ifndef __MOTORWINDOW_H_INCL__
#define __MOTORWINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
#include <fcntl.h>
#include <sys/stat.h>
/**
* TODO: Add class description
*
* @author gagua
*/
class motorWindow : public WindowCLI {
classSOC *m_pSOC;
int cur_P2P_HM;
int min_P2P_HM;
int max_P2P_HM;
int cur_P2P_VM;
int min_P2P_VM;
int max_P2P_VM;
newtComponent m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_t8;
public:
motorWindow();
~motorWindow();
void paint( void );
void resetStat( void );
void saveStatToFile( char *FileName );
};
#endif // __MOTORWINDOW_H_INCL__

2
Projects/DirectMemo/out.txt

@ -0,0 +1,2 @@
c++ -c -x c++ -g -o "Debug/pru_ss.o" ../../source/include/device/modules/pru/pru_ss.c
makefile:84: recipe for target 'Debug/pru_ss.o' failed

1
Projects/DirectMemo/pindosia/gpio-ranges

@ -0,0 +1 @@
GPIO ranges handled:

75
Projects/DirectMemo/pindosia/pinctrl-handles

@ -0,0 +1,75 @@
Requested pin control handlers their pinmux maps:
device: 44e10800.pinmux current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: ddr_vtt_toggle_default (0) function: ddr_vtt_toggle_default (0)
type: MUX_GROUP controller pinctrl-single group: pinmux_debugss_pins (1) function: pinmux_debugss_pins (1)
type: MUX_GROUP controller pinctrl-single group: unused_pins (2) function: unused_pins (2)
device: 4832a000.dss current state: sleep
state: default
type: MUX_GROUP controller pinctrl-single group: dss_pinctrl_default (3) function: dss_pinctrl_default (3)
state: sleep
type: MUX_GROUP controller pinctrl-single group: dss_pinctrl_sleep (4) function: dss_pinctrl_sleep (4)
device: 44e09000.serial current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: uart0_pins_default (5) function: uart0_pins_default (5)
state: sleep
type: MUX_GROUP controller pinctrl-single group: uart0_pins_sleep (6) function: uart0_pins_sleep (6)
device: 47900000.qspi current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: qspi_pins_default (7) function: qspi_pins_default (7)
state: sleep
type: MUX_GROUP controller pinctrl-single group: qspi_pins_sleep (8) function: qspi_pins_sleep (8)
device: 481cc000.can current state: sleep
state: default
type: MUX_GROUP controller pinctrl-single group: dcan0_default_pins (9) function: dcan0_default_pins (9)
state: sleep
type: MUX_GROUP controller pinctrl-single group: dcan0_sleep_pins (10) function: dcan0_sleep_pins (10)
device: 481d0000.can current state: sleep
state: default
type: MUX_GROUP controller pinctrl-single group: dcan1_default_pins (11) function: dcan1_default_pins (11)
state: sleep
type: MUX_GROUP controller pinctrl-single group: dcan1_sleep_pins (12) function: dcan1_sleep_pins (12)
device: 4a100000.ethernet current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: cpsw_default (13) function: cpsw_default (13)
state: sleep
type: MUX_GROUP controller pinctrl-single group: cpsw_sleep (14) function: cpsw_sleep (14)
device: 4a101000.mdio current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: davinci_mdio_default (15) function: davinci_mdio_default (15)
state: sleep
type: MUX_GROUP controller pinctrl-single group: davinci_mdio_sleep (16) function: davinci_mdio_sleep (16)
device: 48390000.usb current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: usb1_pins_default (17) function: usb1_pins_default (17)
state: sleep
type: MUX_GROUP controller pinctrl-single group: usb1_pins_sleep (18) function: usb1_pins_sleep (18)
device: 483d0000.usb current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: usb2_pins_default (19) function: usb2_pins_default (19)
state: sleep
type: MUX_GROUP controller pinctrl-single group: usb2_pins_sleep (20) function: usb2_pins_sleep (20)
device: 48060000.mmc current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: mmc1_pins_default (21) function: mmc1_pins_default (21)
state: sleep
type: MUX_GROUP controller pinctrl-single group: mmc1_pins_sleep (22) function: mmc1_pins_sleep (22)
device: 481d8000.mmc current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: emmc_pins_default (23) function: emmc_pins_default (23)
state: sleep
type: MUX_GROUP controller pinctrl-single group: emmc_pins_sleep (24) function: emmc_pins_sleep (24)
device: gpio_leds current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: leds_pins_default (25) function: leds_pins_default (25)
device: 44e0b000.i2c current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: i2c0_pins (26) function: i2c0_pins (26)
device: 4802a000.i2c current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: i2c1_pins_default (27) function: i2c1_pins_default (27)
state: sleep
type: MUX_GROUP controller pinctrl-single group: i2c1_pins_sleep (28) function: i2c1_pins_sleep (28)
device: gpio_keys current state: default
state: default
type: MUX_GROUP controller pinctrl-single group: keys_pins_default (29) function: keys_pins_default (29)

227
Projects/DirectMemo/pindosia/pingroups

@ -0,0 +1,227 @@
registered pin groups:
group: ddr_vtt_toggle_default
pin 151 (44e10a5c.0)
group: pinmux_debugss_pins
pin 164 (44e10a90.0)
pin 165 (44e10a94.0)
pin 166 (44e10a98.0)
pin 167 (44e10a9c.0)
pin 168 (44e10aa0.0)
pin 169 (44e10aa4.0)
pin 170 (44e10aa8.0)
group: unused_pins
pin 84 (44e10950.0)
pin 85 (44e10954.0)
group: dss_pinctrl_default
pin 8 (44e10820.0)
pin 9 (44e10824.0)
pin 10 (44e10828.0)
pin 11 (44e1082c.0)
pin 12 (44e10830.0)
pin 13 (44e10834.0)
pin 14 (44e10838.0)
pin 15 (44e1083c.0)
pin 40 (44e108a0.0)
pin 41 (44e108a4.0)
pin 42 (44e108a8.0)
pin 43 (44e108ac.0)
pin 44 (44e108b0.0)
pin 45 (44e108b4.0)
pin 46 (44e108b8.0)
pin 47 (44e108bc.0)
pin 48 (44e108c0.0)
pin 49 (44e108c4.0)
pin 50 (44e108c8.0)
pin 51 (44e108cc.0)
pin 52 (44e108d0.0)
pin 53 (44e108d4.0)
pin 54 (44e108d8.0)
pin 55 (44e108dc.0)
pin 56 (44e108e0.0)
pin 57 (44e108e4.0)
pin 58 (44e108e8.0)
pin 59 (44e108ec.0)
group: dss_pinctrl_sleep
pin 8 (44e10820.0)
pin 9 (44e10824.0)
pin 10 (44e10828.0)
pin 11 (44e1082c.0)
pin 12 (44e10830.0)
pin 13 (44e10834.0)
pin 14 (44e10838.0)
pin 15 (44e1083c.0)
pin 40 (44e108a0.0)
pin 41 (44e108a4.0)
pin 42 (44e108a8.0)
pin 43 (44e108ac.0)
pin 44 (44e108b0.0)
pin 45 (44e108b4.0)
pin 46 (44e108b8.0)
pin 47 (44e108bc.0)
pin 48 (44e108c0.0)
pin 49 (44e108c4.0)
pin 50 (44e108c8.0)
pin 51 (44e108cc.0)
pin 52 (44e108d0.0)
pin 53 (44e108d4.0)
pin 54 (44e108d8.0)
pin 55 (44e108dc.0)
pin 56 (44e108e0.0)
pin 57 (44e108e4.0)
pin 58 (44e108e8.0)
pin 59 (44e108ec.0)
group: uart0_pins_default
pin 92 (44e10970.0)
pin 93 (44e10974.0)
group: uart0_pins_sleep
pin 92 (44e10970.0)
pin 93 (44e10974.0)
group: qspi_pins_default
pin 31 (44e1087c.0)
pin 34 (44e10888.0)
pin 36 (44e10890.0)
pin 37 (44e10894.0)
pin 38 (44e10898.0)
pin 39 (44e1089c.0)
group: qspi_pins_sleep
pin 31 (44e1087c.0)
pin 34 (44e10888.0)
pin 36 (44e10890.0)
pin 37 (44e10894.0)
pin 38 (44e10898.0)
pin 39 (44e1089c.0)
group: dcan0_default_pins
pin 94 (44e10978.0)
pin 95 (44e1097c.0)
group: dcan0_sleep_pins
pin 94 (44e10978.0)
pin 95 (44e1097c.0)
group: dcan1_default_pins
pin 96 (44e10980.0)
pin 97 (44e10984.0)
group: dcan1_sleep_pins
pin 96 (44e10980.0)
pin 97 (44e10984.0)
group: cpsw_default
pin 69 (44e10914.0)
pin 70 (44e10918.0)
pin 71 (44e1091c.0)
pin 72 (44e10920.0)
pin 73 (44e10924.0)
pin 74 (44e10928.0)
pin 75 (44e1092c.0)
pin 76 (44e10930.0)
pin 77 (44e10934.0)
pin 78 (44e10938.0)
pin 79 (44e1093c.0)
pin 80 (44e10940.0)
group: cpsw_sleep
pin 69 (44e10914.0)
pin 70 (44e10918.0)
pin 71 (44e1091c.0)
pin 72 (44e10920.0)
pin 73 (44e10924.0)
pin 74 (44e10928.0)
pin 75 (44e1092c.0)
pin 76 (44e10930.0)
pin 77 (44e10934.0)
pin 78 (44e10938.0)
pin 79 (44e1093c.0)
pin 80 (44e10940.0)
group: davinci_mdio_default
pin 82 (44e10948.0)
pin 83 (44e1094c.0)
group: davinci_mdio_sleep
pin 82 (44e10948.0)
pin 83 (44e1094c.0)
group: usb1_pins_default
pin 176 (44e10ac0.0)
group: usb1_pins_sleep
pin 176 (44e10ac0.0)
group: usb2_pins_default
pin 177 (44e10ac4.0)
group: usb2_pins_sleep
pin 177 (44e10ac4.0)
group: mmc1_pins_default
pin 64 (44e10900.0)
pin 65 (44e10904.0)
pin 60 (44e108f0.0)
pin 61 (44e108f4.0)
pin 62 (44e108f8.0)
pin 63 (44e108fc.0)
pin 88 (44e10960.0)
group: mmc1_pins_sleep
pin 64 (44e10900.0)
pin 65 (44e10904.0)
pin 60 (44e108f0.0)
pin 61 (44e108f4.0)
pin 62 (44e108f8.0)
pin 63 (44e108fc.0)
pin 88 (44e10960.0)
group: emmc_pins_default
pin 0 (44e10800.0)
pin 1 (44e10804.0)
pin 2 (44e10808.0)
pin 3 (44e1080c.0)
pin 4 (44e10810.0)
pin 5 (44e10814.0)
pin 6 (44e10818.0)
pin 7 (44e1081c.0)
group: emmc_pins_sleep
pin 0 (44e10800.0)
pin 1 (44e10804.0)
pin 2 (44e10808.0)
pin 3 (44e1080c.0)
pin 4 (44e10810.0)
pin 5 (44e10814.0)
pin 6 (44e10818.0)
pin 7 (44e1081c.0)
pin 32 (44e10880.0)
pin 33 (44e10884.0)
group: leds_pins_default
pin 24 (44e10860.0)
pin 25 (44e10864.0)
pin 26 (44e10868.0)
pin 27 (44e1086c.0)
group: i2c0_pins
pin 98 (44e10988.0)
pin 99 (44e1098c.0)
group: i2c1_pins_default
pin 144 (44e10a40.0)
pin 146 (44e10a48.0)
group: i2c1_pins_sleep
pin 87 (44e1095c.0)
pin 86 (44e10958.0)
group: keys_pins_default
pin 145 (44e10a44.0)
pin 147 (44e10a4c.0)

30
Projects/DirectMemo/pindosia/pinmux-functions

@ -0,0 +1,30 @@
function: ddr_vtt_toggle_default, groups = [ ddr_vtt_toggle_default ]
function: pinmux_debugss_pins, groups = [ pinmux_debugss_pins ]
function: unused_pins, groups = [ unused_pins ]
function: dss_pinctrl_default, groups = [ dss_pinctrl_default ]
function: dss_pinctrl_sleep, groups = [ dss_pinctrl_sleep ]
function: uart0_pins_default, groups = [ uart0_pins_default ]
function: uart0_pins_sleep, groups = [ uart0_pins_sleep ]
function: qspi_pins_default, groups = [ qspi_pins_default ]
function: qspi_pins_sleep, groups = [ qspi_pins_sleep ]
function: dcan0_default_pins, groups = [ dcan0_default_pins ]
function: dcan0_sleep_pins, groups = [ dcan0_sleep_pins ]
function: dcan1_default_pins, groups = [ dcan1_default_pins ]
function: dcan1_sleep_pins, groups = [ dcan1_sleep_pins ]
function: cpsw_default, groups = [ cpsw_default ]
function: cpsw_sleep, groups = [ cpsw_sleep ]
function: davinci_mdio_default, groups = [ davinci_mdio_default ]
function: davinci_mdio_sleep, groups = [ davinci_mdio_sleep ]
function: usb1_pins_default, groups = [ usb1_pins_default ]
function: usb1_pins_sleep, groups = [ usb1_pins_sleep ]
function: usb2_pins_default, groups = [ usb2_pins_default ]
function: usb2_pins_sleep, groups = [ usb2_pins_sleep ]
function: mmc1_pins_default, groups = [ mmc1_pins_default ]
function: mmc1_pins_sleep, groups = [ mmc1_pins_sleep ]
function: emmc_pins_default, groups = [ emmc_pins_default ]
function: emmc_pins_sleep, groups = [ emmc_pins_sleep ]
function: leds_pins_default, groups = [ leds_pins_default ]
function: i2c0_pins, groups = [ i2c0_pins ]
function: i2c1_pins_default, groups = [ i2c1_pins_default ]
function: i2c1_pins_sleep, groups = [ i2c1_pins_sleep ]
function: keys_pins_default, groups = [ keys_pins_default ]

201
Projects/DirectMemo/pindosia/pinmux-pins

@ -0,0 +1,201 @@
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (44e10800.0): 481d8000.mmc (GPIO UNCLAIMED) function emmc_pins_default group emmc_pins_default
pin 1 (44e10804.0): 481d8000.mmc (GPIO UNCLAIMED) function emmc_pins_default group emmc_pins_default
pin 2 (44e10808.0): 481d8000.mmc (GPIO UNCLAIMED) function emmc_pins_default group emmc_pins_default
pin 3 (44e1080c.0): 481d8000.mmc (GPIO UNCLAIMED) function emmc_pins_default group emmc_pins_default
pin 4 (44e10810.0): 481d8000.mmc (GPIO UNCLAIMED) function emmc_pins_default group emmc_pins_default
pin 5 (44e10814.0): 481d8000.mmc (GPIO UNCLAIMED) function emmc_pins_default group emmc_pins_default
pin 6 (44e10818.0): 481d8000.mmc (GPIO UNCLAIMED) function emmc_pins_default group emmc_pins_default
pin 7 (44e1081c.0): 481d8000.mmc (GPIO UNCLAIMED) function emmc_pins_default group emmc_pins_default
pin 8 (44e10820.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 9 (44e10824.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 10 (44e10828.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 11 (44e1082c.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 12 (44e10830.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 13 (44e10834.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 14 (44e10838.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 15 (44e1083c.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 16 (44e10840.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 17 (44e10844.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 18 (44e10848.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 19 (44e1084c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (44e10850.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 21 (44e10854.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 22 (44e10858.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 23 (44e1085c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 24 (44e10860.0): gpio_leds (GPIO UNCLAIMED) function leds_pins_default group leds_pins_default
pin 25 (44e10864.0): gpio_leds (GPIO UNCLAIMED) function leds_pins_default group leds_pins_default
pin 26 (44e10868.0): gpio_leds (GPIO UNCLAIMED) function leds_pins_default group leds_pins_default
pin 27 (44e1086c.0): gpio_leds (GPIO UNCLAIMED) function leds_pins_default group leds_pins_default
pin 28 (44e10870.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 29 (44e10874.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 30 (44e10878.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 31 (44e1087c.0): 47900000.qspi (GPIO UNCLAIMED) function qspi_pins_default group qspi_pins_default
pin 32 (44e10880.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 33 (44e10884.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 34 (44e10888.0): 47900000.qspi (GPIO UNCLAIMED) function qspi_pins_default group qspi_pins_default
pin 35 (44e1088c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 36 (44e10890.0): 47900000.qspi (GPIO UNCLAIMED) function qspi_pins_default group qspi_pins_default
pin 37 (44e10894.0): 47900000.qspi (GPIO UNCLAIMED) function qspi_pins_default group qspi_pins_default
pin 38 (44e10898.0): 47900000.qspi (GPIO UNCLAIMED) function qspi_pins_default group qspi_pins_default
pin 39 (44e1089c.0): 47900000.qspi (GPIO UNCLAIMED) function qspi_pins_default group qspi_pins_default
pin 40 (44e108a0.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 41 (44e108a4.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 42 (44e108a8.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 43 (44e108ac.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 44 (44e108b0.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 45 (44e108b4.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 46 (44e108b8.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 47 (44e108bc.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 48 (44e108c0.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 49 (44e108c4.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 50 (44e108c8.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 51 (44e108cc.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 52 (44e108d0.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 53 (44e108d4.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 54 (44e108d8.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 55 (44e108dc.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 56 (44e108e0.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 57 (44e108e4.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 58 (44e108e8.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 59 (44e108ec.0): 4832a000.dss (GPIO UNCLAIMED) function dss_pinctrl_sleep group dss_pinctrl_sleep
pin 60 (44e108f0.0): 48060000.mmc (GPIO UNCLAIMED) function mmc1_pins_default group mmc1_pins_default
pin 61 (44e108f4.0): 48060000.mmc (GPIO UNCLAIMED) function mmc1_pins_default group mmc1_pins_default
pin 62 (44e108f8.0): 48060000.mmc (GPIO UNCLAIMED) function mmc1_pins_default group mmc1_pins_default
pin 63 (44e108fc.0): 48060000.mmc (GPIO UNCLAIMED) function mmc1_pins_default group mmc1_pins_default
pin 64 (44e10900.0): 48060000.mmc (GPIO UNCLAIMED) function mmc1_pins_default group mmc1_pins_default
pin 65 (44e10904.0): 48060000.mmc (GPIO UNCLAIMED) function mmc1_pins_default group mmc1_pins_default
pin 66 (44e10908.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 67 (44e1090c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 68 (44e10910.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 69 (44e10914.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 70 (44e10918.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 71 (44e1091c.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 72 (44e10920.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 73 (44e10924.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 74 (44e10928.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 75 (44e1092c.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 76 (44e10930.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 77 (44e10934.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 78 (44e10938.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 79 (44e1093c.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 80 (44e10940.0): 4a100000.ethernet (GPIO UNCLAIMED) function cpsw_default group cpsw_default
pin 81 (44e10944.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 82 (44e10948.0): 4a101000.mdio (GPIO UNCLAIMED) function davinci_mdio_default group davinci_mdio_default
pin 83 (44e1094c.0): 4a101000.mdio (GPIO UNCLAIMED) function davinci_mdio_default group davinci_mdio_default
pin 84 (44e10950.0): 44e10800.pinmux (GPIO UNCLAIMED) function unused_pins group unused_pins
pin 85 (44e10954.0): 44e10800.pinmux (GPIO UNCLAIMED) function unused_pins group unused_pins
pin 86 (44e10958.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 87 (44e1095c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 88 (44e10960.0): 48060000.mmc (GPIO UNCLAIMED) function mmc1_pins_default group mmc1_pins_default
pin 89 (44e10964.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 90 (44e10968.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 91 (44e1096c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 92 (44e10970.0): 44e09000.serial (GPIO UNCLAIMED) function uart0_pins_default group uart0_pins_default
pin 93 (44e10974.0): 44e09000.serial (GPIO UNCLAIMED) function uart0_pins_default group uart0_pins_default
pin 94 (44e10978.0): 481cc000.can (GPIO UNCLAIMED) function dcan0_sleep_pins group dcan0_sleep_pins
pin 95 (44e1097c.0): 481cc000.can (GPIO UNCLAIMED) function dcan0_sleep_pins group dcan0_sleep_pins
pin 96 (44e10980.0): 481d0000.can (GPIO UNCLAIMED) function dcan1_sleep_pins group dcan1_sleep_pins
pin 97 (44e10984.0): 481d0000.can (GPIO UNCLAIMED) function dcan1_sleep_pins group dcan1_sleep_pins
pin 98 (44e10988.0): 44e0b000.i2c (GPIO UNCLAIMED) function i2c0_pins group i2c0_pins
pin 99 (44e1098c.0): 44e0b000.i2c (GPIO UNCLAIMED) function i2c0_pins group i2c0_pins
pin 100 (44e10990.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 101 (44e10994.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 102 (44e10998.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 103 (44e1099c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 104 (44e109a0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 105 (44e109a4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 106 (44e109a8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 107 (44e109ac.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 108 (44e109b0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 109 (44e109b4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 110 (44e109b8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 111 (44e109bc.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 112 (44e109c0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 113 (44e109c4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 114 (44e109c8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 115 (44e109cc.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 116 (44e109d0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 117 (44e109d4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 118 (44e109d8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 119 (44e109dc.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 120 (44e109e0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 121 (44e109e4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 122 (44e109e8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 123 (44e109ec.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 124 (44e109f0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 125 (44e109f4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 126 (44e109f8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 127 (44e109fc.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 128 (44e10a00.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 129 (44e10a04.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 130 (44e10a08.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 131 (44e10a0c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 132 (44e10a10.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 133 (44e10a14.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 134 (44e10a18.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 135 (44e10a1c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 136 (44e10a20.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 137 (44e10a24.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 138 (44e10a28.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 139 (44e10a2c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 140 (44e10a30.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 141 (44e10a34.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 142 (44e10a38.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 143 (44e10a3c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 144 (44e10a40.0): 4802a000.i2c (GPIO UNCLAIMED) function i2c1_pins_default group i2c1_pins_default
pin 145 (44e10a44.0): gpio_keys (GPIO UNCLAIMED) function keys_pins_default group keys_pins_default
pin 146 (44e10a48.0): 4802a000.i2c (GPIO UNCLAIMED) function i2c1_pins_default group i2c1_pins_default
pin 147 (44e10a4c.0): gpio_keys (GPIO UNCLAIMED) function keys_pins_default group keys_pins_default
pin 148 (44e10a50.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 149 (44e10a54.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 150 (44e10a58.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 151 (44e10a5c.0): 44e10800.pinmux (GPIO UNCLAIMED) function ddr_vtt_toggle_default group ddr_vtt_toggle_default
pin 152 (44e10a60.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 153 (44e10a64.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 154 (44e10a68.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 155 (44e10a6c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 156 (44e10a70.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 157 (44e10a74.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 158 (44e10a78.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 159 (44e10a7c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 160 (44e10a80.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 161 (44e10a84.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 162 (44e10a88.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 163 (44e10a8c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 164 (44e10a90.0): 44e10800.pinmux (GPIO UNCLAIMED) function pinmux_debugss_pins group pinmux_debugss_pins
pin 165 (44e10a94.0): 44e10800.pinmux (GPIO UNCLAIMED) function pinmux_debugss_pins group pinmux_debugss_pins
pin 166 (44e10a98.0): 44e10800.pinmux (GPIO UNCLAIMED) function pinmux_debugss_pins group pinmux_debugss_pins
pin 167 (44e10a9c.0): 44e10800.pinmux (GPIO UNCLAIMED) function pinmux_debugss_pins group pinmux_debugss_pins
pin 168 (44e10aa0.0): 44e10800.pinmux (GPIO UNCLAIMED) function pinmux_debugss_pins group pinmux_debugss_pins
pin 169 (44e10aa4.0): 44e10800.pinmux (GPIO UNCLAIMED) function pinmux_debugss_pins group pinmux_debugss_pins
pin 170 (44e10aa8.0): 44e10800.pinmux (GPIO UNCLAIMED) function pinmux_debugss_pins group pinmux_debugss_pins
pin 171 (44e10aac.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 172 (44e10ab0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 173 (44e10ab4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 174 (44e10ab8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 175 (44e10abc.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 176 (44e10ac0.0): 48390000.usb (GPIO UNCLAIMED) function usb1_pins_default group usb1_pins_default
pin 177 (44e10ac4.0): 483d0000.usb (GPIO UNCLAIMED) function usb2_pins_default group usb2_pins_default
pin 178 (44e10ac8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 179 (44e10acc.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 180 (44e10ad0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 181 (44e10ad4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 182 (44e10ad8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 183 (44e10adc.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 184 (44e10ae0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 185 (44e10ae4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 186 (44e10ae8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 187 (44e10aec.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 188 (44e10af0.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 189 (44e10af4.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 190 (44e10af8.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 191 (44e10afc.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 192 (44e10b00.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 193 (44e10b04.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 194 (44e10b08.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 195 (44e10b0c.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 196 (44e10b10.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 197 (44e10b14.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 198 (44e10b18.0): (MUX UNCLAIMED) (GPIO UNCLAIMED)

200
Projects/DirectMemo/pindosia/pins

@ -0,0 +1,200 @@
registered pins: 199
pin 0 (44e10800.0) 00060001 pinctrl-single
pin 1 (44e10804.0) 00060001 pinctrl-single
pin 2 (44e10808.0) 00060001 pinctrl-single
pin 3 (44e1080c.0) 00060001 pinctrl-single
pin 4 (44e10810.0) 00060001 pinctrl-single
pin 5 (44e10814.0) 00060001 pinctrl-single
pin 6 (44e10818.0) 00060001 pinctrl-single
pin 7 (44e1081c.0) 00060001 pinctrl-single
pin 8 (44e10820.0) 08040007 pinctrl-single
pin 9 (44e10824.0) 08040007 pinctrl-single
pin 10 (44e10828.0) 08040007 pinctrl-single
pin 11 (44e1082c.0) 08040007 pinctrl-single
pin 12 (44e10830.0) 08040007 pinctrl-single
pin 13 (44e10834.0) 08040007 pinctrl-single
pin 14 (44e10838.0) 08040007 pinctrl-single
pin 15 (44e1083c.0) 08040007 pinctrl-single
pin 16 (44e10840.0) 08040007 pinctrl-single
pin 17 (44e10844.0) 08040007 pinctrl-single
pin 18 (44e10848.0) 08040007 pinctrl-single
pin 19 (44e1084c.0) 08040007 pinctrl-single
pin 20 (44e10850.0) 08040007 pinctrl-single
pin 21 (44e10854.0) 08040007 pinctrl-single
pin 22 (44e10858.0) 08040007 pinctrl-single
pin 23 (44e1085c.0) 08040007 pinctrl-single
pin 24 (44e10860.0) 00010007 pinctrl-single
pin 25 (44e10864.0) 00010007 pinctrl-single
pin 26 (44e10868.0) 00010007 pinctrl-single
pin 27 (44e1086c.0) 00010007 pinctrl-single
pin 28 (44e10870.0) 08060007 pinctrl-single
pin 29 (44e10874.0) 08060007 pinctrl-single
pin 30 (44e10878.0) 08060007 pinctrl-single
pin 31 (44e1087c.0) 00020003 pinctrl-single
pin 32 (44e10880.0) 08050002 pinctrl-single
pin 33 (44e10884.0) 08060002 pinctrl-single
pin 34 (44e10888.0) 00010002 pinctrl-single
pin 35 (44e1088c.0) 08040007 pinctrl-single
pin 36 (44e10890.0) 00060003 pinctrl-single
pin 37 (44e10894.0) 00060003 pinctrl-single
pin 38 (44e10898.0) 00060003 pinctrl-single
pin 39 (44e1089c.0) 00060003 pinctrl-single
pin 40 (44e108a0.0) 08050007 pinctrl-single
pin 41 (44e108a4.0) 08050007 pinctrl-single
pin 42 (44e108a8.0) 08050007 pinctrl-single
pin 43 (44e108ac.0) 08050007 pinctrl-single
pin 44 (44e108b0.0) 08050007 pinctrl-single
pin 45 (44e108b4.0) 08050007 pinctrl-single
pin 46 (44e108b8.0) 08050007 pinctrl-single
pin 47 (44e108bc.0) 08040007 pinctrl-single
pin 48 (44e108c0.0) 08040007 pinctrl-single
pin 49 (44e108c4.0) 08050007 pinctrl-single
pin 50 (44e108c8.0) 08040007 pinctrl-single
pin 51 (44e108cc.0) 08040007 pinctrl-single
pin 52 (44e108d0.0) 08050007 pinctrl-single
pin 53 (44e108d4.0) 08050007 pinctrl-single
pin 54 (44e108d8.0) 08050007 pinctrl-single
pin 55 (44e108dc.0) 08040007 pinctrl-single
pin 56 (44e108e0.0) 08040007 pinctrl-single
pin 57 (44e108e4.0) 08040007 pinctrl-single
pin 58 (44e108e8.0) 08040007 pinctrl-single
pin 59 (44e108ec.0) 08040007 pinctrl-single
pin 60 (44e108f0.0) 00060000 pinctrl-single
pin 61 (44e108f4.0) 00060000 pinctrl-single
pin 62 (44e108f8.0) 00060000 pinctrl-single
pin 63 (44e108fc.0) 00060000 pinctrl-single
pin 64 (44e10900.0) 00060000 pinctrl-single
pin 65 (44e10904.0) 00060000 pinctrl-single
pin 66 (44e10908.0) 08040007 pinctrl-single
pin 67 (44e1090c.0) 08040007 pinctrl-single
pin 68 (44e10910.0) 08040007 pinctrl-single
pin 69 (44e10914.0) 00000002 pinctrl-single
pin 70 (44e10918.0) 00040002 pinctrl-single
pin 71 (44e1091c.0) 00000002 pinctrl-single
pin 72 (44e10920.0) 00000002 pinctrl-single
pin 73 (44e10924.0) 00000002 pinctrl-single
pin 74 (44e10928.0) 00000002 pinctrl-single
pin 75 (44e1092c.0) 00000002 pinctrl-single
pin 76 (44e10930.0) 00040002 pinctrl-single
pin 77 (44e10934.0) 00040002 pinctrl-single
pin 78 (44e10938.0) 00040002 pinctrl-single
pin 79 (44e1093c.0) 00040002 pinctrl-single
pin 80 (44e10940.0) 00040002 pinctrl-single
pin 81 (44e10944.0) 08040007 pinctrl-single
pin 82 (44e10948.0) 00060000 pinctrl-single
pin 83 (44e1094c.0) 00020000 pinctrl-single
pin 84 (44e10950.0) 00040007 pinctrl-single
pin 85 (44e10954.0) 00040000 pinctrl-single
pin 86 (44e10958.0) 08060007 pinctrl-single
pin 87 (44e1095c.0) 08060007 pinctrl-single
pin 88 (44e10960.0) 00050007 pinctrl-single
pin 89 (44e10964.0) 00000007 pinctrl-single
pin 90 (44e10968.0) 08060007 pinctrl-single
pin 91 (44e1096c.0) 08060007 pinctrl-single
pin 92 (44e10970.0) 08060000 pinctrl-single
pin 93 (44e10974.0) 08050000 pinctrl-single
pin 94 (44e10978.0) 00060007 pinctrl-single
pin 95 (44e1097c.0) 00060007 pinctrl-single
pin 96 (44e10980.0) 00060007 pinctrl-single
pin 97 (44e10984.0) 00060007 pinctrl-single
pin 98 (44e10988.0) 00060000 pinctrl-single
pin 99 (44e1098c.0) 00060000 pinctrl-single
pin 100 (44e10990.0) 08040007 pinctrl-single
pin 101 (44e10994.0) 08040007 pinctrl-single
pin 102 (44e10998.0) 08040007 pinctrl-single
pin 103 (44e1099c.0) 08040007 pinctrl-single
pin 104 (44e109a0.0) 08040007 pinctrl-single
pin 105 (44e109a4.0) 08040007 pinctrl-single
pin 106 (44e109a8.0) 08040007 pinctrl-single
pin 107 (44e109ac.0) 08040007 pinctrl-single
pin 108 (44e109b0.0) 08040007 pinctrl-single
pin 109 (44e109b4.0) 08040007 pinctrl-single
pin 110 (44e109b8.0) 08040007 pinctrl-single
pin 111 (44e109bc.0) 08040007 pinctrl-single
pin 112 (44e109c0.0) 08040007 pinctrl-single
pin 113 (44e109c4.0) 08040007 pinctrl-single
pin 114 (44e109c8.0) 08040007 pinctrl-single
pin 115 (44e109cc.0) 08040007 pinctrl-single
pin 116 (44e109d0.0) 08040007 pinctrl-single
pin 117 (44e109d4.0) 08040007 pinctrl-single
pin 118 (44e109d8.0) 08040007 pinctrl-single
pin 119 (44e109dc.0) 08040007 pinctrl-single
pin 120 (44e109e0.0) 08040007 pinctrl-single
pin 121 (44e109e4.0) 08040007 pinctrl-single
pin 122 (44e109e8.0) 08040007 pinctrl-single
pin 123 (44e109ec.0) 08060007 pinctrl-single
pin 124 (44e109f0.0) 08040007 pinctrl-single
pin 125 (44e109f4.0) 08040007 pinctrl-single
pin 126 (44e109f8.0) 08040007 pinctrl-single
pin 127 (44e109fc.0) 08060007 pinctrl-single
pin 128 (44e10a00.0) 08040007 pinctrl-single
pin 129 (44e10a04.0) 08040007 pinctrl-single
pin 130 (44e10a08.0) 08040007 pinctrl-single
pin 131 (44e10a0c.0) 08040007 pinctrl-single
pin 132 (44e10a10.0) 08040007 pinctrl-single
pin 133 (44e10a14.0) 08040007 pinctrl-single
pin 134 (44e10a18.0) 08040007 pinctrl-single
pin 135 (44e10a1c.0) 08040007 pinctrl-single
pin 136 (44e10a20.0) 08040007 pinctrl-single
pin 137 (44e10a24.0) 08040007 pinctrl-single
pin 138 (44e10a28.0) 08060007 pinctrl-single
pin 139 (44e10a2c.0) 08060007 pinctrl-single
pin 140 (44e10a30.0) 08060007 pinctrl-single
pin 141 (44e10a34.0) 08060007 pinctrl-single
pin 142 (44e10a38.0) 08040007 pinctrl-single
pin 143 (44e10a3c.0) 08040007 pinctrl-single
pin 144 (44e10a40.0) 00060001 pinctrl-single
pin 145 (44e10a44.0) 00010007 pinctrl-single
pin 146 (44e10a48.0) 00060001 pinctrl-single
pin 147 (44e10a4c.0) 00010007 pinctrl-single
pin 148 (44e10a50.0) 08040007 pinctrl-single
pin 149 (44e10a54.0) 08040007 pinctrl-single
pin 150 (44e10a58.0) 08040007 pinctrl-single
pin 151 (44e10a5c.0) 09020007 pinctrl-single
pin 152 (44e10a60.0) 08040007 pinctrl-single
pin 153 (44e10a64.0) 08040007 pinctrl-single
pin 154 (44e10a68.0) 08060007 pinctrl-single
pin 155 (44e10a6c.0) 08060007 pinctrl-single
pin 156 (44e10a70.0) 00060003 pinctrl-single
pin 157 (44e10a74.0) 00060003 pinctrl-single
pin 158 (44e10a78.0) 00060000 pinctrl-single
pin 159 (44e10a7c.0) 00060000 pinctrl-single
pin 160 (44e10a80.0) 00050000 pinctrl-single
pin 161 (44e10a84.0) 00060000 pinctrl-single
pin 162 (44e10a88.0) 00050000 pinctrl-single
pin 163 (44e10a8c.0) 00050000 pinctrl-single
pin 164 (44e10a90.0) 00040000 pinctrl-single
pin 165 (44e10a94.0) 00040000 pinctrl-single
pin 166 (44e10a98.0) 00040000 pinctrl-single
pin 167 (44e10a9c.0) 00040000 pinctrl-single
pin 168 (44e10aa0.0) 00040000 pinctrl-single
pin 169 (44e10aa4.0) 00040000 pinctrl-single
pin 170 (44e10aa8.0) 00040000 pinctrl-single
pin 171 (44e10aac.0) 00050000 pinctrl-single
pin 172 (44e10ab0.0) 00050000 pinctrl-single
pin 173 (44e10ab4.0) 00050000 pinctrl-single
pin 174 (44e10ab8.0) 00050000 pinctrl-single
pin 175 (44e10abc.0) 00050000 pinctrl-single
pin 176 (44e10ac0.0) 08040000 pinctrl-single
pin 177 (44e10ac4.0) 08040000 pinctrl-single
pin 178 (44e10ac8.0) 00050000 pinctrl-single
pin 179 (44e10acc.0) 00050000 pinctrl-single
pin 180 (44e10ad0.0) 00050000 pinctrl-single
pin 181 (44e10ad4.0) 00050000 pinctrl-single
pin 182 (44e10ad8.0) 00040000 pinctrl-single
pin 183 (44e10adc.0) 00040000 pinctrl-single
pin 184 (44e10ae0.0) 00040000 pinctrl-single
pin 185 (44e10ae4.0) 00040000 pinctrl-single
pin 186 (44e10ae8.0) 00040000 pinctrl-single
pin 187 (44e10aec.0) 00040000 pinctrl-single
pin 188 (44e10af0.0) 00040000 pinctrl-single
pin 189 (44e10af4.0) 00040000 pinctrl-single
pin 190 (44e10af8.0) 00040000 pinctrl-single
pin 191 (44e10afc.0) 00040000 pinctrl-single
pin 192 (44e10b00.0) 00040000 pinctrl-single
pin 193 (44e10b04.0) 00040000 pinctrl-single
pin 194 (44e10b08.0) 00040000 pinctrl-single
pin 195 (44e10b0c.0) 00040000 pinctrl-single
pin 196 (44e10b10.0) 00040000 pinctrl-single
pin 197 (44e10b14.0) 00040000 pinctrl-single
pin 198 (44e10b18.0) 00050000 pinctrl-single

1347
Projects/DirectMemo/popa.txt
File diff suppressed because it is too large
View File

45
Projects/DirectMemo/protocols.txt

@ -0,0 +1,45 @@
Compatible PTZ Protocols
SAMSUNG MPT-230
SONY EVI-D30
DYNACOLOR DSCP
WON WOO
DONGYANG DSC-230S
DONGYANG DSC-230M
DONGYANG DPC-100
DONGYANG DSC-240
DONGYANG DRX-500
DONGYANG DRX-502A
PELCO D-PROTOCOL
PELCO P-PROTOCOL
PELCO CM6700
COSTAR 2500
VICON V2311RB3
VICON VPS1300
VICON 422R
CNB PTZ 102N
KALATEL KTD-312
SENSOMATIC PTZ
ELMO PTC-200
CANNON VC-C4
HITRON SCANDOMEII
WOOJU (DRX-502A)
SAMSUNG MRX-1000
KCC-PT400
VIDO B-01
LG LPT-A100L
TSC
PIH-302
DS-120
SCC-641
WV-CS850
VC-C50i
NIKO NK-97
NEWBORN DOME
SJ-100
DY-255
HRX-700
VCL
KD6i
BOSCH
HONEYWELL SCANDOMEII

53
Projects/DirectMemo/pru0Window.cpp

@ -0,0 +1,53 @@
#include "pru0Window.h"
#include "../../source/lib/hardware/soc/modules/pru/pru_ss.h"
pru0Window::pru0Window() : WindowCLI( NULL ){
m_pSOC = classSOC::getInstance();
#ifdef NEWT_CLI
#else
create( 0, 18, 40, 17 );
#endif
};
pru0Window::~pru0Window(){
#ifdef NEWT_CLI
newtPopWindow();
#else
#endif
};
void pru0Window::paint( void ){
#ifdef NEWT_CLI
newtOpenWindow( 0, 18, 40, 17, "PRUSS0 Info" );
newtDrawForm( m_oForm );
#else
volatile pruCfg *c_pPRUSS = NULL;
volatile pruCtrl *c_pPRU = NULL;
c_pPRUSS = m_pSOC->getPRUSS_GFG( 0 );
c_pPRU = m_pSOC->getPRU_CTRL( 0, 0 );
createBox( true );
mvwprintw( m_pWND, 2,2, " PRUSS%d Config at: \t%p", 0, c_pPRUSS );
if( c_pPRUSS != NULL ) {
mvwprintw( m_pWND, 3,2, " PRUSS%d Revision ID: \t0x%08x", 0, c_pPRUSS->REVID );
} else {
mvwprintw( m_pWND, 3,2, " Not Init" );
}
if( c_pPRU != NULL ) {
mvwprintw( m_pWND, 4,2, " PRUSS%d_PRU%d INFO:", 0, 0 );
mvwprintw( m_pWND, 6,2, " soft reset bit: \t%d", c_pPRU->CTRL_bit.SOFT_RST_N );
mvwprintw( m_pWND, 7,2, " enable bit: \t\t%d", c_pPRU->CTRL_bit.ENABLE );
mvwprintw( m_pWND, 8,2, " sleeping bit: \t%d", c_pPRU->CTRL_bit.SLEEPING );
mvwprintw( m_pWND, 9,2, " counter enable bit: \t%d", c_pPRU->CTRL_bit.COUNTER_ENABLE );
mvwprintw( m_pWND, 10,2, " single step bit: \t%d", c_pPRU->CTRL_bit.SINGLE_STEP );
mvwprintw( m_pWND, 11,2, " run state bit: \t%d", c_pPRU->CTRL_bit.RUNSTATE );
mvwprintw( m_pWND, 12,2, " PC counter init val: x%08x", c_pPRU->CTRL_bit.PCOUNTER_RST_VAL );
mvwprintw( m_pWND, 13,2, " PC counter value: \t%d", c_pPRU->STS_bit.PCOUNTER );
mvwprintw( m_pWND, 14,2, " cycle count value: \t%d", c_pPRU->CYCLE_bit.CYCLECOUNT );
mvwprintw( m_pWND, 15,2, " stall count value: \t%d", c_pPRU->STALL_bit.STALLCOUNT );
} else {
mvwprintw( m_pWND, 4,2, " NO PRU INFO" );
}
wrefresh( m_pWND );
#endif
};

23
Projects/DirectMemo/pru0Window.h

@ -0,0 +1,23 @@
#ifndef __PRU0WINDOW_H_INCL__
#define __PRU0WINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
/**
* TODO: Add class description
*
* @author gagua
*/
class pru0Window : public WindowCLI {
classSOC *m_pSOC;
public:
pru0Window();
~pru0Window();
void paint( void );
};
#endif // __PRU0WINDOW_H_INCL__

53
Projects/DirectMemo/pru1Window.cpp

@ -0,0 +1,53 @@
#include "pru1Window.h"
#include "../../source/lib/hardware/soc/modules/pru/pru_ss.h"
pru1Window::pru1Window() : WindowCLI( NULL ){
m_pSOC = classSOC::getInstance();
#ifdef NEWT_CLI
#else
create( 40, 18, 40, 17 );
#endif
};
pru1Window::~pru1Window(){
#ifdef NEWT_CLI
newtPopWindow();
#else
#endif
};
void pru1Window::paint( void ){
#ifdef NEWT_CLI
newtOpenWindow( 40, 18, 40, 17, "PRUSS0 Info" );
newtDrawForm( m_oForm );
#else
volatile pruCfg *c_pPRUSS = NULL;
volatile pruCtrl *c_pPRU = NULL;
c_pPRUSS = m_pSOC->getPRUSS_GFG( 1 );
c_pPRU = m_pSOC->getPRU_CTRL( 1, 0 );
createBox( true );
mvwprintw( m_pWND, 2,2, " PRUSS%d Config at: \t%p", 1, c_pPRUSS );
if( c_pPRUSS != NULL ) {
mvwprintw( m_pWND, 3,2, " PRUSS%d Revision ID: \t0x%08x", 1, c_pPRUSS->REVID );
} else {
mvwprintw( m_pWND, 3,2, " Not Init" );
}
if( c_pPRU != NULL ) {
mvwprintw( m_pWND, 4,2, " PRUSS%d_PRU%d INFO:", 1, 0 );
mvwprintw( m_pWND, 6,2, " soft reset bit: \t%d", c_pPRU->CTRL_bit.SOFT_RST_N );
mvwprintw( m_pWND, 7,2, " enable bit: \t\t%d", c_pPRU->CTRL_bit.ENABLE );
mvwprintw( m_pWND, 8,2, " sleeping bit: \t%d", c_pPRU->CTRL_bit.SLEEPING );
mvwprintw( m_pWND, 9,2, " counter enable bit: \t%d", c_pPRU->CTRL_bit.COUNTER_ENABLE );
mvwprintw( m_pWND, 10,2, " single step bit: \t%d", c_pPRU->CTRL_bit.SINGLE_STEP );
mvwprintw( m_pWND, 11,2, " run state bit: \t%d", c_pPRU->CTRL_bit.RUNSTATE );
mvwprintw( m_pWND, 12,2, " PC counter init val: x%08x", c_pPRU->CTRL_bit.PCOUNTER_RST_VAL );
mvwprintw( m_pWND, 13,2, " PC counter value: \t%d", c_pPRU->STS_bit.PCOUNTER );
mvwprintw( m_pWND, 14,2, " cycle count value: \t%d", c_pPRU->CYCLE_bit.CYCLECOUNT );
mvwprintw( m_pWND, 15,2, " stall count value: \t%d", c_pPRU->STALL_bit.STALLCOUNT );
} else {
mvwprintw( m_pWND, 4,2, " NO PRU INFO" );
}
wrefresh( m_pWND );
#endif
};

23
Projects/DirectMemo/pru1Window.h

@ -0,0 +1,23 @@
#ifndef __PRU1WINDOW_H_INCL__
#define __PRU1WINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
/**
* TODO: Add class description
*
* @author gagua
*/
class pru1Window : public WindowCLI {
classSOC *m_pSOC;
public:
pru1Window();
~pru1Window();
void paint( void );
};
#endif // __PRU0WINDOW_H_INCL__

285
Projects/DirectMemo/pruCoresWindow.cpp

@ -0,0 +1,285 @@
#include "pruCoresWindow.h"
#include "../../source/lib/hardware/soc/modules/pru/pru_ss.h"
pruCoresWindow::pruCoresWindow() : WindowCLI( NULL ){
m_pSOC = classSOC::getInstance();
m_x = 6;
m_y = 3;
m_w = 80;
m_h = 32;
#ifdef NEWT_CLI
m_l1 = newtLabel( 3, 1, "--- PRU0 [Pulse Control] ---");
m_l2 = newtLabel( 3, 2, "TUPUS[0,0]:");
m_t1 = newtTextbox( 3, 3, 32, 1, 0 );
m_t2 = newtTextbox( 3, 4, 32, 1, 0 );
m_t3 = newtTextbox( 3, 5, 32, 1, 0 );
m_t4 = newtTextbox( 3, 6, 32, 1, 0 );
m_t5 = newtTextbox( 3, 7, 32, 1, 0 );
m_t6 = newtTextbox( 3, 8, 32, 1, 0 );
m_t7 = newtTextbox( 3, 9, 32, 1, 0 );
m_t8 = newtTextbox( 3, 10, 32, 1, 0 );
m_t38 = newtTextbox( 3, 11, 32, 1, 0 );
m_l3 = newtLabel( 3, 12, "Core Status:");
m_t9 = newtTextbox( 3, 13, 32, 1, 0 );
m_l4 = newtLabel( 3, 15, "--- PRU1 [Motors Control]---");
m_l5 = newtLabel( 3, 16, "TUPUS[0,1]:");
m_t10 = newtTextbox( 3, 17, 32, 1, 0 );
m_t11 = newtTextbox( 3, 18, 32, 1, 0 );
m_t12 = newtTextbox( 3, 19, 32, 1, 0 );
m_t13 = newtTextbox( 3, 20, 32, 1, 0 );
m_t14 = newtTextbox( 3, 21, 32, 1, 0 );
m_t15 = newtTextbox( 3, 22, 32, 1, 0 );
m_t16 = newtTextbox( 3, 23, 32, 1, 0 );
m_t17 = newtTextbox( 3, 24, 32, 1, 0 );
m_t39 = newtTextbox( 3, 25, 32, 1, 0 );
m_l6 = newtLabel( 3, 26, "Core Status:");
m_t18 = newtTextbox( 3, 27, 32, 1, 0 );
m_l7 = newtLabel( 39, 1, "--- PRU2 [ADC Control] ---");
m_l8 = newtLabel( 39, 2, "TUPUS[1,0]:");
m_t19 = newtTextbox( 39, 3, 32, 1, 0 );
m_t20 = newtTextbox( 39, 4, 32, 1, 0 );
m_t21 = newtTextbox( 39, 5, 32, 1, 0 );
m_t22 = newtTextbox( 39, 6, 32, 1, 0 );
m_t23 = newtTextbox( 39, 7, 32, 1, 0 );
m_t24 = newtTextbox( 39, 8, 32, 1, 0 );
m_t25 = newtTextbox( 39, 9, 32, 1, 0 );
m_t26 = newtTextbox( 39, 10, 32, 1, 0 );
m_t40 = newtTextbox( 39, 11, 32, 1, 0 );
m_l9 = newtLabel( 39,12, "Core Status:");
m_t27 = newtTextbox( 39, 13, 32, 1, 0 );
m_l10 = newtLabel(39,15, "--- PRU3 [Detector] ---");
m_l11 = newtLabel(39,16, "TUPUS[1,1]:");
m_t28 = newtTextbox( 39, 17, 32, 1, 0 );
m_t29 = newtTextbox( 39, 18, 32, 1, 0 );
m_t30 = newtTextbox( 39, 19, 32, 1, 0 );
m_t31 = newtTextbox( 39, 20, 32, 1, 0 );
m_t32 = newtTextbox( 39, 21, 32, 1, 0 );
m_t33 = newtTextbox( 39, 22, 32, 1, 0 );
m_t34 = newtTextbox( 39, 23, 32, 1, 0 );
m_t35 = newtTextbox( 39, 24, 32, 1, 0 );
m_t41 = newtTextbox( 39, 25, 32, 1, 0 );
m_l12 = newtLabel( 39, 26, "Core Status:");
m_t36 = newtTextbox( 39, 27, 32, 1, 0 );
m_l13 = newtLabel( 39,28, "Detector Parameters:");
m_t37 = newtTextbox( 39, 29, 38, 1, 0 );
m_b1 = newtCompactButton( 35, 30, "Close" );
newtFormAddComponents( m_oForm, m_l1, m_l2,
m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_t8,
m_l3,
m_t9,
m_l4, m_l5,
m_l6,
m_t10,
m_l7, m_l8,
m_t11, m_t12, m_t13, m_t14, m_l9, m_t15,
m_l10, m_l11, m_t16, m_t17, m_t18, m_t19, m_l12, m_t20, m_b1,
m_t21, m_t22, m_t23, m_t24, m_t25, m_t26, m_t27, m_t28, m_t29, m_t30,
m_t31, m_t32, m_t33, m_t34, m_t35, m_t36, m_l13, m_t37,
m_t38, m_t39, m_t40, m_t41,
NULL );
#else
create( 40, 18, 40, 17 );
#endif
};
pruCoresWindow::~pruCoresWindow(){
#ifdef NEWT_CLI
newtPopWindow();
#else
#endif
};
void pruCoresWindow::paint( void ){
volatile structTUPUS *tTUPUS;
#ifdef NEWT_CLI
char tBuffer[245];
newtCenteredWindow( m_w, m_h, "PRU Cores Info" );
tTUPUS = m_pSOC->getTUPUS( 0 , 0 );
if( tTUPUS != NULL ) {
sprintf( tBuffer, "Host status: 0x%08X", tTUPUS->HOST_status );
newtTextboxSetText( m_t1, tBuffer );
sprintf( tBuffer, "Host cmd: 0x%08X", tTUPUS->HOST_command );
newtTextboxSetText( m_t2, tBuffer );
sprintf( tBuffer, "Host address: 0x%08X", tTUPUS->HOST_address );
newtTextboxSetText( m_t3, tBuffer );
sprintf( tBuffer, "Host data: 0x%08X", tTUPUS->HOST_data );
newtTextboxSetText( m_t4, tBuffer );
sprintf( tBuffer, "PRU ID: 0x%08X", tTUPUS->PRU_id );
newtTextboxSetText( m_t5, tBuffer );
sprintf( tBuffer, "PRU status: 0x%08X", tTUPUS->PRU_status );
newtTextboxSetText( m_t6, tBuffer );
sprintf( tBuffer, "PRU address: 0x%08X", tTUPUS->PRU_address );
newtTextboxSetText( m_t7, tBuffer );
sprintf( tBuffer, "PRU data: 0x%08X", tTUPUS->PRU_data );
newtTextboxSetText( m_t8, tBuffer );
sprintf( tBuffer, "Build Type: 0x%08X", tTUPUS->CORE_id );
newtTextboxSetText( m_t38, tBuffer );
MO_STATUS tT;
*((uint32_t *)&tT) = m_pSOC->getMotorStatus();
sprintf( tBuffer, "O[%s]L[%s]I[%d]M[%d:%d]M[%d:%d]S[%d]E[%d]",
(tT.online?"A":"D"),
(tT.lrf_en?"A":"D"),
tT.inter_mode,
tT.v_motor_en,
tT.v_motor_ok,
tT.h_motor_en,
tT.h_motor_ok,
tT.simulate,
tT.param_err );
newtTextboxSetText( m_t9, tBuffer );
} else {
sprintf( tBuffer, "Not Initialized");
newtTextboxSetText( m_t1, tBuffer );
};
tTUPUS = m_pSOC->getTUPUS( 0 , 1 );
if( tTUPUS != NULL ) {
sprintf( tBuffer, "Host status: 0x%08X", tTUPUS->HOST_status );
newtTextboxSetText( m_t10, tBuffer );
sprintf( tBuffer, "Host cmd: 0x%08X", tTUPUS->HOST_command );
newtTextboxSetText( m_t11, tBuffer );
sprintf( tBuffer, "Host address: 0x%08X", tTUPUS->HOST_address );
newtTextboxSetText( m_t12, tBuffer );
sprintf( tBuffer, "Host data: 0x%08X", tTUPUS->HOST_data );
newtTextboxSetText( m_t13, tBuffer );
sprintf( tBuffer, "PRU ID: 0x%08X", tTUPUS->PRU_id );
newtTextboxSetText( m_t14, tBuffer );
sprintf( tBuffer, "PRU status: 0x%08X", tTUPUS->PRU_status );
newtTextboxSetText( m_t15, tBuffer );
sprintf( tBuffer, "PRU address: 0x%08X", tTUPUS->PRU_address );
newtTextboxSetText( m_t16, tBuffer );
sprintf( tBuffer, "PRU data: 0x%08X", tTUPUS->PRU_data );
newtTextboxSetText( m_t17, tBuffer );
sprintf( tBuffer, "Build Type: 0x%08X", tTUPUS->CORE_id );
newtTextboxSetText( m_t39, tBuffer );
sprintf( tBuffer, "-- No Status of This Core --" );
newtTextboxSetText( m_t18, tBuffer );
} else {
sprintf( tBuffer, "Not Initialized");
newtTextboxSetText( m_t10, tBuffer );
};
tTUPUS = m_pSOC->getTUPUS( 1 , 0 );
if( tTUPUS != NULL ) {
sprintf( tBuffer, "Host status: 0x%08X", tTUPUS->HOST_status );
newtTextboxSetText( m_t19, tBuffer );
sprintf( tBuffer, "Host cmd: 0x%08X", tTUPUS->HOST_command );
newtTextboxSetText( m_t20, tBuffer );
sprintf( tBuffer, "Host address: 0x%08X", tTUPUS->HOST_address );
newtTextboxSetText( m_t21, tBuffer );
sprintf( tBuffer, "Host data: 0x%08X", tTUPUS->HOST_data );
newtTextboxSetText( m_t22, tBuffer );
sprintf( tBuffer, "PRU ID: 0x%08X", tTUPUS->PRU_id );
newtTextboxSetText( m_t23, tBuffer );
sprintf( tBuffer, "PRU status: 0x%08X", tTUPUS->PRU_status );
newtTextboxSetText( m_t24, tBuffer );
sprintf( tBuffer, "PRU address: 0x%08X", tTUPUS->PRU_address );
newtTextboxSetText( m_t25, tBuffer );
sprintf( tBuffer, "PRU data: 0x%08X", tTUPUS->PRU_data );
newtTextboxSetText( m_t26, tBuffer );
sprintf( tBuffer, "Build Type: 0x%08X", tTUPUS->CORE_id );
newtTextboxSetText( m_t40, tBuffer );
sprintf( tBuffer, "Base Shift: %d Mirror Shift: %d", m_pSOC->getBaseShift(), m_pSOC->getMirrorShift());
newtTextboxSetText( m_t27, tBuffer );
} else {
sprintf( tBuffer, "Not Initialized");
newtTextboxSetText( m_t19, tBuffer );
};
tTUPUS = m_pSOC->getTUPUS( 1 , 1 );
if( tTUPUS != NULL ) {
sprintf( tBuffer, "Host status: 0x%08X", tTUPUS->HOST_status );
newtTextboxSetText( m_t28, tBuffer );
sprintf( tBuffer, "Host cmd: 0x%08X", tTUPUS->HOST_command );
newtTextboxSetText( m_t29, tBuffer );
sprintf( tBuffer, "Host address: 0x%08X", tTUPUS->HOST_address );
newtTextboxSetText( m_t30, tBuffer );
sprintf( tBuffer, "Host data: 0x%08X", tTUPUS->HOST_data );
newtTextboxSetText( m_t31, tBuffer );
sprintf( tBuffer, "PRU ID: 0x%08X", tTUPUS->PRU_id );
newtTextboxSetText( m_t32, tBuffer );
sprintf( tBuffer, "PRU status: 0x%08X", tTUPUS->PRU_status );
newtTextboxSetText( m_t33, tBuffer );
sprintf( tBuffer, "PRU address: 0x%08X", tTUPUS->PRU_address );
newtTextboxSetText( m_t34, tBuffer );
sprintf( tBuffer, "PRU data: 0x%08X", tTUPUS->PRU_data );
newtTextboxSetText( m_t35, tBuffer );
sprintf( tBuffer, "Build Type: 0x%08X", tTUPUS->CORE_id );
newtTextboxSetText( m_t41, tBuffer );
DT_STATUS tT;
TH_PARAMS tP;
uint32_t tVal;
tVal = m_pSOC->getThCoreStatus();
memcpy( &tT, &tVal, sizeof(DT_STATUS));
sprintf( tBuffer, "O[%s]W[%s]M[%d]R[%d]E[%d]",
(tT.online?"A":"D"),
(tT.work_en?"A":"D"),
tT.mode,
tT.req,
tT.param_err );
newtTextboxSetText( m_t36, tBuffer );
tVal = m_pSOC->getThCoreParams();
memcpy( &tP, &tVal, sizeof(TH_PARAMS));
sprintf( tBuffer, "Flip:%d GP:%d Off:%d Ord:%d A_TH:%d",
tP.flip_size,
tP.good_points,
tP.offset,
tP.order,
tP.self_build_ena );
newtTextboxSetText( m_t37, tBuffer );
} else {
sprintf( tBuffer, "Not Initialized");
newtTextboxSetText( m_t28, tBuffer );
};
newtDrawForm( m_oForm );
newtRefresh();
#else
volatile pruCfg *c_pPRUSS = NULL;
volatile pruCtrl *c_pPRU = NULL;
c_pPRUSS = m_pSOC->getPRUSS_GFG( 1 );
c_pPRU = m_pSOC->getPRU_CTRL( 1, 0 );
createBox( true );
mvwprintw( m_pWND, 2,2, " PRUSS%d Config at: \t%p", 1, c_pPRUSS );
if( c_pPRUSS != NULL ) {
mvwprintw( m_pWND, 3,2, " PRUSS%d Revision ID: \t0x%08x", 1, c_pPRUSS->REVID );
} else {
mvwprintw( m_pWND, 3,2, " Not Init" );
}
if( c_pPRU != NULL ) {
mvwprintw( m_pWND, 4,2, " PRUSS%d_PRU%d INFO:", 1, 0 );
mvwprintw( m_pWND, 6,2, " soft reset bit: \t%d", c_pPRU->CTRL_bit.SOFT_RST_N );
mvwprintw( m_pWND, 7,2, " enable bit: \t\t%d", c_pPRU->CTRL_bit.ENABLE );
mvwprintw( m_pWND, 8,2, " sleeping bit: \t%d", c_pPRU->CTRL_bit.SLEEPING );
mvwprintw( m_pWND, 9,2, " counter enable bit: \t%d", c_pPRU->CTRL_bit.COUNTER_ENABLE );
mvwprintw( m_pWND, 10,2, " single step bit: \t%d", c_pPRU->CTRL_bit.SINGLE_STEP );
mvwprintw( m_pWND, 11,2, " run state bit: \t%d", c_pPRU->CTRL_bit.RUNSTATE );
mvwprintw( m_pWND, 12,2, " PC counter init val: x%08x", c_pPRU->CTRL_bit.PCOUNTER_RST_VAL );
mvwprintw( m_pWND, 13,2, " PC counter value: \t%d", c_pPRU->STS_bit.PCOUNTER );
mvwprintw( m_pWND, 14,2, " cycle count value: \t%d", c_pPRU->CYCLE_bit.CYCLECOUNT );
mvwprintw( m_pWND, 15,2, " stall count value: \t%d", c_pPRU->STALL_bit.STALLCOUNT );
} else {
mvwprintw( m_pWND, 4,2, " NO PRU INFO" );
}
wrefresh( m_pWND );
#endif
};

29
Projects/DirectMemo/pruCoresWindow.h

@ -0,0 +1,29 @@
#ifndef __PRU_CORES_WINDOW_H_INCL__
#define __PRU_CORES_WINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
/**
* TODO: Add class description
*
* @author gagua
*/
class pruCoresWindow : public WindowCLI {
classSOC *m_pSOC;
newtComponent m_l1, m_l2, m_l3, m_l4, m_l5, m_l6, m_l7, m_l8, m_l9, m_l10, m_l11, m_l12, m_l13;
newtComponent m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_t8, m_t9, m_t10, m_t11, m_t12, m_t13,
m_t14, m_t15, m_t16, m_t17, m_t18, m_t19, m_t20, m_b1;
newtComponent m_t21, m_t22, m_t23, m_t24, m_t25, m_t26, m_t27, m_t28, m_t29, m_t30;
newtComponent m_t31, m_t32, m_t33, m_t34, m_t35, m_t36, m_t37, m_t38, m_t39, m_t40, m_t41;
public:
pruCoresWindow();
~pruCoresWindow();
void paint( void );
};
#endif // __PRU_CORES_WINDOW_H_INCL__

185
Projects/DirectMemo/pwmInfoWindow.cpp

@ -0,0 +1,185 @@
#include "pwmInfoWindow.h"
pwmInfoWindow::pwmInfoWindow() : WindowCLI( NULL ){
m_pSOC = classSOC::getInstance();
m_x = 26;
m_y = 3;
m_w = 80;
m_h = 17;
#ifdef NEWT_CLI
m_l1 = newtLabel( 3, 1, "PWMSS0 Config:");
m_l2 = newtLabel( 39, 1, "PWMSS1 Config:");
m_t1 = newtTextbox( 3, 2, 38, 1, 0 );
m_t2 = newtTextbox( 3, 3, 38, 1, 0 );
m_t3 = newtTextbox( 3, 4, 38, 1, 0 );
m_t4 = newtTextbox( 3, 5, 38, 1, 0 );
m_t5 = newtTextbox( 3, 6, 38, 1, 0 );
m_t6 = newtTextbox( 3, 7, 38, 1, 0 );
m_t7 = newtTextbox( 3, 8, 38, 1, 0 );
m_t8 = newtTextbox( 3, 9, 38, 1, 0 );
m_t9 = newtTextbox( 3, 10, 38, 1, 0 );
m_t10 = newtTextbox( 3, 11, 38, 1, 0 );
m_t11 = newtTextbox( 3, 12, 38, 1, 0 );
m_t12 = newtTextbox( 3, 13, 38, 1, 0 );
m_t13 = newtTextbox( 3, 14, 38, 1, 0 );
m_t14 = newtTextbox( 39, 2, 38, 1, 0 );
m_t15 = newtTextbox( 39, 3, 38, 1, 0 );
m_t16 = newtTextbox( 39, 4, 38, 1, 0 );
m_t17 = newtTextbox( 39, 5, 38, 1, 0 );
m_t18 = newtTextbox( 39, 6, 38, 1, 0 );
m_t19 = newtTextbox( 39, 7, 38, 1, 0 );
m_t20 = newtTextbox( 39, 8, 38, 1, 0 );
m_t21 = newtTextbox( 39, 9, 38, 1, 0 );
m_t22 = newtTextbox( 39, 10, 38, 1, 0 );
m_t23 = newtTextbox( 39, 11, 38, 1, 0 );
m_t24 = newtTextbox( 39, 12, 38, 1, 0 );
m_t25 = newtTextbox( 39, 13, 38, 1, 0 );
m_t26 = newtTextbox( 39, 14, 38, 1, 0 );
newtFormAddComponents( m_oForm, m_l1, m_l2, m_t1, m_t2, m_t3, m_t4,
m_t5, m_t6, m_t7, m_t8, m_t9, m_t10, m_t11,
m_t12, m_t13,m_t14,m_t15,m_t16,m_t17,m_t18,
m_t19,m_t20,m_t21,m_t22,m_t23,m_t24,m_t25,m_t26, NULL );
//paint();
#else
create( m_x, m_y, m_w, m_h );
#endif
};
pwmInfoWindow::~pwmInfoWindow(){
newtPopWindow();
};
void pwmInfoWindow::paint( void ){
volatile sysPwmss *c_pPWM = NULL;
#ifdef NEWT_CLI
char tBuffer[245];
//newtOpenWindow( m_x, m_y, m_w, m_h, "PWM Info" );
newtCenteredWindow( m_w, m_h, "PWM Info" );
c_pPWM = m_pSOC->getPWMSS_CTRL( 1 );
if( c_pPWM != NULL ) {
sprintf( tBuffer, "PWMSS0 Signature: 0x%08x",c_pPWM->IDVER );
newtTextboxSetText( m_t1, tBuffer );
sprintf( tBuffer, " Scheme: %d Func: %d",
c_pPWM->IDVER_bit.SCHEME,
c_pPWM->IDVER_bit.FUNC );
newtTextboxSetText( m_t2, tBuffer );
sprintf( tBuffer, "RTL: %d Revision ID: %d.%d Custom:%d",
c_pPWM->IDVER_bit.R_RTL,
c_pPWM->IDVER_bit.X_MAJOR,
c_pPWM->IDVER_bit.Y_MINOR,
c_pPWM->IDVER_bit.CUSTOM );
newtTextboxSetText( m_t4, tBuffer );
sprintf( tBuffer, "ID: \t0x%08X", c_pPWM->ECAP_REVID );
newtTextboxSetText( m_t5, tBuffer );
sprintf( tBuffer, "Polarity: \t%s",((c_pPWM->ECAP_ECCTL2_bit.APWMPOL==0)?"High":"Low") );
newtTextboxSetText( m_t6, tBuffer );
sprintf( tBuffer, "ECCTL1: \t0x%08X", c_pPWM->ECAP_ECCTL1 );
newtTextboxSetText( m_t7, tBuffer );
sprintf( tBuffer, "ECCTL2: \t0x%08X", c_pPWM->ECAP_ECCTL2 );
newtTextboxSetText( m_t8, tBuffer );
sprintf( tBuffer, "Period: \t%d (%d nSec)", c_pPWM->ECAP_CAP1, c_pPWM->ECAP_CAP1*10 );
newtTextboxSetText( m_t9, tBuffer );
sprintf( tBuffer, "PRESCALE: \t%d", c_pPWM->ECAP_ECCTL1_bit.PRESCALE );
newtTextboxSetText( m_t10, tBuffer );
sprintf( tBuffer, "Duty Cycle: \t\t%d (%d nSec)", c_pPWM->ECAP_CAP2, c_pPWM->ECAP_CAP2*10 );
newtTextboxSetText( m_t11, tBuffer );
sprintf( tBuffer, "S_Period: \t\t%d (%d nSec)", c_pPWM->ECAP_CAP3, c_pPWM->ECAP_CAP3*10 );
newtTextboxSetText( m_t12, tBuffer );
sprintf( tBuffer, "S_Duty Cycle: \t\t%d (%d nSec)", c_pPWM->ECAP_CAP4, c_pPWM->ECAP_CAP4*10 );
newtTextboxSetText( m_t13, tBuffer );
} else {
sprintf( tBuffer, "Not Initialized" );
newtTextboxSetText( m_t1, tBuffer );
};
c_pPWM = m_pSOC->getPWMSS_CTRL( 2 );
if( c_pPWM != NULL ) {
sprintf( tBuffer, "PWMSS1 Signature: 0x%08x", c_pPWM->IDVER );
newtTextboxSetText( m_t14, tBuffer );
sprintf( tBuffer, " Scheme: %d Func: %d",
c_pPWM->IDVER_bit.SCHEME,
c_pPWM->IDVER_bit.FUNC );
newtTextboxSetText( m_t15, tBuffer );
sprintf( tBuffer, "RTL: %d Revision ID: %d.%d Custom:%d",
c_pPWM->IDVER_bit.R_RTL,
c_pPWM->IDVER_bit.X_MAJOR,
c_pPWM->IDVER_bit.Y_MINOR,
c_pPWM->IDVER_bit.CUSTOM );
newtTextboxSetText( m_t17, tBuffer );
sprintf( tBuffer, "ID: \t0x%08x", c_pPWM->ECAP_REVID );
newtTextboxSetText( m_t18, tBuffer );
sprintf( tBuffer, "Polarity: %s",((c_pPWM->ECAP_ECCTL2_bit.APWMPOL==0)?"High":"Low") );
newtTextboxSetText( m_t19, tBuffer );
sprintf( tBuffer, "Time Stamp (TSCTR): %s",((c_pPWM->ECAP_ECCTL2_bit.TSCTRSTOP==0)?"Stoped":"Free-Run") );
newtTextboxSetText( m_t20, tBuffer );
sprintf( tBuffer, "Mode: %s", ((c_pPWM->ECAP_ECCTL2_bit.CAP_APWM==0)?"eCAP":"APWM") );
newtTextboxSetText( m_t21, tBuffer );
sprintf( tBuffer, "Period: \t%d (%d nSec)", c_pPWM->ECAP_CAP1, c_pPWM->ECAP_CAP1*10 );
newtTextboxSetText( m_t22, tBuffer );
sprintf( tBuffer, "PRESCALE: \t%d", c_pPWM->ECAP_ECCTL1_bit.PRESCALE );
newtTextboxSetText( m_t23, tBuffer );
sprintf( tBuffer, "Duty Cycle: \t%d (%d nSec)", c_pPWM->ECAP_CAP2, c_pPWM->ECAP_CAP2*10 );
newtTextboxSetText( m_t24, tBuffer );
sprintf( tBuffer, "S_Period: \t%d (%d nSec)", c_pPWM->ECAP_CAP3, c_pPWM->ECAP_CAP3*10 );
newtTextboxSetText( m_t25, tBuffer );
sprintf( tBuffer, "S_Duty Cycle: %d (%d nSec)", c_pPWM->ECAP_CAP4, c_pPWM->ECAP_CAP4*10 );
newtTextboxSetText( m_t26, tBuffer );
} else {
sprintf( tBuffer, "Not Initialized");
newtTextboxSetText( m_t14, tBuffer );
};
newtDrawForm( m_oForm );
newtRefresh();
#else
createBox( true );
mvwprintw( m_pWND, 2,2,"PWMSS%d Config at: \t%p", 0, 0 );
c_pPWM = m_pSOC->getPWMSS_CTRL( 1 );
if( c_pPWM != NULL ) {
mvwprintw( m_pWND, 3,2,"PWMSS%d val: 0x%08x", 0, c_pPWM->IDVER );
mvwprintw( m_pWND, 4,2," Scheme: %d Func: %d",
c_pPWM->IDVER_bit.SCHEME,
c_pPWM->IDVER_bit.FUNC );
mvwprintw( m_pWND, 5,2,"RTL: %d Revision ID: %d.%d Custom:%d",
c_pPWM->IDVER_bit.R_RTL,
c_pPWM->IDVER_bit.X_MAJOR,
c_pPWM->IDVER_bit.Y_MINOR,
c_pPWM->IDVER_bit.CUSTOM );
mvwprintw( m_pWND, 7,2,"ID: \t0x%08x", c_pPWM->ECAP_REVID );
mvwprintw( m_pWND, 8,2,"Polarity: %s",((c_pPWM->ECAP_ECCTL2_bit.APWMPOL==0)?"High":"Low") );
mvwprintw( m_pWND, 9,2,"ECCTL1: \t\t%08X", c_pPWM->ECAP_ECCTL1 );
mvwprintw( m_pWND, 10,2,"ECCTL2: \t\t%08X", c_pPWM->ECAP_ECCTL2 );
mvwprintw( m_pWND, 11,2,"Period: \t%d (%d nSec)", c_pPWM->ECAP_CAP1, c_pPWM->ECAP_CAP1*10 );
mvwprintw( m_pWND, 12,2,"PRESCALE: \t%d", c_pPWM->ECAP_ECCTL1_bit.PRESCALE );
mvwprintw( m_pWND, 13,2,"Duty Cycle: \t%d (%d nSec)", c_pPWM->ECAP_CAP2, c_pPWM->ECAP_CAP2*10 );
mvwprintw( m_pWND, 14,2,"S_Period: \t%d (%d nSec)", c_pPWM->ECAP_CAP3, c_pPWM->ECAP_CAP3*10 );
mvwprintw( m_pWND, 15,2,"S_Duty Cycle: %d (%d nSec)", c_pPWM->ECAP_CAP4, c_pPWM->ECAP_CAP4*10 );
} else {
mvwprintw( m_pWND, 3,2,"Not Initialized");
}
c_pPWM = m_pSOC->getPWMSS_CTRL( 2 );
mvwprintw( m_pWND, 2,42,"PWMSS%d Config at: \t%p", 1, 0 );
if( c_pPWM != NULL ) {
mvwprintw( m_pWND, 3,42,"PWMSS%d val: 0x%08x", 1, c_pPWM->IDVER );
mvwprintw( m_pWND, 4,42," Scheme: %d Func: %d",
c_pPWM->IDVER_bit.SCHEME,
c_pPWM->IDVER_bit.FUNC );
mvwprintw( m_pWND, 5,42,"RTL: %d Revision ID: %d.%d Custom:%d",
c_pPWM->IDVER_bit.R_RTL,
c_pPWM->IDVER_bit.X_MAJOR,
c_pPWM->IDVER_bit.Y_MINOR,
c_pPWM->IDVER_bit.CUSTOM );
mvwprintw( m_pWND, 7,42,"ID: \t0x%08x", c_pPWM->ECAP_REVID );
mvwprintw( m_pWND, 8,42,"Polarity: %s",((c_pPWM->ECAP_ECCTL2_bit.APWMPOL==0)?"High":"Low") );
mvwprintw( m_pWND, 9,42,"Time Stamp (TSCTR): %s",((c_pPWM->ECAP_ECCTL2_bit.TSCTRSTOP==0)?"Stoped":"Free-Run") );
mvwprintw( m_pWND, 10,42,"Mode: %s", ((c_pPWM->ECAP_ECCTL2_bit.CAP_APWM==0)?"eCAP":"APWM") );
mvwprintw( m_pWND, 11,42,"Period: \t%d (%d nSec)", c_pPWM->ECAP_CAP1, c_pPWM->ECAP_CAP1*10 );
mvwprintw( m_pWND, 12,42,"PRESCALE: \t%d", c_pPWM->ECAP_ECCTL1_bit.PRESCALE );
mvwprintw( m_pWND, 13,42,"Duty Cycle: \t%d (%d nSec)", c_pPWM->ECAP_CAP2, c_pPWM->ECAP_CAP2*10 );
mvwprintw( m_pWND, 14,42,"S_Period: \t%d (%d nSec)", c_pPWM->ECAP_CAP3, c_pPWM->ECAP_CAP3*10 );
mvwprintw( m_pWND, 15,42,"S_Duty Cycle: %d (%d nSec)", c_pPWM->ECAP_CAP4, c_pPWM->ECAP_CAP4*10 );
} else {
mvwprintw( m_pWND, 3,42,"Not Initialized");
};
wrefresh( m_pWND );
#endif
};

28
Projects/DirectMemo/pwmInfoWindow.h

@ -0,0 +1,28 @@
#ifndef __PWMINFOWINDOW_H_INCL__
#define __PWMINFOWINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
/**
* TODO: Add class description
*
* @author gagua
*/
class pwmInfoWindow : public WindowCLI {
private:
classSOC *m_pSOC;
#ifdef NEWT_CLI
newtComponent m_l1, m_l2, m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_t8, m_t9, m_t10, m_t11, m_t12, m_t13;
newtComponent m_t14, m_t15, m_t16, m_t17, m_t18, m_t19, m_t20, m_t21, m_t22, m_t23, m_t24, m_t25, m_t26;
#endif
public:
pwmInfoWindow();
~pwmInfoWindow();
void paint( void );
};
#endif // __PWMINFOWINDOW_H_INCL__

101
Projects/DirectMemo/tgz2Window.cpp

@ -0,0 +1,101 @@
#include "tgz2Window.h"
#include "../../source/lib/hardware/soc/modules/pru/pru_ss.h"
tgz2Window::tgz2Window( protocolTGZ *Device ) : WindowCLI( NULL ){
m_pDeviceProtocol = Device;
m_x = 3;
m_y = 3;
m_w = 40;
m_h = 17;
#ifdef NEWT_CLI
m_l1 = newtLabel( 3, 1, "Bytes: 3 2 1 0");
m_l2 = newtLabel( 3, 2, "Data : 00 00 00 00");
m_l3 = newtLabel( 3, 3, " MSB --- LSB");
m_t1 = newtTextbox( 10, 2, 11, 1, 0 );
m_l4 = newtLabel( 3, 4, "M-Motors: pulses/sec.");
m_t2 = newtTextbox( 14, 4, 6, 1, 0 );
m_l5 = newtLabel( 3, 5, "M-Motors: spins/sec.");
m_t3 = newtTextbox( 14, 5, 5, 1, 0 );
m_l6 = newtLabel( 3, 6, "B-Motors: pulses/sec.");
m_t4 = newtTextbox( 14, 6, 6, 1, 0 );
m_l7 = newtLabel( 3, 7, "B-Motors: spins/sec.");
m_t5 = newtTextbox( 14, 7, 5, 1, 0 );
m_l8 = newtLabel( 3, 8, "Flags: Start[ ] Reset Error[ ]");
m_t6 = newtTextbox( 16, 8, 1, 1, 0 );
m_t7 = newtTextbox( 31, 8, 1, 1, 0 );
m_oMenu = newtListbox( 3, 10, 6, NEWT_FLAG_RETURNEXIT | NEWT_FLAG_SCROLL );
newtListboxAppendEntry( m_oMenu, "Toggle Start/Stop", (void *) 1 );
newtListboxAppendEntry( m_oMenu, "Toggle Reset-Error", (void *) 2 );
newtListboxAppendEntry( m_oMenu, "Toggle Mirror Motor Speed",(void *) 3 );
newtListboxAppendEntry( m_oMenu, "Toggle Base Motor Speed", (void *) 4 );
newtListboxAppendEntry( m_oMenu, "Send CMD to TGZ", (void *) 5 );
newtListboxAppendEntry( m_oMenu, "EXIT", (void *) 255 );
newtFormAddComponents( m_oForm, m_l1, m_l2, m_l3, m_l4, m_l5, m_l6, m_l7, m_l8, m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_oMenu, NULL );
#else
create( 0, 18, 40, 17 );
#endif
};
tgz2Window::~tgz2Window(){
newtPopWindow();
};
int tgz2Window::decodeEvent( newtComponent evt ){
if( evt == m_oMenu ) {
void *selected;
selected = newtListboxGetCurrent( m_oMenu );
return ( int )selected;
};
return 0;
};
void tgz2Window::paint( void ){
#ifdef NEWT_CLI
newtCenteredWindow( m_w, m_h, "TGZ New Protocol" );
if( m_pDeviceProtocol != NULL ) {
char tBuffer[245];
m_dwMyStatus = m_pDeviceProtocol->getPreparing();
m_dwTGZStatus = m_pDeviceProtocol->getLastReceived();
sprintf( tBuffer, "%02X %02X %02X %02X", ((m_dwMyStatus >> 24 )& 0xFF),((m_dwMyStatus >> 16 )& 0xFF),((m_dwMyStatus >> 8 )& 0xFF),( m_dwMyStatus & 0xFF) );
newtTextboxSetText( m_t1, tBuffer );
sprintf( tBuffer, "%d", ( m_pDeviceProtocol->getQSpeed() << 2 ) );
newtTextboxSetText( m_t2, tBuffer );
sprintf( tBuffer, "%0.2f",(float)( m_pDeviceProtocol->getQSpeed() << 2 ) / 8192.f );
newtTextboxSetText( m_t3, tBuffer );
sprintf( tBuffer, "%d", ( m_pDeviceProtocol->getBSpeed() << 4 ) );
newtTextboxSetText( m_t4, tBuffer );
sprintf( tBuffer, "%0.2f", (float)( m_pDeviceProtocol->getBSpeed() << 4 ) / 94208.f );
newtTextboxSetText( m_t5, tBuffer );
sprintf( tBuffer, "%c",(m_pDeviceProtocol->getRunFlag()?'*':' '));
newtTextboxSetText( m_t6, tBuffer );
sprintf( tBuffer, "%c",(m_pDeviceProtocol->getResetFlag()?'*':' '));
newtTextboxSetText( m_t7, tBuffer );
}
newtDrawForm( m_oForm );
#else
createBox( true );
mvwprintw( m_pWND, 2,2, " TGZ Communication " );
if( m_pDeviceProtocol != NULL ) {
m_dwMyStatus = m_pDeviceProtocol->getPreparing();
m_dwTGZStatus = m_pDeviceProtocol->getLastReceived();
mvwprintw( m_pWND, 3,2, " Frame 0x200 output: \t%08X", m_dwMyStatus );
mvwprintw( m_pWND, 4,2, " Control Byte: \t0x%02X [%s%s]", (m_dwMyStatus & 0xFF),((m_dwMyStatus & 0xFF)&2)?"Run":"Stp",((m_dwMyStatus & 0xFF)&1)?",RstErr":"");
mvwprintw( m_pWND, 5,2, " PRF: \t\t%d kHz", ((m_dwMyStatus >> 8) & 0xFF) );
mvwprintw( m_pWND, 6,2, " Block Cycles: \t%d", ((m_dwMyStatus >> 16) & 0xFF) );
mvwprintw( m_pWND, 7,2, " PRF Divider: \t%d", ((m_dwMyStatus >> 24) & 0xFF) );
mvwprintw( m_pWND, 8,2, " Frame 0x201 input: \t%08X", m_dwTGZStatus );
mvwprintw( m_pWND, 9,2, " Status Byte: \t0x%02X [%s%s%s]", (m_dwTGZStatus & 0xFF), ((m_dwTGZStatus & 0xFF)&4)?"Sync":"nSync",((m_dwTGZStatus & 0xFF)&2)?",Run":"",((m_dwTGZStatus & 0xFF)&1)?",Rdy":",Stb" );
mvwprintw( m_pWND, 10,2, " PRF: \t\t%d kHz", ((m_dwTGZStatus >> 8) & 0xFF) );
mvwprintw( m_pWND, 11,2, " Block Cycles: \t%d", ((m_dwTGZStatus >> 16) & 0xFF) );
mvwprintw( m_pWND, 12,2, " PRF Divider: \t%d", ((m_dwTGZStatus >> 24) & 0xFF) );
if( (((m_dwMyStatus & 0xFF)&2)== 0 ) && ((( m_dwTGZStatus & 0xFF)&2)== 0 ) ) {
mvwprintw( m_pWND, 15,2, " [Available to Config]" );
} else {
mvwprintw( m_pWND, 15,2, " [Config is Disabled]" );
}
} else {
mvwprintw( m_pWND, 3,2, " Not Init" );
}
wrefresh( m_pWND );
#endif
};

35
Projects/DirectMemo/tgz2Window.h

@ -0,0 +1,35 @@
#ifndef __TGZ2WINDOW_H_INCL__
#define __TGZ2WINDOW_H_INCL__
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
#include "../../source/lib/components/base/basicLogCollection.h"
#include "../../source/lib/data/protocol/protocolTGZ.h"
/**
* TODO: Add class description
*
* @author gagua
*/
class tgz2Window : public WindowCLI {
private:
unsigned int m_dwMyStatus;
unsigned int m_dwTGZStatus;
protocolTGZ *m_pDeviceProtocol;
#ifdef NEWT_CLI
newtComponent m_oMenu;
newtComponent m_l1, m_l2, m_l3, m_l4, m_l5, m_l6, m_l7, m_l8, m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_t8, m_t9, m_t10, m_t11, m_t12, m_t13;
newtComponent m_t14, m_t15, m_t16, m_t17, m_t18, m_t19, m_t20, m_t21, m_t22, m_t23, m_t24, m_t25, m_t26;
#endif
public:
explicit tgz2Window( protocolTGZ *Device );
virtual ~tgz2Window();
int decodeEvent( newtComponent evt );
void paint( void );
};
#endif // __PRU0WINDOW_H_INCL__

98
Projects/DirectMemo/tgzWindow.cpp

@ -0,0 +1,98 @@
#include "tgzWindow.h"
#include "../../source/lib/hardware/soc/modules/pru/pru_ss.h"
tgz1Window::tgz1Window( protocolTGZ *Device ) : WindowCLI( NULL ){
m_pDeviceProtocol = Device;
m_x = 3;
m_y = 3;
m_w = 40;
m_h = 17;
#ifdef NEWT_CLI
m_l1 = newtLabel( 3, 1, "Bytes: 3 2 1 0");
m_l2 = newtLabel( 3, 2, "Data : 00 00 00 00");
m_l3 = newtLabel( 3, 3, " MSB --- LSB");
m_t1 = newtTextbox( 10, 2, 11, 1, 0 );
m_l4 = newtLabel( 3, 4, "PRF: KHz");
m_t2 = newtTextbox( 8, 4, 3, 1, 0 );
m_l5 = newtLabel( 3, 5, "Divider:");
m_t3 = newtTextbox( 12, 5, 2, 1, 0 );
m_l6 = newtLabel( 3, 6, "Ratio:");
m_t4 = newtTextbox( 10, 6, 3, 1, 0 );
m_l7 = newtLabel( 3, 7, "Flags: Start[ ] Reset Error[ ]");
m_t5 = newtTextbox( 16, 7, 1, 1, 0 );
m_t6 = newtTextbox( 31, 7, 1, 1, 0 );
m_oMenu = newtListbox( 3, 9, 7, NEWT_FLAG_RETURNEXIT | NEWT_FLAG_SCROLL );
newtListboxAppendEntry( m_oMenu, "Toggle Start/Stop", (void *) 1 );
newtListboxAppendEntry( m_oMenu, "Toggle Reset-Error", (void *) 2 );
newtListboxAppendEntry( m_oMenu, "Toggle PRF", (void *) 3 );
newtListboxAppendEntry( m_oMenu, "Toggle Divider", (void *) 4 );
newtListboxAppendEntry( m_oMenu, "Toggle Ratio", (void *) 5 );
newtListboxAppendEntry( m_oMenu, "Send CMD to TGZ", (void *) 6 );
newtListboxAppendEntry( m_oMenu, "EXIT", (void *) 255 );
newtFormAddComponents( m_oForm, m_l1, m_l2, m_l3, m_l4, m_l5, m_l6, m_l7, m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_oMenu, NULL );
#else
create( 0, 18, 40, 17 );
#endif
};
tgz1Window::~tgz1Window(){
newtPopWindow();
};
int tgz1Window::decodeEvent( newtComponent evt ){
if( evt == m_oMenu ) {
void *selected;
selected = newtListboxGetCurrent( m_oMenu );
return ( int )selected;
};
return 0;
};
void tgz1Window::paint( void ){
#ifdef NEWT_CLI
newtCenteredWindow( m_w, m_h, "TGZ Old Protocol" );
if( m_pDeviceProtocol != NULL ) {
char tBuffer[245];
m_dwMyStatus = m_pDeviceProtocol->getPreparing();
m_dwTGZStatus = m_pDeviceProtocol->getLastReceived();
sprintf( tBuffer, "%02X %02X %02X %02X", ((m_dwMyStatus >> 24 )& 0xFF),((m_dwMyStatus >> 16 )& 0xFF),((m_dwMyStatus >> 8 )& 0xFF),( m_dwMyStatus & 0xFF) );
newtTextboxSetText( m_t1, tBuffer );
sprintf( tBuffer, "%d", m_pDeviceProtocol->getPRF() );
newtTextboxSetText( m_t2, tBuffer );
sprintf( tBuffer, "%d", m_pDeviceProtocol->getDivider() );
newtTextboxSetText( m_t3, tBuffer );
sprintf( tBuffer, "%d", m_pDeviceProtocol->getRatio() );
newtTextboxSetText( m_t4, tBuffer );
sprintf( tBuffer, "%c",(m_pDeviceProtocol->getRunFlag()?'*':' '));
newtTextboxSetText( m_t5, tBuffer );
sprintf( tBuffer, "%c",(m_pDeviceProtocol->getResetFlag()?'*':' '));
newtTextboxSetText( m_t6, tBuffer );
}
newtDrawForm( m_oForm );
#else
createBox( true );
mvwprintw( m_pWND, 2,2, " TGZ Communication " );
if( m_pDeviceProtocol != NULL ) {
m_dwMyStatus = m_pDeviceProtocol->getPreparing();
m_dwTGZStatus = m_pDeviceProtocol->getLastReceived();
mvwprintw( m_pWND, 3,2, " Frame 0x200 output: \t%08X", m_dwMyStatus );
mvwprintw( m_pWND, 4,2, " Control Byte: \t0x%02X [%s%s]", (m_dwMyStatus & 0xFF),((m_dwMyStatus & 0xFF)&2)?"Run":"Stp",((m_dwMyStatus & 0xFF)&1)?",RstErr":"");
mvwprintw( m_pWND, 5,2, " PRF: \t\t%d kHz", ((m_dwMyStatus >> 8) & 0xFF) );
mvwprintw( m_pWND, 6,2, " Block Cycles: \t%d", ((m_dwMyStatus >> 16) & 0xFF) );
mvwprintw( m_pWND, 7,2, " PRF Divider: \t%d", ((m_dwMyStatus >> 24) & 0xFF) );
mvwprintw( m_pWND, 8,2, " Frame 0x201 input: \t%08X", m_dwTGZStatus );
mvwprintw( m_pWND, 9,2, " Status Byte: \t0x%02X [%s%s%s]", (m_dwTGZStatus & 0xFF), ((m_dwTGZStatus & 0xFF)&4)?"Sync":"nSync",((m_dwTGZStatus & 0xFF)&2)?",Run":"",((m_dwTGZStatus & 0xFF)&1)?",Rdy":",Stb" );
mvwprintw( m_pWND, 10,2, " PRF: \t\t%d kHz", ((m_dwTGZStatus >> 8) & 0xFF) );
mvwprintw( m_pWND, 11,2, " Block Cycles: \t%d", ((m_dwTGZStatus >> 16) & 0xFF) );
mvwprintw( m_pWND, 12,2, " PRF Divider: \t%d", ((m_dwTGZStatus >> 24) & 0xFF) );
if( (((m_dwMyStatus & 0xFF)&2)== 0 ) && ((( m_dwTGZStatus & 0xFF)&2)== 0 ) ) {
mvwprintw( m_pWND, 15,2, " [Available to Config]" );
} else {
mvwprintw( m_pWND, 15,2, " [Config is Disabled]" );
}
} else {
mvwprintw( m_pWND, 3,2, " Not Init" );
}
wrefresh( m_pWND );
#endif
};

35
Projects/DirectMemo/tgzWindow.h

@ -0,0 +1,35 @@
#ifndef __TGZ1WINDOW_H_INCL__
#define __TGZ1WINDOW_H_INCL__
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
#include "../../source/lib/components/base/basicLogCollection.h"
#include "../../source/lib/data/protocol/protocolTGZ.h"
/**
* TODO: Add class description
*
* @author gagua
*/
class tgz1Window : public WindowCLI {
private:
unsigned int m_dwMyStatus;
unsigned int m_dwTGZStatus;
protocolTGZ *m_pDeviceProtocol;
#ifdef NEWT_CLI
newtComponent m_oMenu;
newtComponent m_l1, m_l2, m_l3, m_l4, m_l5, m_l6, m_l7, m_t1, m_t2, m_t3, m_t4, m_t5, m_t6, m_t7, m_t8, m_t9, m_t10, m_t11, m_t12, m_t13;
newtComponent m_t14, m_t15, m_t16, m_t17, m_t18, m_t19, m_t20, m_t21, m_t22, m_t23, m_t24, m_t25, m_t26;
#endif
public:
explicit tgz1Window( protocolTGZ *Device );
virtual ~tgz1Window();
int decodeEvent( newtComponent evt );
void paint( void );
};
#endif // __PRU0WINDOW_H_INCL__

42
Projects/DirectMemo/tupus0_0Window.cpp

@ -0,0 +1,42 @@
#include "tupus0_0Window.h"
tupus0_0Window::tupus0_0Window() : WindowCLI(NULL){
m_pSOC = classSOC::getInstance();
#ifdef NEWT_CLI
#else
create( 0, 36, 30, 12 );
#endif
};
tupus0_0Window::~tupus0_0Window(){
#ifdef NEWT_CLI
newtPopWindow();
#else
#endif
};
void tupus0_0Window::paint( void ){
#ifdef NEWT_CLI
newtOpenWindow( 0, 36, 30, 12, "TUPUS0_0" );
newtDrawForm( m_oForm );
#else
volatile structTUPUS *tTUPUS;
tTUPUS = m_pSOC->getTUPUS( 0 , 0 );
createBox( true );
mvwprintw( m_pWND, 2,2,"--- TUPUS[0:0] STATUS ---" );
if( tTUPUS != NULL ) {
mvwprintw( m_pWND, 3,2,"Host status:\t0x%08x", tTUPUS->HOST_status );
mvwprintw( m_pWND, 4,2,"Host cmd:\t0x%08x", tTUPUS->HOST_command );
mvwprintw( m_pWND, 5,2,"Host address:\t0x%08x", tTUPUS->HOST_address );
mvwprintw( m_pWND, 6,2,"Host data:\t0x%08x", tTUPUS->HOST_data );
mvwprintw( m_pWND, 7,2,"PRU ID:\t0x%08x", tTUPUS->PRU_id );
mvwprintw( m_pWND, 8,2,"PRU status:\t0x%08x", tTUPUS->PRU_status );
mvwprintw( m_pWND, 9,2,"PRU address:\t0x%08x", tTUPUS->PRU_address );
mvwprintw( m_pWND, 10,2,"PRU data:\t0x%08x", tTUPUS->PRU_data );
} else {
mvwprintw( m_pWND, 3,2,"Not Initialized");
};
wrefresh( m_pWND );
#endif
};

23
Projects/DirectMemo/tupus0_0Window.h

@ -0,0 +1,23 @@
#ifndef __TUPUS0_0WINDOW_H_INCL__
#define __TUPUS0_0WINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
/**
* TODO: Add class description
*
* @author gagua
*/
class tupus0_0Window : public WindowCLI {
classSOC *m_pSOC;
public:
tupus0_0Window();
virtual ~tupus0_0Window();
void paint( void );
};
#endif // __TUPUS0_0WINDOW_H_INCL__

41
Projects/DirectMemo/tupus0_1Window.cpp

@ -0,0 +1,41 @@
#include "tupus0_1Window.h"
tupus0_1Window::tupus0_1Window() : WindowCLI(NULL){
m_pSOC = classSOC::getInstance();
#ifdef NEWT_CLI
#else
create( 30, 36, 30, 12 );
#endif
};
tupus0_1Window::~tupus0_1Window(){
#ifdef NEWT_CLI
newtPopWindow();
#else
#endif
};
void tupus0_1Window::paint( void ){
#ifdef NEWT_CLI
newtOpenWindow( 30, 36, 30, 12, "TUPUS0_1" );
newtDrawForm( m_oForm );
#else
volatile structTUPUS *tTUPUS;
tTUPUS = m_pSOC->getTUPUS( 0 , 1 );
createBox( true );
mvwprintw( m_pWND, 2,2,"--- TUPUS[0:1] STATUS ---" );
if( tTUPUS != NULL ) {
mvwprintw( m_pWND, 3,2,"Host status:\t0x%08x", tTUPUS->HOST_status );
mvwprintw( m_pWND, 4,2,"Host cmd:\t0x%08x", tTUPUS->HOST_command );
mvwprintw( m_pWND, 5,2,"Host address:\t0x%08x", tTUPUS->HOST_address );
mvwprintw( m_pWND, 6,2,"Host data:\t0x%08x", tTUPUS->HOST_data );
mvwprintw( m_pWND, 7,2,"PRU ID:\t0x%08x", tTUPUS->PRU_id );
mvwprintw( m_pWND, 8,2,"PRU status:\t0x%08x", tTUPUS->PRU_status );
mvwprintw( m_pWND, 9,2,"PRU address:\t0x%08x", tTUPUS->PRU_address );
mvwprintw( m_pWND, 10,2,"PRU data:\t0x%08x", tTUPUS->PRU_data );
} else {
mvwprintw( m_pWND, 3,2,"Not Initialized");
};
wrefresh( m_pWND );
#endif
};

23
Projects/DirectMemo/tupus0_1Window.h

@ -0,0 +1,23 @@
#ifndef __TUPUS0_1WINDOW_H_INCL__
#define __TUPUS0_1WINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
/**
* TODO: Add class description
*
* @author gagua
*/
class tupus0_1Window : public WindowCLI {
classSOC *m_pSOC;
public:
tupus0_1Window();
~tupus0_1Window();
void paint( void );
};
#endif // __TUPUS0_1WINDOW_H_INCL__

41
Projects/DirectMemo/tupus1_0Window.cpp

@ -0,0 +1,41 @@
#include "tupus1_0Window.h"
tupus1_0Window::tupus1_0Window() : WindowCLI(NULL){
m_pSOC = classSOC::getInstance();
#ifdef NEWT_CLI
#else
create( 61, 36, 30, 12 );
#endif
};
tupus1_0Window::~tupus1_0Window(){
#ifdef NEWT_CLI
newtPopWindow();
#else
#endif
};
void tupus1_0Window::paint( void ){
#ifdef NEWT_CLI
newtOpenWindow( 61, 36, 30, 12, "TUPUS1_0" );
newtDrawForm( m_oForm );
#else
volatile structTUPUS *tTUPUS;
tTUPUS = m_pSOC->getTUPUS( 1 , 0 );
createBox( true );
mvwprintw( m_pWND, 2,2,"--- TUPUS[1:0] STATUS ---" );
if( tTUPUS != NULL ) {
mvwprintw( m_pWND, 3,2,"Host status:\t0x%08x", tTUPUS->HOST_status );
mvwprintw( m_pWND, 4,2,"Host cmd:\t0x%08x", tTUPUS->HOST_command );
mvwprintw( m_pWND, 5,2,"Host address:\t0x%08x", tTUPUS->HOST_address );
mvwprintw( m_pWND, 6,2,"Host data:\t0x%08x", tTUPUS->HOST_data );
mvwprintw( m_pWND, 7,2,"PRU ID:\t0x%08x", tTUPUS->PRU_id );
mvwprintw( m_pWND, 8,2,"PRU status:\t0x%08x", tTUPUS->PRU_status );
mvwprintw( m_pWND, 9,2,"PRU address:\t0x%08x", tTUPUS->PRU_address );
mvwprintw( m_pWND, 10,2,"PRU data:\t0x%08x", tTUPUS->PRU_data );
} else {
mvwprintw( m_pWND, 3,2,"Not Initialized");
};
wrefresh( m_pWND );
#endif
};

23
Projects/DirectMemo/tupus1_0Window.h

@ -0,0 +1,23 @@
#ifndef __TUPUS1_0WINDOW_H_INCL__
#define __TUPUS1_0WINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
/**
* TODO: Add class description
*
* @author gagua
*/
class tupus1_0Window : public WindowCLI {
classSOC *m_pSOC;
public:
tupus1_0Window();
~tupus1_0Window();
void paint( void );
};
#endif // __TUPUS1_0WINDOW_H_INCL__

41
Projects/DirectMemo/tupus1_1Window.cpp

@ -0,0 +1,41 @@
#include "tupus1_1Window.h"
tupus1_1Window::tupus1_1Window() : WindowCLI(NULL){
m_pSOC = classSOC::getInstance();
#ifdef NEWT_CLI
#else
create( 91, 36, 30, 12 );
#endif
};
tupus1_1Window::~tupus1_1Window(){
#ifdef NEWT_CLI
newtPopWindow();
#else
#endif
};
void tupus1_1Window::paint( void ){
#ifdef NEWT_CLI
newtOpenWindow( 91, 36, 30, 12, "TUPUS1_1" );
newtDrawForm( m_oForm );
#else
volatile structTUPUS *tTUPUS;
tTUPUS = m_pSOC->getTUPUS( 1 , 1 );
createBox( true );
mvwprintw( m_pWND, 2,2,"--- TUPUS[1:1] STATUS ---" );
if( tTUPUS != NULL ) {
mvwprintw( m_pWND, 3,2,"Host status:\t0x%08x", tTUPUS->HOST_status );
mvwprintw( m_pWND, 4,2,"Host cmd:\t0x%08x", tTUPUS->HOST_command );
mvwprintw( m_pWND, 5,2,"Host address:\t0x%08x", tTUPUS->HOST_address );
mvwprintw( m_pWND, 6,2,"Host data:\t0x%08x", tTUPUS->HOST_data );
mvwprintw( m_pWND, 7,2,"PRU ID:\t0x%08x", tTUPUS->PRU_id );
mvwprintw( m_pWND, 8,2,"PRU status:\t0x%08x", tTUPUS->PRU_status );
mvwprintw( m_pWND, 9,2,"PRU address:\t0x%08x", tTUPUS->PRU_address );
mvwprintw( m_pWND, 10,2,"PRU data:\t0x%08x", tTUPUS->PRU_data );
} else {
mvwprintw( m_pWND, 3,2,"Not Initialized");
};
wrefresh( m_pWND );
#endif
};

23
Projects/DirectMemo/tupus1_1Window.h

@ -0,0 +1,23 @@
#ifndef __TUPUS1_1WINDOW_H_INCL__
#define __TUPUS1_1WINDOW_H_INCL__
#include "../../source/lib/hardware/soc/classSOC.h"
#include "../../source/lib/cli/cliClass.h"
#ifndef NEWT_CLI
#include "../../source/lib/components/base/basicNCursesEngine.h"
#endif
/**
* TODO: Add class description
*
* @author gagua
*/
class tupus1_1Window : public WindowCLI {
classSOC *m_pSOC;
public:
tupus1_1Window();
~tupus1_1Window();
void paint( void );
};
#endif // __TUPUS1_1WINDOW_H_INCL__

244
Projects/DirectPRU/DirectPRU.vpj

@ -0,0 +1,244 @@
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
<Project
Version="10.0"
VendorName="SlickEdit"
TemplateName="GNU C/C++"
WorkingDir="."
BuildSystem="vsbuild">
<Config
Name="Debug"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdDirectPRU"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='gcc -c %xup %defd -g -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='ar -rs %xup "%o" %f'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%(VSLICKBIN1)vsbuild" "%w" "%r" -t build'/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%(VSLICKBIN1)vsbuild" "%w" "%r" -t rebuild'/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine=""/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine=""/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="StaticLibrary"/>
</List>
</Config>
<Config
Name="Release"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdDirectPRU"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='gcc -c %xup %defd -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='ar -rs %xup "%o" %f'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%(VSLICKBIN1)vsbuild" "%w" "%r" -t build'/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%(VSLICKBIN1)vsbuild" "%w" "%r" -t rebuild'/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine=""/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine=""/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="StaticLibrary"/>
</List>
</Config>
<Files>
<Folder
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
<F N="src/edma.c"/>
<F N="src/edmautils.c"/>
<F N="src/pru.c"/>
<F N="src/prussdrv.c"/>
<F N="src/suart_api.c"/>
<F N="src/suart_utils.c"/>
</Folder>
<Folder
Name="Header Files"
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
<F N="include/__prussdrv.h"/>
<F N="include/csl/cslr.h"/>
<F N="include/csl/cslr_dspintc.h"/>
<F N="include/csl/cslr_gpio.h"/>
<F N="include/csl/cslr_mcasp.h"/>
<F N="include/csl/cslr_prucore.h"/>
<F N="include/csl/cslr_pruintc.h"/>
<F N="include/csl/cslr_psc_OMAPL138.h"/>
<F N="include/csl/cslr_syscfg0_OMAPL138.h"/>
<F N="include/edma.h"/>
<F N="include/edmautils.h"/>
<F N="include/omapl_suart_board.h"/>
<F N="include/pru.h"/>
<F N="include/pruss_intc_mapping.h"/>
<F N="include/prussdrv.h"/>
<F N="include/csl/soc_OMAPL138.h"/>
<F N="include/suart_api.h"/>
<F N="include/suart_err.h"/>
<F N="include/suart_pru_regs.h"/>
<F N="include/suart_utils.h"/>
<F N="include/tistdtypes.h"/>
</Folder>
<Folder
Name="Resource Files"
Filters="*.ico;*.cur;*.dlg"/>
<Folder
Name="Bitmaps"
Filters="*.bmp"/>
<Folder
Name="Other Files"
Filters=""/>
</Files>
</Project>

182
Projects/DirectPRU/include/__prussdrv.h

@ -0,0 +1,182 @@
/*
* __prussdrv.h
*
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* ============================================================================
* Copyright (c) Texas Instruments Inc 2010-11
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied or provided.
* ============================================================================
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <ctype.h>
#include <fcntl.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/unistd.h>
#define PRUSS_IRAM_SIZE 4096
#define PRUSS_DATARAM_SIZE 512
#define DATARAM0_PHYS_BASE 0x01C30000
#define DATARAM1_PHYS_BASE 0x01C32000
#define INTC_PHYS_BASE 0x01C34000
#define PRU0CONTROL_PHYS_BASE 0x01C37000
#define PRU0DEBUG_PHYS_BASE 0x01C37400
#define PRU1CONTROL_PHYS_BASE 0x01C37800
#define PRU1DEBUG_PHYS_BASE 0x01C37C00
#define PRU0IRAM_PHYS_BASE 0x01C38000
#define PRU1IRAM_PHYS_BASE 0x01C3C000
//NOTE: Above defines are SOC specific
#define PRU_INTC_REVID_REG 0x000
#define PRU_INTC_CR_REG 0x004
#define PRU_INTC_HCR_REG 0x00C
#define PRU_INTC_GER_REG 0x010
#define PRU_INTC_GNLR_REG 0x01C
#define PRU_INTC_SISR_REG 0x020
#define PRU_INTC_SICR_REG 0x024
#define PRU_INTC_EISR_REG 0x028
#define PRU_INTC_EICR_REG 0x02C
#define PRU_INTC_HIEISR_REG 0x034
#define PRU_INTC_HIDISR_REG 0x038
#define PRU_INTC_GPIR_REG 0x080
#define PRU_INTC_SRSR1_REG 0x200
#define PRU_INTC_SRSR2_REG 0x204
#define PRU_INTC_SECR1_REG 0x280
#define PRU_INTC_SECR2_REG 0x284
#define PRU_INTC_ESR1_REG 0x300
#define PRU_INTC_ESR2_REG 0x304
#define PRU_INTC_ECR1_REG 0x380
#define PRU_INTC_ECR2_REG 0x384
#define PRU_INTC_CMR1_REG 0x400
#define PRU_INTC_CMR2_REG 0x404
#define PRU_INTC_CMR3_REG 0x408
#define PRU_INTC_CMR4_REG 0x40C
#define PRU_INTC_CMR5_REG 0x410
#define PRU_INTC_CMR6_REG 0x414
#define PRU_INTC_CMR7_REG 0x418
#define PRU_INTC_CMR8_REG 0x41C
#define PRU_INTC_CMR9_REG 0x420
#define PRU_INTC_CMR10_REG 0x424
#define PRU_INTC_CMR11_REG 0x428
#define PRU_INTC_CMR12_REG 0x42C
#define PRU_INTC_CMR13_REG 0x430
#define PRU_INTC_CMR14_REG 0x434
#define PRU_INTC_CMR15_REG 0x438
#define PRU_INTC_CMR16_REG 0x43C
#define PRU_INTC_HMR1_REG 0x800
#define PRU_INTC_HMR2_REG 0x804
#define PRU_INTC_HMR3_REG 0x808
#define PRU_INTC_SIPR1_REG 0xD00
#define PRU_INTC_SIPR2_REG 0xD04
#define PRU_INTC_SITR1_REG 0xD80
#define PRU_INTC_SITR2_REG 0xD84
#define PRU_INTC_HIER_REG 0x1500
#define PRUSS_UIO_DRV_PRUSS_BASE "/sys/class/uio/uio0/maps/map0/addr"
#define PRUSS_UIO_DRV_PRUSS_SIZE "/sys/class/uio/uio0/maps/map0/size"
#define PRUSS_UIO_DRV_L3RAM_BASE "/sys/class/uio/uio0/maps/map1/addr"
#define PRUSS_UIO_DRV_L3RAM_SIZE "/sys/class/uio/uio0/maps/map1/size"
#define PRUSS_UIO_DRV_EXTRAM_BASE "/sys/class/uio/uio0/maps/map2/addr"
#define PRUSS_UIO_DRV_EXTRAM_SIZE "/sys/class/uio/uio0/maps/map2/size"
typedef struct __prussdrv {
int fd[NUM_PRU_HOSTIRQS];
void *pru0dataram_base;
void *pru1dataram_base;
void *intc_base;
void *pru0control_base;
void *pru0debug_base;
void *pru1control_base;
void *pru1debug_base;
void *pru0iram_base;
void *pru1iram_base;
void *l3ram_base;
void *extram_base;
pthread_t irq_thread[NUM_PRU_HOSTIRQS];
int mmap_fd;
} tprussdrv;
static unsigned int pruss_phys_base, pruss_map_size;
static unsigned int l3ram_phys_base, l3ram_map_size;
static unsigned int extram_phys_base, extram_map_size;
void __prussintc_set_cmr(unsigned int *pruintc_io, unsigned short sysevt,
unsigned short channel)
{
pruintc_io[(PRU_INTC_CMR1_REG + (sysevt & ~(0x3))) >> 2] |=
((channel & 0xF) << ((sysevt & 0x3) << 3));
}
void __prussintc_set_hmr(unsigned int *pruintc_io, unsigned short channel,
unsigned short host)
{
pruintc_io[(PRU_INTC_HMR1_REG + (channel & ~(0x3))) >> 2] =
pruintc_io[(PRU_INTC_HMR1_REG +
(channel & ~(0x3))) >> 2] | (((host) & 0xF) <<
(((channel) & 0x3) << 3));
}

62
Projects/DirectPRU/include/csl/cslr.h

@ -0,0 +1,62 @@
/*****************************************************\
* Copyright 2003-2005 Texas Instruments Incorporated. *
* All rights reserved. *
* Restricted rights to use, duplicate or disclose *
* this code are granted through contract. *
* *
* "@(#) PSP/CSL 3.0.0.0 (2003-09-30) *
\*****************************************************/
/* Register layer central -- contains field-manipulation macro definitions */
#ifndef _CSLR_H_
#define _CSLR_H_
#ifdef __cplusplus
extern "C" {
#endif
/* the "expression" macros */
/* the Field MaKe macro */
#define CSL_FMK(PER_REG_FIELD, val) \
(((val) << CSL_##PER_REG_FIELD##_SHIFT) & CSL_##PER_REG_FIELD##_MASK)
/* the Field EXTract macro */
#define CSL_FEXT(reg, PER_REG_FIELD) \
(((reg) & CSL_##PER_REG_FIELD##_MASK) >> CSL_##PER_REG_FIELD##_SHIFT)
/* the Field INSert macro */
#define CSL_FINS(reg, PER_REG_FIELD, val) \
((reg) = ((reg) & ~CSL_##PER_REG_FIELD##_MASK) \
| CSL_FMK(PER_REG_FIELD, val))
/* the "token" macros */
/* the Field MaKe (Token) macro */
#define CSL_FMKT(PER_REG_FIELD, TOKEN) \
CSL_FMK(PER_REG_FIELD, CSL_##PER_REG_FIELD##_##TOKEN)
/* the Field INSert (Token) macro */
#define CSL_FINST(reg, PER_REG_FIELD, TOKEN) \
CSL_FINS((reg), PER_REG_FIELD, CSL_##PER_REG_FIELD##_##TOKEN)
/* the "raw" macros */
/* the Field MaKe (Raw) macro */
#define CSL_FMKR(msb, lsb, val) \
(((val) & ((1 << ((msb) - (lsb) + 1)) - 1)) << (lsb))
/* the Field EXTract (Raw) macro */
#define CSL_FEXTR(reg, msb, lsb) \
(((reg) >> (lsb)) & ((1 << ((msb) - (lsb) + 1)) - 1))
/* the Field INSert (Raw) macro */
#define CSL_FINSR(reg, msb, lsb, val) \
((reg) = ((reg) &~ (((1 << ((msb) - (lsb) + 1)) - 1) << (lsb))) \
| CSL_FMKR(msb, lsb, val))
#ifdef __cplusplus
}
#endif
#endif /* _CSLR_H_ */

3072
Projects/DirectPRU/include/csl/cslr_dspintc.h
File diff suppressed because it is too large
View File

1655
Projects/DirectPRU/include/csl/cslr_gpio.h
File diff suppressed because it is too large
View File

4000
Projects/DirectPRU/include/csl/cslr_mcasp.h
File diff suppressed because it is too large
View File

757
Projects/DirectPRU/include/csl/cslr_prucore.h

@ -0,0 +1,757 @@
/********************************************************************
* Copyright (C) 2003-2009 Texas Instruments Incorporated.
* All Rights Reserved
*********************************************************************
* file: cslr_prucore.h
*
* Brief: This file contains the Register Description for PRU Core
*
*********************************************************************/
#ifndef _CSLR_PRUCORE_H_
#define _CSLR_PRUCORE_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <csl/cslr.h>
#include "tistdtypes.h"
/* Minimum unit = 1 byte */
/**************************************************************************\
* Register Overlay Structure
\**************************************************************************/
typedef struct {
volatile Uint32 CONTROL;
volatile Uint32 STATUS;
volatile Uint32 WAKEUP;
volatile Uint32 CYCLECNT;
volatile Uint32 STALLCNT;
volatile Uint8 RSVD0[12];
volatile Uint32 CONTABBLKIDX0;
volatile Uint32 CONTABBLKIDX1;
volatile Uint32 CONTABPROPTR0;
volatile Uint32 CONTABPROPTR1;
volatile Uint8 RSVD1[976];
volatile Uint32 INTGPR0;
volatile Uint32 INTGPR1;
volatile Uint32 INTGPR2;
volatile Uint32 INTGPR3;
volatile Uint32 INTGPR4;
volatile Uint32 INTGPR5;
volatile Uint32 INTGPR6;
volatile Uint32 INTGPR7;
volatile Uint32 INTGPR8;
volatile Uint32 INTGPR9;
volatile Uint32 INTGPR10;
volatile Uint32 INTGPR11;
volatile Uint32 INTGPR12;
volatile Uint32 INTGPR13;
volatile Uint32 INTGPR14;
volatile Uint32 INTGPR15;
volatile Uint32 INTGPR16;
volatile Uint32 INTGPR17;
volatile Uint32 INTGPR18;
volatile Uint32 INTGPR19;
volatile Uint32 INTGPR20;
volatile Uint32 INTGPR21;
volatile Uint32 INTGPR22;
volatile Uint32 INTGPR23;
volatile Uint32 INTGPR24;
volatile Uint32 INTGPR25;
volatile Uint32 INTGPR26;
volatile Uint32 INTGPR27;
volatile Uint32 INTGPR28;
volatile Uint32 INTGPR29;
volatile Uint32 INTGPR30;
volatile Uint32 INTGPR31;
volatile Uint32 INTCTER0;
volatile Uint32 INTCTER1;
volatile Uint32 INTCTER2;
volatile Uint32 INTCTER3;
volatile Uint32 INTCTER4;
volatile Uint32 INTCTER5;
volatile Uint32 INTCTER6;
volatile Uint32 INTCTER7;
volatile Uint32 INTCTER8;
volatile Uint32 INTCTER9;
volatile Uint32 INTCTER10;
volatile Uint32 INTCTER11;
volatile Uint32 INTCTER12;
volatile Uint32 INTCTER13;
volatile Uint32 INTCTER14;
volatile Uint32 INTCTER15;
volatile Uint32 INTCTER16;
volatile Uint32 INTCTER17;
volatile Uint32 INTCTER18;
volatile Uint32 INTCTER19;
volatile Uint32 INTCTER20;
volatile Uint32 INTCTER21;
volatile Uint32 INTCTER22;
volatile Uint32 INTCTER23;
volatile Uint32 INTCTER24;
volatile Uint32 INTCTER25;
volatile Uint32 INTCTER26;
volatile Uint32 INTCTER27;
volatile Uint32 INTCTER28;
volatile Uint32 INTCTER29;
volatile Uint32 INTCTER30;
volatile Uint32 INTCTER31;
} CSL_PrucoreRegs;
/**************************************************************************\
* Overlay structure typedef definition
\**************************************************************************/
typedef volatile CSL_PrucoreRegs *CSL_PrucoreRegsOvly;
/**************************************************************************\
* Field Definition Macros
\**************************************************************************/
/* CONTROL */
#define CSL_PRUCORE_CONTROL_PCRESETVAL_MASK (0xFFFF0000u)
#define CSL_PRUCORE_CONTROL_PCRESETVAL_SHIFT (0x00000010u)
#define CSL_PRUCORE_CONTROL_PCRESETVAL_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CONTROL_RUNSTATE_MASK (0x00008000u)
#define CSL_PRUCORE_CONTROL_RUNSTATE_SHIFT (0x0000000Fu)
#define CSL_PRUCORE_CONTROL_RUNSTATE_RESETVAL (0x00000000u)
/*----RUNSTATE Tokens----*/
#define CSL_PRUCORE_CONTROL_RUNSTATE_HALT (0x00000000u)
#define CSL_PRUCORE_CONTROL_RUNSTATE_RUN (0x00000001u)
#define CSL_PRUCORE_CONTROL_SINGLESTEP_MASK (0x00000100u)
#define CSL_PRUCORE_CONTROL_SINGLESTEP_SHIFT (0x00000008u)
#define CSL_PRUCORE_CONTROL_SINGLESTEP_RESETVAL (0x00000000u)
/*----SINGLESTEP Tokens----*/
#define CSL_PRUCORE_CONTROL_SINGLESTEP_FREERUN (0x00000000u)
#define CSL_PRUCORE_CONTROL_SINGLESTEP_SINGLE (0x00000001u)
#define CSL_PRUCORE_CONTROL_COUNTENABLE_MASK (0x00000008u)
#define CSL_PRUCORE_CONTROL_COUNTENABLE_SHIFT (0x00000003u)
#define CSL_PRUCORE_CONTROL_COUNTENABLE_RESETVAL (0x00000000u)
/*----COUNTENABLE Tokens----*/
#define CSL_PRUCORE_CONTROL_COUNTENABLE_DISABLE (0x00000000u)
#define CSL_PRUCORE_CONTROL_COUNTENABLE_ENABLE (0x00000001u)
#define CSL_PRUCORE_CONTROL_SLEEPING_MASK (0x00000004u)
#define CSL_PRUCORE_CONTROL_SLEEPING_SHIFT (0x00000002u)
#define CSL_PRUCORE_CONTROL_SLEEPING_RESETVAL (0x00000000u)
/*----SLEEPING Tokens----*/
#define CSL_PRUCORE_CONTROL_SLEEPING_NOTASLEEP (0x00000000u)
#define CSL_PRUCORE_CONTROL_SLEEPING_ASLEEP (0x00000001u)
#define CSL_PRUCORE_CONTROL_ENABLE_MASK (0x00000002u)
#define CSL_PRUCORE_CONTROL_ENABLE_SHIFT (0x00000001u)
#define CSL_PRUCORE_CONTROL_ENABLE_RESETVAL (0x00000000u)
/*----ENABLE Tokens----*/
#define CSL_PRUCORE_CONTROL_ENABLE_DISABLE (0x00000000u)
#define CSL_PRUCORE_CONTROL_ENABLE_ENABLE (0x00000001u)
#define CSL_PRUCORE_CONTROL_SOFTRESET_MASK (0x00000001u)
#define CSL_PRUCORE_CONTROL_SOFTRESET_SHIFT (0x00000000u)
#define CSL_PRUCORE_CONTROL_SOFTRESET_RESETVAL (0x00000000u)
/*----SOFTRESET Tokens----*/
#define CSL_PRUCORE_CONTROL_SOFTRESET_RESET (0x00000000u)
#define CSL_PRUCORE_CONTROL_SOFTRESET_OUT_OF_RESET (0x00000001u)
#define CSL_PRUCORE_CONTROL_RESETVAL (0x00000000u)
/* STATUS */
#define CSL_PRUCORE_STATUS_PCOUNTER_MASK (0x0000FFFFu)
#define CSL_PRUCORE_STATUS_PCOUNTER_SHIFT (0x00000000u)
#define CSL_PRUCORE_STATUS_PCOUNTER_RESETVAL (0x00000000u)
#define CSL_PRUCORE_STATUS_RESETVAL (0x00000000u)
/* WAKEUP */
#define CSL_PRUCORE_WAKEUP_BITWISEENABLES_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_WAKEUP_BITWISEENABLES_SHIFT (0x00000000u)
#define CSL_PRUCORE_WAKEUP_BITWISEENABLES_RESETVAL (0x00000000u)
#define CSL_PRUCORE_WAKEUP_RESETVAL (0x00000000u)
/* CYCLECNT */
#define CSL_PRUCORE_CYCLECNT_CYCLECOUNT_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_CYCLECNT_CYCLECOUNT_SHIFT (0x00000000u)
#define CSL_PRUCORE_CYCLECNT_CYCLECOUNT_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CYCLECNT_RESETVAL (0x00000000u)
/* STALLCNT */
#define CSL_PRUCORE_STALLCNT_STALLCOUNT_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_STALLCNT_STALLCOUNT_SHIFT (0x00000000u)
#define CSL_PRUCORE_STALLCNT_STALLCOUNT_RESETVAL (0x00000000u)
#define CSL_PRUCORE_STALLCNT_RESETVAL (0x00000000u)
/* CONTABBLKIDX0 */
#define CSL_PRUCORE_CONTABBLKIDX0_C25_MASK (0x000F0000u)
#define CSL_PRUCORE_CONTABBLKIDX0_C25_SHIFT (0x00000010u)
#define CSL_PRUCORE_CONTABBLKIDX0_C25_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CONTABBLKIDX0_C24_MASK (0x0000000Fu)
#define CSL_PRUCORE_CONTABBLKIDX0_C24_SHIFT (0x00000000u)
#define CSL_PRUCORE_CONTABBLKIDX0_C24_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CONTABBLKIDX0_RESETVAL (0x00000000u)
/* CONTABBLKIDX1 */
#define CSL_PRUCORE_CONTABBLKIDX1_C27_MASK (0x000F0000u)
#define CSL_PRUCORE_CONTABBLKIDX1_C27_SHIFT (0x00000010u)
#define CSL_PRUCORE_CONTABBLKIDX1_C27_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CONTABBLKIDX1_C26_MASK (0x0000000Fu)
#define CSL_PRUCORE_CONTABBLKIDX1_C26_SHIFT (0x00000000u)
#define CSL_PRUCORE_CONTABBLKIDX1_C26_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CONTABBLKIDX1_RESETVAL (0x00000000u)
/* CONTABPROPTR0 */
#define CSL_PRUCORE_CONTABPROPTR0_C29_MASK (0xFFFF0000u)
#define CSL_PRUCORE_CONTABPROPTR0_C29_SHIFT (0x00000010u)
#define CSL_PRUCORE_CONTABPROPTR0_C29_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CONTABPROPTR0_C28_MASK (0x0000FFFFu)
#define CSL_PRUCORE_CONTABPROPTR0_C28_SHIFT (0x00000000u)
#define CSL_PRUCORE_CONTABPROPTR0_C28_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CONTABPROPTR0_RESETVAL (0x00000000u)
/* CONTABPROPTR1 */
#define CSL_PRUCORE_CONTABPROPTR1_C31_MASK (0xFFFF0000u)
#define CSL_PRUCORE_CONTABPROPTR1_C31_SHIFT (0x00000010u)
#define CSL_PRUCORE_CONTABPROPTR1_C31_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CONTABPROPTR1_C30_MASK (0x0000FFFFu)
#define CSL_PRUCORE_CONTABPROPTR1_C30_SHIFT (0x00000000u)
#define CSL_PRUCORE_CONTABPROPTR1_C30_RESETVAL (0x00000000u)
#define CSL_PRUCORE_CONTABPROPTR1_RESETVAL (0x00000000u)
/* INTGPR0 */
#define CSL_PRUCORE_INTGPR0_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR0_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR0_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR0_RESETVAL (0x00000000u)
/* INTGPR1 */
#define CSL_PRUCORE_INTGPR1_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR1_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR1_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR1_RESETVAL (0x00000000u)
/* INTGPR2 */
#define CSL_PRUCORE_INTGPR2_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR2_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR2_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR2_RESETVAL (0x00000000u)
/* INTGPR3 */
#define CSL_PRUCORE_INTGPR3_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR3_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR3_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR3_RESETVAL (0x00000000u)
/* INTGPR4 */
#define CSL_PRUCORE_INTGPR4_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR4_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR4_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR4_RESETVAL (0x00000000u)
/* INTGPR5 */
#define CSL_PRUCORE_INTGPR5_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR5_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR5_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR5_RESETVAL (0x00000000u)
/* INTGPR6 */
#define CSL_PRUCORE_INTGPR6_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR6_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR6_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR6_RESETVAL (0x00000000u)
/* INTGPR7 */
#define CSL_PRUCORE_INTGPR7_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR7_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR7_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR7_RESETVAL (0x00000000u)
/* INTGPR8 */
#define CSL_PRUCORE_INTGPR8_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR8_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR8_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR8_RESETVAL (0x00000000u)
/* INTGPR9 */
#define CSL_PRUCORE_INTGPR9_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR9_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR9_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR9_RESETVAL (0x00000000u)
/* INTGPR10 */
#define CSL_PRUCORE_INTGPR10_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR10_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR10_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR10_RESETVAL (0x00000000u)
/* INTGPR11 */
#define CSL_PRUCORE_INTGPR11_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR11_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR11_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR11_RESETVAL (0x00000000u)
/* INTGPR12 */
#define CSL_PRUCORE_INTGPR12_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR12_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR12_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR12_RESETVAL (0x00000000u)
/* INTGPR13 */
#define CSL_PRUCORE_INTGPR13_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR13_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR13_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR13_RESETVAL (0x00000000u)
/* INTGPR14 */
#define CSL_PRUCORE_INTGPR14_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR14_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR14_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR14_RESETVAL (0x00000000u)
/* INTGPR15 */
#define CSL_PRUCORE_INTGPR15_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR15_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR15_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR15_RESETVAL (0x00000000u)
/* INTGPR16 */
#define CSL_PRUCORE_INTGPR16_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR16_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR16_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR16_RESETVAL (0x00000000u)
/* INTGPR17 */
#define CSL_PRUCORE_INTGPR17_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR17_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR17_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR17_RESETVAL (0x00000000u)
/* INTGPR18 */
#define CSL_PRUCORE_INTGPR18_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR18_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR18_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR18_RESETVAL (0x00000000u)
/* INTGPR19 */
#define CSL_PRUCORE_INTGPR19_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR19_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR19_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR19_RESETVAL (0x00000000u)
/* INTGPR20 */
#define CSL_PRUCORE_INTGPR20_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR20_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR20_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR20_RESETVAL (0x00000000u)
/* INTGPR21 */
#define CSL_PRUCORE_INTGPR21_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR21_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR21_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR21_RESETVAL (0x00000000u)
/* INTGPR22 */
#define CSL_PRUCORE_INTGPR22_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR22_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR22_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR22_RESETVAL (0x00000000u)
/* INTGPR23 */
#define CSL_PRUCORE_INTGPR23_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR23_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR23_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR23_RESETVAL (0x00000000u)
/* INTGPR24 */
#define CSL_PRUCORE_INTGPR24_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR24_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR24_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR24_RESETVAL (0x00000000u)
/* INTGPR25 */
#define CSL_PRUCORE_INTGPR25_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR25_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR25_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR25_RESETVAL (0x00000000u)
/* INTGPR26 */
#define CSL_PRUCORE_INTGPR26_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR26_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR26_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR26_RESETVAL (0x00000000u)
/* INTGPR27 */
#define CSL_PRUCORE_INTGPR27_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR27_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR27_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR27_RESETVAL (0x00000000u)
/* INTGPR28 */
#define CSL_PRUCORE_INTGPR28_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR28_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR28_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR28_RESETVAL (0x00000000u)
/* INTGPR29 */
#define CSL_PRUCORE_INTGPR29_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR29_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR29_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR29_RESETVAL (0x00000000u)
/* INTGPR30 */
#define CSL_PRUCORE_INTGPR30_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR30_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR30_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR30_RESETVAL (0x00000000u)
/* INTGPR31 */
#define CSL_PRUCORE_INTGPR31_REG_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTGPR31_REG_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTGPR31_REG_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTGPR31_RESETVAL (0x00000000u)
/* INTCTER0 */
#define CSL_PRUCORE_INTCTER0_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER0_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER0_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER0_RESETVAL (0x00000000u)
/* INTCTER1 */
#define CSL_PRUCORE_INTCTER1_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER1_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER1_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER1_RESETVAL (0x00000000u)
/* INTCTER2 */
#define CSL_PRUCORE_INTCTER2_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER2_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER2_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER2_RESETVAL (0x00000000u)
/* INTCTER3 */
#define CSL_PRUCORE_INTCTER3_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER3_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER3_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER3_RESETVAL (0x00000000u)
/* INTCTER4 */
#define CSL_PRUCORE_INTCTER4_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER4_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER4_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER4_RESETVAL (0x00000000u)
/* INTCTER5 */
#define CSL_PRUCORE_INTCTER5_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER5_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER5_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER5_RESETVAL (0x00000000u)
/* INTCTER6 */
#define CSL_PRUCORE_INTCTER6_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER6_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER6_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER6_RESETVAL (0x00000000u)
/* INTCTER7 */
#define CSL_PRUCORE_INTCTER7_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER7_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER7_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER7_RESETVAL (0x00000000u)
/* INTCTER8 */
#define CSL_PRUCORE_INTCTER8_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER8_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER8_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER8_RESETVAL (0x00000000u)
/* INTCTER9 */
#define CSL_PRUCORE_INTCTER9_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER9_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER9_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER9_RESETVAL (0x00000000u)
/* INTCTER10 */
#define CSL_PRUCORE_INTCTER10_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER10_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER10_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER10_RESETVAL (0x00000000u)
/* INTCTER11 */
#define CSL_PRUCORE_INTCTER11_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER11_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER11_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER11_RESETVAL (0x00000000u)
/* INTCTER12 */
#define CSL_PRUCORE_INTCTER12_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER12_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER12_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER12_RESETVAL (0x00000000u)
/* INTCTER13 */
#define CSL_PRUCORE_INTCTER13_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER13_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER13_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER13_RESETVAL (0x00000000u)
/* INTCTER14 */
#define CSL_PRUCORE_INTCTER14_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER14_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER14_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER14_RESETVAL (0x00000000u)
/* INTCTER15 */
#define CSL_PRUCORE_INTCTER15_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER15_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER15_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER15_RESETVAL (0x00000000u)
/* INTCTER16 */
#define CSL_PRUCORE_INTCTER16_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER16_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER16_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER16_RESETVAL (0x00000000u)
/* INTCTER17 */
#define CSL_PRUCORE_INTCTER17_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER17_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER17_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER17_RESETVAL (0x00000000u)
/* INTCTER18 */
#define CSL_PRUCORE_INTCTER18_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER18_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER18_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER18_RESETVAL (0x00000000u)
/* INTCTER19 */
#define CSL_PRUCORE_INTCTER19_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER19_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER19_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER19_RESETVAL (0x00000000u)
/* INTCTER20 */
#define CSL_PRUCORE_INTCTER20_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER20_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER20_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER20_RESETVAL (0x00000000u)
/* INTCTER21 */
#define CSL_PRUCORE_INTCTER21_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER21_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER21_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER21_RESETVAL (0x00000000u)
/* INTCTER22 */
#define CSL_PRUCORE_INTCTER22_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER22_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER22_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER22_RESETVAL (0x00000000u)
/* INTCTER23 */
#define CSL_PRUCORE_INTCTER23_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER23_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER23_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER23_RESETVAL (0x00000000u)
/* INTCTER24 */
#define CSL_PRUCORE_INTCTER24_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER24_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER24_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER24_RESETVAL (0x00000000u)
/* INTCTER25 */
#define CSL_PRUCORE_INTCTER25_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER25_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER25_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER25_RESETVAL (0x00000000u)
/* INTCTER26 */
#define CSL_PRUCORE_INTCTER26_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER26_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER26_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER26_RESETVAL (0x00000000u)
/* INTCTER27 */
#define CSL_PRUCORE_INTCTER27_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER27_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER27_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER27_RESETVAL (0x00000000u)
/* INTCTER28 */
#define CSL_PRUCORE_INTCTER28_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER28_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER28_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER28_RESETVAL (0x00000000u)
/* INTCTER29 */
#define CSL_PRUCORE_INTCTER29_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER29_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER29_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER29_RESETVAL (0x00000000u)
/* INTCTER30 */
#define CSL_PRUCORE_INTCTER30_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER30_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER30_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER30_RESETVAL (0x00000000u)
/* INTCTER31 */
#define CSL_PRUCORE_INTCTER31_ENTRY_MASK (0xFFFFFFFFu)
#define CSL_PRUCORE_INTCTER31_ENTRY_SHIFT (0x00000000u)
#define CSL_PRUCORE_INTCTER31_ENTRY_RESETVAL (0x00000000u)
#define CSL_PRUCORE_INTCTER31_RESETVAL (0x00000000u)
#ifdef __cplusplus
}
#endif
#endif

3777
Projects/DirectPRU/include/csl/cslr_pruintc.h
File diff suppressed because it is too large
View File

532
Projects/DirectPRU/include/csl/cslr_psc_OMAPL138.h

@ -0,0 +1,532 @@
/********************************************************************
* Copyright (C) 2003-2008 Texas Instruments Incorporated.
* All Rights Reserved
*********************************************************************
* file: cslr_psc.h
*
* Brief: This file contains the Register Description for psc
*
*********************************************************************/
#ifndef _CSLR_PSC_H_
#define _CSLR_PSC_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "csl/cslr.h"
#include "tistdtypes.h"
/* NOTE1
* This is the superset list for all modules present in this family
* Please refer to individual device datasheet to see which modules
* apply on the device being used
* e.g. c6747 does not have ARM module, so PSC0 CSL_PSC_ARM does not
* exist for c6747 */
/* NOTE2
* The actual number of MDCTL and MDSTAT register depend on number of
* LPSC modules in a PSC. The number of MDCTL/MDSTAT registers defined
* here would be a superset
* e.g. PSC0 has 16 MDCTL/MDSTAT register, PSC1 has 32 MDCTL/MDSTAT
* registers */
/* NOTE3
* Please refer to the device specific PSC user guide to see what
* register bit fields apply to individual registers
* e.g. For PSC0 MERRPR0 bits 14,15 exist but for PSC1 MERRPR0
* these bits are RESERVED */
typedef enum {
CSL_PSC_CC0 = 0,
CSL_PSC_TC0 = 1,
CSL_PSC_TC1 = 2,
CSL_PSC_EMIFA = 3,
CSL_PSC_SPI0 = 4,
CSL_PSC_MMCSD0 = 5,
CSL_PSC_AINTC = 6,
CSL_PSC_ARM_RAMROM = 7,
CSL_PSC_UART0 = 9,
CSL_PSC_SCR0_SS = 10,
CSL_PSC_SCR1_SS = 11,
CSL_PSC_SCR2_SS = 12,
CSL_PSC_PRU = 13,
CSL_PSC_ARM = 14,
CSL_PSC_DSP = 15
} CSL_Psc0Peripheral;
typedef enum {
CSL_PSC_CC1 = 0,
CSL_PSC_USB0 = 1,
CSL_PSC_USB1 = 2,
CSL_PSC_GPIO = 3,
CSL_PSC_UHPI = 4,
CSL_PSC_EMAC = 5,
CSL_PSC_DDR2_MDDR = 6,
CSL_PSC_MCASP0 = 7,
CSL_PSC_SATA = 8,
CSL_PSC_VPIF = 9,
CSL_PSC_SPI1 = 10,
CSL_PSC_I2C1 = 11,
CSL_PSC_UART1 = 12,
CSL_PSC_UART2 = 13,
CSL_PSC_MCBSP0 = 14,
CSL_PSC_MCBSP1 = 15,
CSL_PSC_LCDC = 16,
CSL_PSC_EHRPWM = 17,
CSL_PSC_MMCSD1 = 18,
CSL_PSC_UPP = 19,
CSL_PSC_ECAP0_1_2 = 20,
CSL_PSC_TC2 = 21,
CSL_PSC_SCRF0_SS = 24,
CSL_PSC_SCRF1_SS = 25,
CSL_PSC_SCRF2_SS = 26,
CSL_PSC_SCRF6_SS = 27,
CSL_PSC_SCRF7_SS = 28,
CSL_PSC_SCRF8_SS = 29,
CSL_PSC_BR_F7 = 30,
CSL_PSC_SHRAM = 31
} CSL_Psc1Peripheral;
/* Minimum unit = 1 byte */
/**************************************************************************\
* Register Overlay Structure
\**************************************************************************/
typedef struct {
volatile Uint32 REVID;
volatile Uint8 RSVD0[20];
volatile Uint32 INTEVAL;
volatile Uint8 RSVD1[36];
volatile Uint32 MERRPR0;
volatile Uint8 RSVD2[12];
volatile Uint32 MERRCR0;
volatile Uint8 RSVD3[12];
volatile Uint32 PERRPR;
volatile Uint8 RSVD4[4];
volatile Uint32 PERRCR;
volatile Uint8 RSVD5[180];
volatile Uint32 PTCMD;
volatile Uint8 RSVD6[4];
volatile Uint32 PTSTAT;
volatile Uint8 RSVD7[212];
volatile Uint32 PDSTAT0;
volatile Uint32 PDSTAT1;
volatile Uint8 RSVD8[248];
volatile Uint32 PDCTL0;
volatile Uint32 PDCTL1;
volatile Uint8 RSVD9[248];
volatile Uint32 PDCFG0;
volatile Uint32 PDCFG1;
volatile Uint8 RSVD10[1016];
volatile Uint32 MDSTAT[32];
volatile Uint8 RSVD11[384];
volatile Uint32 MDCTL[32];
} CSL_PscRegs;
/**************************************************************************\
* Overlay structure typedef definition
\**************************************************************************/
typedef volatile CSL_PscRegs *CSL_PscRegsOvly;
/**************************************************************************\
* Field Definition Macros
\**************************************************************************/
/* REVID */
#define CSL_PSC_REVID_REV_MASK (0xFFFFFFFFu)
#define CSL_PSC_REVID_REV_SHIFT (0x00000000u)
#define CSL_PSC_REVID_REV_RESETVAL (0x44823A00u)
#define CSL_PSC_REVID_RESETVAL (0x44823A00u)
/* INTEVAL */
#define CSL_PSC_INTEVAL_ALLEV_MASK (0x00000001u)
#define CSL_PSC_INTEVAL_ALLEV_SHIFT (0x00000000u)
#define CSL_PSC_INTEVAL_ALLEV_RESETVAL (0x00000000u)
/*----ALLEV Tokens----*/
#define CSL_PSC_INTEVAL_ALLEV_NO_EFFECT (0x00000000u)
#define CSL_PSC_INTEVAL_ALLEV_RE_EVALUATE (0x00000001u)
#define CSL_PSC_INTEVAL_RESETVAL (0x00000000u)
/* MERRPR0 */
#define CSL_PSC_MERRPR0_M15_MASK (0x0000C000u)
#define CSL_PSC_MERRPR0_M15_SHIFT (0x0000000Eu)
#define CSL_PSC_MERRPR0_M15_RESETVAL (0x00000000u)
/*----M15 Tokens----*/
#define CSL_PSC_MERRPR0_M15_NO_ERR (0x00000000u)
#define CSL_PSC_MERRPR0_M15_ERROR (0x00000001u)
#define CSL_PSC_MERRPR0_M14_MASK (0x00006000u)
#define CSL_PSC_MERRPR0_M14_SHIFT (0x0000000Du)
#define CSL_PSC_MERRPR0_M14_RESETVAL (0x00000000u)
/*----M14 Tokens----*/
#define CSL_PSC_MERRPR0_M14_NO_ERR (0x00000000u)
#define CSL_PSC_MERRPR0_M14_ERROR (0x00000001u)
#define CSL_PSC_MERRPR0_RESETVAL (0x00000000u)
/* MERRCR0 */
#define CSL_PSC_MERRCR0_M15_MASK (0x0000C000u)
#define CSL_PSC_MERRCR0_M15_SHIFT (0x0000000Eu)
#define CSL_PSC_MERRCR0_M15_RESETVAL (0x00000000u)
/*----M15 Tokens----*/
#define CSL_PSC_MERRCR0_M15_NO_EFFECT (0x00000000u)
#define CSL_PSC_MERRCR0_M15_CLR_ERR (0x00000001u)
#define CSL_PSC_MERRCR0_M14_MASK (0x00006000u)
#define CSL_PSC_MERRCR0_M14_SHIFT (0x0000000Du)
#define CSL_PSC_MERRCR0_M14_RESETVAL (0x00000000u)
/*----M14 Tokens----*/
#define CSL_PSC_MERRCR0_M14_NO_EFFECT (0x00000000u)
#define CSL_PSC_MERRCR0_M14_CLR_ERR (0x00000001u)
#define CSL_PSC_MERRCR0_RESETVAL (0x00000000u)
/* PERRPR */
#define CSL_PSC_PERRPR_P1_MASK (0x00000002u)
#define CSL_PSC_PERRPR_P1_SHIFT (0x00000001u)
#define CSL_PSC_PERRPR_P1_RESETVAL (0x00000000u)
/*----P1 Tokens----*/
#define CSL_PSC_PERRPR_P1_NO_ERR (0x00000000u)
#define CSL_PSC_PERRPR_P1_ERROR (0x00000001u)
#define CSL_PSC_PERRPR_P0_MASK (0x00000001u)
#define CSL_PSC_PERRPR_P0_SHIFT (0x00000000u)
#define CSL_PSC_PERRPR_P0_RESETVAL (0x00000000u)
/*----P0 Tokens----*/
#define CSL_PSC_PERRPR_P0_NO_ERR (0x00000000u)
#define CSL_PSC_PERRPR_P0_ERROR (0x00000001u)
#define CSL_PSC_PERRPR_RESETVAL (0x00000000u)
/* PERRCR */
#define CSL_PSC_PERRCR_P1_MASK (0x00000002u)
#define CSL_PSC_PERRCR_P1_SHIFT (0x00000001u)
#define CSL_PSC_PERRCR_P1_RESETVAL (0x00000000u)
/*----P1 Tokens----*/
#define CSL_PSC_PERRCR_P1_NO_EFFECT (0x00000000u)
#define CSL_PSC_PERRCR_P1_CLR_ERR (0x00000001u)
#define CSL_PSC_PERRCR_P0_MASK (0x00000001u)
#define CSL_PSC_PERRCR_P0_SHIFT (0x00000000u)
#define CSL_PSC_PERRCR_P0_RESETVAL (0x00000000u)
/*----P0 Tokens----*/
#define CSL_PSC_PERRCR_P0_NO_EFFECT (0x00000000u)
#define CSL_PSC_PERRCR_P0_CLR_ERR (0x00000001u)
#define CSL_PSC_PERRCR_RESETVAL (0x00000000u)
/* PTCMD */
#define CSL_PSC_PTCMD_GO1_MASK (0x00000002u)
#define CSL_PSC_PTCMD_GO1_SHIFT (0x00000001u)
#define CSL_PSC_PTCMD_GO1_RESETVAL (0x00000000u)
/*----GO1 Tokens----*/
#define CSL_PSC_PTCMD_GO1_NO_EFFECT (0x00000000u)
#define CSL_PSC_PTCMD_GO1_SET (0x00000001u)
#define CSL_PSC_PTCMD_GO0_MASK (0x00000001u)
#define CSL_PSC_PTCMD_GO0_SHIFT (0x00000000u)
#define CSL_PSC_PTCMD_GO0_RESETVAL (0x00000000u)
/*----GO0 Tokens----*/
#define CSL_PSC_PTCMD_GO0_NO_EFFECT (0x00000000u)
#define CSL_PSC_PTCMD_GO0_SET (0x00000001u)
#define CSL_PSC_PTCMD_RESETVAL (0x00000000u)
/* PTSTAT */
#define CSL_PSC_PTSTAT_GOSTAT1_MASK (0x00000002u)
#define CSL_PSC_PTSTAT_GOSTAT1_SHIFT (0x00000001u)
#define CSL_PSC_PTSTAT_GOSTAT1_RESETVAL (0x00000000u)
/*----GOSTAT1 Tokens----*/
#define CSL_PSC_PTSTAT_GOSTAT1_NO_TRANSITION (0x00000000u)
#define CSL_PSC_PTSTAT_GOSTAT1_IN_TRANSITION (0x00000001u)
#define CSL_PSC_PTSTAT_GOSTAT0_MASK (0x00000001u)
#define CSL_PSC_PTSTAT_GOSTAT0_SHIFT (0x00000000u)
#define CSL_PSC_PTSTAT_GOSTAT0_RESETVAL (0x00000000u)
/*----GOSTAT0 Tokens----*/
#define CSL_PSC_PTSTAT_GOSTAT0_NO_TRANSITION (0x00000000u)
#define CSL_PSC_PTSTAT_GOSTAT0_IN_TRANSITION (0x00000001u)
#define CSL_PSC_PTSTAT_RESETVAL (0x00000000u)
/* PDSTAT0 */
#define CSL_PSC_PDSTAT0_EMUIHB_MASK (0x00000800u)
#define CSL_PSC_PDSTAT0_EMUIHB_SHIFT (0x0000000Bu)
#define CSL_PSC_PDSTAT0_EMUIHB_RESETVAL (0x00000000u)
/*----EMUIHB Tokens----*/
#define CSL_PSC_PDSTAT0_EMUIHB_INHIBIT_OFF (0x00000000u)
#define CSL_PSC_PDSTAT0_EMUIHB_INHIBIT_ON (0x00000001u)
#define CSL_PSC_PDSTAT0_STATE_MASK (0x0000001Fu)
#define CSL_PSC_PDSTAT0_STATE_SHIFT (0x00000000u)
#define CSL_PSC_PDSTAT0_STATE_RESETVAL (0x00000000u)
/*----STATE Tokens----*/
#define CSL_PSC_PDSTAT0_STATE_OFF (0x00000000u)
#define CSL_PSC_PDSTAT0_STATE_ON (0x00000001u)
#define CSL_PSC_PDSTAT0_RESETVAL (0x00000000u)
/* PDSTAT1 */
#define CSL_PSC_PDSTAT1_EMUIHB_MASK (0x00000800u)
#define CSL_PSC_PDSTAT1_EMUIHB_SHIFT (0x0000000Bu)
#define CSL_PSC_PDSTAT1_EMUIHB_RESETVAL (0x00000000u)
/*----EMUIHB Tokens----*/
#define CSL_PSC_PDSTAT1_EMUIHB_INHIBIT_OFF (0x00000000u)
#define CSL_PSC_PDSTAT1_EMUIHB_INHIBIT_ON (0x00000001u)
#define CSL_PSC_PDSTAT1_STATE_MASK (0x0000001Fu)
#define CSL_PSC_PDSTAT1_STATE_SHIFT (0x00000000u)
#define CSL_PSC_PDSTAT1_STATE_RESETVAL (0x00000000u)
/*----STATE Tokens----*/
#define CSL_PSC_PDSTAT1_STATE_OFF (0x00000000u)
#define CSL_PSC_PDSTAT1_STATE_ON (0x00000001u)
#define CSL_PSC_PDSTAT1_RESETVAL (0x00000000u)
/* PDCTL0 */
#define CSL_PSC_PDCTL0_WAKECNT_MASK (0x00FF0000u)
#define CSL_PSC_PDCTL0_WAKECNT_SHIFT (0x00000010u)
#define CSL_PSC_PDCTL0_WAKECNT_RESETVAL (0x0000001Fu)
#define CSL_PSC_PDCTL0_PDMODE_MASK (0x0000F000u)
#define CSL_PSC_PDCTL0_PDMODE_SHIFT (0x0000000Cu)
#define CSL_PSC_PDCTL0_PDMODE_RESETVAL (0x0000000Fu)
#define CSL_PSC_PDCTL0_EMUIHBIE_MASK (0x00000200u)
#define CSL_PSC_PDCTL0_EMUIHBIE_SHIFT (0x00000009u)
#define CSL_PSC_PDCTL0_EMUIHBIE_RESETVAL (0x00000000u)
/*----EMUIHBIE Tokens----*/
#define CSL_PSC_PDCTL0_EMUIHBIE_DISABLE (0x00000000u)
#define CSL_PSC_PDCTL0_EMUIHBIE_ENABLE (0x00000001u)
#define CSL_PSC_PDCTL0_NEXT_MASK (0x00000001u)
#define CSL_PSC_PDCTL0_NEXT_SHIFT (0x00000000u)
#define CSL_PSC_PDCTL0_NEXT_RESETVAL (0x00000001u)
/*----NEXT Tokens----*/
#define CSL_PSC_PDCTL0_NEXT_OFF (0x00000000u)
#define CSL_PSC_PDCTL0_NEXT_ON (0x00000001u)
#define CSL_PSC_PDCTL0_RESETVAL (0x001FF101u)
/* PDCTL1 */
#define CSL_PSC_PDCTL1_WAKECNT_MASK (0x00FF0000u)
#define CSL_PSC_PDCTL1_WAKECNT_SHIFT (0x00000010u)
#define CSL_PSC_PDCTL1_WAKECNT_RESETVAL (0x0000001Fu)
#define CSL_PSC_PDCTL1_PDMODE_MASK (0x0000F000u)
#define CSL_PSC_PDCTL1_PDMODE_SHIFT (0x0000000Cu)
#define CSL_PSC_PDCTL1_PDMODE_RESETVAL (0x0000000Fu)
/*----PDMODE Tokens----*/
#define CSL_PSC_PDCTL1_PDMODE_OFF (0x00000000u)
#define CSL_PSC_PDCTL1_PDMODE_RAM_OFF (0x00000008u)
#define CSL_PSC_PDCTL1_PDMODE_DEEP_SLEEP (0x00000009u)
#define CSL_PSC_PDCTL1_PDMODE_LIGHT_SLEEP (0x0000000Au)
#define CSL_PSC_PDCTL1_PDMODE_RETENTION (0x0000000Bu)
#define CSL_PSC_PDCTL1_PDMODE_ON (0x0000000Fu)
#define CSL_PSC_PDCTL1_EMUIHBIE_MASK (0x00000200u)
#define CSL_PSC_PDCTL1_EMUIHBIE_SHIFT (0x00000009u)
#define CSL_PSC_PDCTL1_EMUIHBIE_RESETVAL (0x00000000u)
/*----EMUIHBIE Tokens----*/
#define CSL_PSC_PDCTL1_EMUIHBIE_DISABLE (0x00000000u)
#define CSL_PSC_PDCTL1_EMUIHBIE_ENABLE (0x00000001u)
#define CSL_PSC_PDCTL1_NEXT_MASK (0x00000001u)
#define CSL_PSC_PDCTL1_NEXT_SHIFT (0x00000000u)
#define CSL_PSC_PDCTL1_NEXT_RESETVAL (0x00000001u)
/*----NEXT Tokens----*/
#define CSL_PSC_PDCTL1_NEXT_OFF (0x00000000u)
#define CSL_PSC_PDCTL1_NEXT_ON (0x00000001u)
#define CSL_PSC_PDCTL1_RESETVAL (0x001FF101u)
/* PDCFG0 */
#define CSL_PSC_PDCFG0_PDLOCK_MASK (0x00000008u)
#define CSL_PSC_PDCFG0_PDLOCK_SHIFT (0x00000003u)
#define CSL_PSC_PDCFG0_PDLOCK_RESETVAL (0x00000001u)
/*----PD LOCK Tokens----*/
#define CSL_PSC_PDCFG0_PDLOCK_YES (0x00000000u)
#define CSL_PSC_PDCFG0_PDLOCK_NO (0x00000001u)
#define CSL_PSC_PDCFG0_ICEPICK_MASK (0x00000004u)
#define CSL_PSC_PDCFG0_ICEPICK_SHIFT (0x00000002u)
#define CSL_PSC_PDCFG0_ICEPICK_RESETVAL (0x00000001u)
/*----ICEPICK Tokens----*/
#define CSL_PSC_PDCFG0_ICEPICK_ABSENT (0x00000000u)
#define CSL_PSC_PDCFG0_ICEPICK_PRESENT (0x00000001u)
#define CSL_PSC_PDCFG0_RAM_PSM_MASK (0x00000002u)
#define CSL_PSC_PDCFG0_RAM_PSM_SHIFT (0x00000001u)
#define CSL_PSC_PDCFG0_RAM_PSM_RESETVAL (0x00000000u)
/*----RAM_PSM Tokens----*/
#define CSL_PSC_PDCFG0_RAM_PSM_NO (0x00000000u)
#define CSL_PSC_PDCFG0_RAM_PSM_YES (0x00000001u)
#define CSL_PSC_PDCFG0_ALWAYSON_MASK (0x00000001u)
#define CSL_PSC_PDCFG0_ALWAYSON_SHIFT (0x00000000u)
#define CSL_PSC_PDCFG0_ALWAYSON_RESETVAL (0x00000001u)
/*----ALWAYSON Tokens----*/
#define CSL_PSC_PDCFG0_ALWAYSON_NO (0x00000000u)
#define CSL_PSC_PDCFG0_ALWAYSON_YES (0x00000001u)
#define CSL_PSC_PDCFG0_RESETVAL (0x0000000Du)
/* PDCFG1 */
#define CSL_PSC_PDCFG1_PDLOCK_MASK (0x00000008u)
#define CSL_PSC_PDCFG1_PDLOCK_SHIFT (0x00000003u)
#define CSL_PSC_PDCFG1_PDLOCK_RESETVAL (0x00000001u)
/*----PD LOCK Tokens----*/
#define CSL_PSC_PDCFG1_PDLOCK_YES (0x00000000u)
#define CSL_PSC_PDCFG1_PDLOCK_NO (0x00000001u)
#define CSL_PSC_PDCFG1_ICEPICK_MASK (0x00000004u)
#define CSL_PSC_PDCFG1_ICEPICK_SHIFT (0x00000002u)
#define CSL_PSC_PDCFG1_ICEPICK_RESETVAL (0x00000001u)
/*----ICEPICK Tokens----*/
#define CSL_PSC_PDCFG1_ICEPICK_ABSENT (0x00000000u)
#define CSL_PSC_PDCFG1_ICEPICK_PRESENT (0x00000001u)
#define CSL_PSC_PDCFG1_RAM_PSM_MASK (0x00000002u)
#define CSL_PSC_PDCFG1_RAM_PSM_SHIFT (0x00000001u)
#define CSL_PSC_PDCFG1_RAM_PSM_RESETVAL (0x00000001u)
/*----RAM_PSM Tokens----*/
#define CSL_PSC_PDCFG1_RAM_PSM_NO (0x00000000u)
#define CSL_PSC_PDCFG1_RAM_PSM_YES (0x00000001u)
#define CSL_PSC_PDCFG1_ALWAYSON_MASK (0x00000001u)
#define CSL_PSC_PDCFG1_ALWAYSON_SHIFT (0x00000000u)
#define CSL_PSC_PDCFG1_ALWAYSON_RESETVAL (0x00000000u)
/*----ALWAYSON Tokens----*/
#define CSL_PSC_PDCFG1_ALWAYSON_NO (0x00000000u)
#define CSL_PSC_PDCFG1_ALWAYSON_YES (0x00000001u)
#define CSL_PSC_PDCFG1_RESETVAL (0x0000000Eu)
/* MDSTAT */
#define CSL_PSC_MDSTAT_EMUIHB_MASK (0x00020000u)
#define CSL_PSC_MDSTAT_EMUIHB_SHIFT (0x00000011u)
#define CSL_PSC_MDSTAT_EMUIHB_RESETVAL (0x00000000u)
/*----EMUIHB Tokens----*/
#define CSL_PSC_MDSTAT_EMUIHB_DISABLE (0x00000000u)
#define CSL_PSC_MDSTAT_EMUIHB_ENABLE (0x00000001u)
#define CSL_PSC_MDSTAT_EMURST_MASK (0x00010000u)
#define CSL_PSC_MDSTAT_EMURST_SHIFT (0x00000010u)
#define CSL_PSC_MDSTAT_EMURST_RESETVAL (0x00000000u)
/*----EMURST Tokens----*/
#define CSL_PSC_MDSTAT_EMURST_DISABLE (0x00000000u)
#define CSL_PSC_MDSTAT_EMURST_ENABLE (0x00000001u)
#define CSL_PSC_MDSTAT_MCKOUT_MASK (0x00001000u)
#define CSL_PSC_MDSTAT_MCKOUT_SHIFT (0x0000000Cu)
#define CSL_PSC_MDSTAT_MCKOUT_RESETVAL (0x00000000u)
/*----MCKOUT Tokens----*/
#define CSL_PSC_MDSTAT_MCKOUT_OFF (0x00000000u)
#define CSL_PSC_MDSTAT_MCKOUT_ON (0x00000001u)
#define CSL_PSC_MDSTAT_MRSTDONE_MASK (0x00000800u)
#define CSL_PSC_MDSTAT_MRSTDONE_SHIFT (0x0000000Bu)
#define CSL_PSC_MDSTAT_MRSTDONE_RESETVAL (0x00000000u)
/*----MRSTDONE Tokens----*/
#define CSL_PSC_MDSTAT_MRSTDONE_COMPLETE (0x00000000u)
#define CSL_PSC_MDSTAT_MRSTDONE_INCOMPLETE (0x00000001u)
#define CSL_PSC_MDSTAT_MRST_MASK (0x00000400u)
#define CSL_PSC_MDSTAT_MRST_SHIFT (0x0000000Au)
#define CSL_PSC_MDSTAT_MRST_RESETVAL (0x00000000u)
/*----MRST Tokens----*/
#define CSL_PSC_MDSTAT_MRST_ASSERT (0x00000000u)
#define CSL_PSC_MDSTAT_MRST_DEASSERT (0x00000001u)
#define CSL_PSC_MDSTAT_LRSTDONE_MASK (0x00000200u)
#define CSL_PSC_MDSTAT_LRSTDONE_SHIFT (0x00000009u)
#define CSL_PSC_MDSTAT_LRSTDONE_RESETVAL (0x00000000u)
/*----LRSTDONE Tokens----*/
#define CSL_PSC_MDSTAT_LRSTDONE_NOTDONE (0x00000000u)
#define CSL_PSC_MDSTAT_LRSTDONE_DONE (0x00000001u)
#define CSL_PSC_MDSTAT_LRST_MASK (0x00000100u)
#define CSL_PSC_MDSTAT_LRST_SHIFT (0x00000008u)
#define CSL_PSC_MDSTAT_LRST_RESETVAL (0x00000000u)
/*----LRST Tokens----*/
#define CSL_PSC_MDSTAT_LRST_ASSERT (0x00000000u)
#define CSL_PSC_MDSTAT_LRST_DEASSERT (0x00000001u)
#define CSL_PSC_MDSTAT_STATE_MASK (0x0000003Fu)
#define CSL_PSC_MDSTAT_STATE_SHIFT (0x00000000u)
#define CSL_PSC_MDSTAT_STATE_RESETVAL (0x00000000u)
/*----STATE Tokens----*/
#define CSL_PSC_MDSTAT_STATE_SWRSTDISABLE (0x00000000u)
#define CSL_PSC_MDSTAT_STATE_SYNCRST (0x00000001u)
#define CSL_PSC_MDSTAT_STATE_DISABLE (0x00000002u)
#define CSL_PSC_MDSTAT_STATE_ENABLE (0x00000003u)
#define CSL_PSC_MDSTAT_STATE_AUTOSLEEP (0x00000004u)
#define CSL_PSC_MDSTAT_STATE_AUTOWAKE (0x00000005u)
#define CSL_PSC_MDSTAT_RESETVAL (0x00000000u)
/* MDCTL */
#define CSL_PSC_MDCTL_FORCE_MASK (0x80000000u)
#define CSL_PSC_MDCTL_FORCE_SHIFT (0x0000001Fu)
#define CSL_PSC_MDCTL_FORCE_RESETVAL (0x00000000u)
/*----FORCE Tokens----*/
#define CSL_PSC_MDCTL_FORCE_DISABLE (0x00000000u)
#define CSL_PSC_MDCTL_FORCE_ENABLE (0x00000001u)
#define CSL_PSC_MDCTL_EMUIHBIE_MASK (0x00000400u)
#define CSL_PSC_MDCTL_EMUIHBIE_SHIFT (0x0000000Au)
#define CSL_PSC_MDCTL_EMUIHBIE_RESETVAL (0x00000000u)
/*----EMUIHBIE Tokens----*/
#define CSL_PSC_MDCTL_EMUIHBIE_DISABLE (0x00000000u)
#define CSL_PSC_MDCTL_EMUIHBIE_ENABLE (0x00000001u)
#define CSL_PSC_MDCTL_EMURSTIE_MASK (0x00000200u)
#define CSL_PSC_MDCTL_EMURSTIE_SHIFT (0x00000009u)
#define CSL_PSC_MDCTL_EMURSTIE_RESETVAL (0x00000000u)
/*----EMURSTIE Tokens----*/
#define CSL_PSC_MDCTL_EMURSTIE_DISABLE (0x00000000u)
#define CSL_PSC_MDCTL_EMURSTIE_ENABLE (0x00000001u)
#define CSL_PSC_MDCTL_LRST_MASK (0x00000100u)
#define CSL_PSC_MDCTL_LRST_SHIFT (0x00000008u)
#define CSL_PSC_MDCTL_LRST_RESETVAL (0x00000000u)
/*----LRST Tokens----*/
#define CSL_PSC_MDCTL_LRST_ASSERT (0x00000000u)
#define CSL_PSC_MDCTL_LRST_DEASSERT (0x00000001u)
#define CSL_PSC_MDCTL_NEXT_MASK (0x0000001Fu)
#define CSL_PSC_MDCTL_NEXT_SHIFT (0x00000000u)
#define CSL_PSC_MDCTL_NEXT_RESETVAL (0x00000000u)
/*----NEXT Tokens----*/
#define CSL_PSC_MDCTL_NEXT_SWRSTDISABLE (0x00000000u)
#define CSL_PSC_MDCTL_NEXT_SYNCRST (0x00000001u)
#define CSL_PSC_MDCTL_NEXT_DISABLE (0x00000002u)
#define CSL_PSC_MDCTL_NEXT_ENABLE (0x00000003u)
#define CSL_PSC_MDCTL_NEXT_AUTOSLEEP (0x00000004u)
#define CSL_PSC_MDCTL_NEXT_AUTOWAKE (0x00000005u)
#define CSL_PSC_MDCTL_RESETVAL (0x00000000u)
#ifdef __cplusplus
}
#endif
#endif

2624
Projects/DirectPRU/include/csl/cslr_syscfg0_OMAPL138.h
File diff suppressed because it is too large
View File

900
Projects/DirectPRU/include/csl/soc_OMAPL138.h

@ -0,0 +1,900 @@
/* ============================================================================
* Copyright (c) Texas Instruments Inc 2002, 2003, 2004, 2005, 2006, 2007
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied.
* ===========================================================================
*/
#ifndef _SOC_H_
#define _SOC_H_
/* =============================================================================
* Revision History
* ===============
* 15-Feb-2007 NS File created.
* Apr 09 2009 IMTIAZ SMA Updated for OMAPL138 SoC
* =============================================================================
*/
#ifdef __cplusplus
extern "C" {
#endif
#include "csl/cslr.h"
/**************************************************************************\
* SOC file
\**************************************************************************/
/******************************************************************************\
* Static inline definition
\******************************************************************************/
#ifndef CSL_IDEF_INLINE
#define CSL_IDEF_INLINE static inline
#endif
/******************************************************************************\
* Peripheral Instance count
\******************************************************************************/
/** @brief Number of UPP instances */
#define CSL_UPP_PER_CNT 1
/** @brief Number of UHPI instances */
#define CSL_HPI_PER_CNT 1
/** @brief Number of McASP instances */
#define CSL_MCASP_PER_CNT 1
/** @brief Number of TIMER instances */
#define CSL_TMR_PER_CNT 4
/** @brief Number of PSC instances */
#define CSL_PSC_PER_CNT 2
/** @brief Number of UART instances */
#define CSL_UART_PER_CNT 3
/** @brief Number of SPI instances */
#define CSL_SPI_PER_CNT 2
/** @brief Number of I2C instances */
#define CSL_I2C_PER_CNT 2
/** @brief Number of PLL instances */
#define CSL_PLLC_PER_CNT 2
/** @brief Number of MMCSD instances */
#define CSL_MMCSD_PER_CNT 2
/** @brief Number of LCDC instances */
#define CSL_LCDC_PER_CNT 1
/** @brief Number of Mcbsp instances */
#define CSL_MCBSP_PER_CNT 2
/** @brief Number of EDMA3 CC instances */
#define CSL_EDMA3CC_CNT 2
/** @brief Number of EDMA3 TC instances */
#define CSL_EDMA3TC_CNT 3
/** @brief Number of EMIFA instances */
#define CSL_EMIFA_PER_CNT 1
/** @brief Number of EMIFB instances */
#define CSL_EMIFB_PER_CNT 1
/** @brief Number of EMAC instances */
#define CSL_EMAC_PER_CNT 1
/** @brief Number of MDIO instances */
#define CSL_MDIO_PER_CNT 1
/** @brief Number of EHRPWM instances */
#define CSL_EHRPWM_PER_CNT 2
/** @brief Number of ECAP instances */
#define CSL_ECAP_PER_CNT 3
/** @brief Number of CPGMAC instances */
#define CSL_CPGMACSSR_PER_CNT 1
/** @brief Number of CPPI instances */
#define CSL_CPPI_PER_CNT 1
/** @brief Number of USB instances */
#define CSL_USB_PER_CNT 2
/** @brief Number of VPIF instances */
#define CSL_VPIF_PER_CNT 1
/** @brief Number of INTC instances */
#define CSL_INTC_PER_CNT 1
/** @brief Number of AINTC instances */
#define CSL_AINTC_PER_CNT 1
/** @brief Number of SATA instances */
#define CSL_SATA_PER_CNT 1
/** @brief Number of RTC instances */
#define CSL_RTC_PER_CNT 1
/** @brief Number of GPIO instances */
#define CSL_GPIO_PER_CNT 1
/** @brief Number of SYSCFG instances */
#define CSL_SYSCFG_PER_CNT 2
/******************************************************************************\
* Peripheral Instance definitions.
\******************************************************************************/
/** @brief Peripheral Instances of UHPI instances */
#define CSL_HPI (0)
/** @brief Peripheral Instances of McASP instances */
#define CSL_MCASP_0 (0)
/** @brief Peripheral Instance of EDMA CC instances */
#define CSL_EDMA3CC_0 (0)
#define CSL_EDMA3CC_1 (1)
/** @brief Peripheral Instance of EDMA TC instances */
#define CSL_EDMA3TC_0 (0)
#define CSL_EDMA3TC_1 (1)
/** @brief Peripheral Instance of Timer 64 instances */
#define CSL_TMR_0 (0)
#define CSL_TMR_1 (1)
#define CSL_TMR_2 (2)
#define CSL_TMR_3 (3)
/** @brief Peripheral Instances of PSC instances */
#define CSL_PSC_0 (0)
#define CSL_PSC_1 (1)
/** @brief Peripheral Instances of UART instances */
#define CSL_UART_0 (0)
#define CSL_UART_1 (1)
#define CSL_UART_2 (2)
/** @brief Peripheral Instances of SPI instances */
#define CSL_SPI_0 (0)
#define CSL_SPI_1 (1)
/** @brief Peripheral Instances of I2C instances */
#define CSL_I2C_0 (0)
#define CSL_I2C_1 (1)
/** @brief Peripheral Instances of MMCSD instances */
#define CSL_MMCSD_0 (0)
#define CSL_MMCSD_1 (1)
/** @brief Peripheral Instances of LCDC instances */
#define CSL_LCDC (0)
/** @brief Instance number of PLL controller */
#define CSL_PLLC_0 (0)
#define CSL_PLLC_1 (1)
/** @brief Peripheral Instance of EMIFA instances */
#define CSL_EMIFA (0)
/** @brief Peripheral Instance of EMAC instances */
#define CSL_EMAC (0)
/** @brief Peripheral Instance of MDIO instances */
#define CSL_MDIO (0)
/** @brief Peripheral Instance of EHRPWM instances */
#define CSL_EHRPWM_0 (0)
#define CSL_EHRPWM_1 (1)
/** @brief Peripheral Instance of ECAP instances */
#define CSL_ECAP_0 (0)
#define CSL_ECAP_1 (1)
#define CSL_ECAP_2 (2)
/** @brief Peripheral Instance of USB instances */
#define CSL_USB_0 (0)
#define CSL_USB_1 (1)
/** @brief Peripheral Instance of PRU CORE instances */
#define CSL_PRUCORE_0 (0)
#define CSL_PRUCORE_1 (1)
/** @brief Peripheral Instance of PRUINTC instances */
#define CSL_PRUINTC (0)
/** @brief Peripheral Instance of INTC instances */
#define CSL_INTC (0)
/** @brief Peripheral Instance of AINTC instances */
#define CSL_AINTC (0)
/** @brief Peripheral Instance of RTC instances */
#define CSL_RTC (0)
/** @brief Peripheral Instance of GPIO instances */
#define CSL_GPIO (0)
/** @brief Peripheral Instance of ECTL instances */
#define CSL_ECTL (0)
/** @brief Peripheral Instance of SYSCFG instances */
#define CSL_SYSCFG (2)
/*******************************************************************************
* Peripheral Base Address
*******************************************************************************/
/** @brief Base address of INTC memory mapped registers */
#define CSL_INTC_0_REGS (0x01800000u)
/** @brief Base address of PDC memory mapped registers */
#define CSL_PWRDWN_PDC_REGS (0x01810000u)
/** @brief Base address of SYS - Security ID register */
#define CSL_SYS_0_SECURITY_ID_REGS (0x01811000u)
/** @brief Base address of SYS - Revision ID register */
#define CSL_SYS_0_REV_ID_REGS (0x01812000u)
/** #brief IDMA Module memory mapped address */
#define CSL_IDMA_0_REGS (0x01820000u)
/** #brief EMC Module memory mapped address */
#define CSL_EMC_0_REGS (0x01820000u)
/** #brief Cache Module memory mapped address */
#define CSL_CACHE_0_REGS (0x01840000u)
/** @brief Base address of Channel controller memory mapped registers */
#define CSL_EDMA30CC_0_REGS (0x01C00000u)
/** @brief Base address of Transfer controller memory mapped registers */
#define CSL_EDMA30TC_0_REGS (0x01C08000u)
#define CSL_EDMA30TC_1_REGS (0x01C08400u)
/** @brief Base address of PSC memory mapped registers */
#define CSL_PSC_0_REGS (0x01C10000u)
/** @brief PLL controller instance o module address */
#define CSL_PLLC_0_REGS (0x01C11000u)
/** @brief Base address of DEV memory mapped registers */
#define CSL_SYSCFG_0_REGS (0x01C14000u)
/** @brief Base address of TIMER memory mapped registers */
#define CSL_TMR_0_REGS (0x01C20000u)
#define CSL_TMR_1_REGS (0x01C21000u)
/** @brief Base address of I2C memory mapped registers */
#define CSL_I2C_0_REGS (0x01C22000u)
/** @brief Base address of RTC memory */
#define CSL_RTC_0_REGS (0x01C23000u)
/** @brief Base address of MMCSD memory mapped registers */
#define CSL_MMCSD_0_REGS (0x01C40000u)
/** @brief Base address of SPI memory mapped registers */
#define CSL_SPI_0_REGS (0x01C41000u)
/** @brief Base address of UART memory mapped registers */
#define CSL_UART_0_REGS (0x01C42000u)
/** @brief Base address of McASP memory mapped registers */
#define CSL_MCASP_0_CTRL_REGS (0x01D00000u)
#define CSL_MCASP_0_FIFO_REGS (0x01D01000u)
#define CSL_MCASP_0_DATA_REGS (0x01D02000u)
/** @brief Base address of UART memory mapped registers */
#define CSL_UART_1_REGS (0x01D0C000u)
#define CSL_UART_2_REGS (0x01D0D000u)
/** @brief Base address of McBSP memory mapped registers */
#define CSL_MCBSP_0_CTRL_REGS (0x01D10000u)
#define CSL_MCBSP_0_FIFO_REGS (0x01D10800u)
#define CSL_MCBSP_0_DATA_REGS (0x01F10000u)
/** @brief Base address of McASP memory mapped registers */
#define CSL_MCBSP_1_CTRL_REGS (0x01D11000u)
#define CSL_MCBSP_1_FIFO_REGS (0x01D11800u)
#define CSL_MCBSP_1_DATA_REGS (0x01F10000u)
/** @brief Base address of USB memory */
#define CSL_USB_0_REGS (0x01E00000u)
#define CSL_USB_1_REGS (0x01E25000u)
/** @brief Base address of HPI memory mapped registers */
#define CSL_HPI_0_REGS (0x01E10000u)
/** @brief Base address of LCDC memory mapped registers */
#define CSL_LCDC_0_REGS (0x01E13000u)
/** @brief Base address of UPP memory mapped registers */
#define CSL_UPP_0_REGS (0x01E16000u)
/** @brief Base address of VPIF memory mapped registers */
#define CSL_VPIF_0_REGS (0x01E17000u)
/** @brief Base address of SATA memory mapped registers */
#define CSL_SATA_0_REGS (0x01E18000u)
/** @brief PLL controller instance 1 module address */
#define CSL_PLLC_1_REGS (0X01E1A000u)
/** @brief Base address of MMCSD memory mapped registers */
#define CSL_MMCSD_1_REGS (0x01E1B000u)
/** @brief Base address of EMAC memory */
#define CSL_EMAC_DSC_CTRL_MOD_RAM (0x01E20000u)
#define CSL_EMAC_DSC_CTRL_MOD_REG (0x01E22000u)
#define CSL_EMAC_DSC_CONTROL_REG (0x01E23000u)
#define CSL_MDIO_0_REGS (0x01E24000u)
/** @brief Base address of PRU Core Regsiters */
#define CSL_PRUCORE_0_REGS (0x01C37000u)
#define CSL_PRUCORE_1_REGS (0x01C37800u)
/** @brief Base address of PRU Interrupt Controller Registers */
#define CSL_PRUINTC_0_REGS (0x01C34000u)
/** @brief Base address of GPIO memory mapped registers */
#define CSL_GPIO_0_REGS (0x01E26000u)
/** @brief Base address of PSC memory mapped registers */
#define CSL_PSC_1_REGS (0x01E27000u)
/** @brief Base address of I2C memory mapped registers */
#define CSL_I2C_1_REGS (0x01E28000u)
/** @brief Base address of syscfg registers */
#define CSL_SYSCFG_1_REGS (0x01E2C000u)
/** @brief Base address of Channel controller memory mapped registers */
#define CSL_EDMA31CC_0_REGS (0x01E30000u)
/** @brief Base address of Transfer controller memory mapped registers */
#define CSL_EDMA31TC_0_REGS (0x01E38000u)
/** @brief Base address of EPWM memory mapped registers */
#define CSL_EHRPWM_0_REGS (0x01F00000u)
#define CSL_EHRPWM_1_REGS (0x01F02000u)
/** @brief Base address of EPWM memory mapped registers */
#define CSL_HRPWM_0_REGS (0x01F01000u)
#define CSL_HRPWM_1_REGS (0x01F03000u)
/** @brief Base address of ECAP memory mapped registers */
#define CSL_ECAP_0_REGS (0x01F06000u)
#define CSL_ECAP_1_REGS (0x01F07000u)
#define CSL_ECAP_2_REGS (0x01F08000u)
/** @brief Base address of TIMER memory mapped registers */
#define CSL_TMR_2_REGS (0x01F0C000u)
#define CSL_TMR_3_REGS (0x01F0D000u)
/** @brief Base address of SPI memory mapped registers */
#define CSL_SPI_1_REGS (0x01F0E000u)
/** @brief Base address of EMIFA memory mapped registers */
#define CSL_EMIFA_0_REGS (0x68000000u)
/** @brief Base address of EMIFA_CS0 memory */
#define CSL_EMIFA_CS0_ADDR (0x40000000u)
/** @brief Base address of EMIFA_CS2 memory */
#define CSL_EMIFA_CS2_ADDR (0x60000000u)
/** @brief Base address of EMIFA_CS3 memory */
#define CSL_EMIFA_CS3_ADDR (0x62000000u)
/** @brief Base address of EMIFA_CS4 memory */
#define CSL_EMIFA_CS4_ADDR (0x64000000u)
/** @brief Base address of EMIFA_CS5 memory */
#define CSL_EMIFA_CS5_ADDR (0x66000000u)
/** @brief Base address of DDR memory mapped registers */
#define CSL_DDR2_0_CTRL_REGS (0xB0000000u)
#define CSL_DDR2_0_DATA_REGS (0xC0000000u)
/** @brief Base address of AINTC memory mapped registers */
#define CSL_AINTC_0_REGS (0xFFFEE000u)
/** @brief Base address of UMC Memory protection registers */
#define CSL_MEMPROT_L2_REGS (0x00800000u)
/** @brief Base address of PMC memory Protection registers */
#define CSL_MEMPROT_L1P_REGS (0x00E00000u)
/** @brief Base address of DMC memory protection registers */
#define CSL_MEMPROT_L1D_REGS (0x00F00000u)
/******************************************************************************\
* Interrupt Event IDs
\******************************************************************************/
/*
* @brief Interrupt Event IDs
*/
/* Output of event combiner 0, for events 1 to 31 */
#define CSL_INTC_EVENTID_EVT0 (0)
/* Output of event combiner 0, for events 32 to 63 */
#define CSL_INTC_EVENTID_EVT1 (1)
/* Output of event combiner 0, for events 64 to 95 */
#define CSL_INTC_EVENTID_EVT2 (2)
/* Output of event combiner 0, for events 96 to 127 */
#define CSL_INTC_EVENTID_EVT3 (3)
/* Timer 64P0 lower counter interrupt */
#define CSL_INTC_EVENTID_T64P0_TINT12 (4)
/* SYSCFG CHIPSIG Register Interrupt */
#define CSL_INTC_EVENTID_BOOTCFGINT0 (5)
#define CSL_INTC_EVENTID_EHRPWM0 (7)
/* CC Completion Interrupt for region 1 */
#define CSL_INTC_EVENTID_EDMA3CC_INT1 (8)
/* EMU interrupt */
#define CSL_INTC_EVENTID_EMU_DTDMA (9)
/* HiResTimer Trip Zone Interrupt */
#define CSL_INTC_EVENTID_EHRPWM0TZ (10)
/* EMU real time data exchange receive complete */
#define CSL_INTC_EVENTID_EMU_RTDXRX (11)
/* EMU RTDX transmit complete */
#define CSL_INTC_EVENTID_EMU_RTDXTX (12)
/* IDMA Channel 0 Interrupt */
#define CSL_INTC_EVENTID_IDMA0 (13)
/* IDMA Channel 1 Interrupt */
#define CSL_INTC_EVENTID_IDMA1 (14)
/* mmcsd0 mmcsd interrupt */
#define CSL_INTC_EVENTID_MMCSD0_INT0 (15)
/* mmcsd0 SDIO interrupt */
#define CSL_INTC_EVENTID_MMCSD0_INT1 (16)
#define CSL_INTC_EVENTID_EHRPWM1 (18)
/* USB Interrupt */
#define CSL_INTC_EVENTID_USBINT0 (19)
#define CSL_INTC_EVENTID_USB1_HCINT (20)
#define CSL_INTC_EVENTID_USB1_RWAKEUP (21)
#define CSL_INTC_EVENTID_EHRPWM1TZ (23)
/* SATA interrupt */
#define CSL_INTC_EVENTID_SATAINT (24)
/* Timer 64P2 COMBINED counter interrupt */
#define CSL_INTC_EVENTID_T64P2_TINTALL (25)
/* EMAC Interrupt */
#define CSL_INTC_EVENTID_EMAC_RXTHRHC0 (26)
#define CSL_INTC_EVENTID_EMAC_RXC0 (27)
#define CSL_INTC_EVENTID_EMAC_TXC0 (28)
#define CSL_INTC_EVENTID_EMAC_MISCC0 (29)
#define CSL_INTC_EVENTID_EMAC_RXTHRHC1 (30)
#define CSL_INTC_EVENTID_EMAC_RXC1 (31)
#define CSL_INTC_EVENTID_EMAC_TXC1 (32)
#define CSL_INTC_EVENTID_EMAC_MISCC1 (33)
/* UHPI DSPI Interrupt */
#define CSL_INTC_EVENTID_UHPI_DSPINT (34)
/* I2C interrupt */
#define CSL_INTC_EVENTID_I2CINT0 (36)
/* SPI interrupt */
#define CSL_INTC_EVENTID_SPIINT0 (37)
/* UART interrupt */
#define CSL_INTC_EVENTID_UARTINT0 (38)
/* Timer 64P1 lower counter interrupt */
#define CSL_INTC_EVENTID_T64P1_TINT12 (40)
/* GPIO BANK 1 interrupt */
#define CSL_INTC_EVENTID_GPIO_BNK1_INT (41)
#define CSL_INTC_EVENTID_I2CINT1 (42)
/* SPI interrupt */
#define CSL_INTC_EVENTID_SPIINT1 (43)
/* ECAP0 interrupt */
#define CSL_INTC_EVENTID_ECAPINT0 (45)
/* UART INTERRUPT */
#define CSL_INTC_EVENTID_UARTINT1 (46)
/* ECAP1 interrupt */
#define CSL_INTC_EVENTID_ECAPINT1 (47)
/* Timer 64P1 higher counter interrupt */
#define CSL_INTC_EVENTID_T64P1_TINT34 (48)
/* GPIO BANK 2 interrupt */
#define CSL_INTC_EVENTID_GPIO_BNK2_INT (49)
/* ECAP2 interrupt */
#define CSL_INTC_EVENTID_ECAPINT2 (51)
/* GPIO BANK 3 interrupt */
#define CSL_INTC_EVENTID_GPIO_BNK3_INT (52)
/* mmcsd1 SDIO interrupt */
#define CSL_INTC_EVENTID_MMCSD1_INT1 (53)
/* GPIO BANK 4 interrupt */
#define CSL_INTC_EVENTID_GPIO_BNK4_INT (54)
/* EMIFA Error Interrupt */
#define CSL_INTC_EVENTID_EMIFAINT (55)
/* EDMA3 CC Interrupt */
#define CSL_INTC_EVENTID_TPCC0_ERRINT (56)
/* EDMA3 TC Interrupt */
#define CSL_INTC_EVENTID_TPTC_ERRINT0 (57)
#define CSL_INTC_EVENTID_TPTC_ERRINT1 (58)
/* GPIO BANK 5 interrupt */
#define CSL_INTC_EVENTID_GPIO_BNK5_INT (59)
/* DDR2 memory err interrupt */
#define CSL_INTC_EVENTID_DDR2_MEMERR (60)
/* McASP combined interrupt */
#define CSL_INTC_EVENTID_MCASP0INT (61)
/* GPIO BANK 6 interrupt */
#define CSL_INTC_EVENTID_GPIO_BNK6_INT (62)
/* RTC Combined Interrupt */
#define CSL_INTC_EVENTID_RTC_IRQS (63)
/* Timer 64P0 higher counter interrupt */
#define CSL_INTC_EVENTID_T64P0_TINT34 (64)
/* GPIO BANK 0 interrupt */
#define CSL_INTC_EVENTID_GPIO_BNK0_INT (65)
/* SYSCFG_CHIPSIG Register */
#define CSL_INTC_EVENTID_SYSCFG_CHIPINT3 (67)
/* MMCSD 1 interrupt */
#define CSL_INTC_EVENTID_MMCSD1_INT0 (68)
/* uart2 interrupt */
#define CSL_INTC_EVENTID_UARTINT2 (69)
/* PSC interrupt */
#define CSL_INTC_EVENTID_PSC0_ALLINT (70)
#define CSL_INTC_EVENTID_PSC1_ALLINT (71)
/* GPIO bank 7 interrupt */
#define CSL_INTC_EVENTID_GPIO_BNK7_INT (72)
/* LCDC interrupt */
#define CSL_INTC_EVENTID_LCDC_INT0 (73)
/* SYSCFG Protection Shared Interrupt */
#define CSL_INTC_EVENTID_PROTERR (74)
/* GPIO bank 8 interrupt */
#define CSL_INTC_EVENTID_GPIO_BNK8_INT (75)
/* Timer 64P2 Compare Interrupt */
#define CSL_INTC_EVENTID_T64P2_CMPINT0 (78)
#define CSL_INTC_EVENTID_T64P2_CMPINT1 (79)
#define CSL_INTC_EVENTID_T64P2_CMPINT2 (80)
#define CSL_INTC_EVENTID_T64P2_CMPINT3 (81)
#define CSL_INTC_EVENTID_T64P2_CMPINT4 (82)
#define CSL_INTC_EVENTID_T64P2_CMPINT5 (83)
#define CSL_INTC_EVENTID_T64P2_CMPINT6 (84)
#define CSL_INTC_EVENTID_T64P2_CMPINT7 (85)
/* Timer 64P3 Compare Interrupt */
#define CSL_INTC_EVENTID_T64P3_TINTALL (86)
/* McBSP0 RX interrupt */
#define CSL_INTC_EVENTID_MCBSP0_RXINT (87)
/* McBSP0 TX interrupt */
#define CSL_INTC_EVENTID_MCBSP0_TXINT (88)
/* McBSP1 RX interrupt */
#define CSL_INTC_EVENTID_MCBSP1_RXINT (89)
/* McBSP1 TX interrupt */
#define CSL_INTC_EVENTID_MCBSP1_TXINT (90)
/* CC1 region 1 interrupt */
#define CSL_INTC_EVENTID_EDMA3CC1_INT1 (91)
/* CC1 Error Interrupt */
#define CSL_INTC_EVENTID_EDMA3CC1_ERRINT (92)
/* TC2 Error Interrupt */
#define CSL_INTC_EVENTID_EDMA3TC2_ERRINT (93)
/* UPP interrupt event */
#define CSL_INTC_EVENTID_UPPINT (94)
/* VPIF INTERRUPT EVENT */
#define CSL_INTC_EVENTID_VPIFINT (95)
/* Dropped CPU interrupt event */
#define CSL_INTC_EVENTID_INTERR (96)
/* EMC Invalid IDMA parameters */
#define CSL_INTC_EVENTID_EMC_IDMAERR (97)
/* PMC Single bit error detected during DMA read */
#define CSL_INTC_EVENTID_PMC_ED (113)
/* UMC single bit error detected */
#define CSL_INTC_EVENTID_UMC_ED1 (116)
/* UMC two bit error detected */
#define CSL_INTC_EVENTID_UMC_ED2 (117)
/* Power Down sleep interrupt */
#define CSL_INTC_EVENTID_PDC_INT (118)
/* SYS CMPA CPU memory protection fault */
#define CSL_INTC_EVENTID_SYS_CMPA (119)
/* PMC CPU memory protection fault */
#define CSL_INTC_EVENTID_PMC_CMPA (120)
/* PMC DMA memory protection fault */
#define CSL_INTC_EVENTID_PMC_DMPA (121)
/* DMC CPU memory protection fault */
#define CSL_INTC_EVENTID_DMC_CMPA (122)
/* DMC DMA memory protection fault */
#define CSL_INTC_EVENTID_DMC_DMPA (123)
/* UMC CPU memory protection fault */
#define CSL_INTC_EVENTID_UMC_CMPA (124)
/* UMC DMA memory protection fault */
#define CSL_INTC_EVENTID_UMC_DMPA (125)
/* IDMA CPU memory protection fault */
#define CSL_INTC_EVENTID_EMC_CMPA (126)
/* IDMA Bus error interrupt */
#define CSL_INTC_EVENTID_EMC_BUSERR (127)
/*************************** EDMA RELATED DEFINES ****************************/
/******************************************************************************\
* Parameterizable Configuration:- These are fed directly from the RTL
* parameters for the given SOC
\******************************************************************************/
#define CSL_EDMA3_NUM_DMACH 32
#define CSL_EDMA3_NUM_QDMACH 8
#define CSL_EDMA3_NUM_PARAMSETS 128
#define CSL_EDMA3_NUM_EVQUE 2
#define CSL_EDMA3_CHMAPEXIST 0
#define CSL_EDMA3_NUM_REGIONS 4
#define CSL_EDMA3_MEMPROTECT 0
/******************************************************************************\
* Channel Instance count
\******************************************************************************/
#define CSL_EDMA3_CHA_CNT (CSL_EDMA3_NUM_DMACH + \
CSL_EDMA3_NUM_QDMACH)
/* EDMA channel synchronization events */
/* McASP0 Receive Event */
#define CSL_EDMA3_CHA_MCASP0_RX 0
/* McASP0 Transmit Event */
#define CSL_EDMA3_CHA_MCASP0_TX 1
/* McBSP0 Receive Event */
#define CSL_EDMA3_CHA_MCBSP0_RX 2
/* McBSP1 Transmit Event */
#define CSL_EDMA3_CHA_MCBSP0_TX 3
/* McBSP1 Receive Event */
#define CSL_EDMA3_CHA_MCBSP1_RX 4
/* McBSP1 Transmit Event */
#define CSL_EDMA3_CHA_MCBSP1_TX 5
/* GPIO Bank0 event */
#define CSL_EDMA3_CHA_GPIO_BNKINT0 6
/* GPIO Bank1 event */
#define CSL_EDMA3_CHA_GPIO_BNKINT1 7
/* GPIO Bank2 event */
#define CSL_EDMA3_CHA_GPIO_BNKINT2 22
/* GPIO Bank3 event */
#define CSL_EDMA3_CHA_GPIO_BNKINT3 23
/* GPIO Bank4 event */
#define CSL_EDMA3_CHA_GPIO_BNKINT4 28
/* GPIO Bank5 event */
#define CSL_EDMA3_CHA_GPIO_BNKINT5 29
/* GPIO Bank6 event (TPCC1) */
#define CSL_EDMA3_CHA_GPIO_BNKINT6 16
/* GPIO Bank7 event (TPCC1) */
#define CSL_EDMA3_CHA_GPIO_BNKINT7 17
/* GPIO Bank8 event (TPCC1) */
#define CSL_EDMA3_CHA_GPIO_BNKINT8 18
/* UART0 Receive Event */
#define CSL_EDMA3_CHA_UART0_RX 8
/* UART0 Transmit Event */
#define CSL_EDMA3_CHA_UART0_TX 9
/* UART1 Receive Event */
#define CSL_EDMA3_CHA_UART1_RX 12
/* UART1 Transmit Event */
#define CSL_EDMA3_CHA_UART1_TX 13
/* UART2 Receive Event */
#define CSL_EDMA3_CHA_UART2_RX 30
/* UART2 Transmit Event */
#define CSL_EDMA3_CHA_UART2_TX 31
/* Timer 64P0 Event Out 12 */
#define CSL_EDMA3_CHA_TIMER64P0_EVT12 10
/* Timer 64P0 Event Out 34 */
#define CSL_EDMA3_CHA_TIMER64P0_EVT34 11
/* Timer 64P2 Event Out 12 (TPCC1) */
#define CSL_EDMA3_CHA_TIMER64P2_EVT12 24
/* Timer 64P2 Event Out 34 (TPCC1) */
#define CSL_EDMA3_CHA_TIMER64P2_EVT34 25
/* Timer 64P3 Event Out 12 (TPCC1) */
#define CSL_EDMA3_CHA_TIMER64P3_EVT12 26
/* Timer 64P3 Event Out 34 (TPCC1) */
#define CSL_EDMA3_CHA_TIMER64P3_EVT34 27
/* SPI0 Receive Event */
#define CSL_EDMA3_CHA_SPI0_RX 14
/* SPI0 Transmit Event */
#define CSL_EDMA3_CHA_SPI0_TX 15
/* SPI1 Receive Event */
#define CSL_EDMA3_CHA_SPI1_RX 18
/* SPI1 Transmit Event */
#define CSL_EDMA3_CHA_SPI1_TX 19
/* MMCSD0 Receive Event */
#define CSL_EDMA3_CHA_MMCSD0_RX 16
/* MMCSD0 Transmit Event */
#define CSL_EDMA3_CHA_MMCSD0_TX 17
/* MMCSD1 Receive Event (TPCC1) */
#define CSL_EDMA3_CHA_MMCSD1_RX 28
/* MMCSD1 Transmit Event (TPCC1) */
#define CSL_EDMA3_CHA_MMCSD1_TX 29
/* I2C0 Receive Event */
#define CSL_EDMA3_CHA_I2C0_RX 24
/* I2C0 Transmit Event */
#define CSL_EDMA3_CHA_I2C0_TX 25
/* I2C1 Receive Event */
#define CSL_EDMA3_CHA_I2C1_RX 26
/* I2C1 Transmit Event */
#define CSL_EDMA3_CHA_I2C1_TX 27
/* Timer 2 compare event0 (TPCC1) */
#define CSL_EDMA3_TIMER2_T12CMPEVT0 00
/* Timer 2 compare event1 (TPCC1) */
#define CSL_EDMA3_TIMER2_T12CMPEVT1 01
/* Timer 2 compare event2 (TPCC1) */
#define CSL_EDMA3_TIMER2_T12CMPEVT2 02
/* Timer 2 compare event3 (TPCC1) */
#define CSL_EDMA3_TIMER2_T12CMPEVT3 03
/* Timer 2 compare event4 (TPCC1) */
#define CSL_EDMA3_TIMER2_T12CMPEVT4 04
/* Timer 2 compare event5 (TPCC1) */
#define CSL_EDMA3_TIMER2_T12CMPEVT5 05
/* Timer 2 compare event6 (TPCC1) */
#define CSL_EDMA3_TIMER2_T12CMPEVT6 06
/* Timer 2 compare event7 (TPCC1) */
#define CSL_EDMA3_TIMER2_T12CMPEVT7 07
/* Timer 3 compare event0 (TPCC1) */
#define CSL_EDMA3_TIMER3_T12CMPEVT0 08
/* Timer 3 compare event1 (TPCC1) */
#define CSL_EDMA3_TIMER3_T12CMPEVT1 09
/* Timer 3 compare event2 (TPCC1) */
#define CSL_EDMA3_TIMER3_T12CMPEVT2 10
/* Timer 3 compare event3 (TPCC1) */
#define CSL_EDMA3_TIMER3_T12CMPEVT3 11
/* Timer 3 compare event4 (TPCC1) */
#define CSL_EDMA3_TIMER3_T12CMPEVT4 12
/* Timer 3 compare event5 (TPCC1) */
#define CSL_EDMA3_TIMER3_T12CMPEVT5 13
/* Timer 3 compare event6 (TPCC1) */
#define CSL_EDMA3_TIMER3_T12CMPEVT6 14
/* Timer 3 compare event7 (TPCC1) */
#define CSL_EDMA3_TIMER3_T12CMPEVT7 15
/* QDMA channels */
#define CSL_EDMA3_QCHA_BASE CSL_EDMA3_NUM_DMACH /* QDMA Channel Base */
#define CSL_EDMA3_QCHA_0 (CSL_EDMA3_QCHA_BASE + 0) /* QDMA Channel 0 */
#define CSL_EDMA3_QCHA_1 (CSL_EDMA3_QCHA_BASE + 1) /* QDMA Channel 1 */
#define CSL_EDMA3_QCHA_2 (CSL_EDMA3_QCHA_BASE + 2) /* QDMA Channel 2 */
#define CSL_EDMA3_QCHA_3 (CSL_EDMA3_QCHA_BASE + 3) /* QDMA Channel 3 */
#define CSL_EDMA3_QCHA_4 (CSL_EDMA3_QCHA_BASE + 4) /* QDMA Channel 4 */
#define CSL_EDMA3_QCHA_5 (CSL_EDMA3_QCHA_BASE + 5) /* QDMA Channel 5 */
#define CSL_EDMA3_QCHA_6 (CSL_EDMA3_QCHA_BASE + 6) /* QDMA Channel 6 */
#define CSL_EDMA3_QCHA_7 (CSL_EDMA3_QCHA_BASE + 7) /* QDMA Channel 7 */
/* Enumerations for EDMA Controlleres */
typedef enum {
CSL_EDMACC_ANY = -1, /* Any instance of EDMACC module */
CSL_EDMACC_0 = 0 /* EDMACC Instance 0 */
} CSL_EdmaccNum;
/* Enumerations for EDMA Event Queues */
typedef enum {
CSL_EDMA3_QUE_0 = 0, /* Queue 0 */
CSL_EDMA3_QUE_1 = 1 /* Queue 1 */
} CSL_Edma3Que;
/* Enumerations for EDMA Transfer Controllers
*
* There are 2 Transfer Controllers. Typically a one to one mapping exists
* between Event Queues and Transfer Controllers.
*
*/
typedef enum {
CSL_EDMATC_ANY = -1, /* Any instance of EDMATC */
CSL_EDMATC_0 = 0, /* EDMATC Instance 0 */
CSL_EDMATC_1 = 1 /* EDMATC Instance 1 */
} CSL_EdmatcNum;
#define CSL_EDMA3_REGION_GLOBAL -1
#define CSL_EDMA3_REGION_0 0
#define CSL_EDMA3_REGION_1 1
#define CSL_EDMA3_REGION_2 2
#define CSL_EDMA3_REGION_3 3
/******************************* DAT RELATED DEFINES **************************/
/******************************************************************************\
* Parameterizable Configuration:- These are fed directly from the RTL
* parameters for the given SOC
\******************************************************************************/
/******************************************************************************\
* Channel Instance count
\******************************************************************************/
/** @brief Number of Generic Channel instances */
/** @brief Enumerations for EDMA channels
*
* There are 8 QDMA channels -
*
*/
#define CSL_DAT_QCHA_0 0 /**< QDMA Channel 0 */
#define CSL_DAT_QCHA_1 1 /**< QDMA Channel 1 */
#define CSL_DAT_QCHA_2 2 /**< QDMA Channel 2 */
#define CSL_DAT_QCHA_3 3 /**< QDMA Channel 3 */
#define CSL_DAT_QCHA_4 4 /**< QDMA Channel 4 */
#define CSL_DAT_QCHA_5 5 /**< QDMA Channel 5 */
#define CSL_DAT_QCHA_6 6 /**< QDMA Channel 6 */
#define CSL_DAT_QCHA_7 7 /**< QDMA Channel 7 */
/** @brief Enumerations for EDMA Event Queues
*
* There are two Event Queues. Q0 is the highest priority and Q1 is the least
* priority
*
*/
typedef enum {
CSL_DAT_PRI_DEFAULT = 0, /* Queue 0 is default */
CSL_DAT_PRI_0 = 0, /* Queue 0 */
CSL_DAT_PRI_1 = 1 /* Queue 1 */
} CSL_DatPriority;
/** @brief Enumeration for EDMA Regions
*
*
*/
#define CSL_DAT_REGION_GLOBAL -1 /* Global Region */
#define CSL_DAT_REGION_0 0 /* EDMA Region 0 */
#define CSL_DAT_REGION_1 1 /* EDMA Region 1 */
#define CSL_DAT_REGION_2 2 /* EDMA Region 2 */
#define CSL_DAT_REGION_3 3 /* EDMA Region 3 */
#ifdef __cplusplus
}
#endif
#endif /* _SOC_H_ */

70
Projects/DirectPRU/include/edma.h

@ -0,0 +1,70 @@
/*
* edma.h
*
* EDMA user space library - Allocates EDMA channel for memory to memory
* copy using kernel DMA API. Allocates from the same TC (Transfer Controller)
* so that multiple bus masters (ARM9 and PRU) can read/write to shared memory
* using EDMA and EDMA h/w will take care of data integrity.
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* ============================================================================
* Copyright (c) Texas Instruments Inc 2010-11
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied or provided.
* ============================================================================
*/
#ifndef _EDMA_H
#define _EDMA_H
#include <sys/types.h>
#if defined (__cplusplus)
extern "C" {
#endif
int edma_allocate_channel(int *channel);
int edma_memcpy(int channel, unsigned int dst, unsigned int src,
unsigned int length);
int edma_memset(int channel, unsigned int dst,
unsigned int patternaddr, unsigned int length);
int edma_free_channel(int channel);
#if defined (__cplusplus)
}
#endif
#endif

67
Projects/DirectPRU/include/edmautils.h

@ -0,0 +1,67 @@
/*
* edma.h
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/*
* ============================================================================
* Copyright (c) Texas Instruments Inc 2010-11
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied or provided.
* ============================================================================
*/
#ifndef _EDMADRV_H
#define _EDMADRV_H
#include <linux/ioctl.h>
#if defined (__cplusplus)
extern "C" {
#endif
#define MAX_EDMA_CHANNELS 8
typedef struct _memcpy {
int channel;
unsigned int srcaddr;
unsigned int dstaddr;
unsigned int len;
} memcpyparams_t;
typedef struct _memset {
int channel;
unsigned int dstaddr;
unsigned int patternaddr;
unsigned int len;
} memsetparams_t;
#define DRIVER_MAJOR 0 // define major number if 0 driver search for a free number
//define magic number for ioctl function
#define EDMADRV_IOC_MAGIC 0xE2
#define EDMADRV_IOCALLOC_EDMA _IOW(EDMADRV_IOC_MAGIC, 1, int)
#define EDMADRV_IOCMEMCPY_EDMA _IOR(EDMADRV_IOC_MAGIC, 2, memcpyparams_t*)
#define EDMADRV_IOCMEMSET_EDMA _IOR(EDMADRV_IOC_MAGIC, 3, memsetparams_t*)
#define EDMADRV_IOCFREE_EDMA _IOR(EDMADRV_IOC_MAGIC, 4, int)
#if defined (__cplusplus)
}
#endif
#endif

61
Projects/DirectPRU/include/omapl_suart_board.h

@ -0,0 +1,61 @@
/*
* linux/<file location within the kernel tree>
*
* Copyright (C) 2010 Texas Instruments Incorporated
* Author: Ganeshan N
*
* Based on <Give reference of old kernel file from which this file is derived from>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
* whether express or implied; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef _OMAPL_SUART_BOARD_H_
#define _OMAPL_SUART_BOARD_H_
#ifdef __cplusplus
extern "C" {
#endif
#define PRU_SUART1_CONFIG_DUPLEX (ePRU_SUART_HALF_TX | ePRU_SUART_HALF_RX)
#define PRU_SUART1_CONFIG_RX_SER (PRU_SUART_SERIALIZER_7)
#define PRU_SUART1_CONFIG_TX_SER (PRU_SUART_SERIALIZER_8)
#define PRU_SUART2_CONFIG_DUPLEX (ePRU_SUART_HALF_TX | ePRU_SUART_HALF_RX)
#define PRU_SUART2_CONFIG_RX_SER (PRU_SUART_SERIALIZER_9)
#define PRU_SUART2_CONFIG_TX_SER (PRU_SUART_SERIALIZER_10)
#define PRU_SUART3_CONFIG_DUPLEX (ePRU_SUART_HALF_TX | ePRU_SUART_HALF_RX)
#define PRU_SUART3_CONFIG_RX_SER (PRU_SUART_SERIALIZER_13)
#define PRU_SUART3_CONFIG_TX_SER (PRU_SUART_SERIALIZER_14)
#define PRU_SUART4_CONFIG_DUPLEX (ePRU_SUART_HALF_TX | ePRU_SUART_HALF_RX)
#define PRU_SUART4_CONFIG_RX_SER (PRU_SUART_SERIALIZER_NONE)
#define PRU_SUART4_CONFIG_TX_SER (PRU_SUART_SERIALIZER_NONE)
#define PRU_SUART5_CONFIG_DUPLEX (ePRU_SUART_HALF_TX | ePRU_SUART_HALF_RX)
#define PRU_SUART5_CONFIG_RX_SER (PRU_SUART_SERIALIZER_NONE)
#define PRU_SUART5_CONFIG_TX_SER (PRU_SUART_SERIALIZER_NONE)
#define PRU_SUART6_CONFIG_DUPLEX (ePRU_SUART_HALF_TX | ePRU_SUART_HALF_RX)
#define PRU_SUART6_CONFIG_RX_SER (PRU_SUART_SERIALIZER_NONE)
#define PRU_SUART6_CONFIG_TX_SER (PRU_SUART_SERIALIZER_NONE)
#define PRU_SUART7_CONFIG_DUPLEX (ePRU_SUART_HALF_TX | ePRU_SUART_HALF_RX)
#define PRU_SUART7_CONFIG_RX_SER (PRU_SUART_SERIALIZER_NONE)
#define PRU_SUART7_CONFIG_TX_SER (PRU_SUART_SERIALIZER_NONE)
#define PRU_SUART8_CONFIG_DUPLEX (ePRU_SUART_HALF_TX | ePRU_SUART_HALF_RX)
#define PRU_SUART8_CONFIG_RX_SER (PRU_SUART_SERIALIZER_NONE)
#define PRU_SUART8_CONFIG_TX_SER (PRU_SUART_SERIALIZER_NONE)
#ifdef __cplusplus
} /* End of extern C */
#endif /* #ifdef __cplusplus */
#endif /* End of _<MOD>_FILENAME_API_H_ */

155
Projects/DirectPRU/include/pru.h

@ -0,0 +1,155 @@
/* --------------------------------------------------------------------------
FILE : pru.h
PROJECT : DA8xx/OMAP-L138/C674x PRU Development
DESC : PRU Load and Run API Definitions
----------------------------------------------------------------------------- */
#ifndef _PRU_H_
#define _PRU_H_
#include "tistdtypes.h"
#include "csl/cslr_prucore.h"
// Prevent C++ name mangling
#ifdef __cplusplus
extern far "c" {
#endif
#define PRU_NUM0 (0)
#define PRU_NUM1 (1)
/***********************************************************
* Global Macro Declarations *
***********************************************************/
// PRU Memory Macros
#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)
/* Macros defining some PRU specific constants. */
#define PRU_INTC_HOSTINTLVL_MAX 9
/*
*====================
* Typedef structures
*====================
*/
typedef struct arm_pru_iomap {
void *pru_io_addr;
void *mcasp_io_addr;
void *psc0_io_addr;
void *psc1_io_addr;
void *syscfg_io_addr;
void *pFifoBufferPhysBase;
void *pFifoBufferVirtBase;
} arm_pru_iomap;
/***********************************************************
* Global Function Declarations *
***********************************************************/
extern __FAR__ Uint32 pru_enable(Uint8 pruNum,
arm_pru_iomap * pru_arm_iomap);
extern __FAR__ Uint32 pru_load(Uint8 pruNum, Uint32 * pruCode,
Uint32 codeSizeInWords,
arm_pru_iomap * pru_arm_iomap);
extern __FAR__ Uint32 pru_run(Uint8 pruNum,
arm_pru_iomap * pru_arm_iomap);
extern __FAR__ Uint32 pru_waitForHalt(Uint8 pruNum, Int32 timeout,
arm_pru_iomap * pru_arm_iomap);
extern __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);
short pru_ram_read_data(Uint32 u32offset, Uint8 * pu8datatoread,
Uint16 u16wordstoread,
arm_pru_iomap * pru_arm_iomap);
short pru_ram_read_data_4byte(unsigned int u32offset,
unsigned int *pu32datatoread,
short u16wordstoread);
short pru_ram_write_data_4byte(unsigned int u32offset,
unsigned int *pu32datatoread,
short u16wordstoread);
/***********************************************************
* End file *
***********************************************************/
#ifdef __cplusplus
}
#endif
#endif // End _PRU_H_

95
Projects/DirectPRU/include/pruss_intc_mapping.h

@ -0,0 +1,95 @@
/*
* pruss_intc_mapping.h
*
* PRUSS INTC mapping for the application
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* ============================================================================
* Copyright (c) Texas Instruments Inc 2010-11
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied or provided.
* ============================================================================
*/
#define PRU0_PRU1_INTERRUPT 32
#define PRU1_PRU0_INTERRUPT 33
#define PRU0_ARM_INTERRUPT 34
#define PRU1_ARM_INTERRUPT 35
#define ARM_PRU0_INTERRUPT 36
#define ARM_PRU1_INTERRUPT 37
#define CHANNEL0 0
#define CHANNEL1 1
#define CHANNEL2 2
#define CHANNEL3 3
#define CHANNEL4 4
#define CHANNEL5 5
#define CHANNEL6 6
#define CHANNEL7 7
#define CHANNEL8 8
#define CHANNEL9 9
#define PRU0 0
#define PRU1 1
#define PRU_EVTOUT0 2
#define PRU_EVTOUT1 3
#define PRU_EVTOUT2 4
#define PRU_EVTOUT3 5
#define PRU_EVTOUT4 6
#define PRU_EVTOUT5 7
#define PRU_EVTOUT6 8
#define PRU_EVTOUT7 9
#define PRU0_HOSTEN_MASK 0x0001
#define PRU1_HOSTEN_MASK 0x0002
#define PRU_EVTOUT0_HOSTEN_MASK 0x0004
#define PRU_EVTOUT1_HOSTEN_MASK 0x0008
#define PRU_EVTOUT2_HOSTEN_MASK 0x0010
#define PRU_EVTOUT3_HOSTEN_MASK 0x0020
#define PRU_EVTOUT4_HOSTEN_MASK 0x0040
#define PRU_EVTOUT5_HOSTEN_MASK 0x0080
#define PRU_EVTOUT6_HOSTEN_MASK 0x0100
#define PRU_EVTOUT7_HOSTEN_MASK 0x0200
#define PRUSS_INTC_INITDATA { \
{ PRU0_PRU1_INTERRUPT, PRU1_PRU0_INTERRUPT, PRU0_ARM_INTERRUPT, PRU1_ARM_INTERRUPT, ARM_PRU0_INTERRUPT, ARM_PRU1_INTERRUPT, -1 }, \
{ {PRU0_PRU1_INTERRUPT,CHANNEL1}, {PRU1_PRU0_INTERRUPT, CHANNEL0}, {PRU0_ARM_INTERRUPT,CHANNEL2}, {PRU1_ARM_INTERRUPT, CHANNEL3}, {ARM_PRU0_INTERRUPT, CHANNEL0}, {ARM_PRU1_INTERRUPT, CHANNEL1}, {-1,-1}}, \
{ {CHANNEL0,PRU0}, {CHANNEL1, PRU1}, {CHANNEL2, PRU_EVTOUT0}, {CHANNEL3, PRU_EVTOUT1}, {-1,-1} }, \
(PRU0_HOSTEN_MASK | PRU1_HOSTEN_MASK | PRU_EVTOUT0_HOSTEN_MASK | PRU_EVTOUT1_HOSTEN_MASK) /*Enable PRU0, PRU1, PRU_EVTOUT0 */ \
} \

148
Projects/DirectPRU/include/prussdrv.h

@ -0,0 +1,148 @@
/*
* prussdrv.h
*
* Describes PRUSS userspace driver for Industrial Communications
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* ============================================================================
* Copyright (c) Texas Instruments Inc 2010-11
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied or provided.
* ============================================================================
*/
#ifndef _PRUSSDRV_H
#define _PRUSSDRV_H
#include <sys/types.h>
#include <pthread.h>
#if defined (__cplusplus)
extern "C" {
#endif
#define NUM_PRU_HOSTIRQS 8
#define NUM_PRU_HOSTS 10
#define NUM_PRU_CHANNELS 10
#define NUM_PRU_SYS_EVTS 64
#define PRUSS0_PRU0_DATARAM 0
#define PRUSS0_PRU1_DATARAM 1
#define PRUSS0_PRU0_IRAM 2
#define PRUSS0_PRU1_IRAM 3
#define PRU_EVTOUT_0 0
#define PRU_EVTOUT_1 1
#define PRU_EVTOUT_2 2
#define PRU_EVTOUT_3 3
#define PRU_EVTOUT_4 4
#define PRU_EVTOUT_5 5
#define PRU_EVTOUT_6 6
#define PRU_EVTOUT_7 7
typedef void *(*prussdrv_function_handler) (void *);
typedef struct __sysevt_to_channel_map {
short sysevt;
short channel;
} tsysevt_to_channel_map;
typedef struct __channel_to_host_map {
short channel;
short host;
} tchannel_to_host_map;
typedef struct __pruss_intc_initdata {
//Enabled SYSEVTs - Range:0..63
//{-1} indicates end of list
char sysevts_enabled[NUM_PRU_SYS_EVTS];
//SysEvt to Channel map. SYSEVTs - Range:0..63 Channels -Range: 0..9
//{-1, -1} indicates end of list
tsysevt_to_channel_map sysevt_to_channel_map[NUM_PRU_SYS_EVTS];
//Channel to Host map.Channels -Range: 0..9 HOSTs - Range:0..9
//{-1, -1} indicates end of list
tchannel_to_host_map channel_to_host_map[NUM_PRU_CHANNELS];
//10-bit mask - Enable Host0-Host9 {Host0/1:PRU0/1, Host2..9 : PRUEVT_OUT0..7)
unsigned int host_enable_bitmask;
} tpruss_intc_initdata;
int prussdrv_init(void);
int prussdrv_open(unsigned int pru_evtout_num);
int prussdrv_pru_reset(unsigned int prunum);
int prussdrv_pru_disable(unsigned int prunum);
int prussdrv_pru_enable(unsigned int prunum);
int prussdrv_pru_write_memory(unsigned int pru_ram_id,
unsigned int wordoffset,
unsigned int *memarea,
unsigned int bytelength);
int prussdrv_pruintc_init(tpruss_intc_initdata * prussintc_init_data);
int prussdrv_map_l3mem(void **address);
int prussdrv_map_extmem(void **address);
int prussdrv_map_prumem(unsigned int pru_ram_id, void **address);
unsigned int prussdrv_get_phys_addr(void *address);
void *prussdrv_get_virt_addr(unsigned int phyaddr);
int prussdrv_pru_wait_event(unsigned int pru_evtout_num);
int prussdrv_pru_send_event(unsigned int eventnum);
int prussdrv_pru_clear_event(unsigned int eventnum);
int prussdrv_pru_send_wait_clear_event(unsigned int send_eventnum,
unsigned int pru_evtout_num,
unsigned int ack_eventnum);
int prussdrv_exit(void);
int prussdrv_exec_program(int prunum, char *filename);
int prussdrv_start_irqthread(unsigned int pru_evtout_num, int priority,
prussdrv_function_handler irqhandler);
#if defined (__cplusplus)
}
#endif
#endif

378
Projects/DirectPRU/include/suart_api.h

@ -0,0 +1,378 @@
/*
* linux/<file location within the kernel tree>
*
* Copyright (C) 2010 Texas Instruments Incorporated
* Author: Ganeshan N
*
* Based on <Give reference of old kernel file from which this file is derived from>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
* whether express or implied; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef _SUART_API_H_
#define _SUART_API_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
*====================
* Includes
*====================
*/
#include "tistdtypes.h"
#include "pru.h"
/*
*====================
* Defines
*====================
*/
/* Retrun Values */
#ifndef BIT
#define BIT(x) (1 << x)
#endif
#define SUART_NUM_OF_CHANNELS_PER_SUART 2
#define SUART_NUM_OF_BYTES_PER_CHANNEL 16
#define SUART_PASS 0
#define SUART_SUCCESS 0
#define SUART_FAIL 1
#define SUART_FALSE 0
#define SUART_TRUE 1
#define PRU_TX_INTR 1
#define PRU_RX_INTR 2
#define CHN_TXRX_STATUS_TIMEOUT BIT(6)
#define CHN_TXRX_STATUS_BI BIT(5)
#define CHN_TXRX_STATUS_FE BIT(4)
#define CHN_TXRX_STATUS_UNERR BIT(3)
#define CHN_TXRX_STATUS_OVRNERR BIT(3) /* UNERR->TX & OVRNERR->RX */
#define CHN_TXRX_STATUS_ERR BIT(2)
#define CHN_TXRX_STATUS_CMPLT BIT(1)
#define CHN_TXRX_STATUS_RDY BIT(0)
#define CHN_TXRX_IE_MASK_TIMEOUT BIT(14)
#define CHN_TXRX_IE_MASK_BI BIT(13)
#define CHN_TXRX_IE_MASK_FE BIT(12)
#define CHN_TXRX_IE_MASK_CMPLT BIT(1)
#define SUART_GBL_INTR_ERR_MASK BIT(9)
#define SUART_PRU_ID_MASK 0xFF
#define SUART_FIFO_LEN 15
#define SUART_8X_OVRSMPL 1
#define SUART_16X_OVRSMPL 2
#define SUART_DEFAULT_OVRSMPL SUART_8X_OVRSMPL
#if (SUART_DEFAULT_OVRSMPL == SUART_16X_OVRSMPL)
#define SUART_DEFAULT_BAUD 57600
#else
#define SUART_DEFAULT_BAUD 115200
#endif
#define PRU_SUART_UART1 (1u)
/** UART instance */
#define PRU_SUART_UART2 (2u)
/** UART instance */
#define PRU_SUART_UART3 (3u)
/** UART instance */
#define PRU_SUART_UART4 (4u)
/** UART instance */
#define PRU_SUART_UART5 (5u)
/** UART instance */
#define PRU_SUART_UART6 (6u)
/** UART instance */
#define PRU_SUART_UART7 (7u)
/** UART instance */
#define PRU_SUART_UART8 (8u)
/** UART instance */
#define PRU_SUART_UARTx_INVALID (9u)
/** UART instance */
/*
*====================
* Enumerations
*====================
*/
/**
* \brief One line description of the enum
*
* Detailed description of the enum
*/
typedef enum {
ePRU_SUART_DATA_BITS6 = 8,
/**< 6 + 2 */
ePRU_SUART_DATA_BITS7,
/**< member2 description */
ePRU_SUART_DATA_BITS8,
/**< member1 description */
ePRU_SUART_DATA_BITS9,
/**< member2 description */
ePRU_SUART_DATA_BITS10,
/**< member1 description */
ePRU_SUART_DATA_BITS11,
/**< member1 description */
ePRU_SUART_DATA_BITS12
/**< member1 description */
} SUART_EN_BITSPERCHAR;
/**
* \brief One line description of the enum
*
* Detailed description of the enum
*/
typedef enum {
ePRU_SUART_NUM_1 = 1,
/**< member1 description */
ePRU_SUART_NUM_2,
/**< member1 description */
ePRU_SUART_NUM_3,
/**< member1 description */
ePRU_SUART_NUM_4,
/**< member1 description */
ePRU_SUART_NUM_5,
/**< member1 description */
ePRU_SUART_NUM_6,
/**< member1 description */
ePRU_SUART_NUM_7,
/**< member1 description */
ePRU_SUART_NUM_8
/**< member1 description */
} SUART_EN_UARTNUM;
/**
* \brief One line description of the enum
*
* Detailed description of the enum
*/
typedef enum {
ePRU_SUART_HALF_TX = 1,
ePRU_SUART_HALF_RX,
ePRU_SUART_FULL_TX_RX
} SUART_EN_UARTTYPE;
/**
* \brief One line description of the enum
*
* Detailed description of the enum
*/
typedef enum {
ePRU_SUART_TX_CH0 = 0,
/**< member1 description */
ePRU_SUART_TX_CH1,
/**< member1 description */
ePRU_SUART_TX_CH2,
/**< member1 description */
ePRU_SUART_TX_CH3,
/**< member1 description */
ePRU_SUART_TX_CH4,
/**< member1 description */
ePRU_SUART_TX_CH5,
/**< member1 description */
ePRU_SUART_TX_CH6,
/**< member1 description */
ePRU_SUART_TX_CH7
/**< member1 description */
} SUART_EN_TXCHANNEL;
/**
* \brief One line description of the enum
*
* Detailed description of the enum
*/
typedef enum {
ePRU_SUART_RX_CH0 = 0,
/**< member1 description */
ePRU_SUART_RX_CH1,
/**< member1 description */
ePRU_SUART_RX_CH2,
/**< member1 description */
ePRU_SUART_RX_CH3,
/**< member1 description */
ePRU_SUART_RX_CH4,
/**< member1 description */
ePRU_SUART_RX_CH5,
/**< member1 description */
ePRU_SUART_RX_CH6,
/**< member1 description */
ePRU_SUART_RX_CH7
/**< member1 description */
} SUART_EN_RXCHANNEL;
/**
* \brief One line description of the enum
*
* Detailed description of the enum
*/
typedef enum {
ePRU_SUART_UART_FREE = 0,
/**< member1 description */
ePRU_SUART_UART_IN_USE
/**< member1 description */
} SUART_EN_UART_STATUS;
/*
*====================
* Structures
*====================
*/
#define PRU_NUM_OF_CHANNELS 16
typedef struct {
unsigned short CH_Ctrl;
/**< PRU SUART control register */
unsigned short CH_Config1;
/**< PRU SUART configuration1 register */
unsigned short CH_Config2;
/**< PRU SUART configuration2 register */
unsigned short CH_TXRXStatus;
/**< PRU SUART TX/RX status register */
unsigned int CH_TXRXData;
/**< PRU SUART TX/RX data register */
unsigned int Reserved1;
/**< Reserved 1 */
} pru_suart_regs[PRU_NUM_OF_CHANNELS];
typedef volatile pru_suart_regs *PRU_SUART_RegsOvly;
/**
* \brief One line description of the structure
*
* Detailed description of the structure
*/
typedef struct {
unsigned char TXSerializer;
/**< It takes the value of the serializer. It takes the value 0-15 range */
unsigned char RXSerializer;
/**< It takes the value of the serializer. It takes the value 0-15 range */
unsigned short txClkDivisor; /**< Divisor (CLKXDIV* HCLKXDIV) value to generate the appropriate baud rate */
unsigned short rxClkDivisor; /**< Divisor (CLKXDIV* HCLKXDIV) value to generate the appropriate baud rate */
unsigned char txBitsPerChar; /**< Bits per Character (Range: 6 to 12) */
unsigned char rxBitsPerChar; /**< Bits per Character (Range: 6 to 12) */
unsigned char Oversampling; /**< Oversampling rate */
unsigned char BIIntrMask; /**< Break Indicator Interrupt Mask Bit */
unsigned char FEIntrMask; /**< Framing Error Interrupt Mask Bit */
} suart_config;
/**
* \brief One line description of the structure
*
* Detailed description of the structure
*/
typedef struct {
unsigned short uartNum;/**< UART number (Range 1 to 16) */
unsigned short uartType;
/**< Type of the UART i.e., Full UART, Half UART */
unsigned short uartTxChannel;
/**< Soft UART Channel for Transmission */
unsigned short uartRxChannel;
/**< Soft UART Channel for Reception */
unsigned short uartStatus;
/**< Status of the UART */
} suart_struct_handle;
typedef suart_struct_handle *suart_handle;
/*
*====================
* API declarations
*====================
*/
short pru_softuart_init(unsigned int txBaudValue,
unsigned int rxBaudValue,
unsigned int oversampling,
unsigned char *pru_suart_emu_code,
unsigned int fw_size,
arm_pru_iomap * pru_arm_iomap1);
int pru_intr_set_mask(unsigned short uartNum,
unsigned int txrxmode, unsigned int intrmask);
short pru_softuart_reset(unsigned int txBaudValue,
unsigned int rxBaudValue,
unsigned int oversampling);
short pru_softuart_open(suart_handle hSuart);
short pru_softuart_close(suart_handle hUart);
short pru_softuart_setbaud
(suart_handle hUart,
unsigned short txClkDivisor, unsigned short rxClkDivisor);
short pru_softuart_setdatabits
(suart_handle hUart,
unsigned short txDataBits, unsigned short rxDataBits);
short pru_softuart_setconfig
(suart_handle hUart, suart_config * configUart);
short pru_softuart_getconfig
(suart_handle hUart, suart_config * configUart);
short pru_softuart_write
(suart_handle hUart,
unsigned int *ptTxDataBuf, unsigned short dataLen);
short pru_softuart_read
(suart_handle hUart,
unsigned int *ptDataBuf, unsigned short dataLen);
int suart_intr_clrmask(unsigned short uartNum,
unsigned int txrxmode, unsigned int intrmask);
short pru_softuart_clrTxStatus(suart_handle hUart);
short pru_softuart_getTxStatus(suart_handle hUart);
short pru_softuart_clrRxStatus(suart_handle hUart);
short pru_softuart_getRxStatus(suart_handle hUart);
short pru_softuart_get_isrstatus(unsigned short uartNum,
unsigned short *txrxFlag);
int pru_intr_clr_isrstatus(unsigned short uartNum, unsigned int txrxmode);
int suart_intr_getmask(unsigned short uartNum,
unsigned int txrxmode, unsigned int intrmask);
int suart_intr_setmask(unsigned short uartNum,
unsigned int txrxmode, unsigned int intrmask);
short pru_softuart_getTxDataLen(suart_handle hUart);
short pru_softuart_getRxDataLen(suart_handle hUart);
short suart_arm_to_pru_intr(unsigned short uartNum);
short arm_to_pru_intr_init(void);
short pru_softuart_deinit(void);
short pru_softuart_clrRxFifo(suart_handle hUart);
short pru_softuart_read_data (suart_handle hUart, Uint8 * pDataBuffer,
Int32 s32MaxLen, Uint32 * pu32DataRead);
short pru_softuart_stopReceive (suart_handle hUart);
int suart_pru_to_host_intr_enable (unsigned short uartNum,
unsigned int txrxmode, int s32Flag);
void pru_set_fifo_timeout(Uint32 timeout);
#ifdef __cplusplus
} /* End of extern C */
#endif /* #ifdef __cplusplus */
#endif

76
Projects/DirectPRU/include/suart_err.h

@ -0,0 +1,76 @@
/*
* linux/<file location within the kernel tree>
*
* Copyright (C) 2010 Texas Instruments Incorporated
* Author: Ganeshan N
*
* Based on <Give reference of old kernel file from which this file is derived from>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
* whether express or implied; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef _SUART_ERR_H_
#define _SUART_ERR_H_
#ifdef __cplusplus
extern "C" {
#endif
#define PRU_SUART_SUCCESS (0u)
#define PRU_SUART_FAILURE (-1)
/** Returns success on Soft UART transaction */
#define PRU_SUART_ERR_DEVICE_NOT_OPEN (1u)
/** Return */
#define PRU_SUART_ERR_UARTS_INIT_FAIL (2u)
/** Return */
#define PRU_SUART_ERR_UARTS_RESET_FAIL (3u)
/** Return */
#define PRU_SUART_ERR_HANDLE_INVALID (4u)
/** Return */
#define PRU_SUART_ERR_PARAMETER_INVALID (5u)
/** Return */
/* Transmit */
#define PRU_SUART_ERR_TX (6u)
/** Return */
#define PRU_SUART_TX_COMPLETE (7u)
/** Return */
#define PRU_SUART_TX_BUSY (8u)
/** Return */
#define PRU_SUART_TX_UNDERRUN (9u)
/** Return */
/* Receive */
#define PRU_SUART_ERR_RX (10u)
/** Return */
#define PRU_SUART_RX_COMPLETE (11u)
/** Return */
#define PRU_SUART_RX_BUSY (12u)
/** Return */
#define PRU_SUART_RX_OVERRUN (13u)
/** Return */
/* API Specific Errors */
#define SUART_INVALID_TX_BAUD (14u)
#define SUART_INVALID_OVERSAMPLING (15u)
#define SUART_INVALID_RX_BAUD (16u)
#define SUART_UART_IN_USE (17u)
#define SUART_INVALID_CLKDIVISOR (18u)
#define SUART_INVALID_UART_NUM (19u)
#define SUART_INVALID_SR_NUM (20u)
#ifdef __cplusplus
} /* End of extern C */
#endif /* #ifdef __cplusplus */
#endif

215
Projects/DirectPRU/include/suart_pru_regs.h

@ -0,0 +1,215 @@
/*
* linux/<file location within the kernel tree>
*
* Copyright (C) 2010 Texas Instruments Incorporated
* Author: jitendra@mistralsolutions.com
*
* Based on <Give reference of old kernel file from which this file is derived from>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
* whether express or implied; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef _SUART_PRU_REGS_H_
#define _SUART_PRU_REGS_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
*====================
* Includes
*====================
*/
#include "tistdtypes.h"
/*
*====================
* Defines
*====================
*/
#define PRU_DATARAM_BASE_ADDR (0x01C30000u)
#define PRU0_DATARAM0_OFFSET (0x0000u)
/** PRU0 DATA RAM base address */
#define PRU0_DATARAM1_OFFSET (0x2000u)
/** PRU0 DATA RAM base address */
#define PRU_SUART_DATARAM0_BASE (PRU_DATARAM_BASE_ADDR + PRU0_DATARAM0_OFFSET)
/** PRU1 DATA RAM base address */
#define PRU_SUART_DATARAM1_BASE (PRU_DATARAM_BASE_ADDR + PRU0_DATARAM0_OFFSET)
/** PRU1 DATA RAM base address */
#define PRU_SUART_PRU0_CH0_OFFSET (0x0000)
/** Channel 0 */
#define PRU_SUART_PRU0_CH1_OFFSET (0x0010)
/** Channel 1 */
#define PRU_SUART_PRU0_CH2_OFFSET (0x0020)
/** Channel 2 */
#define PRU_SUART_PRU0_CH3_OFFSET (0x0030)
/** Channel 3 */
#define PRU_SUART_PRU0_CH4_OFFSET (0x0040)
/** Channel 4 */
#define PRU_SUART_PRU0_CH5_OFFSET (0x0050)
/** Channel 5 */
#define PRU_SUART_PRU0_CH6_OFFSET (0x0060)
/** Channel 6 */
#define PRU_SUART_PRU0_CH7_OFFSET (0x0070)
/** Channel 7 */
#define PRU_SUART_PRU0_IMR_OFFSET (0x0080)
/** Interrupt Mask Register */
#define PRU_SUART_PRU0_ISR_OFFSET (0x0082)
/** Interrupt Status Register */
#define PRU_SUART_PRU0_ID_ADDR (0x0084)
/** PRU ID Register */
#define PRU_SUART_PRU0_IDLE_TIMEOUT_OFFSET 0x0086
/* ********* PRU 1 Macros ************* */
#define PRU_SUART_PRU1_CH0_OFFSET (0x2000)
/** Channel 0 */
#define PRU_SUART_PRU1_CH1_OFFSET (0x2010)
/** Channel 1 */
#define PRU_SUART_PRU1_CH2_OFFSET (0x2020)
/** Channel 2 */
#define PRU_SUART_PRU1_CH3_OFFSET (0x2030)
/** Channel 3 */
#define PRU_SUART_PRU1_CH4_OFFSET (0x2040)
/** Channel 4 */
#define PRU_SUART_PRU1_CH5_OFFSET (0x2050)
/** Channel 5 */
#define PRU_SUART_PRU1_CH6_OFFSET (0x2060)
/** Channel 6 */
#define PRU_SUART_PRU1_CH7_OFFSET (0x2070)
/** Channel 7 */
#define PRU_SUART_PRU1_IMR_OFFSET (0x2080)
/** Interrupt Mask Register */
#define PRU_SUART_PRU1_ISR_OFFSET (0x2080)
/** Interrupt Status Register */
#define PRU_SUART_PRU1_ID_ADDR (0x2084)
/** PRU ID Register */
#define PRU_SUART_PRU1_IDLE_TIMEOUT_OFFSET 0x2086
/* SUART Channel Control Register bit descriptions */
#define PRU_SUART_CH_CTRL_MODE_SHIFT 0x0000
#define PRU_SUART_CH_CTRL_MODE_MASK 0x0003
#define PRU_SUART_CH_CTRL_TX_MODE 0x0001
#define PRU_SUART_CH_CTRL_RX_MODE 0x0002
/* Service Request */
#define PRU_SUART_CH_CTRL_SREQ_SHIFT 0x0002
#define PRU_SUART_CH_CTRL_SREQ_MASK 0x0004
#define PRU_SUART_CH_CTRL_SREQ 0x0001
/* McASP Instance */
#define PRU_SUART_CH_CTRL_MCASP_SHIFT 0x0003
#define PRU_SUART_CH_CTRL_MCASP_MASK 0x0018
#define PRU_SUART_CH_CTRL_SR_SHIFT 0x0008
#define PRU_SUART_CH_CTRL_SR_MASK 0x0F00
/* SUART channel configuration1 register descriptions */
/* clock divisor - relative baud value */
#define PRU_SUART_CH_CONFIG1_DIVISOR_SHIFT 0x0000
#define PRU_SUART_CH_CONFIG1_DIVISOR_MASK 0x03FF
/* oversampling */
#define PRU_SUART_CH_CONFIG1_OVS_SHIFT 0x000A
#define PRU_SUART_CH_CONFIG1_OVS_MASK 0x0C00
/* SUART channel configuration2 register descriptions */
/* Bits per character */
#define PRU_SUART_CH_CONFIG2_BITPERCHAR_SHIFT 0x0000
#define PRU_SUART_CH_CONFIG2_BITPERCHAR_MASK 0x000F
/* Bits per character */
#define PRU_SUART_CH_CONFIG2_DATALEN_SHIFT 0x0008
#define PRU_SUART_CH_CONFIG2_DATALEN_MASK 0x0F00
/* SUART Channel register offsets */
#define PRU_SUART_CH_CTRL_OFFSET 0x00
#define PRU_SUART_CH_CONFIG1_OFFSET 0x02
#define PRU_SUART_CH_CONFIG2_OFFSET 0x04
#define PRU_SUART_CH_TXRXSTATUS_OFFSET 0x06
#define PRU_SUART_CH_TXRXDATA_OFFSET 0x08
#define PRU_SUART_CH_BYTESDONECNTR_OFFSET 0x0C
/* SUART Event Numbers macros */
#define PRU_SUART0_TX_EVT 34
#define PRU_SUART0_RX_EVT 35
#define PRU_SUART1_TX_EVT 36
#define PRU_SUART1_RX_EVT 37
#define PRU_SUART2_TX_EVT 38
#define PRU_SUART2_RX_EVT 39
#define PRU_SUART3_TX_EVT 40
#define PRU_SUART3_RX_EVT 41
#define PRU_SUART4_TX_EVT 42
#define PRU_SUART4_RX_EVT 43
#define PRU_SUART5_TX_EVT 44
#define PRU_SUART5_RX_EVT 45
#define PRU_SUART6_TX_EVT 46
#define PRU_SUART6_RX_EVT 47
#define PRU_SUART7_TX_EVT 48
#define PRU_SUART7_RX_EVT 49
#define PRU_SUART0_TX_EVT_BIT BIT(2)
#define PRU_SUART0_RX_EVT_BIT BIT(3)
#define PRU_SUART1_TX_EVT_BIT BIT(4)
#define PRU_SUART1_RX_EVT_BIT BIT(5)
#define PRU_SUART2_TX_EVT_BIT BIT(6)
#define PRU_SUART2_RX_EVT_BIT BIT(7)
#define PRU_SUART3_TX_EVT_BIT BIT(8)
#define PRU_SUART3_RX_EVT_BIT BIT(9)
#define PRU_SUART4_TX_EVT_BIT BIT(10)
#define PRU_SUART4_RX_EVT_BIT BIT(11)
#define PRU_SUART5_TX_EVT_BIT BIT(12)
#define PRU_SUART5_RX_EVT_BIT BIT(13)
#define PRU_SUART6_TX_EVT_BIT BIT(14)
#define PRU_SUART6_RX_EVT_BIT BIT(15)
#define PRU_SUART7_TX_EVT_BIT BIT(16)
#define PRU_SUART7_RX_EVT_BIT BIT(17)
/**
* \brief One line description of the structure
*
* Detailed description of the structure
*/
typedef struct {
unsigned short CHn_Ctrl;/**< UART number (Range 1 to 16) */
unsigned short CHn_Config1;
/**< Type of the UART i.e., Full UART, Half UART */
unsigned short CHn_Config2;
/**< Soft UART Channel for Transmission */
unsigned short CHn_TXRXStatus;
/**< Soft UART Channel for Reception */
unsigned int CHn_TXRXData;/**< Status of the UART */
} suart_struct_pru_regs;
#ifdef __cplusplus
} /* End of extern C */
#endif /* #ifdef __cplusplus */
#endif

106
Projects/DirectPRU/include/suart_utils.h

@ -0,0 +1,106 @@
/*
* linux/<file location within the kernel tree>
*
* Copyright (C) 2010 Texas Instruments Incorporated
* Author: Ganeshan N
*
* Based on <Give reference of old kernel file from which this file is derived from>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
* whether express or implied; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef _SUART_UTILS_H_
#define _SUART_UTILS_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
*====================
* Includes
*====================
*/
#include "tistdtypes.h"
/* ************ Serializers ***************** */
#define PRU_SUART_SERIALIZER_0 (0u)
/** Serializer */
#define PRU_SUART_SERIALIZER_1 (1u)
/** Serializer */
#define PRU_SUART_SERIALIZER_2 (2u)
/** Serializer */
#define PRU_SUART_SERIALIZER_3 (3u)
/** Serializer */
#define PRU_SUART_SERIALIZER_4 (4u)
/** Serializer */
#define PRU_SUART_SERIALIZER_5 (5u)
/** Serializer */
#define PRU_SUART_SERIALIZER_6 (6u)
/** Serializer */
#define PRU_SUART_SERIALIZER_7 (7u)
/** Serializer */
#define PRU_SUART_SERIALIZER_8 (8u)
/** Serializer */
#define PRU_SUART_SERIALIZER_9 (9u)
/** Serializer */
#define PRU_SUART_SERIALIZER_10 (10u)
/** Serializer */
#define PRU_SUART_SERIALIZER_11 (11u)
/** Serializer */
#define PRU_SUART_SERIALIZER_12 (12u)
/** Serializer */
#define PRU_SUART_SERIALIZER_13 (13u)
/** Serializer */
#define PRU_SUART_SERIALIZER_14 (14u)
/** Serializer */
#define PRU_SUART_SERIALIZER_15 (15u)
/** Serializer */
#define PRU_SUART_SERIALIZER_NONE (16u)
/* Total number of baud rates supported */
#define SUART_NUM_OF_BAUDS_SUPPORTED 13
#define MCASP_PDIR_VAL ( \
CSL_MCASP_PDIR_AFSR_OUTPUT<<CSL_MCASP_PDIR_AFSR_SHIFT | \
CSL_MCASP_PDIR_AHCLKR_OUTPUT<<CSL_MCASP_PDIR_AHCLKR_SHIFT | \
CSL_MCASP_PDIR_ACLKR_OUTPUT<<CSL_MCASP_PDIR_ACLKR_SHIFT | \
CSL_MCASP_PDIR_AFSX_OUTPUT<<CSL_MCASP_PDIR_AFSX_SHIFT | \
CSL_MCASP_PDIR_AHCLKX_OUTPUT<<CSL_MCASP_PDIR_AHCLKX_SHIFT | \
CSL_MCASP_PDIR_ACLKX_OUTPUT<<CSL_MCASP_PDIR_ACLKX_SHIFT | \
CSL_MCASP_PDIR_AXR8_OUTPUT<<CSL_MCASP_PDIR_AXR8_SHIFT | \
CSL_MCASP_PDIR_AXR7_INPUT<<CSL_MCASP_PDIR_AXR7_SHIFT | \
CSL_MCASP_PDIR_AXR10_OUTPUT<<CSL_MCASP_PDIR_AXR10_SHIFT | \
CSL_MCASP_PDIR_AXR9_INPUT<<CSL_MCASP_PDIR_AXR9_SHIFT | \
CSL_MCASP_PDIR_AXR14_OUTPUT<<CSL_MCASP_PDIR_AXR14_SHIFT | \
CSL_MCASP_PDIR_AXR13_INPUT<<CSL_MCASP_PDIR_AXR13_SHIFT)
extern void suart_mcasp_config(unsigned int mcasp_addr,
unsigned int txBaudValue,
unsigned int rxBaudValue,
unsigned int oversampling,
arm_pru_iomap * pru_arm_iomap);
extern short suart_asp_baud_set(unsigned int txBaudValue,
unsigned int rxBaudValue,
unsigned int oversampling,
arm_pru_iomap * pru_arm_iomap);
extern void suart_mcasp_psc_disable(unsigned int psc1_addr);
extern void suart_mcasp_psc_enable(unsigned int psc1_addr);
extern short suart_asp_serializer_deactivate (unsigned short u16srNum,
arm_pru_iomap * pru_arm_iomap);
extern void suart_mcasp_tx_serialzier_set(unsigned int serializerNum,
arm_pru_iomap * pru_arm_iomap);
#ifdef __cplusplus
} /* End of extern C */
#endif /* #ifdef __cplusplus */
#endif

203
Projects/DirectPRU/include/tistdtypes.h

@ -0,0 +1,203 @@
/*
* Copyright 2008 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/*
* ======== tistdtypes.h ========
*
*/
/*
* These types are also defined by other TI components. They are bracketed
* with _TI_STD_TYPES to avoid warnings for duplicate definition. The
* The Uint16, etc. definitions were provided in early 2.x versions of CSL
* that did not have _TI_STD_TYPES protection.
*
* You may get warnings about duplicate type definitions when using this
* header file with 2.x CSL. You can use the '-pds303' compiler option to
* suppress these warnings.
*/
#ifndef _TISTDTYPES_H_
#define _TISTDTYPES_H_
// Prevent C++ name mangling
#ifdef __cplusplus
extern far "c" {
#endif
/*
* Null declaration
*/
#ifndef NULL
#define NULL (0)
#endif
/*
* Return type defines
*/
#ifndef E_PASS
#define E_PASS (0x00000000u)
#endif
#ifndef E_FAIL
#define E_FAIL (0x00000001u)
#endif
#ifndef E_TIMEOUT
#define E_TIMEOUT (0x00000002u)
#endif
// Aliases for standard C types
typedef int Int;
typedef unsigned Uns;
typedef char Char;
typedef char *String; /* pointer to null-terminated character sequence */
typedef void *Ptr; /* pointer to arbitrary type */
typedef unsigned short Bool; /* boolean */
// Boolean declarations
#ifndef TRUE
#define TRUE ((Bool) 1)
#endif
#ifndef FALSE
#define FALSE ((Bool) 0)
#endif
// GENERIC BUS width defines
#ifndef BUS_8BIT
#define BUS_8BIT (0x01)
#endif
#ifndef BUS_16BIT
#define BUS_16BIT (0x02)
#endif
#ifndef BUS_32BIT
#define BUS_32BIT (0x04)
#endif
#ifndef BUS_64BIT
#define BUS_64BIT (0x08)
#endif
// Generic bit mask defines
#ifndef BIT0
#define BIT0 (0x00000001)
#define BIT1 (0x00000002)
#define BIT2 (0x00000004)
#define BIT3 (0x00000008)
#define BIT4 (0x00000010)
#define BIT5 (0x00000020)
#define BIT6 (0x00000040)
#define BIT7 (0x00000080)
#define BIT8 (0x00000100)
#define BIT9 (0x00000200)
#define BIT10 (0x00000400)
#define BIT11 (0x00000800)
#define BIT12 (0x00001000)
#define BIT13 (0x00002000)
#define BIT14 (0x00004000)
#define BIT15 (0x00008000)
#define BIT16 (0x00010000)
#define BIT17 (0x00020000)
#define BIT18 (0x00040000)
#define BIT19 (0x00080000)
#define BIT20 (0x00100000)
#define BIT21 (0x00200000)
#define BIT22 (0x00400000)
#define BIT23 (0x00800000)
#define BIT24 (0x01000000)
#define BIT25 (0x02000000)
#define BIT26 (0x04000000)
#define BIT27 (0x08000000)
#define BIT28 (0x10000000)
#define BIT29 (0x20000000)
#define BIT30 (0x40000000)
#define BIT31 (0x80000000)
#endif
/*
* Uint8, Uint16, Uint32, etc are defined to be "smallest unit of
* available storage that is large enough to hold unsigned or integer
* of specified size".
*/
/* Handle the 6x ISA */
#if defined(_TMS320C6X)
/* Unsigned integer definitions (32bit, 16bit, 8bit) follow... */
typedef unsigned int Uint32;
typedef unsigned short Uint16;
typedef unsigned char Uint8;
/* Signed integer definitions (32bit, 16bit, 8bit) follow... */
typedef int Int32;
typedef short Int16;
typedef char Int8;
/* Volatile unsigned integer definitions (32bit, 16bit, 8bit) follow... */
typedef volatile unsigned int VUint32;
typedef volatile unsigned short VUint16;
typedef volatile unsigned char VUint8;
/* Volatile signed integer definitions (32bit, 16bit, 8bit) follow... */
typedef volatile int VInt32;
typedef volatile short VInt16;
typedef volatile char VInt8;
#define __FAR__ far
#define __NEAR__ near
/* Handle the 54x, 55x ISAs */
#elif defined(_TMS320C5XX) || defined(__TMS320C55X__)
/* Unsigned integer definitions (32bit, 16bit, 8bit) follow... */
typedef unsigned long Uint32;
typedef unsigned short Uint16;
typedef unsigned char Uint8;
/* Signed integer definitions (32bit, 16bit, 8bit) follow... */
typedef long Int32;
typedef short Int16;
typedef char Int8;
/* Handle 28x ISA */
#elif defined(_TMS320C28X)
/* Unsigned integer definitions (32bit, 16bit, 8bit) follow... */
typedef unsigned long Uint32;
typedef unsigned int Uint16;
typedef unsigned char Uint8;
/* Signed integer definitions (32bit, 16bit, 8bit) follow... */
typedef long Int32;
typedef int Int16;
typedef char Int8;
/* Handle ARM TMS470 ISA (GNU compiler is assumed to exist for ARM only)*/
#elif (defined(__TMS470__) || defined(__GNUC__))
/* Unsigned integer definitions (32bit, 16bit, 8bit) follow... */
typedef unsigned int Uint32;
typedef unsigned short Uint16;
typedef unsigned char Uint8;
/* Signed integer definitions (32bit, 16bit, 8bit) follow... */
typedef int Int32;
typedef short Int16;
typedef char Int8;
/* Volatile unsigned integer definitions (32bit, 16bit, 8bit) follow... */
typedef volatile unsigned int VUint32;
typedef volatile unsigned short VUint16;
typedef volatile unsigned char VUint8;
/* Volatile signed integer definitions (32bit, 16bit, 8bit) follow... */
typedef volatile int VInt32;
typedef volatile short VInt16;
typedef volatile char VInt8;
/* empty defines */
#define __FAR__
#define __NEAR__
#else
/* Other ISAs not supported */
#error <tistdtypes.h> is not supported for this target
#endif
#ifdef __cplusplus
}
#endif
#endif /* _TISTDTYPES_H_ */

169
Projects/DirectPRU/src/edma.c

@ -0,0 +1,169 @@
/*
* edma.c
*
* User space driver for edma
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* ============================================================================
* Copyright (c) Texas Instruments Inc 2010-11
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied or provided.
* ============================================================================
*/
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdlib.h>
#include <strings.h>
#include "../module/edmautils.h"
#include "edma.h"
#define EDMA_DEVICE "/dev/edma"
#ifdef __DEBUG
#define __D(fmt, args...) fprintf(stderr, "edma Debug: " fmt, ## args)
#else
#define __D(fmt, args...)
#endif
#ifdef __DEBUG
#define __E(fmt, args...) fprintf(stderr, "edma Error: " fmt, ## args)
#else
#define __E(fmt, args...)
#endif
static int refcount, edma_fd = -1;
int
edma_memcpy(int channel, unsigned int dst, unsigned int src,
unsigned int length)
{
memcpyparams_t memcpyparams;
if (edma_fd == -1) {
__E("You must initialize EDMA before making API calls\n");
return -1;
}
memcpyparams.channel = channel;
memcpyparams.srcaddr = src;
memcpyparams.dstaddr = dst;
memcpyparams.len = length;
if (ioctl(edma_fd, EDMADRV_IOCMEMCPY_EDMA, &memcpyparams) == -1) {
__E("%s could not do memcpy using EDMA\n", EDMA_DEVICE);
return -1;
}
return 0;
}
int
edma_memset(int channel, unsigned int dst, unsigned int patternaddr,
unsigned int length)
{
memsetparams_t memsetparams;
if (edma_fd == -1) {
__E("You must initialize EDMA before making API calls\n");
return -1;
}
memsetparams.channel = channel;
memsetparams.patternaddr = patternaddr;
memsetparams.dstaddr = dst;
memsetparams.len = length;
if (ioctl(edma_fd, EDMADRV_IOCMEMSET_EDMA, &memsetparams) == -1) {
__E("%s could not do memcpy using EDMA\n", EDMA_DEVICE);
return -1;
}
return 0;
}
int edma_allocate_channel(int *channel)
{
if (refcount == 0) {
edma_fd = open(EDMA_DEVICE, O_RDWR | O_SYNC); //O_SYNC is essential
if (edma_fd == -1) {
__E("init: Failed to open %s\n", EDMA_DEVICE);
return -1;
}
}
refcount++;
if (ioctl(edma_fd, EDMADRV_IOCALLOC_EDMA, channel) == -1) {
__E("%s could not alloc EDMA channel:%d\n", EDMA_DEVICE, *channel);
return -1;
}
return 0;
}
int edma_free_channel(int channel)
{
int result = 0;
if (edma_fd == -1) {
__E("exit: You must initialize EDMA before making API calls.\n");
result = -1;
goto end;
}
refcount--;
if (ioctl(edma_fd, EDMADRV_IOCFREE_EDMA, &channel) == -1) {
__E("%s could not free EDMA channel: %d\n", EDMA_DEVICE, channel);
result = -1;
}
if (refcount == 0) {
result = close(edma_fd);
edma_fd = -1;
}
end:
return result;
}

329
Projects/DirectPRU/src/edmautils.c

@ -0,0 +1,329 @@
/*
* edma.c
*
* EDMA kernel driver
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
/*
* ============================================================================
* Copyright (c) Texas Instruments Inc 2010-11
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied or provided.
* ============================================================================
*/
#include <linux/module.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/list.h>
#include <linux/cdev.h>
#include <linux/proc_fs.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <asm/page.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/io.h>
#include<asm/system.h>
#include <asm/irq.h>
#include <linux/completion.h>
#include <mach/edma.h>
#include "edmautils.h"
#ifdef __DEBUG
#define __D(fmt, args...) printk(KERN_DEBUG "edma Debug: " fmt, ## args)
#else
#define __D(fmt, args...)
#endif
#define __E(fmt, args...) printk(KERN_ERR "edma Error: " fmt, ## args)
typedef struct _dmacompletion {
int channel;
struct completion completion_evt;
} dmacompletion_t;
static int major = 0, channels_allocated = 0;
static dmacompletion_t edma_completion[MAX_EDMA_CHANNELS];
#if (USE_UDEV==1)
static struct class *edma_class;
#endif //USE_UDEV
/* Forward declaration of system calls */
static int ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long args);
//static int mmap (struct file *filp, struct vm_area_struct *vma);
static int open(struct inode *inode, struct file *filp);
static int release(struct inode *inode, struct file *filp);
static struct file_operations edma_fxns = {
.owner = THIS_MODULE,
ioctl:ioctl,
//mmap:mmap,
open:open,
release:release
};
#if 0
static int mmap(struct file *filp, struct vm_area_struct *vma)
{
__D("mmap: vma->vm_start = %#lx\n", vma->vm_start);
__D("mmap: vma->vm_pgoff = %#lx\n", vma->vm_pgoff);
__D("mmap: vma->vm_end = %#lx\n", vma->vm_end);
__D("mmap: size = %#lx\n", vma->vm_end - vma->vm_start);
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
if (remap_pfn_range(vma, vma->vm_start,
vma->vm_pgoff,
vma->vm_end - vma->vm_start, vma->vm_page_prot)) {
__E("mmap: failed remap_pfn_range\n");
return -EAGAIN;
}
return 0;
}
#endif
static void edma_callback(unsigned channel, u16 ch_status, void *data)
{
int i;
edma_stop(channel);
for (i = 0; i < MAX_EDMA_CHANNELS; i++) {
if (edma_completion[i].channel == channel)
break;
}
if (i < MAX_EDMA_CHANNELS)
complete(&edma_completion[i].completion_evt);
}
int EDMAAlloc(void)
{
int channel, i;
if (channels_allocated >= MAX_EDMA_CHANNELS)
return -EFAULT;
channel = edma_alloc_channel(EDMA_CHANNEL_ANY, &edma_callback, NULL,
EVENTQ_1);
edma_set_src_index(channel, 0, 0);
edma_set_dest_index(channel, 0, 0);
for (i = 0; i < MAX_EDMA_CHANNELS; i++) {
if (edma_completion[i].channel == -1)
break;
}
edma_completion[i].channel = channel;
channels_allocated++;
return channel;
}
int EDMAFree(unsigned int channel)
{
int i;
edma_free_channel(channel);
for (i = 0; i < MAX_EDMA_CHANNELS; i++) {
if (edma_completion[i].channel == channel)
break;
}
if (i == MAX_EDMA_CHANNELS)
return -EFAULT;
edma_completion[i].channel = -1;
channels_allocated--;
return 0;
}
int EDMAMemCpy(memcpyparams_t memcpyparams)
{
struct edmacc_param p_ram;
int i;
edma_set_src(memcpyparams.channel, memcpyparams.srcaddr, INCR, W8BIT);
edma_set_dest(memcpyparams.channel, memcpyparams.dstaddr, INCR, W8BIT);
edma_set_transfer_params(memcpyparams.channel, memcpyparams.len, 1,
1, 0, ASYNC);
edma_read_slot(memcpyparams.channel, &p_ram);
p_ram.opt |= TCINTEN | EDMA_TCC(EDMA_CHAN_SLOT(memcpyparams.channel));
edma_write_slot(memcpyparams.channel, &p_ram);
edma_start(memcpyparams.channel);
for (i = 0; i < MAX_EDMA_CHANNELS; i++) {
if (edma_completion[i].channel == memcpyparams.channel)
break;
}
if (i == MAX_EDMA_CHANNELS)
return -EFAULT;
wait_for_completion_interruptible(&edma_completion[i].completion_evt);
return 0;
}
int EDMAMemSet(memsetparams_t memsetparams)
{
struct edmacc_param p_ram;
int i;
edma_set_src(memsetparams.channel, memsetparams.patternaddr, FIFO,
W8BIT);
edma_set_dest(memsetparams.channel, memsetparams.dstaddr, INCR, W8BIT);
edma_set_transfer_params(memsetparams.channel, memsetparams.len, 1,
1, 0, ASYNC);
edma_read_slot(memsetparams.channel, &p_ram);
p_ram.opt |= TCINTEN | EDMA_TCC(EDMA_CHAN_SLOT(memsetparams.channel));
edma_write_slot(memsetparams.channel, &p_ram);
edma_start(memsetparams.channel);
for (i = 0; i < MAX_EDMA_CHANNELS; i++) {
if (edma_completion[i].channel == memsetparams.channel)
break;
}
if (i == MAX_EDMA_CHANNELS)
return -EFAULT;
wait_for_completion_interruptible(&edma_completion[i].completion_evt);
return 0;
}
static int
ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
unsigned long args)
{
unsigned int __user *argp = (unsigned int __user *) args;
int channel;
switch (cmd) {
case EDMADRV_IOCMEMCPY_EDMA:
{
memcpyparams_t memcpy_params;
if (copy_from_user
(&memcpy_params, argp, sizeof(memcpy_params))) {
__E("MEMCPY_EDMA failed\n");
return -EFAULT;
}
return EDMAMemCpy(memcpy_params);
}
break;
case EDMADRV_IOCMEMSET_EDMA:
{
memsetparams_t memset_params;
if (copy_from_user
(&memset_params, argp, sizeof(memset_params))) {
__E("MEMSET_EDMA failed\n");
return -EFAULT;
}
return EDMAMemSet(memset_params);
}
break;
case EDMADRV_IOCALLOC_EDMA:
{
channel = EDMAAlloc();
if (put_user(channel, argp)) {
__E("ALLOC_ARMEDMA - put_user failed\n");
return -EFAULT;
}
return 0;
}
break;
case EDMADRV_IOCFREE_EDMA:
{
if (get_user(channel, argp)) {
__E("FREE_ARMEDMA - get_user failed\n");
return -EFAULT;
}
EDMAFree(channel);
return 0;
}
break;
default:
__E("Unknown ioctl received = %d.\n", cmd);
return -EINVAL;
}
return 0;
}
static int open(struct inode *inode, struct file *filp)
{
__D("open: called.\n");
return 0;
}
static int release(struct inode *inode, struct file *filp)
{
__D("close: called.");
return 0;
}
int __init edma_init(void)
{
int i;
__D("** EDMA kernel module built: " __DATE__ " " __TIME__ "\n");
major = register_chrdev(DRIVER_MAJOR, "edma", &edma_fxns);
if (major < 0) {
__E("Failed to allocate major number.\n");
return -ENODEV;
}
#if (USE_UDEV==1)
edma_class = class_create(THIS_MODULE, "edma");
if (IS_ERR(edma_class)) {
__E("Error creating edma device class.\n");
return -EIO;
}
device_create(edma_class, NULL, MKDEV(major, 0), NULL, "edma");
#endif //USE_UDEV
for (i = 0; i < MAX_EDMA_CHANNELS; i++) {
init_completion(&edma_completion[i].completion_evt);
edma_completion[i].channel = -1;
}
return 0;
}
void __exit edma_exit(void)
{
#if (USE_UDEV==1)
device_destroy(edma_class, MKDEV(major, 0));
class_destroy(edma_class);
#endif // USE_UDEV
unregister_chrdev(major, "edma");
}
module_init(edma_init);
module_exit(edma_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Texas Instruments");
MODULE_DESCRIPTION("EDMA usercopy driver");

317
Projects/DirectPRU/src/pru.c

@ -0,0 +1,317 @@
/*
* pru/hal/uart/src/pru.c
*
* Copyright (C) 2010 Texas Instruments Incorporated
* Author: Jitendra Kumar <jitendra@mistralsolutions.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
* whether express or implied; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
/************************************************************
* Include Files *
************************************************************/
#include "tistdtypes.h"
#include "csl/cslr.h"
#include "csl/soc_OMAPL138.h"
#include "csl/cslr_prucore.h"
#include "csl/cslr_psc_OMAPL138.h"
#include "pru.h"
/************************************************************
* Local Function Declarations *
************************************************************/
static void pru_psc_disable(arm_pru_iomap * pru_arm_iomap);
static void pru_psc_enable(arm_pru_iomap * pru_arm_iomap);
// Load the specified PRU with code
Uint32 pru_load(Uint8 pruNum, Uint32 * pruCode, Uint32 codeSizeInWords,
arm_pru_iomap * pru_arm_iomap)
{
Uint32 *pruIram;
Uint32 i;
if (pruNum == CSL_PRUCORE_0) {
pruIram = (Uint32 *) ((Uint32 )pru_arm_iomap->pru_io_addr + 0x8000);
} else if (pruNum == CSL_PRUCORE_1) {
pruIram = (Uint32 *) ((Uint32 )pru_arm_iomap->pru_io_addr + 0xc000);
} else {
return E_FAIL;
}
pru_enable(pruNum, pru_arm_iomap);
// Copy dMAX code to its instruction RAM
for (i = 0; i < codeSizeInWords; i++) {
pruIram[i] = pruCode[i];
}
return E_PASS;
}
Uint32 pru_run(Uint8 pruNum, arm_pru_iomap * pru_arm_iomap)
{
CSL_PrucoreRegsOvly hPru;
if (pruNum == CSL_PRUCORE_0) {
hPru = (CSL_PrucoreRegsOvly) ((Uint32 )pru_arm_iomap->pru_io_addr + 0x7000); //CSL_PRUCORE_0_REGS;
} else if (pruNum == CSL_PRUCORE_1) {
hPru = (CSL_PrucoreRegsOvly) ((Uint32 )pru_arm_iomap->pru_io_addr + 0x7800); //CSL_PRUCORE_1_REGS;
} else {
return E_FAIL;
}
// Enable dMAX, let it execute the code we just copied
CSL_FINST(hPru->CONTROL, PRUCORE_CONTROL_COUNTENABLE, ENABLE);
CSL_FINST(hPru->CONTROL, PRUCORE_CONTROL_ENABLE, ENABLE);
return E_PASS;
}
Uint32 pru_waitForHalt(Uint8 pruNum, Int32 timeout,
arm_pru_iomap * pru_arm_iomap)
{
CSL_PrucoreRegsOvly hPru;
Int32 cnt = timeout;
if (pruNum == CSL_PRUCORE_0) {
hPru = (CSL_PrucoreRegsOvly) ((Uint32 )pru_arm_iomap->pru_io_addr + 0x7000); //CSL_PRUCORE_0_REGS;
} else if (pruNum == CSL_PRUCORE_1) {
hPru = (CSL_PrucoreRegsOvly) ((Uint32 )pru_arm_iomap->pru_io_addr + 0x7800); //CSL_PRUCORE_1_REGS;
} else {
return E_FAIL;
}
while (CSL_FEXT(hPru->CONTROL, PRUCORE_CONTROL_RUNSTATE) ==
CSL_PRUCORE_CONTROL_RUNSTATE_RUN) {
if (cnt > 0) {
cnt--;
}
if (cnt == 0) {
return E_TIMEOUT;
}
}
return E_PASS;
}
Uint32 pru_disable(arm_pru_iomap * pru_arm_iomap)
{
CSL_PrucoreRegsOvly hPru;
// Disable PRU0
hPru = (CSL_PrucoreRegsOvly) ((Uint32 )pru_arm_iomap->pru_io_addr + 0x7000); //CSL_PRUCORE_0_REGS;
CSL_FINST(hPru->CONTROL, PRUCORE_CONTROL_COUNTENABLE, DISABLE);
CSL_FINST(hPru->CONTROL, PRUCORE_CONTROL_ENABLE, DISABLE);
// Reset PRU0
hPru->CONTROL = CSL_PRUCORE_CONTROL_RESETVAL;
// Disable PRU1
hPru = (CSL_PrucoreRegsOvly) ((Uint32 )pru_arm_iomap->pru_io_addr + 0x7800); //CSL_PRUCORE_1_REGS;
CSL_FINST(hPru->CONTROL, PRUCORE_CONTROL_COUNTENABLE, DISABLE);
CSL_FINST(hPru->CONTROL, PRUCORE_CONTROL_ENABLE, DISABLE);
// Reset PRU1
hPru->CONTROL = CSL_PRUCORE_CONTROL_RESETVAL;
// Disable PRU SS
pru_psc_disable(pru_arm_iomap);
return E_PASS;
}
Uint32 pru_enable(Uint8 pruNum, arm_pru_iomap * pru_arm_iomap)
{
CSL_PrucoreRegsOvly hPru;
// Enable PRU SS
pru_psc_enable(pru_arm_iomap);
if (pruNum == CSL_PRUCORE_0) {
// Reset PRU0
hPru = (CSL_PrucoreRegsOvly) ((Uint32 )pru_arm_iomap->pru_io_addr + 0x7000); //CSL_PRUCORE_0_REGS;
hPru->CONTROL = CSL_PRUCORE_CONTROL_RESETVAL;
} else if (pruNum == CSL_PRUCORE_1) {
// Reset PRU1
hPru = (CSL_PrucoreRegsOvly) ((Uint32 )pru_arm_iomap->pru_io_addr + 0x7800); //CSL_PRUCORE_1_REGS;
hPru->CONTROL = CSL_PRUCORE_CONTROL_RESETVAL;
}
return E_PASS;
}
/************************************************************
* Local Function Definitions *
************************************************************/
static void pru_psc_enable(arm_pru_iomap * pru_arm_iomap)
{
CSL_PscRegsOvly PSC = (CSL_PscRegsOvly) pru_arm_iomap->psc0_io_addr; //CSL_PSC_0_REGS;
// Wait for any outstanding transition to complete
while (CSL_FEXT(PSC->PTSTAT, PSC_PTSTAT_GOSTAT0) ==
CSL_PSC_PTSTAT_GOSTAT0_IN_TRANSITION) ;
// If we are already in that state, just return
if (CSL_FEXT(PSC->MDSTAT[CSL_PSC_PRU], PSC_MDSTAT_STATE) ==
CSL_PSC_MDSTAT_STATE_ENABLE)
return;
// Perform transition
CSL_FINST(PSC->MDCTL[CSL_PSC_PRU], PSC_MDCTL_NEXT, ENABLE);
CSL_FINST(PSC->PTCMD, PSC_PTCMD_GO0, SET);
// Wait for transition to complete
while (CSL_FEXT(PSC->PTSTAT, PSC_PTSTAT_GOSTAT0) ==
CSL_PSC_PTSTAT_GOSTAT0_IN_TRANSITION) ;
// Wait and verify the state
while (CSL_FEXT(PSC->MDSTAT[CSL_PSC_PRU], PSC_MDSTAT_STATE) !=
CSL_PSC_MDSTAT_STATE_ENABLE) ;
}
static void pru_psc_disable(arm_pru_iomap * pru_arm_iomap)
{
CSL_PscRegsOvly PSC = (CSL_PscRegsOvly) pru_arm_iomap->psc0_io_addr; //CSL_PSC_0_REGS;
// Wait for any outstanding transition to complete
while (CSL_FEXT(PSC->PTSTAT, PSC_PTSTAT_GOSTAT0) ==
CSL_PSC_PTSTAT_GOSTAT0_IN_TRANSITION) ;
// If we are already in that state, just return
if (CSL_FEXT(PSC->MDSTAT[CSL_PSC_PRU], PSC_MDSTAT_STATE) ==
CSL_PSC_MDSTAT_STATE_SYNCRST)
return;
// Perform transition
CSL_FINST(PSC->MDCTL[CSL_PSC_PRU], PSC_MDCTL_NEXT, SYNCRST);
CSL_FINST(PSC->PTCMD, PSC_PTCMD_GO0, SET);
// Wait for transition to complete
while (CSL_FEXT(PSC->PTSTAT, PSC_PTSTAT_GOSTAT0) ==
CSL_PSC_PTSTAT_GOSTAT0_IN_TRANSITION) ;
// Wait and verify the state
while (CSL_FEXT(PSC->MDSTAT[CSL_PSC_PRU], PSC_MDSTAT_STATE) !=
CSL_PSC_MDSTAT_STATE_SYNCRST) ;
}
/***********************************************************
* End file *
***********************************************************/
/** ********************************************************************************************************
* \brief 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
*
* \param u32offset Offset of the data RAM where the data has to be written
* \param pu32datatowrite Pointer to a buffer that holds the data to be written into RAM
* \param u16wordstowrite Number of bytes to be written into that RAM
*
* \return SUCCESS or FAILURE
*
***********************************************************************************************************/
short pru_ram_write_data
(Uint32 u32offset,
Uint8 * pu8datatowrite,
Uint16 u16bytestowrite, arm_pru_iomap * pru_arm_iomap) {
Uint8 *pu8addresstowrite;
Uint16 u16loop;
u32offset = (unsigned int)pru_arm_iomap->pru_io_addr + u32offset;
pu8addresstowrite = (Uint8 *) (u32offset);
for (u16loop = 0; u16loop < u16bytestowrite; u16loop++)
*pu8addresstowrite++ = *pu8datatowrite++;
return 0;
}
/** ********************************************************************************************************
* \brief 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
*
* \param u32offset Offset of the data RAM where the data has to be read
* \param pu8datatoread Pointer to a buffer that would hold the data to be read from the RAM
* \param u16bytestoread Number of bytes to be read from RAM
*
* \return SUCCESS or FAILURE
*
***********************************************************************************************************/
short pru_ram_read_data
(Uint32 u32offset,
Uint8 * pu8datatoread,
Uint16 u16bytestoread, arm_pru_iomap * pru_arm_iomap) {
Uint8 *pu8addresstoread;
Uint16 u16loop;
u32offset = (unsigned int)pru_arm_iomap->pru_io_addr + u32offset;
pu8addresstoread = (Uint8 *) (u32offset);
for (u16loop = 0; u16loop < u16bytestoread; u16loop++)
*pu8datatoread++ = *pu8addresstoread++;
return 0;
}
/** ********************************************************************************************************
* \brief 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
*
* \param u32offset Offset of the data RAM where the data has to be written
* \param pu32datatowrite Pointer to a buffer that holds the data to be written into RAM
* \param u16wordstowrite Number of words to be written into that RAM
*
* \r//eturn SUCCESS or FAILURE
*
***********************************************************************************************************/
short pru_ram_write_data_4byte(unsigned int u32offset,
unsigned int *pu32datatowrite,
short u16wordstowrite)
{
unsigned int *pu32addresstowrite;
short u16loop;
pu32addresstowrite = (unsigned int *)(u32offset);
for (u16loop = 0; u16loop < u16wordstowrite; u16loop++)
*pu32addresstowrite++ = *pu32datatowrite++;
return 0;
}
/** ********************************************************************************************************
* \brief 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
*
* \param u32offset Offset of the data RAM where the data has to be read
* \param pu32datatoread Pointer to a buffer that would hold the data to be read from the RAM
* \param u16wordstoread Number of words to be read from RAM
*
* \return SUCCESS or FAILURE
*
***********************************************************************************************************/
short pru_ram_read_data_4byte(unsigned int u32offset,
unsigned int *pu32datatoread,
short u16wordstoread)
{
unsigned int *pu32addresstoread;
short u16loop;
pu32addresstoread = (unsigned int *)(u32offset);
for (u16loop = 0; u16loop < u16wordstoread; u16loop++)
*pu32datatoread++ = *pu32addresstoread++;
return 0;
}

538
Projects/DirectPRU/src/prussdrv.c

@ -0,0 +1,538 @@
/*
* prussdrv.c
*
* User space driver for PRUSS
*
* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
/*
* ============================================================================
* Copyright (c) Texas Instruments Inc 2010-11
*
* Use of this software is controlled by the terms and conditions found in the
* license agreement under which this software has been supplied or provided.
* ============================================================================
*/
#include <prussdrv.h>
#include "__prussdrv.h"
#include <pthread.h>
static tprussdrv prussdrv;
static pthread_mutex_t prussdrv_send_event_mutex = PTHREAD_MUTEX_INITIALIZER;
//static pthread_mutex_t prussdrv_clear_event_mutex = PTHREAD_MUTEX_INITIALIZER;
int __prussdrv_memmap_init( void ){
int i, fd;
char hexstring[20];
if( prussdrv.mmap_fd == 0 ){
for (i = 0; i < NUM_PRU_HOSTIRQS; i++) {
if (prussdrv.fd[i])
break;
}
if (i == NUM_PRU_HOSTIRQS)
return -1;
else
prussdrv.mmap_fd = prussdrv.fd[i];
}
fd = open(PRUSS_UIO_DRV_PRUSS_BASE, O_RDONLY);
if (fd >= 0) {
read(fd, hexstring, 20);
pruss_phys_base = strtoul(hexstring, NULL, 16);
close(fd);
} else
return -1;
fd = open(PRUSS_UIO_DRV_PRUSS_SIZE, O_RDONLY);
if (fd >= 0) {
read(fd, hexstring, 20);
pruss_map_size = strtoul(hexstring, NULL, 16);
close(fd);
} else
return -1;
prussdrv.pru0dataram_base =
mmap(0, pruss_map_size, PROT_READ | PROT_WRITE, MAP_SHARED,
prussdrv.mmap_fd, pruss_phys_base);
prussdrv.pru1dataram_base =
prussdrv.pru0dataram_base + (DATARAM1_PHYS_BASE -
DATARAM0_PHYS_BASE);
prussdrv.intc_base =
prussdrv.pru0dataram_base + (INTC_PHYS_BASE - DATARAM0_PHYS_BASE);
prussdrv.pru0control_base =
prussdrv.pru0dataram_base + (PRU0CONTROL_PHYS_BASE -
DATARAM0_PHYS_BASE);
prussdrv.pru0debug_base =
prussdrv.pru0dataram_base + (PRU0DEBUG_PHYS_BASE -
DATARAM0_PHYS_BASE);
prussdrv.pru1control_base =
prussdrv.pru0dataram_base + (PRU1CONTROL_PHYS_BASE -
DATARAM0_PHYS_BASE);
prussdrv.pru1debug_base =
prussdrv.pru0dataram_base + (PRU1DEBUG_PHYS_BASE -
DATARAM0_PHYS_BASE);
prussdrv.pru0iram_base =
prussdrv.pru0dataram_base + (PRU0IRAM_PHYS_BASE -
DATARAM0_PHYS_BASE);
prussdrv.pru1iram_base =
prussdrv.pru0dataram_base + (PRU1IRAM_PHYS_BASE -
DATARAM0_PHYS_BASE);
fd = open(PRUSS_UIO_DRV_L3RAM_BASE, O_RDONLY);
if (fd >= 0) {
read(fd, hexstring, 20);
l3ram_phys_base = strtoul(hexstring, NULL, 16);
close(fd);
} else
return -1;
fd = open(PRUSS_UIO_DRV_L3RAM_SIZE, O_RDONLY);
if (fd >= 0) {
read(fd, hexstring, 20);
l3ram_map_size = strtoul(hexstring, NULL, 16);
close(fd);
} else
return -1;
prussdrv.l3ram_base =
mmap(0, l3ram_map_size, PROT_READ | PROT_WRITE, MAP_SHARED,
prussdrv.mmap_fd, l3ram_phys_base);
fd = open(PRUSS_UIO_DRV_EXTRAM_BASE, O_RDONLY);
if (fd >= 0) {
read(fd, hexstring, 20);
extram_phys_base = strtoul(hexstring, NULL, 16);
close(fd);
} else
return -1;
fd = open(PRUSS_UIO_DRV_EXTRAM_SIZE, O_RDONLY);
if (fd >= 0) {
read(fd, hexstring, 20);
extram_map_size = strtoul(hexstring, NULL, 16);
close(fd);
} else
return -1;
prussdrv.extram_base =
mmap(0, extram_map_size, PROT_READ | PROT_WRITE, MAP_SHARED,
prussdrv.mmap_fd, extram_phys_base);
return 0;
}
int prussdrv_init(void)
{
memset(&prussdrv, 0, sizeof(prussdrv));
return 0;
}
int prussdrv_open(unsigned int pru_evtout_num)
{
char name[128];
sprintf(name, "/dev/uio%d", pru_evtout_num);
prussdrv.fd[pru_evtout_num] = open(name, O_RDWR | O_SYNC);
return __prussdrv_memmap_init();
}
int prussdrv_pru_reset(unsigned int prunum)
{
unsigned int *prucontrolregs;
if (prunum == 0)
prucontrolregs = (unsigned int *) prussdrv.pru0control_base;
else if (prunum == 1)
prucontrolregs = (unsigned int *) prussdrv.pru1control_base;
else
return -1;
*prucontrolregs = 0;
return 0;
}
int prussdrv_pru_enable(unsigned int prunum)
{
unsigned int *prucontrolregs;
if (prunum == 0)
prucontrolregs = (unsigned int *) prussdrv.pru0control_base;
else if (prunum == 1)
prucontrolregs = (unsigned int *) prussdrv.pru1control_base;
else
return -1;
*prucontrolregs = 2;
return 0;
}
int prussdrv_pru_disable(unsigned int prunum)
{
unsigned int *prucontrolregs;
if (prunum == 0)
prucontrolregs = (unsigned int *) prussdrv.pru0control_base;
else if (prunum == 1)
prucontrolregs = (unsigned int *) prussdrv.pru1control_base;
else
return -1;
*prucontrolregs = 1;
return 0;
}
int prussdrv_pru_write_memory(unsigned int pru_ram_id,
unsigned int wordoffset,
unsigned int *memarea,
unsigned int bytelength)
{
unsigned int *pruramarea, i, wordlength;
switch (pru_ram_id) {
case PRUSS0_PRU0_IRAM:
pruramarea = (unsigned int *) prussdrv.pru0iram_base;
break;
case PRUSS0_PRU1_IRAM:
pruramarea = (unsigned int *) prussdrv.pru1iram_base;
break;
case PRUSS0_PRU0_DATARAM:
pruramarea = (unsigned int *) prussdrv.pru0dataram_base;
break;
case PRUSS0_PRU1_DATARAM:
pruramarea = (unsigned int *) prussdrv.pru1dataram_base;
break;
default:
return -1;
}
wordlength = (bytelength + 3) >> 2; //Adjust length as multiple of 4 bytes
for (i = 0; i < wordlength; i++) {
*(pruramarea + i + wordoffset) = *(memarea + i);
}
return wordlength;
}
int prussdrv_pruintc_init(tpruss_intc_initdata * prussintc_init_data)
{
unsigned int *pruintc_io = (unsigned int *) prussdrv.intc_base;
unsigned int i, mask1, mask2;
pruintc_io[PRU_INTC_SIPR1_REG >> 2] = 0xFFFFFFFF;
pruintc_io[PRU_INTC_SIPR2_REG >> 2] = 0xFFFFFFFF;
for (i = 0; i < (NUM_PRU_SYS_EVTS + 3) >> 2; i++)
pruintc_io[(PRU_INTC_CMR1_REG >> 2) + i] = 0;
for (i = 0;
((prussintc_init_data->sysevt_to_channel_map[i].sysevt != -1)
&& (prussintc_init_data->sysevt_to_channel_map[i].channel !=
-1)); i++) {
__prussintc_set_cmr(pruintc_io,
prussintc_init_data->
sysevt_to_channel_map[i].sysevt,
prussintc_init_data->
sysevt_to_channel_map[i].channel);
}
for (i = 0; i < (NUM_PRU_HOSTS + 3) >> 2; i++)
pruintc_io[(PRU_INTC_HMR1_REG >> 2) + i] = 0;
for (i = 0;
((prussintc_init_data->channel_to_host_map[i].channel != -1)
&& (prussintc_init_data->channel_to_host_map[i].host != -1));
i++) {
__prussintc_set_hmr(pruintc_io,
prussintc_init_data->
channel_to_host_map[i].channel,
prussintc_init_data->
channel_to_host_map[i].host);
}
pruintc_io[PRU_INTC_SITR1_REG >> 2] = 0x0;
pruintc_io[PRU_INTC_SITR2_REG >> 2] = 0x0;
mask1 = mask2 = 0;
for (i = 0; prussintc_init_data->sysevts_enabled[i] != 255; i++) {
if (prussintc_init_data->sysevts_enabled[i] < 32) {
mask1 =
mask1 + (1 << (prussintc_init_data->sysevts_enabled[i]));
} else if (prussintc_init_data->sysevts_enabled[i] < 64) {
mask2 =
mask2 +
(1 << (prussintc_init_data->sysevts_enabled[i] - 32));
} else {
printf("Error: SYS_EVT%d out of range\n",
prussintc_init_data->sysevts_enabled[i]);
return -1;
}
}
pruintc_io[PRU_INTC_ESR1_REG >> 2] = mask1;
pruintc_io[PRU_INTC_SECR1_REG >> 2] = mask1;
pruintc_io[PRU_INTC_ESR2_REG >> 2] = mask2;
pruintc_io[PRU_INTC_SECR2_REG >> 2] = mask2;
pruintc_io[PRU_INTC_HIER_REG >> 2] =
(prussintc_init_data->host_enable_bitmask) & 0x3FF;
pruintc_io[PRU_INTC_GER_REG >> 2] = 0x1;
return 0;
}
int prussdrv_pru_send_event(unsigned int eventnum)
{
unsigned int *pruintc_io = (unsigned int *) prussdrv.intc_base;
// pthread_mutex_lock (&prussdrv_send_event_mutex);
pruintc_io[PRU_INTC_SRSR2_REG >> 2] = 1 << (eventnum - 32);
//pthread_mutex_unlock (&prussdrv_send_event_mutex);
return 0;
}
int prussdrv_pru_wait_event(unsigned int pru_evtout_num)
{
int event_count;
return (read(prussdrv.fd[pru_evtout_num], &event_count, sizeof(int)));
}
int prussdrv_pru_clear_event(unsigned int eventnum)
{
unsigned int *pruintc_io = (unsigned int *) prussdrv.intc_base;
//pthread_mutex_lock (&prussdrv_clear_event_mutex);
pruintc_io[PRU_INTC_SECR2_REG >> 2] = 1 << (eventnum - 32);
//pthread_mutex_unlock (&prussdrv_clear_event_mutex);
return 0;
}
int prussdrv_pru_send_wait_clear_event(unsigned int send_eventnum,
unsigned int pru_evtout_num,
unsigned int ack_eventnum)
{
pthread_mutex_lock(&prussdrv_send_event_mutex);
prussdrv_pru_send_event(send_eventnum);
prussdrv_pru_wait_event(pru_evtout_num);
prussdrv_pru_clear_event(ack_eventnum);
pthread_mutex_unlock(&prussdrv_send_event_mutex);
return 0;
}
int prussdrv_map_l3mem(void **address)
{
*address = prussdrv.l3ram_base;
return 0;
}
int prussdrv_map_extmem(void **address)
{
*address = prussdrv.extram_base;
return 0;
}
int prussdrv_map_prumem(unsigned int pru_ram_id, void **address)
{
switch (pru_ram_id) {
case PRUSS0_PRU0_DATARAM:
*address = prussdrv.pru0dataram_base;
break;
case PRUSS0_PRU1_DATARAM:
*address = prussdrv.pru1dataram_base;
default:
return -1;
}
return 0;
}
unsigned int prussdrv_get_phys_addr(void *address)
{
unsigned int retaddr = 0;
if ((address >= prussdrv.pru0dataram_base)
&& (address < prussdrv.pru0dataram_base + PRUSS_DATARAM_SIZE)) {
retaddr =
((unsigned int) (address - prussdrv.pru0dataram_base) +
DATARAM0_PHYS_BASE);
} else if ((address >= prussdrv.pru1dataram_base)
&& (address <
prussdrv.pru1dataram_base + PRUSS_DATARAM_SIZE)) {
retaddr =
((unsigned int) (address - prussdrv.pru1dataram_base) +
DATARAM1_PHYS_BASE);
} else if ((address >= prussdrv.l3ram_base)
&& (address < prussdrv.l3ram_base + l3ram_map_size)) {
retaddr =
((unsigned int) (address - prussdrv.l3ram_base) +
l3ram_phys_base);
} else if ((address >= prussdrv.extram_base)
&& (address < prussdrv.extram_base + extram_map_size)) {
retaddr =
((unsigned int) (address - prussdrv.extram_base) +
extram_phys_base);
}
return retaddr;
}
void *prussdrv_get_virt_addr(unsigned int phyaddr)
{
void *address = 0;
if ((phyaddr >= DATARAM0_PHYS_BASE)
&& (phyaddr < DATARAM0_PHYS_BASE + PRUSS_DATARAM_SIZE)) {
address =
(void *) ((unsigned int) prussdrv.pru0dataram_base +
(phyaddr - DATARAM0_PHYS_BASE));
} else if ((phyaddr >= DATARAM1_PHYS_BASE)
&& (phyaddr < DATARAM1_PHYS_BASE + PRUSS_DATARAM_SIZE)) {
address =
(void *) ((unsigned int) prussdrv.pru1dataram_base +
(phyaddr - DATARAM1_PHYS_BASE));
} else if ((phyaddr >= l3ram_phys_base)
&& (phyaddr < l3ram_phys_base + l3ram_map_size)) {
address =
(void *) ((unsigned int) prussdrv.l3ram_base +
(phyaddr - l3ram_phys_base));
} else if ((phyaddr >= extram_phys_base)
&& (phyaddr < extram_phys_base + extram_map_size)) {
address =
(void *) ((unsigned int) prussdrv.extram_base +
(phyaddr - extram_phys_base));
}
return address;
}
int prussdrv_exit()
{
int i;
munmap(prussdrv.pru0dataram_base, pruss_map_size);
munmap(prussdrv.l3ram_base, l3ram_map_size);
munmap(prussdrv.extram_base, extram_map_size);
for (i = 0; i < NUM_PRU_HOSTIRQS; i++) {
if (prussdrv.fd[i])
close(prussdrv.fd[i]);
if (prussdrv.irq_thread[i])
pthread_join(prussdrv.irq_thread[i], NULL);
}
return 0;
}
int prussdrv_exec_program(int prunum, char *filename)
{
FILE *fPtr;
unsigned char fileDataArray[PRUSS_IRAM_SIZE];
int fileSize = 0;
unsigned int pru_ram_id;
if (prunum == 0)
pru_ram_id = PRUSS0_PRU0_IRAM;
else if (prunum == 1)
pru_ram_id = PRUSS0_PRU1_IRAM;
else
return -1;
// Open an File from the hard drive
fPtr = fopen(filename, "rb");
if (fPtr == NULL) {
printf("File %s open failed\n", filename);
} else {
printf("File %s open passed\n", filename);
}
// Read file size
fseek(fPtr, 0, SEEK_END);
fileSize = ftell(fPtr);
if (fileSize == 0) {
printf("File read failed.. Closing program\n");
fclose(fPtr);
return -1;
}
fseek(fPtr, 0, SEEK_SET);
if (fileSize !=
fread((unsigned char *) fileDataArray, 1, fileSize, fPtr)) {
printf("WARNING: File Size mismatch\n");
}
fclose(fPtr);
// Make sure PRU sub system is first disabled/reset
prussdrv_pru_disable(prunum);
prussdrv_pru_write_memory(pru_ram_id, 0,
(unsigned int *) fileDataArray, fileSize);
prussdrv_pru_enable(prunum);
return 0;
}
int prussdrv_start_irqthread(unsigned int pru_evtout_num, int priority,
prussdrv_function_handler irqhandler)
{
pthread_attr_t pthread_attr;
struct sched_param sched_param;
pthread_attr_init(&pthread_attr);
if (priority != 0) {
pthread_attr_setinheritsched(&pthread_attr,
PTHREAD_EXPLICIT_SCHED);
pthread_attr_setschedpolicy(&pthread_attr, SCHED_FIFO);
sched_param.sched_priority = priority;
pthread_attr_setschedparam(&pthread_attr, &sched_param);
}
pthread_create(&prussdrv.irq_thread[pru_evtout_num], &pthread_attr,
irqhandler, NULL);
pthread_attr_destroy(&pthread_attr);
return 0;
}

1936
Projects/DirectPRU/src/suart_api.c
File diff suppressed because it is too large
View File

443
Projects/DirectPRU/src/suart_utils.c

@ -0,0 +1,443 @@
/*
* pru/hal/uart/src/suart_utils.c
*
* Copyright (C) 2010 Texas Instruments Incorporated
* Author: Jitendra Kumar <jitendra@mistralsolutions.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any kind,
* whether express or implied; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
/*
*====================
* Includes
*====================
*/
#include "suart_pru_regs.h"
#include "omapl_suart_board.h"
#include "suart_api.h"
#include "suart_utils.h"
#include "suart_err.h"
#include "pru.h"
#include "csl/soc_OMAPL138.h"
#include "csl/cslr_dspintc.h"
#include "csl/cslr_mcasp.h"
#include "csl/cslr_psc_OMAPL138.h"
#define SUART_TRX_DIV_CONF_SZ 4
static short suart_mcasp_tx_baud_set(unsigned int txBaudValue,
arm_pru_iomap * pru_arm_iomap);
static short suart_mcasp_rx_baud_set(unsigned int rxBaudValue,
unsigned int oversampling,
arm_pru_iomap * pru_arm_iomap);
/*
* Lookup table for TX baud rate
* The divisor value is calculated using the formula
*
* ACLKX = (AUXCLK)/(CLKXDIV * HCLKXDIV)
*
* Where
* CLKXDIV takes values from 1-32
* HCLKXDIV takes values from 1-4096
* Here
* AUXCLK = 24MHz
*/
unsigned int lt_tx_baud_rate[][SUART_TRX_DIV_CONF_SZ] = {
/*BaudRate, Divisor, CLKXDIV, HCLKXDIV */
{300, 80000, 24, 3200},
{600, 40000, 15, 2500},
{1800, 13333, 10, 1212},
{2400, 10000, 4, 2000},
{4800, 5000, 1, 2500},
{7200, 3333, 0, 3333},
{9600, 2500, 0, 2500},
{14400, 1666, 0, 1666},
{19200, 1250, 0, 1250},
{38400, 625, 0, 625},
{57600, 416, 0, 416},
{115200, 208, 0, 208},
{230400, 104, 0, 104}
};
/*
* Lookup table for RX baud rate for 8 bit oversampling
* The divisor value is calculated using the formula
*
* ACLKR = (AUXCLK)/(CLKRDIV * HCLKRDIV) * Oversampling
*
* Where
* CLKRDIV takes values from 1-32
* HCLKRDIV takes values from 1-4096
* Here
* AUXCLK = 24MHz
*/
unsigned int lt_rx_8x_baud_rate[][SUART_TRX_DIV_CONF_SZ] = {
/*BaudRate, Divisor, CLKXDIV, HCLKXDIV */
{300, 10000, 4, 2000},
{600, 5000, 1, 2500},
{1800, 1667, 0, 1667},
{2400, 1250, 0, 1250},
{7200, 417, 0, 417},
{4800, 625, 0, 625},
{9600, 312, 0, 312},
{14400, 208, 0, 208},
{19200, 156, 0, 156},
{38400, 78, 0, 78},
{57600, 52, 0, 52},
{115200, 26, 0, 26},
{230400, 13, 0, 13}
};
/*
* Lookup table for RX baud rate for 16 bit oversampling
* The divisor value is calculated using the formula
*
* ACLKR = (AUXCLK)/(CLKRDIV * HCLKRDIV) * Oversampling
*
* Where
* CLKRDIV takes values from 1-32
* HCLKRDIV takes values from 1-4096
* Here
* AUXCLK = 24MHz
*/
unsigned int lt_rx_16x_baud_rate[][SUART_TRX_DIV_CONF_SZ] = {
/*BaudRate, Divisor, CLKXDIV, HCLKXDIV */
{300, 5000, 1, 2500},
{600, 2500, 0, 2500},
{1800, 833, 0, 833},
{2400, 625, 0, 625},
{4800, 312, 0, 312},
{7200, 208, 0, 208},
{9600, 156, 0, 156},
{14400, 104, 0, 104},
{19200, 78, 0, 78},
{38400, 39, 0, 39},
{57600, 26, 0, 26},
{115200, 13, 0, 13},
{230400, 6, 0, 6}
};
/*
*====================
* API implementations
*====================
*/
/*
* McASP configuration routine
*/
void suart_mcasp_config(unsigned int mcasp_addr,
unsigned int txBaudValue,
unsigned int rxBaudValue,
unsigned int oversampling,
arm_pru_iomap * pru_arm_iomap)
{
CSL_McaspRegsOvly mcasp0Regs = (CSL_McaspRegsOvly) mcasp_addr; //CSL_MCASP_0_CTRL_REGS;
// reset mcasp.
mcasp0Regs->GBLCTL = 0;
mcasp0Regs->RGBLCTL = 0;
mcasp0Regs->XGBLCTL = 0;
// configure receive registers.
if ((SUART_8X_OVRSMPL == oversampling) || (0 == oversampling)){
mcasp0Regs->RMASK = 0x000000FF; //0x0000FFFF for 16
mcasp0Regs->RFMT = 0x0000A038; //slot size 8 bits , RPAD = 1. 0x0000A078 for x16
}
if(SUART_16X_OVRSMPL == oversampling){
mcasp0Regs->RMASK = 0x0000FFFF;
mcasp0Regs->RFMT = 0x0000A078;
}
mcasp0Regs->AFSRCTL = 0x00000012; //burst mode
mcasp0Regs->ACLKRCTL = 0x000000A0;
mcasp0Regs->AHCLKRCTL = 0x00008000;
suart_mcasp_rx_baud_set(rxBaudValue, oversampling, pru_arm_iomap);
mcasp0Regs->RTDM = 0x00000003;
mcasp0Regs->RINTCTL = 0x00000000;
mcasp0Regs->RCLKCHK = 0x00FF0008;
// configure transmit registers.
mcasp0Regs->XMASK = 0x0000FFFF;
mcasp0Regs->XFMT = 0x00002078;
mcasp0Regs->AFSXCTL = 0x00000012;
mcasp0Regs->ACLKXCTL = 0x000000E0;
mcasp0Regs->AHCLKXCTL = 0x00008000;
suart_mcasp_tx_baud_set(txBaudValue, pru_arm_iomap);
mcasp0Regs->XTDM = 0x00000003;
mcasp0Regs->XINTCTL = 0x00000000;
mcasp0Regs->XCLKCHK = 0x00FF0008;
//Serializer as a transmitter
mcasp0Regs->SRCTL0 = 0x000c;
mcasp0Regs->SRCTL1 = 0x000c;
mcasp0Regs->SRCTL2 = 0x000c;
mcasp0Regs->SRCTL3 = 0x000c;
mcasp0Regs->SRCTL4 = 0x000c;
mcasp0Regs->SRCTL5 = 0x000c;
mcasp0Regs->SRCTL6 = 0x000c;
mcasp0Regs->SRCTL7 = 0x000C;
mcasp0Regs->SRCTL8 = 0x000C;
mcasp0Regs->SRCTL9 = 0x000C;
mcasp0Regs->SRCTL10 = 0x000C;
mcasp0Regs->SRCTL11 = 0x000C;
mcasp0Regs->SRCTL12 = 0x000C;
mcasp0Regs->SRCTL13 = 0x000C;
mcasp0Regs->SRCTL14 = 0x000C;
mcasp0Regs->SRCTL15 = 0x000c;
//Configure all AXR[n] as McASP pins
mcasp0Regs->PFUNC = CSL_MCASP_PFUNC_RESETVAL;
mcasp0Regs->PDOUT = 0xFFFF;
//Configure PDIR for test purposes
//set frame sync, clocks as output, AXR8, 10 & 14 as output, AXR7, 9 & 13
mcasp0Regs->PDIR = MCASP_PDIR_VAL; // has receiver configuration as well
mcasp0Regs->PDOUT = 0xFFFF;
// config pin function and direction.
mcasp0Regs->DITCTL = 0x00000000;
mcasp0Regs->DLBCTL = 0x00000000;
mcasp0Regs->AMUTE = 0x00000000;
mcasp0Regs->XSTAT = 0x0000FFFF; // Clear all
mcasp0Regs->RSTAT = 0x0000FFFF; // Clear all
}
void suart_mcasp_tx_serialzier_set(unsigned int serializerNum,
arm_pru_iomap * pru_arm_iomap)
{
CSL_McaspRegsOvly mcasp0Regs =
(CSL_McaspRegsOvly) pru_arm_iomap->mcasp_io_addr;
mcasp0Regs->PFUNC |= (0x1 << serializerNum);
}
/*
* mcasp TX buard rate setting routine
*/
short suart_mcasp_tx_baud_set(unsigned int txBaudValue,
arm_pru_iomap * pru_arm_iomap)
{
unsigned int clkDivVal;
unsigned int loopCnt;
short status = SUART_SUCCESS;
short foundVal = SUART_FALSE;
CSL_McaspRegsOvly mcasp0Regs =
(CSL_McaspRegsOvly) pru_arm_iomap->mcasp_io_addr;
/* Search the supported baud rate in the table */
for (loopCnt = 0; loopCnt < SUART_NUM_OF_BAUDS_SUPPORTED; loopCnt++) {
if (txBaudValue == lt_tx_baud_rate[loopCnt][0]) {
foundVal = SUART_TRUE;
break;
}
}
if (foundVal == SUART_TRUE) {
clkDivVal = lt_tx_baud_rate[loopCnt][2];
mcasp0Regs->ACLKXCTL |=
clkDivVal << CSL_MCASP_ACLKXCTL_CLKXDIV_SHIFT;
clkDivVal = lt_tx_baud_rate[loopCnt][3]; /* starts from 0 */
mcasp0Regs->AHCLKXCTL |=
clkDivVal << CSL_MCASP_AHCLKXCTL_HCLKXDIV_SHIFT;
} else {
return SUART_INVALID_TX_BAUD;
}
return (status);
}
/*
* mcasp RX buard rate setting routine
*/
short suart_mcasp_rx_baud_set(unsigned int rxBaudValue,
unsigned int oversampling,
arm_pru_iomap * pru_arm_iomap)
{
unsigned int clkDivVal;
unsigned int loopCnt;
short status = SUART_SUCCESS;
short foundVal = SUART_FALSE;
CSL_McaspRegsOvly mcasp0Regs =
(CSL_McaspRegsOvly) pru_arm_iomap->mcasp_io_addr;
if (oversampling == SUART_8X_OVRSMPL) {
for (loopCnt = 0; loopCnt < SUART_NUM_OF_BAUDS_SUPPORTED;
loopCnt++) {
if (rxBaudValue == lt_rx_8x_baud_rate[loopCnt][0]) {
clkDivVal = lt_rx_8x_baud_rate[loopCnt][2];
mcasp0Regs->ACLKRCTL |=
clkDivVal <<
CSL_MCASP_ACLKXCTL_CLKXDIV_SHIFT;
clkDivVal = lt_rx_8x_baud_rate[loopCnt][3] - 1; /* starts from 0 */
mcasp0Regs->AHCLKRCTL |=
clkDivVal <<
CSL_MCASP_AHCLKXCTL_HCLKXDIV_SHIFT;
foundVal = SUART_TRUE;
break;
}
}
} else if (oversampling == SUART_16X_OVRSMPL) {
for (loopCnt = 0; loopCnt < SUART_NUM_OF_BAUDS_SUPPORTED;
loopCnt++) {
if (rxBaudValue == lt_rx_16x_baud_rate[loopCnt][0]) {
clkDivVal = lt_rx_16x_baud_rate[loopCnt][2];
mcasp0Regs->ACLKRCTL |=
clkDivVal <<
CSL_MCASP_ACLKXCTL_CLKXDIV_SHIFT;
clkDivVal = lt_rx_16x_baud_rate[loopCnt][3];
mcasp0Regs->AHCLKRCTL |=
clkDivVal <<
CSL_MCASP_AHCLKXCTL_HCLKXDIV_SHIFT;
foundVal = SUART_TRUE;
break;
}
}
} else if (oversampling == 0) {
for (loopCnt = 0; loopCnt < SUART_NUM_OF_BAUDS_SUPPORTED;
loopCnt++) {
if (rxBaudValue == lt_tx_baud_rate[loopCnt][0]) {
clkDivVal = lt_tx_baud_rate[loopCnt][2];
mcasp0Regs->ACLKRCTL |=
clkDivVal <<
CSL_MCASP_ACLKXCTL_CLKXDIV_SHIFT;
clkDivVal = lt_tx_baud_rate[loopCnt][3];
mcasp0Regs->AHCLKRCTL |=
clkDivVal <<
CSL_MCASP_AHCLKXCTL_HCLKXDIV_SHIFT;
foundVal = SUART_TRUE;
break;
}
}
} else {
return SUART_INVALID_OVERSAMPLING;
}
if (foundVal != SUART_TRUE) {
return SUART_INVALID_RX_BAUD;
}
return (status);
}
/*
* mcasp buard rate setting routine
*/
short suart_asp_baud_set(unsigned int txBaudValue,
unsigned int rxBaudValue,
unsigned int oversampling,
arm_pru_iomap * pru_arm_iomap)
{
short status = SUART_SUCCESS;
status = suart_mcasp_tx_baud_set(txBaudValue, pru_arm_iomap);
status =
suart_mcasp_rx_baud_set(rxBaudValue, oversampling, pru_arm_iomap);
return (status);
}
/*
* mcasp deactivate the selected serializer
*/
short suart_asp_serializer_deactivate (unsigned short u16srNum,
arm_pru_iomap * pru_arm_iomap)
{
short status = SUART_SUCCESS;
CSL_McaspRegsOvly mcasp0Regs =
(CSL_McaspRegsOvly) pru_arm_iomap->mcasp_io_addr;
unsigned int * pu32SrCtlAddr = NULL;
if (u16srNum > 15)
{
status = SUART_INVALID_SR_NUM ;
}
else
{
pu32SrCtlAddr = (unsigned int *)&(mcasp0Regs->SRCTL0);
pu32SrCtlAddr += u16srNum;
* (pu32SrCtlAddr) = 0x000C;
}
return (status);
}
/*
* mcasp psc enable routine
*/
void suart_mcasp_psc_enable(unsigned int psc1_addr)
{
CSL_PscRegsOvly PSC = (CSL_PscRegsOvly) psc1_addr; // CSL_PSC_1_REGS;
// Wait for any outstanding transition to complete
while (CSL_FEXT(PSC->PTSTAT, PSC_PTSTAT_GOSTAT0) ==
CSL_PSC_PTSTAT_GOSTAT0_IN_TRANSITION) ;
// If we are already in that state, just return
if (CSL_FEXT(PSC->MDSTAT[CSL_PSC_MCASP0], PSC_MDSTAT_STATE) ==
CSL_PSC_MDSTAT_STATE_ENABLE)
return;
// Perform transition
CSL_FINST(PSC->MDCTL[CSL_PSC_MCASP0], PSC_MDCTL_NEXT, ENABLE);
CSL_FINST(PSC->PTCMD, PSC_PTCMD_GO0, SET);
// Wait for transition to complete
while (CSL_FEXT(PSC->PTSTAT, PSC_PTSTAT_GOSTAT0) ==
CSL_PSC_PTSTAT_GOSTAT0_IN_TRANSITION) ;
// Wait and verify the state
while (CSL_FEXT(PSC->MDSTAT[CSL_PSC_MCASP0], PSC_MDSTAT_STATE) !=
CSL_PSC_MDSTAT_STATE_ENABLE) ;
}
/*
* mcasp psc disable routine
*/
void suart_mcasp_psc_disable(unsigned int psc1_addr)
{
CSL_PscRegsOvly PSC = (CSL_PscRegsOvly) psc1_addr; // CSL_PSC_1_REGS;
// Wait for any outstanding transition to complete
while (CSL_FEXT(PSC->PTSTAT, PSC_PTSTAT_GOSTAT0) ==
CSL_PSC_PTSTAT_GOSTAT0_IN_TRANSITION) ;
// If we are already in that state, just return
if (CSL_FEXT(PSC->MDSTAT[CSL_PSC_MCASP0], PSC_MDSTAT_STATE) ==
CSL_PSC_MDSTAT_STATE_SYNCRST)
return;
// Perform transition
CSL_FINST(PSC->MDCTL[CSL_PSC_MCASP0], PSC_MDCTL_NEXT, SYNCRST);
CSL_FINST(PSC->PTCMD, PSC_PTCMD_GO0, SET);
// Wait for transition to complete
while (CSL_FEXT(PSC->PTSTAT, PSC_PTSTAT_GOSTAT0) ==
CSL_PSC_PTSTAT_GOSTAT0_IN_TRANSITION) ;
// Wait and verify the state
while (CSL_FEXT(PSC->MDSTAT[CSL_PSC_MCASP0], PSC_MDSTAT_STATE) !=
CSL_PSC_MDSTAT_STATE_SYNCRST) ;
}
/* End of file */

BIN
Projects/JustADCTest/Debug/JustADCTest

Binary file not shown.

BIN
Projects/JustADCTest/Debug/JustADCTest.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/adc_ss.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/am437x_cm.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/am437x_prmcm.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/basicDualThread.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/basicLogCollection.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/basicLoggingService.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/basicRing.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/basicThread.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/basicTransport.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/canbus.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/classSOC.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/cliClass.o

Binary file not shown.

1908
Projects/JustADCTest/Debug/my.log
File diff suppressed because it is too large
View File

BIN
Projects/JustADCTest/Debug/objectFileLoggingService.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/pru_ss.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/pwm_ss.o

Binary file not shown.

BIN
Projects/JustADCTest/Debug/tupus_ext.o

Binary file not shown.

94
Projects/JustADCTest/JustADCTest.cpp

@ -0,0 +1,94 @@
#include <stdlib.h>
#include <stdio.h>
#include "../../source/lib/components/base/basicLogCollection.h"
#include "../../source/lib/components/object/objectFileLoggingService.h"
#include "../../source/lib/hardware/soc/classSOC.h"
#define LOG( X ) LogEng->Log( "main", 0, X )
#define LOG_ERROR( X ) LogEng->Log( "main", 0, _LOG_ERROR, X )
int main (int argc, char *argv[]){
basicLogCollection *LogEng;
objectFileLoggingService *LogFile;
classSOC *mSOC;
printf("Just ADC Tests.\n\n");
LogEng = basicLogCollection::getInstance();
LogFile = new objectFileLoggingService("my.log");
LogEng->addHandler( LogFile );
mSOC = classSOC::getInstance();
enable_ADC1_CLK();
init_ADC_0();
init_ADC_1();
printf( "ADC Init Done\n" );
printf( "Revision 0: 0x%08X\n", getRevisionADC0() );
printf( "Revision 1: 0x%08X\n", getRevisionADC1() );
prepareFSM1();
printf( "ADC FSM Ready\nStrike Enter\n" );
char kaka;
kaka = getchar();
printf( "Starting Loop\n" );
uint16_t AD0_Data = 0;
uint8_t AD0_Channel = 0;
uint16_t AD1_Data = 0;
uint8_t AD1_Channel = 0;
uint8_t k,z;
uint32_t Data;
while(1){
//index++;
//if( index > 15 ) index = 1;
//c_out = 0x0F000000 & (~( index << 24 ));
//b_out = 0x00000060 & (~( index << 5 ));
//setOutputDirect( 1, c_out );
//setOutputDirect( 3, b_out );
//usleep(10000);
//ADC
//printf("Putzi Putzi\n\n");
z = getSizeADC1_FIFO(0);
if( z > 0 ) {
for( k = 0; k < z; k++ ) {
Data = getDataADC1_FIFO0( 100 );
if( k < 8 )
if( Data != ADC_VALUE_TIMEOUT ) {
#ifdef ADC_WORK_SIMULTANEOUS_MODE
AD0_Channel = ( Data >> 28 ) & 0xF;
AD0_Data = ( Data >> 16 ) & 0xFFF;
AD1_Channel = ( Data >> 12 ) & 0xF;
AD1_Data = Data & 0xFFF;
#else
AD0_Channel = 0;
AD0_Data = 0;//( Data >> 16 ) & 0xFFF;
AD1_Channel = ( Data >> 12 ) & 0xF;
AD1_Data = ( Data >> 0 ) & 0xFFF;
#endif
printf( " ADC Data[%03d]: ADC1[%01d]: 0x%08X 0x%03X +%0.3f VDC\n", k, AD1_Channel, Data, AD1_Data, ADC_MULTIPLIER * AD1_Data );
} else {
printf( " ADC Data[%d]: TIMEOUT ??\n", k );
};
// Data = getDataADC1_FIFO1( 100 );
//if( Data != ADC_VALUE_TIMEOUT ) {
//printf( " ADC FIFO 1 [%d]: 0x%08X\n", k, Data );
//} else {
//printf( " ADC FIFO 1 [%d]: TIMEOUT\n", k );
//};
};
printf( "FIFO[0] Count: %d\n", z );
} else {
//printf( "Starting 8 seq\n");
startADC1();
}
usleep(100000);
};
return(0);
};
#undef LOG
#undef LOG_ERROR

233
Projects/JustADCTest/JustADCTest.vpj

@ -0,0 +1,233 @@
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd">
<Project
Version="10.0"
VendorName="SlickEdit"
TemplateName="GNU C/C++"
WorkingDir="."
BuildSystem="automakefile"
BuildMakeFile="makefile">
<Config
Name="Debug"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdJustADCTest"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -g -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -g -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" CFG=%b'/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Config
Name="Release"
Type="gnuc"
DebugCallbackName="gdb"
Version="1"
OutputFile="%bdJustADCTest"
CompilerConfigName="Latest Version">
<Menu>
<Target
Name="Compile"
MenuCaption="&amp;Compile"
Dialog="_gnuc_options_form Compile"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
OutputExts="*.o"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ -c %xup %defd -o "%bd%n%oe" %i "%f"'/>
</Target>
<Target
Name="Link"
MenuCaption="&amp;Link"
ShowOnMenu="Never"
Dialog="_gnuc_options_form Link"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveCurrent"
RunFromDir="%rw">
<Exec CmdLine='g++ %xup -o "%o" %f %libs'/>
</Target>
<Target
Name="Build"
MenuCaption="&amp;Build"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" CFG=%b'/>
</Target>
<Target
Name="Rebuild"
MenuCaption="&amp;Rebuild"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/>
</Target>
<Target
Name="Debug"
MenuCaption="&amp;Debug"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveNone"
RunFromDir="%rw">
<Exec CmdLine='vsdebugio -prog "%o"'/>
</Target>
<Target
Name="Execute"
MenuCaption="E&amp;xecute"
Dialog="_gnuc_options_form Run/Debug"
BuildFirst="1"
CaptureOutputWith="ProcessBuffer"
Deletable="0"
SaveOption="SaveWorkspaceFiles"
RunFromDir="%rw">
<Exec CmdLine='"%o"'/>
</Target>
<Target
Name="dash"
MenuCaption="-"
Deletable="0">
<Exec/>
</Target>
<Target
Name="GNU C Options"
MenuCaption="GNU C &amp;Options..."
ShowOnMenu="HideIfNoCmdLine"
Deletable="0"
SaveOption="SaveNone">
<Exec
CmdLine="gnucoptions"
Type="Slick-C"/>
</Target>
</Menu>
<List Name="GNUC Options">
<Item
Name="LinkerOutputType"
Value="Executable"/>
</List>
</Config>
<Files>
<Folder
Name="Source Files"
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d">
<F N="../../source/lib/hardware/soc/modules/adc/adc_ss.c"/>
<F N="../../source/lib/hardware/soc/general/am437x_cm.c"/>
<F N="../../source/lib/hardware/soc/general/am437x_prmcm.c"/>
<F N="../../source/lib/components/base/basicLogCollection.cpp"/>
<F N="../../source/lib/components/base/basicLoggingService.cpp"/>
<F N="../../source/lib/components/base/basicRing.cpp"/>
<F N="../../source/lib/hardware/soc/classSOC.cpp"/>
<F N="JustADCTest.cpp"/>
<F N="../../source/lib/components/object/objectFileLoggingService.cpp"/>
<F N="../../source/lib/hardware/soc/modules/pru/pru_ss.c"/>
<F N="../../source/lib/hardware/soc/modules/pwmss/pwm_ss.c"/>
<F N="../../source/lib/hardware/soc/modules/pru/tupus_ext.c"/>
</Folder>
<Folder
Name="Header Files"
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
<F N="../../source/lib/hardware/soc/modules/adc/adc_ss.h"/>
<F N="../../source/lib/hardware/soc/modules/adc/sys_adc0TscSs.h"/>
<F N="../../source/lib/hardware/soc/modules/adc/sys_adc1MagSs.h"/>
</Folder>
<Folder
Name="Resource Files"
Filters="*.ico;*.cur;*.dlg"/>
<Folder
Name="Bitmaps"
Filters="*.bmp"/>
<Folder
Name="Other Files"
Filters="">
<F
N="makefile"
Type="Makefile"/>
</Folder>
</Files>
</Project>

207
Projects/JustADCTest/makefile

@ -0,0 +1,207 @@
# SlickEdit generated file. Do not edit this file except in designated areas.
# Make command to use for dependencies
MAKE=make
RM=rm
MKDIR=mkdir
# -----Begin user-editable area-----
# -----End user-editable area-----
# If no configuration is specified, "Debug" will be used
ifndef CFG
CFG=Debug
endif
#
# Configuration: Debug
#
ifeq "$(CFG)" "Debug"
OUTDIR=Debug
OUTFILE=$(OUTDIR)/JustADCTest
CFG_INC=
CFG_LIB=
CFG_OBJ=
COMMON_OBJ=$(OUTDIR)/adc_ss.o $(OUTDIR)/am437x_cm.o \
$(OUTDIR)/am437x_prmcm.o $(OUTDIR)/basicLogCollection.o \
$(OUTDIR)/basicLoggingService.o $(OUTDIR)/basicRing.o \
$(OUTDIR)/classSOC.o $(OUTDIR)/JustADCTest.o \
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/pru_ss.o \
$(OUTDIR)/pwm_ss.o $(OUTDIR)/tupus_ext.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
ALL_OBJ=$(OUTDIR)/adc_ss.o $(OUTDIR)/am437x_cm.o \
$(OUTDIR)/am437x_prmcm.o $(OUTDIR)/basicLogCollection.o \
$(OUTDIR)/basicLoggingService.o $(OUTDIR)/basicRing.o \
$(OUTDIR)/classSOC.o $(OUTDIR)/JustADCTest.o \
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/pru_ss.o \
$(OUTDIR)/pwm_ss.o $(OUTDIR)/tupus_ext.o
COMPILE=g++ -c -g -o "$(OUTDIR)/$(*F).o" $(CFG_INC) "$<"
LINK=g++ -g -o "$(OUTFILE)" $(OBJ) $(CFG_LIB)
# Pattern rules
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pru/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : %.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/general/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pwmss/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/base/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/adc/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/object/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pru/%.c
$(COMPILE)
$(OUTDIR)/%.o : %.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/general/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pwmss/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/base/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/adc/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/object/%.c
$(COMPILE)
# Build rules
all: $(OUTFILE)
$(OUTFILE): $(OUTDIR) $(OBJ)
$(LINK)
$(OUTDIR):
$(MKDIR) -p "$(OUTDIR)"
# Rebuild this project
rebuild: cleanall all
# Clean this project
clean:
$(RM) -f $(OUTFILE)
$(RM) -f $(OBJ)
# Clean this project and all dependencies
cleanall: clean
endif
#
# Configuration: Release
#
ifeq "$(CFG)" "Release"
OUTDIR=Release
OUTFILE=$(OUTDIR)/JustADCTest
CFG_INC=
CFG_LIB=
CFG_OBJ=
COMMON_OBJ=$(OUTDIR)/adc_ss.o $(OUTDIR)/am437x_cm.o \
$(OUTDIR)/am437x_prmcm.o $(OUTDIR)/basicLogCollection.o \
$(OUTDIR)/basicLoggingService.o $(OUTDIR)/basicRing.o \
$(OUTDIR)/classSOC.o $(OUTDIR)/JustADCTest.o \
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/pru_ss.o \
$(OUTDIR)/pwm_ss.o $(OUTDIR)/tupus_ext.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
ALL_OBJ=$(OUTDIR)/adc_ss.o $(OUTDIR)/am437x_cm.o \
$(OUTDIR)/am437x_prmcm.o $(OUTDIR)/basicLogCollection.o \
$(OUTDIR)/basicLoggingService.o $(OUTDIR)/basicRing.o \
$(OUTDIR)/classSOC.o $(OUTDIR)/JustADCTest.o \
$(OUTDIR)/objectFileLoggingService.o $(OUTDIR)/pru_ss.o \
$(OUTDIR)/pwm_ss.o $(OUTDIR)/tupus_ext.o
COMPILE=g++ -c -o "$(OUTDIR)/$(*F).o" $(CFG_INC) "$<"
LINK=g++ -o "$(OUTFILE)" $(OBJ) $(CFG_LIB)
# Pattern rules
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pru/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : %.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/general/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pwmss/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/base/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/adc/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/object/%.cpp
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pru/%.c
$(COMPILE)
$(OUTDIR)/%.o : %.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/general/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/pwmss/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/base/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/hardware/soc/modules/adc/%.c
$(COMPILE)
$(OUTDIR)/%.o : ../../source/lib/components/object/%.c
$(COMPILE)
# Build rules
all: $(OUTFILE)
$(OUTFILE): $(OUTDIR) $(OBJ)
$(LINK)
$(OUTDIR):
$(MKDIR) -p "$(OUTDIR)"
# Rebuild this project
rebuild: cleanall all
# Clean this project
clean:
$(RM) -f $(OUTFILE)
$(RM) -f $(OBJ)
# Clean this project and all dependencies
cleanall: clean
endif

61
Projects/LRF_Server/Debug/3DLRF.conf

@ -0,0 +1,61 @@
NETWORK_SERVER :
{
NW_HOSTNAME_IP = "192.168.200.107";
NW_LISTEN_PORT = 2222;
};
HARDWARE_MANAGER :
{
MASTER_ROLE = true;
LRF_ENABLED = true;
SIG_SYM_ENABLE = false;
MOTORS_AUTOSTART = false;
VERTICAL_ENC_FREQ = 57600;
HORIZONTAL_ENC_FREQ = 4000;
VERTICAL_MOTOR_CTRL = false;
HORIZONTAL_MOTOR_CTRL = false;
LRF_PULSES_INTERLEAVE = 4;
TH_OFFSET = 32;
TH_ORDER = 3;
TH_DELTA = 16;
TH_FLIP = 8;
TH_GOOD_POINTS = 6;
CAN_BUS_ENABLE = false;
CAN_BUS_ID = 1;
CAN_MY_ID = 512;
CAN_TGZ_ID = 513;
TGZ_DIV = 1;
TGZ_RATIO = 64;
TGZ_PRF = 35;
TH_GENERATED_BY_PRU = false;
DUMP_TH_ON_DISK = false;
TH_SPIKE_SIZE = 1;
TGZ_MIRROR_SPEED = 14400;
TGZ_BASE_SPEED = 250;
SUNBIT_ENABLE = false;
BASE_SHIFT = 0;
MIRROR_SHIFT = 0;
};
KERNEL :
{
ENABLE_SAFE_SHORE = false;
DETECTOR_WIDTH = 200;
DETECTOR_SST = 0;
SAFESHORE_CONNECTION :
{
SCANNER_NAME = "LRF_LIBERMAN_MASTER";
SCANNER_DIMENTIONS = 3;
LCU_IP_ADDRESS = "192.168.200.204";
LCU_IP_PORT = 80;
CURL_POST_CONTENT_TYPE = "application/xml";
};
ENABLED_LRF = 255;
ENABLE_DEFENDER = true;
DEFENDER_CONNECTION :
{
SCANNER_NAME = "LRF_3D_001";
SCANNER_DIMENTIONS = 3;
CEP_IP_ADDRESS = "192.168.200.204";
CEP_IP_PORT = 80;
CURL_POST_CONTENT_TYPE = "application/json";
};
};

48
Projects/LRF_Server/Debug/3DLRF.conf.backup

@ -0,0 +1,48 @@
NETWORK_SERVER :
{
NW_HOSTNAME_IP = "192.168.200.108";
NW_LISTEN_PORT = 2222;
};
HARDWARE_MANAGER :
{
MASTER_ROLE = true;
LRF_ENABLED = true;
SIG_SYM_ENABLE = false;
MOTORS_AUTOSTART = true;
VERTICAL_ENC_FREQ = 57600;
HORIZONTAL_ENC_FREQ = 4000;
VERTICAL_MOTOR_CTRL = true;
HORIZONTAL_MOTOR_CTRL = true;
LRF_PULSES_INTERLEAVE = 4;
TH_OFFSET = 32;
TH_ORDER = 3;
TH_DELTA = 16;
TH_FLIP = 8;
TH_GOOD_POINTS = 6;
CAN_BUS_ENABLE = false;
CAN_BUS_ID = 1;
CAN_MY_ID = 512;
CAN_TGZ_ID = 513;
TGZ_DIV = 1;
TGZ_RATIO = 64;
TGZ_PRF = 35;
TH_GENERATED_BY_PRU = false;
DUMP_TH_ON_DISK = false;
TH_SPIKE_SIZE = 5;
TGZ_MIRROR_SPEED = 14400;
TGZ_BASE_SPEED = 250;
SUNBIT_ENABLE = false;
};
KERNEL :
{
ENABLE_SAFE_SHORE = false;
DETECTOR_WIDTH = 200;
DETECTOR_SST = 0;
SAFESHORE_CONNECTION :
{
SCANNER_NAME = "LRF_LIBERMAN_MASTER";
SCANNER_DIMENTIONS = 3;
LCU_IP_ADDRESS = "192.168.200.204";
LCU_IP_PORT = 80;
};
};

BIN
Projects/LRF_Server/Debug/PRU_0_0.bin

Binary file not shown.

BIN
Projects/LRF_Server/Debug/PRU_0_1.bin

Binary file not shown.

BIN
Projects/LRF_Server/Debug/PRU_1_0.bin

Binary file not shown.

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save