libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
systemcontrol.c
Go to the documentation of this file.
1
/*
2
* This file is part of the libopencm3 project.
3
*
4
* Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
5
*
6
* This library is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation, either version 3 of the License, or
9
* (at your option) any later version.
10
*
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this library. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#include <
libopencm3/lm4f/systemcontrol.h
>
21
22
/**
23
* \brief Enable the clock source for the peripheral
24
*
25
* @param[in] periph peripheral and clock type to enable @see lm4f_clken
26
*/
27
void
periph_clock_enable
(
enum
lm4f_clken
periph)
28
{
29
MMIO32
(
SYSCTL_BASE
+ (periph >> 5)) |= 1 << (periph & 0x1f);
30
}
31
32
/**
33
* \brief Disable the clock source for the peripheral
34
*
35
* @param[in] periph peripheral and clock type to enable @see lm4f_clken
36
*/
37
void
periph_clock_disable
(
enum
lm4f_clken
periph)
38
{
39
MMIO32
(
SYSCTL_BASE
+ (periph >> 5)) &= ~(1 << (periph & 0x1f));
40
}
MMIO32
#define MMIO32(addr)
Definition:
common.h:69
lm4f_clken
lm4f_clken
Clock enable definitions.
Definition:
systemcontrol.h:628
periph_clock_enable
void periph_clock_enable(enum lm4f_clken periph)
Enable the clock source for the peripheral.
Definition:
systemcontrol.c:27
periph_clock_disable
void periph_clock_disable(enum lm4f_clken periph)
Disable the clock source for the peripheral.
Definition:
systemcontrol.c:37
SYSCTL_BASE
#define SYSCTL_BASE
Definition:
lm4f/memorymap.h:83
systemcontrol.h
lib
lm4f
systemcontrol.c
Generated on Tue Mar 7 2023 16:12:50 for libopencm3 by
1.9.4