Yes, you got it.
If you were not sure by what I meant with the term "Register Instance Definitions", just copy it and paste into a legacy peripheral header file search. This is the exact terminology used. In the comments of course.
After comparing and studying the differences between the two peripheral header docs, (actually almost identical, certainly in using stuct's), I managed to see how to do a simple edit to get it to compile. e.g.
Legacy:
GPIOB_PDDR |= GPIO_PDDR_PDD(0x00040000);
Newer:
((GPIOB)->PDDR) |= GPIO_PDDR_PDD(0x00040000);
also;
Legacy:
PORTB_PCR18 = (uint32_t)((PORTB_PCR18 & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
Newer:
((PORTB)->PCR[18]) = (uint32_t)((((PORTB)->PCR[18]) & (uint32_t)~(uint32_t)(
PORT_PCR_ISF_MASK |
PORT_PCR_MUX(0x06)
)) | (uint32_t)(
PORT_PCR_MUX(0x01)
));
As you can see from above, the only portion that changes is the reference to the actual register assignment. All the mask constructs are the same. But based on your examples to me, I'm guessing that this is not the "preferred" new paradigm. Also I don't know if this edited code actually works. I just know that it compiles without error.
However, I ran into problems when trying to edit config writes to the NVIC. Of course, this is part of CMSIS/Arm documentation and more murky to me.
I think I get your reasoning that it makes code more portable, at least I'll trust your judgement.
It does bother me that there is now no direct terminology linkage to the device Reference Manual. That is, I would study a devices peripherals and registers using the pdf manual. I could then copy and paste a registers name into a header search, verify it and start using it. Seems like a step backward.
Also, you mentioned "bitfield level access". This reminds me of another gripe I have with 'Xpresso. When playing around with the "Pins" configuration tool, I finally figured out that they use the term "Pin" for both the actual package pin, as well as register configuration BITS! These aren't PINS, they're BITS! At least that is the way the Reference Manual rightly refers to them. Talk about super confusing.
From what I'm seeing, the newer tools are digressing from the device Reference Manual. So I guess the new bibles to use are the "MCUXpresso SDK API Reference Manual"?
Thanks for your reply and support.
Gregg