CSD_SW_REFGEN_SEL |= ((uint32)1 << SW_SGRE);
sorry, i doesnt work.
I get the message "use of undeclared identifier CSD_SW_REFGEN_SEL"
The original question was "How to set or clear a register bit in software?"
Can you please post your complete project so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
now i used
refgen = CY_GET_REG32(0x400B02A8);
refgen |= 0x1000000; // Mask Bit 24
CY_SET_REG32(0x400B02A8, refgen); // Set register CSD_SW_REFGEN_SEL (Bit 24)
and it works!