Jump to content
OMRON Forums

PowerPmac "C" functions


bradp

Recommended Posts

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

[quote=brad] Where should I look inside the PowerPmac to find functions available for C - Code? [/quote] (assuming the address of your powerpmac is 192.168.0.200) ftp://192.168.0.200/ppmaclibs/rtpmaclib/rtpmacapi.h - API functions available for use for things like getting P and M variables and getting memory pointers ftp://192.168.0.200/ppmaclibs/rtpmaclib/rtpmaclib.h - Delta Tau optimized math libraries ftp://192.168.0.200/ppmaclibs/RtPmac/RtGpShm.h - Delta Tau shared memory structures ftp://192.168.0.200/ppmaclibs/GpLib/gplib.h - Library initilization functions and GetResponse (These are not available for Real Time C Code only background C Code). To use these from a C APP you must first call InitLibrary() and should call CloseLibrary() at the end of the C APP. You can use these directly from a CPLC (do not call InitLibrary).
Link to comment
Share on other sites

[quote=brad] Where should I look inside the PowerPmac to find functions available for C - Code? [/quote] In firmware dated after August 31st 2008 there are additional “C” functions to get the Gate pointers and you can use their defined structures in “RtGpShm.h”. Below is an example for using them. Their prototypes are in “rtpmacapi.h. If the gate is not at the index, a NULL pointer is returned. These functions can be used in Rt or background “C” programs. /* * GPLinux Power PMAC "C" Template * To make a standard C Program do the following: * 1. Copy GpCtpl.c and Makefile to your project directory * 2. Rename all "GpCtpl" in GpCtpl.c and Makefile to your name * 3. Then "make clean" and "make", you should have a successful compile * 4. When no longer debugging, in Makefile change "-g3" to "-02" * * Change Log: * ---------- * Date By Comment * ------- ------ ---------------------------------------- * 02/13/07 EL Creation * * * */ #include "../GpLib/gplib.h" #include "../RtPmac/RtGpShm.h" // Global Rt/Gp Shared memory pointers #include "../RtPmac/pRtGpShm.h" // Global Rt/Gp Shared memory pointers int main(void) { volatile GateArray1* Gate1; volatile GateIOStruct* GateIO; //------------------------------- // Required Startup Code //------------------------------- InitLibrary () ; //--------------------------------- // Get Shared MEM & IO MEM Ptrs //--------------------------------- // pshm = GetSharedMemPtr(); // piom = GetIOMemPtr(); //----------------------------------------------------------- // All 24 bit UMAC bus cards are in // the upper 24 of 32 bit Power PMAC memeory // The 1st UMAC bus Gate1 card is at index 4 // Use "sys.Gate1AutoDetect to get the allowed Gate1 indexes //----------------------------------------------------------- Gate1 = GetGate1MemPtr(4); if(Gate1) { Gate1->Chan[0].Ctrl |= 0x400000; // Enable AMP (Bit 14 + 8 bit offset) sleep(2); Gate1->Chan[0].Ctrl &= 0xFFBFFFFF; // Disable AMP } //------------------------------------------------------------------- // Use "sys.CardIOAutoDetect to get the allowed CardIO/GateIO indexes //------------------------------------------------------------------- GateIO = GetGateIOMemPtr(0); if(GateIO) { GateIO->DataReg[3] = 0x5500; } CloseLibrary(); return 0; }
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

×
×
  • Create New...