libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
syscon.h
Go to the documentation of this file.
1/** @defgroup syscon_defines SYSCON Defines
2 *
3 * @brief <b>Defined Constants and Types for the SWM050 SYSCON peripheral</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 Icenowy Zheng <icenowy@aosc.io>
13 * Copyright (C) 2019 Caleb Szalacinski <contact@skiboy.net>
14 *
15 * This library is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU Lesser General Public License for more details.
24 *
25 * You should have received a copy of the GNU Lesser General Public License
26 * along with this library. If not, see <http://www.gnu.org/licenses/>.
27 */
28/**@{*/
29#ifndef LIBOPENCM3_SYSCON_H
30#define LIBOPENCM3_SYSCON_H
33
34/* SYSCON Registers */
35/** @defgroup syscon_registers SYSCON Registers
36@{*/
37/** SWD Enable register */
38#define SYSCON_SWD_SEL MMIO32(SYSTEM_CON_BASE + 0x30)
39/** Pin Alternate function selection register */
40#define SYSCON_PORTA_SEL MMIO32(SYSTEM_CON_BASE + 0x80)
41/** Pin Pull up register */
42#define SYSCON_PORTA_PULLUP MMIO32(SYSTEM_CON_BASE + 0x90)
43/** Pin Input enable register */
44#define SYSCON_PORTA_INEN MMIO32(SYSTEM_CON_BASE + 0xe0)
45/*@}*/
46
48
49void syscon_sel_af(uint16_t gpios, bool af_en);
50void syscon_pullup(uint16_t gpios, bool en);
51void syscon_input_enable(uint16_t gpios, bool en);
52void syscon_sel_swd(bool en);
53
55
56#endif
57/**@}*/
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33
void syscon_sel_af(uint16_t gpios, bool af_en)
Select the alternative function of a Group of Pins.
Definition: syscon.c:43
void syscon_pullup(uint16_t gpios, bool en)
Enable the internal pull-up of a Group of Pins.
Definition: syscon.c:75
void syscon_sel_swd(bool en)
Select the SWD function of GPIO 1/2.
Definition: syscon.c:112
void syscon_input_enable(uint16_t gpios, bool en)
Enable the input function of a Group of Pins.
Definition: syscon.c:95