To program peripherals SCI, SPI, I2c on Microprocessors (like f2806x and f2802x), each peripheral TI has two sets of registers definition. For example SCI, Ti has struct _SCI_Obj_ in sci.h/sci.c and struct SCI_REGS in F2806x_Sci.h (union based from controlSUITE). They are actually same size and in same order of each member in the structure.
So, after we use the SCI base address to do the initialization (with SCI_init()) to get SCI_Handle object. Then if we want to use SCI_REGS structure object, just cast and pass the SCI_Handle object to a pointer of SCI_REGS.
Like the following:
SCI_Handle scia_handle = SCI_init((void*)SCIA_BASE_ADDR, sizeof(SCI_Obj));
SCI_REGS *scia_regs_p = (SCI_REGS *)scia_handle;
Just want to make sure it is the right way to do it.
Thanks.