source: rtems/bsps/arm/atsam/clock/systick-freq.c @ ba619b7f

Last change on this file since ba619b7f was ba619b7f, checked in by Joel Sherrill <joel@…>, on 03/01/22 at 21:38:20

bsps/arm/: Scripted embedded brains header file clean up

Updates #4625.

  • Property mode set to 100644
File size: 522 bytes
Line 
1/*
2 * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
9#include <bsp.h>
10
11#include <chip.h>
12
13uint32_t atsam_systick_frequency(void)
14{
15  uint32_t mdiv = (PMC->PMC_MCKR & PMC_MCKR_MDIV_Msk) >> PMC_MCKR_MDIV_Pos;
16  uint32_t fclk;
17
18  if (mdiv == 3) {
19    fclk = BOARD_MCK * mdiv;
20  } else {
21    fclk = BOARD_MCK * (1 << mdiv);
22  }
23
24  return fclk;
25}
Note: See TracBrowser for help on using the repository browser.