doc: efm32: include gpio_common

gpio_common was built, but wasn't picked up by any documentation.
Use the peripheral_apis style from stm32, but try out the #pragma once
style.  Downside is you don't get warnings if you include an sub layer
.h file.  Upsides are
* no ifdef/endif blocks
* no /**@cond*/ /**@endcond*/ blocks
* that's enough win!
This commit is contained in:
Karl Palsson 2019-06-22 00:53:54 +00:00
parent 6d74262bf4
commit 9bc432474b
7 changed files with 55 additions and 31 deletions

View File

@ -1,3 +1,5 @@
/** @addtogroup gpio_defines
*/
/*
* This file is part of the libopencm3 project.
*
@ -17,12 +19,13 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_EFM32_GPIO_H
#define LIBOPENCM3_EFM32_GPIO_H
#pragma once
#include <libopencm3/efm32/memorymap.h>
#include <libopencm3/cm3/common.h>
/**@{*/
#define GPIO_P(i) (GPIO_BASE + (0x24 * (i)))
#define GPIO_PA GPIO_P(0)
#define GPIO_PB GPIO_P(1)
@ -326,5 +329,4 @@ void gpio_port_config_lock(uint32_t gpio_port, uint16_t gpios);
END_DECLS
#endif
/**@}*/

View File

@ -1,3 +1,5 @@
/** @addtogroup gpio_defines
*/
/*
* This file is part of the libopencm3 project.
*
@ -17,15 +19,13 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/** @cond */
#if defined(LIBOPENCM3_GPIO_H)
/** @endcond */
#ifndef LIBOPENCM3_EFM32_GPIO_COMMON_HGLG_H
#define LIBOPENCM3_EFM32_GPIO_COMMON_HGLG_H
#pragma once
#include <libopencm3/efm32/memorymap.h>
#include <libopencm3/cm3/common.h>
/**@{*/
#define GPIO_P(i) (GPIO_BASE + (0x24 * (i)))
#define GPIO_PA GPIO_P(0)
#define GPIO_PB GPIO_P(1)
@ -329,9 +329,4 @@ void gpio_port_config_lock(uint32_t gpio_port, uint16_t gpios);
END_DECLS
#endif
/** @cond */
#else
#warning "gpio_common_hglg.h should not be included explicitly, only via gpio.h"
#endif
/** @endcond */
/**@}*/

View File

@ -1,3 +1,11 @@
/** @defgroup gpio_defines GPIO Defines
*
* @brief <b>Defined Constants and Types for the EZR32WG GPIO module</b>
*
* @ingroup EZR32WG_defines
*
* LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@ -17,9 +25,6 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_EFM32_EZR32WG_GPIO_H
#define LIBOPENCM3_EFM32_EZR32WG_GPIO_H
#pragma once
#include <libopencm3/efm32/common/gpio_common.h>
#endif

View File

@ -1,3 +1,11 @@
/** @defgroup gpio_defines GPIO Defines
*
* @brief <b>Defined Constants and Types for the EFM32HG GPIO module</b>
*
* @ingroup EFM32HG_defines
*
* LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@ -15,9 +23,6 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_GPIO_H
#define LIBOPENCM3_GPIO_H
#pragma once
#include <libopencm3/efm32/common/gpio_common_hglg.h>
#endif

View File

@ -1,3 +1,11 @@
/** @defgroup gpio_defines GPIO Defines
*
* @brief <b>Defined Constants and Types for the EFM32LG GPIO module</b>
*
* @ingroup EFM32LG_defines
*
* LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@ -15,9 +23,6 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_GPIO_H
#define LIBOPENCM3_GPIO_H
#pragma once
#include <libopencm3/efm32/common/gpio_common.h>
#endif

View File

@ -1,3 +1,11 @@
/** @defgroup gpio_defines GPIO Defines
*
* @brief <b>Defined Constants and Types for the EFM32WG GPIO module</b>
*
* @ingroup EFM32WG_defines
*
* LGPL License Terms @ref lgpl_license
*/
/*
* This file is part of the libopencm3 project.
*
@ -17,9 +25,6 @@
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBOPENCM3_EFM32_WG_GPIO_H
#define LIBOPENCM3_EFM32_WG_GPIO_H
#pragma once
#include <libopencm3/efm32/common/gpio_common.h>
#endif

View File

@ -1,3 +1,6 @@
/** @addtogroup gpio_file GPIO peripheral API
* @ingroup peripheral_apis
*/
/*
* This file is part of the libopencm3 project.
*
@ -19,6 +22,8 @@
#include <libopencm3/efm32/gpio.h>
/**@{*/
/**
* Enable GPIO registers lock.
* @see gpio_disable_lock()
@ -173,3 +178,5 @@ void gpio_port_config_lock(uint32_t gpio_port, uint16_t gpios)
{
GPIO_P_PINLOCKN(gpio_port) = ~gpios;
}
/**@}*/