3.1.3 Sample code for initial ECO configuration
Code Listing 1 provides a sample code.
The following description will help you understand the register notation of the driver part of the SDL:
• SRSS->unCLK_ECO_CONFIG.stcField.u1ECO_EN is the SRSS_CLK_ECO_CONFIG.ECO_EN mentioned in the
Registers TRM. Other registers are also described in the same manner.
• Performance improvement measures
To improve the performance of register setting, the SDL writes a complete 32-bit data to the register. Each
bit field is generated in advance in a bit-writable buffer and written to the register as the final 32-bit data.
tempTrimEcoCtlReg.u32Register = SRSS->unCLK_ECO_CONFIG2.u32Register;
tempTrimEcoCtlReg.stcField.u3WDTRIM = wdtrim;
tempTrimEcoCtlReg.stcField.u4ATRIM = atrim;
tempTrimEcoCtlReg.stcField.u2FTRIM = ftrim;
tempTrimEcoCtlReg.stcField.u2RTRIM = rtrim;
tempTrimEcoCtlReg.stcField.u3GTRIM = gtrim;
SRSS->unCLK_ECO_CONFIG2.u32Register = tempTrimEcoCtlReg.u32Register;
See cyip_srss_v2.h under hdr/rev_x/ip for more information on the union and structure representation of
registers.