mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-01 12:52:26 +00:00
This is a straightforward conversion of existing tables into X-Macro style definitions for the GPIO alternate functions. This change in itself, is not particularly powerful, but having all GPIO settings in a single file makes a board easier to understand. Signed-off-by: Anton Staaf <robotboy@chromium.org> BRANCH=none TEST=make buildall -j Followed by manual testing of interrupt on change and UART functionality on STM32F0 based discovery board. Change-Id: Ib7f1f014f4bd289d7c0ac3100470ba2dc71ca579 Reviewed-on: https://chromium-review.googlesource.com/207987 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Anton Staaf <robotboy@chromium.org> Commit-Queue: Anton Staaf <robotboy@chromium.org>
31 lines
893 B
C
31 lines
893 B
C
/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#define GPIO(name, port, pin, flags, signal) \
|
|
{#name, GPIO_##port, (1 << pin), flags, signal},
|
|
|
|
#define UNIMPLEMENTED(name) \
|
|
{#name, DUMMY_GPIO_BANK, 0, 0, NULL},
|
|
|
|
/* GPIO signal list. */
|
|
const struct gpio_info gpio_list[] = {
|
|
#include "gpio.wrap"
|
|
};
|
|
|
|
BUILD_ASSERT(ARRAY_SIZE(gpio_list) == GPIO_COUNT);
|
|
|
|
/*
|
|
* Construct the gpio_alt_funcs array. This array is used by gpio_config_module
|
|
* to enable and disable GPIO alternate functions on a module by module basis.
|
|
*/
|
|
#define ALTERNATE(port, mask, function, module, flags) \
|
|
{GPIO_##port, mask, function, module, flags},
|
|
|
|
const struct gpio_alt_func gpio_alt_funcs[] = {
|
|
#include "gpio.wrap"
|
|
};
|
|
|
|
const int gpio_alt_funcs_count = ARRAY_SIZE(gpio_alt_funcs);
|