libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
clk.h
Go to the documentation of this file.
1
/** @defgroup clk_defines Clock Defines
2
*
3
* @brief <b>Defined Constants and Types for the SWM050 System Clock</b>
4
*
5
* @ingroup SWM050_defines
6
*
7
* LGPL License Terms @ref lgpl_license
8
*/
9
/*
10
* This file is part of the libopencm3 project.
11
*
12
* Copyright (C) 2019 Caleb Szalacinski <contact@skiboy.net>
13
*
14
* This library is free software: you can redistribute it and/or modify
15
* it under the terms of the GNU Lesser General Public License as published by
16
* the Free Software Foundation, either version 3 of the License, or
17
* (at your option) any later version.
18
*
19
* This library is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
* GNU Lesser General Public License for more details.
23
*
24
* You should have received a copy of the GNU Lesser General Public License
25
* along with this library. If not, see <http://www.gnu.org/licenses/>.
26
*/
27
/**@{*/
28
#ifndef LIBOPENCM3_CLK_H
29
#define LIBOPENCM3_CLK_H
30
#include <
libopencm3/cm3/common.h
>
31
#include <
libopencm3/swm050/memorymap.h
>
32
33
/* Clock speed definitions */
34
/** @defgroup clk_speeds Base Clock Speeds
35
@{*/
36
enum
clk_speeds
{
37
CLK_18MHZ
,
38
CLK_36MHZ
39
};
40
/*@}*/
41
42
/* Clock divider mask */
43
/** @defgroup clk_mask Mask used to set the clock divider
44
@{*/
45
#define CLK_MASK 0xFFFFFC00
46
/*@}*/
47
48
BEGIN_DECLS
49
50
void
clk_speed
(
enum
clk_speeds
mhz, uint16_t div);
51
52
END_DECLS
53
54
#endif
55
/**@}*/
common.h
END_DECLS
#define END_DECLS
Definition:
common.h:34
BEGIN_DECLS
#define BEGIN_DECLS
Definition:
common.h:33
clk_speed
void clk_speed(enum clk_speeds mhz, uint16_t div)
Setup and change the system clock multiplier and divider.
Definition:
clk.c:50
clk_speeds
clk_speeds
Definition:
clk.h:36
CLK_18MHZ
@ CLK_18MHZ
Definition:
clk.h:37
CLK_36MHZ
@ CLK_36MHZ
Definition:
clk.h:38
memorymap.h
include
libopencm3
swm050
clk.h
Generated on Tue Mar 7 2023 16:13:12 for libopencm3 by
1.9.4