184 lines
3.4 KiB
C
184 lines
3.4 KiB
C
|
|
/** \file
|
|
\brief MCU pin mappings.
|
|
|
|
Here we map the pins required by Teacup to the names known by CMSIS.
|
|
*/
|
|
|
|
/** I/O pins.
|
|
|
|
In MBED, I/O pin handling is rather complicated. Lots of enums, lots of
|
|
functions, spread over various files, slow execution (pin toggling about
|
|
15 times slower than what we have here).
|
|
|
|
FASTIO by setting the BSRR (bit set/reset register),
|
|
- Bit0-15 to set
|
|
- Bit16-31 to reset.
|
|
|
|
Pins set for Nucleo F411RE, for other STM32F4-boards you need to add them.
|
|
*/
|
|
|
|
#include "cmsis-stm32f4xx.h"
|
|
|
|
/** Pins for UART, the serial port.
|
|
*/
|
|
#define RXD_PORT PIOA_3_PORT
|
|
#define RXD_PIN PIOA_3_PIN
|
|
#define TXD_PORT PIOA_2_PORT
|
|
#define TXD_PIN PIOA_2_PIN
|
|
|
|
/**
|
|
We define only pins available on the Nucleo F411RE here.
|
|
Use alphas for PORT and numerics for PIN, close to the design.
|
|
*/
|
|
|
|
#define PA_0_PIN 0
|
|
#define PA_0_PORT GPIOA
|
|
|
|
#define PA_1_PIN 1
|
|
#define PA_1_PORT GPIOA
|
|
|
|
#define PA_2_PIN 2
|
|
#define PA_2_PORT GPIOA
|
|
|
|
#define PA_3_PIN 3
|
|
#define PA_3_PORT GPIOA
|
|
|
|
#define PA_4_PIN 4
|
|
#define PA_4_PORT GPIOA
|
|
|
|
#define PA_5_PIN 5
|
|
#define PA_5_PORT GPIOA
|
|
|
|
#define PA_6_PIN 6
|
|
#define PA_6_PORT GPIOA
|
|
|
|
#define PA_7_PIN 7
|
|
#define PA_7_PORT GPIOA
|
|
|
|
#define PA_8_PIN 8
|
|
#define PA_8_PORT GPIOA
|
|
|
|
#define PA_9_PIN 9
|
|
#define PA_9_PORT GPIOA
|
|
|
|
#define PA_10_PIN 10
|
|
#define PA_10_PORT GPIOA
|
|
|
|
#define PA_11_PIN 11
|
|
#define PA_11_PORT GPIOA
|
|
|
|
#define PA_12_PIN 12
|
|
#define PA_12_PORT GPIOA
|
|
|
|
#define PA_13_PIN 13
|
|
#define PA_13_PORT GPIOA
|
|
|
|
#define PA_14_PIN 14
|
|
#define PA_14_PORT GPIOA
|
|
|
|
#define PA_15_PIN 15
|
|
#define PA_15_PORT GPIOA
|
|
|
|
#define PB_0_PIN 0
|
|
#define PB_0_PORT GPIOB
|
|
|
|
#define PB_1_PIN 1
|
|
#define PB_1_PORT GPIOB
|
|
|
|
#define PB_2_PIN 2
|
|
#define PB_2_PORT GPIOB
|
|
|
|
#define PB_3_PIN 3
|
|
#define PB_3_PORT GPIOB
|
|
|
|
#define PB_4_PIN 4
|
|
#define PB_4_PORT GPIOB
|
|
|
|
#define PB_5_PIN 5
|
|
#define PB_5_PORT GPIOB
|
|
|
|
#define PB_6_PIN 6
|
|
#define PB_6_PORT GPIOB
|
|
|
|
#define PB_7_PIN 7
|
|
#define PB_7_PORT GPIOB
|
|
|
|
#define PB_8_PIN 8
|
|
#define PB_8_PORT GPIOB
|
|
|
|
#define PB_9_PIN 9
|
|
#define PB_9_PORT GPIOB
|
|
|
|
#define PB_10_PIN 10
|
|
#define PB_10_PORT GPIOB
|
|
|
|
#define PB_12_PIN 12
|
|
#define PB_12_PORT GPIOB
|
|
|
|
#define PB_13_PIN 13
|
|
#define PB_13_PORT GPIOB
|
|
|
|
#define PB_14_PIN 14
|
|
#define PB_14_PORT GPIOB
|
|
|
|
#define PB_15_PIN 15
|
|
#define PB_15_PORT GPIOB
|
|
|
|
#define PC_0_PIN 0
|
|
#define PC_0_PORT GPIOC
|
|
|
|
#define PC_1_PIN 1
|
|
#define PC_1_PORT GPIOC
|
|
|
|
#define PC_2_PIN 2
|
|
#define PC_2_PORT GPIOC
|
|
|
|
#define PC_3_PIN 3
|
|
#define PC_3_PORT GPIOC
|
|
|
|
#define PC_4_PIN 4
|
|
#define PC_4_PORT GPIOC
|
|
|
|
#define PC_5_PIN 5
|
|
#define PC_5_PORT GPIOC
|
|
|
|
#define PC_6_PIN 6
|
|
#define PC_6_PORT GPIOC
|
|
|
|
#define PC_7_PIN 7
|
|
#define PC_7_PORT GPIOC
|
|
|
|
#define PC_8_PIN 8
|
|
#define PC_8_PORT GPIOC
|
|
|
|
#define PC_9_PIN 9
|
|
#define PC_9_PORT GPIOC
|
|
|
|
#define PC_10_PIN 10
|
|
#define PC_10_PORT GPIOC
|
|
|
|
#define PC_11_PIN 11
|
|
#define PC_11_PORT GPIOC
|
|
|
|
#define PC_12_PIN 12
|
|
#define PC_12_PORT GPIOC
|
|
|
|
#define PC_13_PIN 13
|
|
#define PC_13_PORT GPIOC
|
|
|
|
#define PC_14_PIN 14
|
|
#define PC_14_PORT GPIOC
|
|
|
|
#define PC_15_PIN 15
|
|
#define PC_15_PORT GPIOC
|
|
|
|
#define PD_2_PIN 2
|
|
#define PD_2_PORT GPIOD
|
|
|
|
#define PH_0_PIN 0
|
|
#define PH_0_PORT GPIOH
|
|
|
|
#define PH_1_PIN 1
|
|
#define PH_1_PORT GPIOH
|