Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RESOLVED - Calculating Register Pointer-Adresses
#2
If you want to use a direct pointer based on numerical addresses, it would look like this.
Code:
volatile unsigned int *MyHomeCapt1;
MyHomeCapt1 = (unsigned int *)piom + pshm->OffsetGate3[0]/4 + 0x80/4 + 0x74/4;

It would be much easier to use gate pointers like below, however they will use more memory. I would recommend this method if possible.
Code:
volatile GateIOStruct *GateIo[1];
GateIo[0] = GetGateIOMemPtr(0);
GateIo[0] -> DataReg[3] = (0xFF << 8);

I am attaching a couple short sections about these pointer types.


Attached Files
.pdf   direct pointers.pdf (Size: 724.38 KB / Downloads: 21)
.pdf   gate pointers.pdf (Size: 641.04 KB / Downloads: 19)
Reply


Messages In This Thread
RE: Calculating Register Pointer-Adresses - Eric Hotchkiss - 06-03-2021, 09:03 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)