BSPACM
20150113
Board Support Package for ARM Cortex-M Microcontrollers
|
Support for peripheral pin multiplexing configuration. More...
#include <bspacm/core.h>
Go to the source code of this file.
Data Structures | |
struct | sBSPACMdeviceEFM32pinmux |
Typedefs | |
typedef struct sBSPACMdeviceEFM32pinmux | sBSPACMdeviceEFM32pinmux |
Functions | |
void | vBSPACMdeviceEFM32pinmuxConfigure (const sBSPACMdeviceEFM32pinmux *cfgp, int enablep, int initial_high) |
Support for peripheral pin multiplexing configuration.
EFM32 peripherals are mapped to specific GPIO pins; the specific peripheral function supported by a GPIO pin is determined by the value written to the corresponding ROUTE register within the peripheral device register block.
The mapping between pin and peripheral function is constrained by the specific device. In some cases the same function can be mapped to multiple pins; in that situation, the desired mapping may be specific to the board or even to the application.
This file declares arrays that provide pin mapping definitions for all peripherals that are used by the application. These mappings are used by the generic EFM32 peripheral configuration routines. The application, board, or device should provide definitions for the structure corresponding to each required peripheral in a source file named periph_config.c
with an absolute path set in the make variable PERIPH_CONFIG_SRC
. By default the board-specific periph_config.c
is used.
typedef struct sBSPACMdeviceEFM32pinmux sBSPACMdeviceEFM32pinmux |
Core structure associating a GPIO port, pin, and port control function.
Example to configure PD0
as output (push/pull):
void vBSPACMdeviceEFM32pinmuxConfigure | ( | const sBSPACMdeviceEFM32pinmux * | cfgp, |
int | enablep, | ||
int | initial_high | ||
) |
Function to configure a GPIO according to *cfgp
and provide an initial value.
cfgp | pointer to the configuration structure. If cfgp->port is null, no configuration will be performed. |
enablep | nonzero if the pin is to be configured based on cfgp->mode ; zero if the pin is to be disabled. |
initial_high | zero to clear the pin, positive to set the pin, negative to leave the pin setting unchanged. |