Re: The Renesas User's Manual and FSP (The Deep Magic for R4)

Happy to be proven wrong, but I believe CE only applies to finished products, not components. Anything sold with the expectation of it being used as part of something else does not require a CE mark. This also applies to kits because a kit isn't a finished item.

That is correct.

Again I would tend to agree with you, but what is the exact definition of a kit. I suspect that it would involve at least some soldering somewhere along the line.

And there lies the problem. A lot of furniture is sold as a kit for the purchaser to assemble, I imagine such furniture doesn't require a CE mark, but I don't actually know.

Yes furniture does require a CE mark. If it is self assembly then the product must be safe when assembled correctly. That means it has to have passed safety tests, along with the other stuff required for furniture like fire resistance on any fabric used for covering.

Can you Compare and contrast using PORR/POSR vs PFS for set/clear of individual bits? PORx could in theory do multiple bits, which is nice - even though they're a bit scrambled, 10 of the digital pins are on port1xx...

R_PFS->PORT[1].PIN[2].PmnPFS |= (1<<R_PFS_PORT_PIN_PmnPFS_PCR_Pos);

It's important to notice that those array evaluations all (should) get optimized away during compile, as long as the port and pin are constants. You'll wind up with a simple read/modify/write of the register in memory.

Yes. This sort of thing is pretty common for 32bit RISC CPUs; it helps make up for not having things like the SBI/CBI instructions. Even the newer AVRs (like the 4809) have set/reset registers. Among other things, they're nicely atomic, whereas if all you had was PODR, you'd spend a lot of time and instructions adding that atomicity.

BTW, as @susan-parker demonstrated in her "direct access" code, the PFS registers are byte-writable as well as 16/32bit modes, and the low 8bits are all "known constants" for digital output, so you don't even need the |= or &=~ operators.
image

  • NCODR Open Drain Control
  • PCR Pull-up control
  • PDR direction control
  • PIDR input state (read only)
  • PODR output data.

To write a 0, write a byte with just PDR set (PODR = 0)
To write a 1, write a byte with PDR and PODR set.

There's no "toggle" register for the RA4, is there?