source: rtems/bsps/arm/lpc24xx/include/bsp/system-clocks.h @ 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: 1.6 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup RTEMSBSPsARMLPC24XX_clocks
5 *
6 * @brief System clocks.
7 */
8
9/*
10 * Copyright (c) 2008, 2009 embedded brains GmbH.  All rights reserved.
11 *
12 * The license and distribution terms for this file may be
13 * found in the file LICENSE in this distribution or at
14 * http://www.rtems.org/license/LICENSE.
15 */
16
17#ifndef LIBBSP_ARM_LPC24XX_SYSTEM_CLOCKS_H
18#define LIBBSP_ARM_LPC24XX_SYSTEM_CLOCKS_H
19
20#include <bsp/lpc24xx.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* __cplusplus */
25
26/**
27 * @defgroup lpc24xx_clock System Clocks
28 *
29 * @ingroup RTEMSBSPsARMLPC24XX
30 *
31 * @brief System clocks.
32 *
33 * @{
34 */
35
36/**
37 * @brief Initializes the standard timer.
38 *
39 * This function uses Timer 1.
40 */
41void lpc24xx_timer_initialize(void);
42
43/**
44 * @brief Returns current standard timer value in CPU clocks.
45 *
46 * This function uses Timer 1.
47 */
48static inline unsigned lpc24xx_timer(void)
49{
50  return T1TC;
51}
52
53/**
54 * @brief Delay for @a us micro seconds.
55 *
56 * This function uses the standard timer and assumes that the CPU frequency is
57 * in whole MHz numbers.  The delay value @a us will be converted to CPU ticks
58 * and there is no protection against integer overflows.
59 *
60 * This function uses Timer 1.
61 */
62void lpc24xx_micro_seconds_delay(unsigned us);
63
64/**
65 * @brief Returns the PLL output clock frequency in [Hz].
66 *
67 * Returns zero in case of an unexpected PLL input frequency.
68 */
69unsigned lpc24xx_pllclk(void);
70
71/**
72 * @brief Returns the CPU clock frequency in [Hz].
73 *
74 * Returns zero in case of an unexpected PLL input frequency.
75 */
76unsigned lpc24xx_cclk(void);
77
78/** @} */
79
80#ifdef __cplusplus
81}
82#endif /* __cplusplus */
83
84#endif /* LIBBSP_ARM_LPC24XX_SYSTEM_CLOCKS_H */
Note: See TracBrowser for help on using the repository browser.