@FlyingCzech
I'm sure Mark has his own comments but here are mine.
First off, I *think* you're calling "|=" "logical NOT" and this is not correct, you're doing a bitwise OR on the contents of the register. A logical NOT would look like "!=".
With Mark's post and your results, I understand where the problem is.
When the K22 is reset, the PORTA->PCR[1] register has a default "MUX" value of 0b111 (the default is "ALT7" or "JTAG_TDI" - which Mark reported that the pin was set to). To select the DI/DO functionality ("PTA1") you want the MUX value to be 0b001 and your are doing a logical OR of the contents and not changing anything as you look at how the code executes:
PORTA->PCR[1] |= 0x100; // Expands out to
PORTA->PCR[1] = PORTA->PCR[1] | 0x100;
// Since MUX bits default to 0b111, ORing it with 0b001 doesn't change anything.
// The line of code is effectively:
PORTA->PCR[1] = PORTA-PCR[1];
I just saw your reply regarding using the SDK and I highly recommend that you reconsider your attitude regarding using the SDK for your application coding. I know where you're coming from; I started in the 8 bit world and I saw a lot of very poor drivers written by manufacturers that were often written for a specific purpose turned into an ApNote and then used as a reference for a driver as well as being compiled by a tool that was very primitive.
This is 2021 and we're working with a very complex 32bit processor and integrated peripherals. The SDK code that I have seen is quite well written. I don't think Mark feels as positively about it as I do (he feels his code is better) but I haven't encountered any situations where there are execution errors and the examples are not bad. Along with that, we're working with a very sophisticated and validated compiler so the code produced is quite well optimized. Finally, we're working with processors with thousands of registers and a plethora of execution modes - understanding all of them (or even the ones critical to your application, even one as simple as this one) is simply not reasonable.
Hopefully you can look over this thread and see the irony in your statement "I would like to stay as close to the registers as possible just because I think it reduces the likelihood of unintended behavior " - becasue this is exactly what happened, instead of letting the SDK code setup the IO pin, you ineffectively wrote to a register and ended up with behaviour that you didn't expect.
Instead of starting your journey with the Kinetis by studying the 1,500 pages of the RM and the 80 or so pages of the datasheet, could I suggest that you download MCUXpresso and run through some of the example projects so that you can see how the SDK works and try your hand at some applications? There is a ton of stuff to learn here and you can see how the tools makes your life easier and will get you running code faster with fewer problems.
Trust me, there will be LOTS of cases where you need to take deep dives into the operation of the chip - let MCUXPresso with it's the SDK, GCC Compiler, GDB debugger make the initial steps much easier.