libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
pmc_common_3a3s3x.h
Go to the documentation of this file.
1/*
2 * This file is part of the libopencm3 project.
3 *
4 * Copyright (C) 2012 Gareth McMullin <gareth@blacksphere.co.nz>
5 * Copyright (C) 2015 Felix Held <felix-libopencm3@felixheld.de>
6 *
7 * This library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#if defined(LIBOPENCM3_PMC_H)
22
23#ifndef LIBOPENCM3_PMC_COMMON_3A3S3X_H
24#define LIBOPENCM3_PMC_COMMON_3A3S3X_H
25
26
27/* --- Power Management Controller (PMC) registers ----------------------- */
28
29/* Peripheral Clock Enable Register 0 */
30#define PMC_PCER0 MMIO32(PMC_BASE + 0x0010)
31
32/* Peripheral Clock Disable Register 0 */
33#define PMC_PCDR0 MMIO32(PMC_BASE + 0x0014)
34
35/* Peripheral Clock Status Register 0 */
36#define PMC_PCSR0 MMIO32(PMC_BASE + 0x0018)
37
38/* USB Clock Register */
39#define PMC_USB MMIO32(PMC_BASE + 0x0038)
40
41/* Peripheral Clock Enable Register 1 */
42#define PMC_PCER1 MMIO32(PMC_BASE + 0x0100)
43
44/* Peripheral Clock Disable Register 1 */
45#define PMC_PCDR1 MMIO32(PMC_BASE + 0x0104)
46
47/* Peripheral Clock Status Register 1 */
48#define PMC_PCSR1 MMIO32(PMC_BASE + 0x0108)
49
50
51/* --- Register contents --------------------------------------------------- */
52
53
54/* --- PMC USB Clock Register (PMC_USB) ------------------------------------ */
55
56/* Divider for USB Clock */
57#define PMC_USB_USBDIV_SHIFT 8
58#define PMC_USB_USBDIV_MASK (0x0F << PMC_USB_USBDIV_SHIFT)
59
60/* USB Input Clock Selection */
61#define PMC_USB_USBS (0x01 << 0)
62
63
64#endif
65
66#else
67#warning "pmc_common_3a3s3x.h should not be included explicitly, only via pmc.h"
68#endif