vorkiej:
How can I directly write a register value in my code?For example the PWM_CMR_CPOL (0x1u << 9) change the register value 0 to 1.
// This doesn't work
#define PWM_CMR_CPOL 1;
That won't work. #define works like a placeholder everywhere the compilers find the term PWM_CMR_CPOL he would replace it with a 1.
Something like this should set the register Value to a 1
PWM->PWM_CMR = PWM_CMR_CPOL;