Aren't there more than 256 registers in a 16-series chip? So Uint8_t does not have enough bits to identify the register (with bank).
also, aren't the LATB and LATC registers sequential so you only need one of each or, one overall since the LATC registers are next to the LATB registers?
and all possible values of LATC or LATB or LATA are one register (address). What exactly are you trying to do?
It's a pointer to a uint8_t and will be 16 (or 14) bit. I used LAT as an example, the actual SFRs I'm writing to are the RBnPPS & RCnPPS registers and I didn't want people to get distracted by the actual registers. The above code seems a little long winded and I was wondering if there was a simpler way.
Mike.
Edit, in case someone comes across this in the future, to place the array in flash and not ram requires the const keywork after the *.
I.E.
It's actually making sense now as &PORTB is just a 16 bit address so the compiler needs to know it's a uint8_t pointer. However, I thought it was obvious I was defining an array of uint8_t pointers. To be fair, it did compile but gave lots of pointer conversion type warnings. I don't like any warnings now and try to get rid of them as in the past I've missed actually errors due to them being obscured by warnings. Also not sure why the const has to be placed after the *.