Content originally posted in LPCWare by jmhartmann on Fri Aug 14 14:01:03 MST 2015 In the User Manual UM10470, many configuration registers described have bits described as "Reserved. Read value is undefined, only zero should be written". This implies that read/modify/write operations such as "example->register |= 0x01" would not be allowed because the entire register is read, bit zero is set, and the entire register is written back.
However, in driver code provided by NXP such as the drivers here: https://www.lpcware.com/content/nxpfile/lpc177x-and-lpc178x-cmsis-compliant-standard-peripheral-firm..., this is precisely what the driver is doing. For example, in the file lpc177x_8x_timer.c where the register TCR is modified. TCR bits 31:2 are defined as "Reserved. Read value is undefined, only zero should be written". See the code below for the implementation.
My question is, is the UM correct and the example code wrong?