[riot-notifications] [RIOT-OS/RIOT] cpu/qn908x: Initial minimal support for NXP QN908x CPUs. (#13855)
notifications at github.com
Sun Nov 29 18:14:36 CET 2020
@iosabi commented on this pull request.
> +void clocks_init(void)
+ /* Set up clock selectors - Attach clocks to the peripheries */
+ /* Switch XTAL_CLK to 32M */
+ /* Switch 32K_CLK to XTAL32K */
+ /* Switch SYS_CLK to XTAL */
+ /* Switch WDT_CLK to APB */
+ /* Set up dividers */
+ /* Set OSC32M_DIV divider to value 2 */
+ CLOCK_SetClkDiv(kCLOCK_DivOsc32mClk, 1U);
+ /* Set XTAL_DIV divider to value 2 */
+ CLOCK_SetClkDiv(kCLOCK_DivXtalClk, 1U);
+ /* Set AHB_DIV divider to value 2 */
+ CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 1U);
+ /* Set FRG_MULT1 to value 0, Set FRG_DIV1 to value 255 */
+ CLOCK_SetClkDiv(kCLOCK_DivFrg1, 0U);
+ /* Set FRG_MULT0 to value 0, Set FRG_DIV0 to value 255 */
+ CLOCK_SetClkDiv(kCLOCK_DivFrg0, 0U);
+ /* Set APB_DIV divider to value 1 */
+ CLOCK_SetClkDiv(kCLOCK_DivApbClk, 0U);
ok, the thinking here is that whether you have an external XTAL for 32 MHz (or 16 MHz) and another external xtal for the 32.768 KHz depends on the board wiring, you can have a design that uses only the internal ones (32MHz and 32.768 KHz), then based on this you would have different clock setup for the board which also changes how do you configure the APB bus clock for the peripherals.
Should all of this be done using macros in `cpu_conf.h` that the board can override, but the code lives in cpu_init() (or a function called from there)?
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications