Board files regenerated with the updated tool. Fixed some errors in demos.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7854 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
60d63e9970
commit
2381a70190
|
@ -76,26 +76,32 @@ PROJECT = ch
|
|||
|
||||
# Imported source files and paths
|
||||
CHIBIOS = ../../..
|
||||
# Startup files.
|
||||
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk
|
||||
# HAL-OSAL files (optional).
|
||||
include $(CHIBIOS)/os/hal/hal.mk
|
||||
include $(CHIBIOS)/os/hal/boards/ST_NUCLEO_F030R8/board.mk
|
||||
include $(CHIBIOS)/os/hal/ports/STM32/STM32F0xx/platform.mk
|
||||
include $(CHIBIOS)/os/hal/boards/ST_NUCLEO_F030R8/board.mk
|
||||
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
|
||||
# RTOS files (optional).
|
||||
include $(CHIBIOS)/os/rt/rt.mk
|
||||
include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_stm32f0xx.mk
|
||||
include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
|
||||
# Other files (optional).
|
||||
include $(CHIBIOS)/test/rt/test.mk
|
||||
|
||||
# Define linker script file here
|
||||
LDSCRIPT= $(PORTLD)/STM32F030x8.ld
|
||||
LDSCRIPT= $(STARTUPLD)/STM32F030x8.ld
|
||||
|
||||
# C sources that can be compiled in ARM or THUMB mode depending on the global
|
||||
# setting.
|
||||
CSRC = $(PORTSRC) \
|
||||
CSRC = $(STARTUPSRC) \
|
||||
$(KERNSRC) \
|
||||
$(TESTSRC) \
|
||||
$(HALSRC) \
|
||||
$(PORTSRC) \
|
||||
$(OSALSRC) \
|
||||
$(HALSRC) \
|
||||
$(PLATFORMSRC) \
|
||||
$(BOARDSRC) \
|
||||
$(TESTSRC) \
|
||||
main.c
|
||||
|
||||
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
|
||||
|
@ -123,10 +129,10 @@ TCSRC =
|
|||
TCPPSRC =
|
||||
|
||||
# List ASM source files here
|
||||
ASMSRC = $(PORTASM)
|
||||
ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
|
||||
|
||||
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
|
||||
$(HALINC) $(OSALINC) $(PLATFORMINC) $(BOARDINC) \
|
||||
INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
|
||||
$(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
|
||||
$(CHIBIOS)/os/various
|
||||
|
||||
#
|
||||
|
|
|
@ -591,7 +591,7 @@ static void RemoveHandler(eventid_t id) {
|
|||
* Green LED blinker thread, times are in milliseconds.
|
||||
*/
|
||||
static THD_WORKING_AREA(waThread1, 128);
|
||||
static msg_t Thread1(void *arg) {
|
||||
static THD_FUNCTION(Thread1, arg) {
|
||||
|
||||
(void)arg;
|
||||
chRegSetThreadName("blinker");
|
||||
|
@ -599,8 +599,6 @@ static msg_t Thread1(void *arg) {
|
|||
palTogglePad(GPIOC, GPIOC_LED);
|
||||
chThdSleepMilliseconds(fs_ready ? 125 : 500);
|
||||
}
|
||||
|
||||
return MSG_OK; /* warning suppressor */
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -87,7 +87,7 @@ THD_WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE);
|
|||
/**
|
||||
* HTTP server thread.
|
||||
*/
|
||||
msg_t http_server(void *p) {
|
||||
THD_FUNCTION(http_server, p) {
|
||||
struct netconn *conn, *newconn;
|
||||
err_t err;
|
||||
|
||||
|
@ -96,7 +96,7 @@ msg_t http_server(void *p) {
|
|||
|
||||
/* Create a new TCP connection handle */
|
||||
conn = netconn_new(NETCONN_TCP);
|
||||
LWIP_ERROR("http_server: invalid conn", (conn != NULL), return MSG_RESET;);
|
||||
LWIP_ERROR("http_server: invalid conn", (conn != NULL), chThdExit(MSG_RESET););
|
||||
|
||||
/* Bind to port 80 (HTTP) with default IP address */
|
||||
netconn_bind(conn, NULL, WEB_THREAD_PORT);
|
||||
|
@ -107,14 +107,13 @@ msg_t http_server(void *p) {
|
|||
/* Goes to the final priority after initialization.*/
|
||||
chThdSetPriority(WEB_THREAD_PRIORITY);
|
||||
|
||||
while(1) {
|
||||
while (true) {
|
||||
err = netconn_accept(conn, &newconn);
|
||||
if (err != ERR_OK)
|
||||
continue;
|
||||
http_server_serve(newconn);
|
||||
netconn_delete(newconn);
|
||||
}
|
||||
return MSG_OK;
|
||||
}
|
||||
|
||||
#endif /* LWIP_NETCONN */
|
||||
|
|
|
@ -41,7 +41,7 @@ extern THD_WORKING_AREA(wa_http_server, WEB_THREAD_STACK_SIZE);
|
|||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
msg_t http_server(void *p);
|
||||
THD_FUNCTION(http_server, p);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
* Red LED blinker thread, times are in milliseconds.
|
||||
*/
|
||||
static THD_WORKING_AREA(waThread1, 128);
|
||||
static msg_t Thread1(void *arg) {
|
||||
static THD_FUNCTION(Thread1, arg) {
|
||||
|
||||
(void)arg;
|
||||
chRegSetThreadName("blinker1");
|
||||
|
@ -43,7 +43,7 @@ static msg_t Thread1(void *arg) {
|
|||
* Green LED blinker thread, times are in milliseconds.
|
||||
*/
|
||||
static THD_WORKING_AREA(waThread2, 128);
|
||||
static msg_t Thread2(void *arg) {
|
||||
static THD_FUNCTION(Thread2, arg) {
|
||||
|
||||
(void)arg;
|
||||
chRegSetThreadName("blinker2");
|
||||
|
|
|
@ -77,10 +77,10 @@ void __early_init(void) {
|
|||
* @brief SDC card detection.
|
||||
*/
|
||||
bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
||||
static bool last_status = false;
|
||||
|
||||
if (blkIsTransferring(sdcp))
|
||||
return last_status;
|
||||
static bool last_status = false;
|
||||
|
||||
if (blkIsTransferring(sdcp))
|
||||
return last_status;
|
||||
return last_status = (bool)palReadPad(GPIOC, GPIOC_SD_D3);
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,8 @@ bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
|||
* @brief SDC card write protection detection.
|
||||
*/
|
||||
bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
|
||||
|
||||
(void)sdcp;
|
||||
|
||||
(void)sdcp;
|
||||
return false;
|
||||
}
|
||||
#endif /* HAL_USE_SDC */
|
||||
|
|
|
@ -37,18 +37,18 @@
|
|||
* Board oscillators-related settings.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 12000000
|
||||
#define STM32_HSECLK 12000000U
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 330
|
||||
#define STM32_VDD 330U
|
||||
|
||||
/*
|
||||
* MCU type as defined in the ST header.
|
||||
|
@ -58,180 +58,180 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_BUTTON_WKUP 0
|
||||
#define GPIOA_ETH_RMII_REF_CLK 1
|
||||
#define GPIOA_ETH_RMII_MDIO 2
|
||||
#define GPIOA_ETH_RMII_MDINT 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_PIN5 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_ETH_RMII_CRS_DV 7
|
||||
#define GPIOA_USB_HS_BUSON 8
|
||||
#define GPIOA_OTG_FS_VBUS 9
|
||||
#define GPIOA_OTG_FS_ID 10
|
||||
#define GPIOA_OTG_FS_DM 11
|
||||
#define GPIOA_OTG_FS_DP 12
|
||||
#define GPIOA_JTAG_TMS 13
|
||||
#define GPIOA_JTAG_TCK 14
|
||||
#define GPIOA_JTAG_TDI 15
|
||||
#define GPIOA_BUTTON_WKUP 0U
|
||||
#define GPIOA_ETH_RMII_REF_CLK 1U
|
||||
#define GPIOA_ETH_RMII_MDIO 2U
|
||||
#define GPIOA_ETH_RMII_MDINT 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_PIN5 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_ETH_RMII_CRS_DV 7U
|
||||
#define GPIOA_USB_HS_BUSON 8U
|
||||
#define GPIOA_OTG_FS_VBUS 9U
|
||||
#define GPIOA_OTG_FS_ID 10U
|
||||
#define GPIOA_OTG_FS_DM 11U
|
||||
#define GPIOA_OTG_FS_DP 12U
|
||||
#define GPIOA_JTAG_TMS 13U
|
||||
#define GPIOA_JTAG_TCK 14U
|
||||
#define GPIOA_JTAG_TDI 15U
|
||||
|
||||
#define GPIOB_USB_FS_BUSON 0
|
||||
#define GPIOB_USB_HS_FAULT 1
|
||||
#define GPIOB_BOOT1 2
|
||||
#define GPIOB_JTAG_TDO 3
|
||||
#define GPIOB_JTAG_TRST 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_I2C1_SCL 8
|
||||
#define GPIOB_I2C1_SDA 9
|
||||
#define GPIOB_SPI2_SCK 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_OTG_HS_ID 12
|
||||
#define GPIOB_OTG_HS_VBUS 13
|
||||
#define GPIOB_OTG_HS_DM 14
|
||||
#define GPIOB_OTG_HS_DP 15
|
||||
#define GPIOB_USB_FS_BUSON 0U
|
||||
#define GPIOB_USB_HS_FAULT 1U
|
||||
#define GPIOB_BOOT1 2U
|
||||
#define GPIOB_JTAG_TDO 3U
|
||||
#define GPIOB_JTAG_TRST 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_I2C1_SCL 8U
|
||||
#define GPIOB_I2C1_SDA 9U
|
||||
#define GPIOB_SPI2_SCK 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_OTG_HS_ID 12U
|
||||
#define GPIOB_OTG_HS_VBUS 13U
|
||||
#define GPIOB_OTG_HS_DM 14U
|
||||
#define GPIOB_OTG_HS_DP 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_ETH_RMII_MDC 1
|
||||
#define GPIOC_SPI2_MISO 2
|
||||
#define GPIOC_SPI2_MOSI 3
|
||||
#define GPIOC_ETH_RMII_RXD0 4
|
||||
#define GPIOC_ETH_RMII_RXD1 5
|
||||
#define GPIOC_USART6_TX 6
|
||||
#define GPIOC_USART6_RX 7
|
||||
#define GPIOC_SD_D0 8
|
||||
#define GPIOC_SD_D1 9
|
||||
#define GPIOC_SD_D2 10
|
||||
#define GPIOC_SD_D3 11
|
||||
#define GPIOC_SD_CLK 12
|
||||
#define GPIOC_LED 13
|
||||
#define GPIOC_OSC32_IN 14
|
||||
#define GPIOC_OSC32_OUT 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_ETH_RMII_MDC 1U
|
||||
#define GPIOC_SPI2_MISO 2U
|
||||
#define GPIOC_SPI2_MOSI 3U
|
||||
#define GPIOC_ETH_RMII_RXD0 4U
|
||||
#define GPIOC_ETH_RMII_RXD1 5U
|
||||
#define GPIOC_USART6_TX 6U
|
||||
#define GPIOC_USART6_RX 7U
|
||||
#define GPIOC_SD_D0 8U
|
||||
#define GPIOC_SD_D1 9U
|
||||
#define GPIOC_SD_D2 10U
|
||||
#define GPIOC_SD_D3 11U
|
||||
#define GPIOC_SD_CLK 12U
|
||||
#define GPIOC_LED 13U
|
||||
#define GPIOC_OSC32_IN 14U
|
||||
#define GPIOC_OSC32_OUT 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_SD_CMD 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_SD_CMD 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_PIN0 0
|
||||
#define GPIOF_PIN1 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_USB_FS_FAULT 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_PIN0 0U
|
||||
#define GPIOF_PIN1 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_USB_FS_FAULT 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
#define GPIOG_PIN0 0
|
||||
#define GPIOG_PIN1 1
|
||||
#define GPIOG_PIN2 2
|
||||
#define GPIOG_PIN3 3
|
||||
#define GPIOG_PIN4 4
|
||||
#define GPIOG_PIN5 5
|
||||
#define GPIOG_PIN6 6
|
||||
#define GPIOG_PIN7 7
|
||||
#define GPIOG_PIN8 8
|
||||
#define GPIOG_PIN9 9
|
||||
#define GPIOG_SPI2_CS 10
|
||||
#define GPIOG_ETH_RMII_TXEN 11
|
||||
#define GPIOG_PIN12 12
|
||||
#define GPIOG_ETH_RMII_TXD0 13
|
||||
#define GPIOG_ETH_RMII_TXD1 14
|
||||
#define GPIOG_PIN15 15
|
||||
#define GPIOG_PIN0 0U
|
||||
#define GPIOG_PIN1 1U
|
||||
#define GPIOG_PIN2 2U
|
||||
#define GPIOG_PIN3 3U
|
||||
#define GPIOG_PIN4 4U
|
||||
#define GPIOG_PIN5 5U
|
||||
#define GPIOG_PIN6 6U
|
||||
#define GPIOG_PIN7 7U
|
||||
#define GPIOG_PIN8 8U
|
||||
#define GPIOG_PIN9 9U
|
||||
#define GPIOG_SPI2_CS 10U
|
||||
#define GPIOG_ETH_RMII_TXEN 11U
|
||||
#define GPIOG_PIN12 12U
|
||||
#define GPIOG_ETH_RMII_TXD0 13U
|
||||
#define GPIOG_ETH_RMII_TXD1 14U
|
||||
#define GPIOG_PIN15 15U
|
||||
|
||||
#define GPIOH_OSC_IN 0
|
||||
#define GPIOH_OSC_OUT 1
|
||||
#define GPIOH_PIN2 2
|
||||
#define GPIOH_PIN3 3
|
||||
#define GPIOH_PIN4 4
|
||||
#define GPIOH_PIN5 5
|
||||
#define GPIOH_PIN6 6
|
||||
#define GPIOH_PIN7 7
|
||||
#define GPIOH_PIN8 8
|
||||
#define GPIOH_PIN9 9
|
||||
#define GPIOH_PIN10 10
|
||||
#define GPIOH_PIN11 11
|
||||
#define GPIOH_PIN12 12
|
||||
#define GPIOH_PIN13 13
|
||||
#define GPIOH_PIN14 14
|
||||
#define GPIOH_PIN15 15
|
||||
#define GPIOH_OSC_IN 0U
|
||||
#define GPIOH_OSC_OUT 1U
|
||||
#define GPIOH_PIN2 2U
|
||||
#define GPIOH_PIN3 3U
|
||||
#define GPIOH_PIN4 4U
|
||||
#define GPIOH_PIN5 5U
|
||||
#define GPIOH_PIN6 6U
|
||||
#define GPIOH_PIN7 7U
|
||||
#define GPIOH_PIN8 8U
|
||||
#define GPIOH_PIN9 9U
|
||||
#define GPIOH_PIN10 10U
|
||||
#define GPIOH_PIN11 11U
|
||||
#define GPIOH_PIN12 12U
|
||||
#define GPIOH_PIN13 13U
|
||||
#define GPIOH_PIN14 14U
|
||||
#define GPIOH_PIN15 15U
|
||||
|
||||
#define GPIOI_PIN0 0
|
||||
#define GPIOI_PIN1 1
|
||||
#define GPIOI_PIN2 2
|
||||
#define GPIOI_PIN3 3
|
||||
#define GPIOI_PIN4 4
|
||||
#define GPIOI_PIN5 5
|
||||
#define GPIOI_PIN6 6
|
||||
#define GPIOI_PIN7 7
|
||||
#define GPIOI_PIN8 8
|
||||
#define GPIOI_PIN9 9
|
||||
#define GPIOI_PIN10 10
|
||||
#define GPIOI_PIN11 11
|
||||
#define GPIOI_PIN12 12
|
||||
#define GPIOI_PIN13 13
|
||||
#define GPIOI_PIN14 14
|
||||
#define GPIOI_PIN15 15
|
||||
#define GPIOI_PIN0 0U
|
||||
#define GPIOI_PIN1 1U
|
||||
#define GPIOI_PIN2 2U
|
||||
#define GPIOI_PIN3 3U
|
||||
#define GPIOI_PIN4 4U
|
||||
#define GPIOI_PIN5 5U
|
||||
#define GPIOI_PIN6 6U
|
||||
#define GPIOI_PIN7 7U
|
||||
#define GPIOI_PIN8 8U
|
||||
#define GPIOI_PIN9 9U
|
||||
#define GPIOI_PIN10 10U
|
||||
#define GPIOI_PIN11 11U
|
||||
#define GPIOI_PIN12 12U
|
||||
#define GPIOI_PIN13 13U
|
||||
#define GPIOI_PIN14 14U
|
||||
#define GPIOI_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -77,10 +77,10 @@ void __early_init(void) {
|
|||
* @brief SDC card detection.
|
||||
*/
|
||||
bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
||||
static bool last_status = false;
|
||||
|
||||
if (blkIsTransferring(sdcp))
|
||||
return last_status;
|
||||
static bool last_status = false;
|
||||
|
||||
if (blkIsTransferring(sdcp))
|
||||
return last_status;
|
||||
return last_status = (bool)palReadPad(GPIOC, GPIOC_SD_D3);
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,8 @@ bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
|||
* @brief SDC card write protection detection.
|
||||
*/
|
||||
bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
|
||||
|
||||
(void)sdcp;
|
||||
|
||||
(void)sdcp;
|
||||
return false;
|
||||
}
|
||||
#endif /* HAL_USE_SDC */
|
||||
|
|
|
@ -37,18 +37,18 @@
|
|||
* Board oscillators-related settings.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 12000000
|
||||
#define STM32_HSECLK 12000000U
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 330
|
||||
#define STM32_VDD 330U
|
||||
|
||||
/*
|
||||
* MCU type as defined in the ST header.
|
||||
|
@ -58,180 +58,180 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_BUTTON_WKUP 0
|
||||
#define GPIOA_ETH_RMII_REF_CLK 1
|
||||
#define GPIOA_ETH_RMII_MDIO 2
|
||||
#define GPIOA_ETH_RMII_MDINT 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_PIN5 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_ETH_RMII_CRS_DV 7
|
||||
#define GPIOA_USB_HS_BUSON 8
|
||||
#define GPIOA_OTG_FS_VBUS 9
|
||||
#define GPIOA_OTG_FS_ID 10
|
||||
#define GPIOA_OTG_FS_DM 11
|
||||
#define GPIOA_OTG_FS_DP 12
|
||||
#define GPIOA_JTAG_TMS 13
|
||||
#define GPIOA_JTAG_TCK 14
|
||||
#define GPIOA_JTAG_TDI 15
|
||||
#define GPIOA_BUTTON_WKUP 0U
|
||||
#define GPIOA_ETH_RMII_REF_CLK 1U
|
||||
#define GPIOA_ETH_RMII_MDIO 2U
|
||||
#define GPIOA_ETH_RMII_MDINT 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_PIN5 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_ETH_RMII_CRS_DV 7U
|
||||
#define GPIOA_USB_HS_BUSON 8U
|
||||
#define GPIOA_OTG_FS_VBUS 9U
|
||||
#define GPIOA_OTG_FS_ID 10U
|
||||
#define GPIOA_OTG_FS_DM 11U
|
||||
#define GPIOA_OTG_FS_DP 12U
|
||||
#define GPIOA_JTAG_TMS 13U
|
||||
#define GPIOA_JTAG_TCK 14U
|
||||
#define GPIOA_JTAG_TDI 15U
|
||||
|
||||
#define GPIOB_USB_FS_BUSON 0
|
||||
#define GPIOB_USB_FS_FAULT 1
|
||||
#define GPIOB_BOOT1 2
|
||||
#define GPIOB_JTAG_TDO 3
|
||||
#define GPIOB_JTAG_TRST 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_I2C1_SCL 8
|
||||
#define GPIOB_I2C1_SDA 9
|
||||
#define GPIOB_SPI2_SCK 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_OTG_HS_ID 12
|
||||
#define GPIOB_OTG_HS_VBUS 13
|
||||
#define GPIOB_OTG_HS_DM 14
|
||||
#define GPIOB_OTG_HS_DP 15
|
||||
#define GPIOB_USB_FS_BUSON 0U
|
||||
#define GPIOB_USB_FS_FAULT 1U
|
||||
#define GPIOB_BOOT1 2U
|
||||
#define GPIOB_JTAG_TDO 3U
|
||||
#define GPIOB_JTAG_TRST 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_I2C1_SCL 8U
|
||||
#define GPIOB_I2C1_SDA 9U
|
||||
#define GPIOB_SPI2_SCK 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_OTG_HS_ID 12U
|
||||
#define GPIOB_OTG_HS_VBUS 13U
|
||||
#define GPIOB_OTG_HS_DM 14U
|
||||
#define GPIOB_OTG_HS_DP 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_ETH_RMII_MDC 1
|
||||
#define GPIOC_SPI2_MISO 2
|
||||
#define GPIOC_SPI2_MOSI 3
|
||||
#define GPIOC_ETH_RMII_RXD0 4
|
||||
#define GPIOC_ETH_RMII_RXD1 5
|
||||
#define GPIOC_USART6_TX 6
|
||||
#define GPIOC_USART6_RX 7
|
||||
#define GPIOC_SD_D0 8
|
||||
#define GPIOC_SD_D1 9
|
||||
#define GPIOC_SD_D2 10
|
||||
#define GPIOC_SD_D3 11
|
||||
#define GPIOC_SD_CLK 12
|
||||
#define GPIOC_LED 13
|
||||
#define GPIOC_OSC32_IN 14
|
||||
#define GPIOC_OSC32_OUT 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_ETH_RMII_MDC 1U
|
||||
#define GPIOC_SPI2_MISO 2U
|
||||
#define GPIOC_SPI2_MOSI 3U
|
||||
#define GPIOC_ETH_RMII_RXD0 4U
|
||||
#define GPIOC_ETH_RMII_RXD1 5U
|
||||
#define GPIOC_USART6_TX 6U
|
||||
#define GPIOC_USART6_RX 7U
|
||||
#define GPIOC_SD_D0 8U
|
||||
#define GPIOC_SD_D1 9U
|
||||
#define GPIOC_SD_D2 10U
|
||||
#define GPIOC_SD_D3 11U
|
||||
#define GPIOC_SD_CLK 12U
|
||||
#define GPIOC_LED 13U
|
||||
#define GPIOC_OSC32_IN 14U
|
||||
#define GPIOC_OSC32_OUT 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_SD_CMD 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_SD_CMD 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_PIN0 0
|
||||
#define GPIOF_PIN1 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_USB_HS_FAULT 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_PIN0 0U
|
||||
#define GPIOF_PIN1 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_USB_HS_FAULT 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
#define GPIOG_PIN0 0
|
||||
#define GPIOG_PIN1 1
|
||||
#define GPIOG_PIN2 2
|
||||
#define GPIOG_PIN3 3
|
||||
#define GPIOG_PIN4 4
|
||||
#define GPIOG_PIN5 5
|
||||
#define GPIOG_PIN6 6
|
||||
#define GPIOG_PIN7 7
|
||||
#define GPIOG_PIN8 8
|
||||
#define GPIOG_PIN9 9
|
||||
#define GPIOG_SPI2_CS 10
|
||||
#define GPIOG_ETH_RMII_TXEN 11
|
||||
#define GPIOG_PIN12 12
|
||||
#define GPIOG_ETH_RMII_TXD0 13
|
||||
#define GPIOG_ETH_RMII_TXD1 14
|
||||
#define GPIOG_PIN15 15
|
||||
#define GPIOG_PIN0 0U
|
||||
#define GPIOG_PIN1 1U
|
||||
#define GPIOG_PIN2 2U
|
||||
#define GPIOG_PIN3 3U
|
||||
#define GPIOG_PIN4 4U
|
||||
#define GPIOG_PIN5 5U
|
||||
#define GPIOG_PIN6 6U
|
||||
#define GPIOG_PIN7 7U
|
||||
#define GPIOG_PIN8 8U
|
||||
#define GPIOG_PIN9 9U
|
||||
#define GPIOG_SPI2_CS 10U
|
||||
#define GPIOG_ETH_RMII_TXEN 11U
|
||||
#define GPIOG_PIN12 12U
|
||||
#define GPIOG_ETH_RMII_TXD0 13U
|
||||
#define GPIOG_ETH_RMII_TXD1 14U
|
||||
#define GPIOG_PIN15 15U
|
||||
|
||||
#define GPIOH_OSC_IN 0
|
||||
#define GPIOH_OSC_OUT 1
|
||||
#define GPIOH_PIN2 2
|
||||
#define GPIOH_PIN3 3
|
||||
#define GPIOH_PIN4 4
|
||||
#define GPIOH_PIN5 5
|
||||
#define GPIOH_PIN6 6
|
||||
#define GPIOH_PIN7 7
|
||||
#define GPIOH_PIN8 8
|
||||
#define GPIOH_PIN9 9
|
||||
#define GPIOH_PIN10 10
|
||||
#define GPIOH_PIN11 11
|
||||
#define GPIOH_PIN12 12
|
||||
#define GPIOH_PIN13 13
|
||||
#define GPIOH_PIN14 14
|
||||
#define GPIOH_PIN15 15
|
||||
#define GPIOH_OSC_IN 0U
|
||||
#define GPIOH_OSC_OUT 1U
|
||||
#define GPIOH_PIN2 2U
|
||||
#define GPIOH_PIN3 3U
|
||||
#define GPIOH_PIN4 4U
|
||||
#define GPIOH_PIN5 5U
|
||||
#define GPIOH_PIN6 6U
|
||||
#define GPIOH_PIN7 7U
|
||||
#define GPIOH_PIN8 8U
|
||||
#define GPIOH_PIN9 9U
|
||||
#define GPIOH_PIN10 10U
|
||||
#define GPIOH_PIN11 11U
|
||||
#define GPIOH_PIN12 12U
|
||||
#define GPIOH_PIN13 13U
|
||||
#define GPIOH_PIN14 14U
|
||||
#define GPIOH_PIN15 15U
|
||||
|
||||
#define GPIOI_PIN0 0
|
||||
#define GPIOI_PIN1 1
|
||||
#define GPIOI_PIN2 2
|
||||
#define GPIOI_PIN3 3
|
||||
#define GPIOI_PIN4 4
|
||||
#define GPIOI_PIN5 5
|
||||
#define GPIOI_PIN6 6
|
||||
#define GPIOI_PIN7 7
|
||||
#define GPIOI_PIN8 8
|
||||
#define GPIOI_PIN9 9
|
||||
#define GPIOI_PIN10 10
|
||||
#define GPIOI_PIN11 11
|
||||
#define GPIOI_PIN12 12
|
||||
#define GPIOI_PIN13 13
|
||||
#define GPIOI_PIN14 14
|
||||
#define GPIOI_PIN15 15
|
||||
#define GPIOI_PIN0 0U
|
||||
#define GPIOI_PIN1 1U
|
||||
#define GPIOI_PIN2 2U
|
||||
#define GPIOI_PIN3 3U
|
||||
#define GPIOI_PIN4 4U
|
||||
#define GPIOI_PIN5 5U
|
||||
#define GPIOI_PIN6 6U
|
||||
#define GPIOI_PIN7 7U
|
||||
#define GPIOI_PIN8 8U
|
||||
#define GPIOI_PIN9 9U
|
||||
#define GPIOI_PIN10 10U
|
||||
#define GPIOI_PIN11 11U
|
||||
#define GPIOI_PIN12 12U
|
||||
#define GPIOI_PIN13 13U
|
||||
#define GPIOI_PIN14 14U
|
||||
#define GPIOI_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -77,10 +77,10 @@ void __early_init(void) {
|
|||
* @brief SDC card detection.
|
||||
*/
|
||||
bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
||||
static bool last_status = false;
|
||||
|
||||
if (blkIsTransferring(sdcp))
|
||||
return last_status;
|
||||
static bool last_status = false;
|
||||
|
||||
if (blkIsTransferring(sdcp))
|
||||
return last_status;
|
||||
return last_status = (bool)palReadPad(GPIOC, GPIOC_SD_D3);
|
||||
}
|
||||
|
||||
|
@ -88,8 +88,8 @@ bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
|||
* @brief SDC card write protection detection.
|
||||
*/
|
||||
bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
|
||||
|
||||
(void)sdcp;
|
||||
|
||||
(void)sdcp;
|
||||
return false;
|
||||
}
|
||||
#endif /* HAL_USE_SDC */
|
||||
|
|
|
@ -37,18 +37,18 @@
|
|||
* Board oscillators-related settings.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 12000000
|
||||
#define STM32_HSECLK 12000000U
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 330
|
||||
#define STM32_VDD 330U
|
||||
|
||||
/*
|
||||
* MCU type as defined in the ST header.
|
||||
|
@ -58,180 +58,180 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_BUTTON_WKUP 0
|
||||
#define GPIOA_ETH_RMII_REF_CLK 1
|
||||
#define GPIOA_ETH_RMII_MDIO 2
|
||||
#define GPIOA_ETH_RMII_MDINT 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_PIN5 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_ETH_RMII_CRS_DV 7
|
||||
#define GPIOA_USB_HS_BUSON 8
|
||||
#define GPIOA_OTG_FS_VBUS 9
|
||||
#define GPIOA_OTG_FS_ID 10
|
||||
#define GPIOA_OTG_FS_DM 11
|
||||
#define GPIOA_OTG_FS_DP 12
|
||||
#define GPIOA_JTAG_TMS 13
|
||||
#define GPIOA_JTAG_TCK 14
|
||||
#define GPIOA_JTAG_TDI 15
|
||||
#define GPIOA_BUTTON_WKUP 0U
|
||||
#define GPIOA_ETH_RMII_REF_CLK 1U
|
||||
#define GPIOA_ETH_RMII_MDIO 2U
|
||||
#define GPIOA_ETH_RMII_MDINT 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_PIN5 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_ETH_RMII_CRS_DV 7U
|
||||
#define GPIOA_USB_HS_BUSON 8U
|
||||
#define GPIOA_OTG_FS_VBUS 9U
|
||||
#define GPIOA_OTG_FS_ID 10U
|
||||
#define GPIOA_OTG_FS_DM 11U
|
||||
#define GPIOA_OTG_FS_DP 12U
|
||||
#define GPIOA_JTAG_TMS 13U
|
||||
#define GPIOA_JTAG_TCK 14U
|
||||
#define GPIOA_JTAG_TDI 15U
|
||||
|
||||
#define GPIOB_USB_FS_BUSON 0
|
||||
#define GPIOB_USB_HS_FAULT 1
|
||||
#define GPIOB_BOOT1 2
|
||||
#define GPIOB_JTAG_TDO 3
|
||||
#define GPIOB_JTAG_TRST 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_I2C1_SCL 8
|
||||
#define GPIOB_I2C1_SDA 9
|
||||
#define GPIOB_SPI2_SCK 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_OTG_HS_ID 12
|
||||
#define GPIOB_OTG_HS_VBUS 13
|
||||
#define GPIOB_OTG_HS_DM 14
|
||||
#define GPIOB_OTG_HS_DP 15
|
||||
#define GPIOB_USB_FS_BUSON 0U
|
||||
#define GPIOB_USB_HS_FAULT 1U
|
||||
#define GPIOB_BOOT1 2U
|
||||
#define GPIOB_JTAG_TDO 3U
|
||||
#define GPIOB_JTAG_TRST 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_I2C1_SCL 8U
|
||||
#define GPIOB_I2C1_SDA 9U
|
||||
#define GPIOB_SPI2_SCK 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_OTG_HS_ID 12U
|
||||
#define GPIOB_OTG_HS_VBUS 13U
|
||||
#define GPIOB_OTG_HS_DM 14U
|
||||
#define GPIOB_OTG_HS_DP 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_ETH_RMII_MDC 1
|
||||
#define GPIOC_SPI2_MISO 2
|
||||
#define GPIOC_SPI2_MOSI 3
|
||||
#define GPIOC_ETH_RMII_RXD0 4
|
||||
#define GPIOC_ETH_RMII_RXD1 5
|
||||
#define GPIOC_USART6_TX 6
|
||||
#define GPIOC_USART6_RX 7
|
||||
#define GPIOC_SD_D0 8
|
||||
#define GPIOC_SD_D1 9
|
||||
#define GPIOC_SD_D2 10
|
||||
#define GPIOC_SD_D3 11
|
||||
#define GPIOC_SD_CLK 12
|
||||
#define GPIOC_LED 13
|
||||
#define GPIOC_OSC32_IN 14
|
||||
#define GPIOC_OSC32_OUT 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_ETH_RMII_MDC 1U
|
||||
#define GPIOC_SPI2_MISO 2U
|
||||
#define GPIOC_SPI2_MOSI 3U
|
||||
#define GPIOC_ETH_RMII_RXD0 4U
|
||||
#define GPIOC_ETH_RMII_RXD1 5U
|
||||
#define GPIOC_USART6_TX 6U
|
||||
#define GPIOC_USART6_RX 7U
|
||||
#define GPIOC_SD_D0 8U
|
||||
#define GPIOC_SD_D1 9U
|
||||
#define GPIOC_SD_D2 10U
|
||||
#define GPIOC_SD_D3 11U
|
||||
#define GPIOC_SD_CLK 12U
|
||||
#define GPIOC_LED 13U
|
||||
#define GPIOC_OSC32_IN 14U
|
||||
#define GPIOC_OSC32_OUT 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_SD_CMD 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_SD_CMD 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_PIN0 0
|
||||
#define GPIOF_PIN1 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_USB_FS_FAULT 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_PIN0 0U
|
||||
#define GPIOF_PIN1 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_USB_FS_FAULT 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
#define GPIOG_PIN0 0
|
||||
#define GPIOG_PIN1 1
|
||||
#define GPIOG_PIN2 2
|
||||
#define GPIOG_PIN3 3
|
||||
#define GPIOG_PIN4 4
|
||||
#define GPIOG_PIN5 5
|
||||
#define GPIOG_PIN6 6
|
||||
#define GPIOG_PIN7 7
|
||||
#define GPIOG_PIN8 8
|
||||
#define GPIOG_PIN9 9
|
||||
#define GPIOG_SPI2_CS 10
|
||||
#define GPIOG_ETH_RMII_TXEN 11
|
||||
#define GPIOG_PIN12 12
|
||||
#define GPIOG_ETH_RMII_TXD0 13
|
||||
#define GPIOG_ETH_RMII_TXD1 14
|
||||
#define GPIOG_PIN15 15
|
||||
#define GPIOG_PIN0 0U
|
||||
#define GPIOG_PIN1 1U
|
||||
#define GPIOG_PIN2 2U
|
||||
#define GPIOG_PIN3 3U
|
||||
#define GPIOG_PIN4 4U
|
||||
#define GPIOG_PIN5 5U
|
||||
#define GPIOG_PIN6 6U
|
||||
#define GPIOG_PIN7 7U
|
||||
#define GPIOG_PIN8 8U
|
||||
#define GPIOG_PIN9 9U
|
||||
#define GPIOG_SPI2_CS 10U
|
||||
#define GPIOG_ETH_RMII_TXEN 11U
|
||||
#define GPIOG_PIN12 12U
|
||||
#define GPIOG_ETH_RMII_TXD0 13U
|
||||
#define GPIOG_ETH_RMII_TXD1 14U
|
||||
#define GPIOG_PIN15 15U
|
||||
|
||||
#define GPIOH_OSC_IN 0
|
||||
#define GPIOH_OSC_OUT 1
|
||||
#define GPIOH_PIN2 2
|
||||
#define GPIOH_PIN3 3
|
||||
#define GPIOH_PIN4 4
|
||||
#define GPIOH_PIN5 5
|
||||
#define GPIOH_PIN6 6
|
||||
#define GPIOH_PIN7 7
|
||||
#define GPIOH_PIN8 8
|
||||
#define GPIOH_PIN9 9
|
||||
#define GPIOH_PIN10 10
|
||||
#define GPIOH_PIN11 11
|
||||
#define GPIOH_PIN12 12
|
||||
#define GPIOH_PIN13 13
|
||||
#define GPIOH_PIN14 14
|
||||
#define GPIOH_PIN15 15
|
||||
#define GPIOH_OSC_IN 0U
|
||||
#define GPIOH_OSC_OUT 1U
|
||||
#define GPIOH_PIN2 2U
|
||||
#define GPIOH_PIN3 3U
|
||||
#define GPIOH_PIN4 4U
|
||||
#define GPIOH_PIN5 5U
|
||||
#define GPIOH_PIN6 6U
|
||||
#define GPIOH_PIN7 7U
|
||||
#define GPIOH_PIN8 8U
|
||||
#define GPIOH_PIN9 9U
|
||||
#define GPIOH_PIN10 10U
|
||||
#define GPIOH_PIN11 11U
|
||||
#define GPIOH_PIN12 12U
|
||||
#define GPIOH_PIN13 13U
|
||||
#define GPIOH_PIN14 14U
|
||||
#define GPIOH_PIN15 15U
|
||||
|
||||
#define GPIOI_PIN0 0
|
||||
#define GPIOI_PIN1 1
|
||||
#define GPIOI_PIN2 2
|
||||
#define GPIOI_PIN3 3
|
||||
#define GPIOI_PIN4 4
|
||||
#define GPIOI_PIN5 5
|
||||
#define GPIOI_PIN6 6
|
||||
#define GPIOI_PIN7 7
|
||||
#define GPIOI_PIN8 8
|
||||
#define GPIOI_PIN9 9
|
||||
#define GPIOI_PIN10 10
|
||||
#define GPIOI_PIN11 11
|
||||
#define GPIOI_PIN12 12
|
||||
#define GPIOI_PIN13 13
|
||||
#define GPIOI_PIN14 14
|
||||
#define GPIOI_PIN15 15
|
||||
#define GPIOI_PIN0 0U
|
||||
#define GPIOI_PIN1 1U
|
||||
#define GPIOI_PIN2 2U
|
||||
#define GPIOI_PIN3 3U
|
||||
#define GPIOI_PIN4 4U
|
||||
#define GPIOI_PIN5 5U
|
||||
#define GPIOI_PIN6 6U
|
||||
#define GPIOI_PIN7 7U
|
||||
#define GPIOI_PIN8 8U
|
||||
#define GPIOI_PIN9 9U
|
||||
#define GPIOI_PIN10 10U
|
||||
#define GPIOI_PIN11 11U
|
||||
#define GPIOI_PIN12 12U
|
||||
#define GPIOI_PIN13 13U
|
||||
#define GPIOI_PIN14 14U
|
||||
#define GPIOI_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
* NOTE: HSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 0
|
||||
#define STM32_LSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3 << 3)
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 0
|
||||
#define STM32_HSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_HSE_BYPASS
|
||||
|
@ -52,111 +52,111 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_PIN0 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_USART_TX 2
|
||||
#define GPIOA_USART_RX 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_LED_GREEN 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_PIN7 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_OTG_FS_DM 11
|
||||
#define GPIOA_OTG_FS_DP 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_PIN15 15
|
||||
#define GPIOA_PIN0 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_USART_TX 2U
|
||||
#define GPIOA_USART_RX 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_LED_GREEN 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_PIN7 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_OTG_FS_DM 11U
|
||||
#define GPIOA_OTG_FS_DP 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_PIN15 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_SWO 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_SWO 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_PIN7 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_PIN9 9
|
||||
#define GPIOC_PIN10 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_BUTTON 13
|
||||
#define GPIOC_PIN14 14
|
||||
#define GPIOC_PIN15 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_PIN7 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_PIN9 9U
|
||||
#define GPIOC_PIN10 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_BUTTON 13U
|
||||
#define GPIOC_PIN14 14U
|
||||
#define GPIOC_PIN15 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOF_OSC_IN 0
|
||||
#define GPIOF_OSC_OUT 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_OSC_IN 0U
|
||||
#define GPIOF_OSC_OUT 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_10M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_10M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
* NOTE: HSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 0
|
||||
#define STM32_LSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3 << 3)
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 0
|
||||
#define STM32_HSECLK 0U
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -50,129 +50,129 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_PIN0 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_USART_TX 2
|
||||
#define GPIOA_USART_RX 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_LED_GREEN 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_PIN7 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_OTG_FS_DM 11
|
||||
#define GPIOA_OTG_FS_DP 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_PIN15 15
|
||||
#define GPIOA_PIN0 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_USART_TX 2U
|
||||
#define GPIOA_USART_RX 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_LED_GREEN 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_PIN7 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_OTG_FS_DM 11U
|
||||
#define GPIOA_OTG_FS_DP 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_PIN15 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_SWO 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_SWO 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_PIN7 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_PIN9 9
|
||||
#define GPIOC_PIN10 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_BUTTON 13
|
||||
#define GPIOC_PIN14 14
|
||||
#define GPIOC_PIN15 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_PIN7 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_PIN9 9U
|
||||
#define GPIOC_PIN10 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_BUTTON 13U
|
||||
#define GPIOC_PIN14 14U
|
||||
#define GPIOC_PIN15 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_PIN0 0
|
||||
#define GPIOF_PIN1 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_PIN0 0U
|
||||
#define GPIOF_PIN1 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -34,18 +34,18 @@
|
|||
* NOTE: HSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 0
|
||||
#define STM32_LSECLK 0U
|
||||
#endif
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 0
|
||||
#define STM32_HSECLK 0U
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 300
|
||||
#define STM32_VDD 300U
|
||||
|
||||
/*
|
||||
* MCU type as defined in the ST header.
|
||||
|
@ -55,180 +55,180 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_PIN0 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_USART_TX 2
|
||||
#define GPIOA_USART_RX 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_LED_GREEN 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_PIN7 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_OTG_FS_DM 11
|
||||
#define GPIOA_OTG_FS_DP 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_PIN15 15
|
||||
#define GPIOA_PIN0 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_USART_TX 2U
|
||||
#define GPIOA_USART_RX 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_LED_GREEN 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_PIN7 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_OTG_FS_DM 11U
|
||||
#define GPIOA_OTG_FS_DP 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_PIN15 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_SWO 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_SWO 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_PIN7 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_PIN9 9
|
||||
#define GPIOC_PIN10 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_BUTTON 13
|
||||
#define GPIOC_PIN14 14
|
||||
#define GPIOC_PIN15 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_PIN7 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_PIN9 9U
|
||||
#define GPIOC_PIN10 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_BUTTON 13U
|
||||
#define GPIOC_PIN14 14U
|
||||
#define GPIOC_PIN15 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_PIN0 0
|
||||
#define GPIOF_PIN1 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_PIN0 0U
|
||||
#define GPIOF_PIN1 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
#define GPIOG_PIN0 0
|
||||
#define GPIOG_PIN1 1
|
||||
#define GPIOG_PIN2 2
|
||||
#define GPIOG_PIN3 3
|
||||
#define GPIOG_PIN4 4
|
||||
#define GPIOG_PIN5 5
|
||||
#define GPIOG_PIN6 6
|
||||
#define GPIOG_PIN7 7
|
||||
#define GPIOG_PIN8 8
|
||||
#define GPIOG_PIN9 9
|
||||
#define GPIOG_PIN10 10
|
||||
#define GPIOG_PIN11 11
|
||||
#define GPIOG_PIN12 12
|
||||
#define GPIOG_PIN13 13
|
||||
#define GPIOG_PIN14 14
|
||||
#define GPIOG_PIN15 15
|
||||
#define GPIOG_PIN0 0U
|
||||
#define GPIOG_PIN1 1U
|
||||
#define GPIOG_PIN2 2U
|
||||
#define GPIOG_PIN3 3U
|
||||
#define GPIOG_PIN4 4U
|
||||
#define GPIOG_PIN5 5U
|
||||
#define GPIOG_PIN6 6U
|
||||
#define GPIOG_PIN7 7U
|
||||
#define GPIOG_PIN8 8U
|
||||
#define GPIOG_PIN9 9U
|
||||
#define GPIOG_PIN10 10U
|
||||
#define GPIOG_PIN11 11U
|
||||
#define GPIOG_PIN12 12U
|
||||
#define GPIOG_PIN13 13U
|
||||
#define GPIOG_PIN14 14U
|
||||
#define GPIOG_PIN15 15U
|
||||
|
||||
#define GPIOH_OSC_IN 0
|
||||
#define GPIOH_OSC_OUT 1
|
||||
#define GPIOH_PIN2 2
|
||||
#define GPIOH_PIN3 3
|
||||
#define GPIOH_PIN4 4
|
||||
#define GPIOH_PIN5 5
|
||||
#define GPIOH_PIN6 6
|
||||
#define GPIOH_PIN7 7
|
||||
#define GPIOH_PIN8 8
|
||||
#define GPIOH_PIN9 9
|
||||
#define GPIOH_PIN10 10
|
||||
#define GPIOH_PIN11 11
|
||||
#define GPIOH_PIN12 12
|
||||
#define GPIOH_PIN13 13
|
||||
#define GPIOH_PIN14 14
|
||||
#define GPIOH_PIN15 15
|
||||
#define GPIOH_OSC_IN 0U
|
||||
#define GPIOH_OSC_OUT 1U
|
||||
#define GPIOH_PIN2 2U
|
||||
#define GPIOH_PIN3 3U
|
||||
#define GPIOH_PIN4 4U
|
||||
#define GPIOH_PIN5 5U
|
||||
#define GPIOH_PIN6 6U
|
||||
#define GPIOH_PIN7 7U
|
||||
#define GPIOH_PIN8 8U
|
||||
#define GPIOH_PIN9 9U
|
||||
#define GPIOH_PIN10 10U
|
||||
#define GPIOH_PIN11 11U
|
||||
#define GPIOH_PIN12 12U
|
||||
#define GPIOH_PIN13 13U
|
||||
#define GPIOH_PIN14 14U
|
||||
#define GPIOH_PIN15 15U
|
||||
|
||||
#define GPIOI_PIN0 0
|
||||
#define GPIOI_PIN1 1
|
||||
#define GPIOI_PIN2 2
|
||||
#define GPIOI_PIN3 3
|
||||
#define GPIOI_PIN4 4
|
||||
#define GPIOI_PIN5 5
|
||||
#define GPIOI_PIN6 6
|
||||
#define GPIOI_PIN7 7
|
||||
#define GPIOI_PIN8 8
|
||||
#define GPIOI_PIN9 9
|
||||
#define GPIOI_PIN10 10
|
||||
#define GPIOI_PIN11 11
|
||||
#define GPIOI_PIN12 12
|
||||
#define GPIOI_PIN13 13
|
||||
#define GPIOI_PIN14 14
|
||||
#define GPIOI_PIN15 15
|
||||
#define GPIOI_PIN0 0U
|
||||
#define GPIOI_PIN1 1U
|
||||
#define GPIOI_PIN2 2U
|
||||
#define GPIOI_PIN3 3U
|
||||
#define GPIOI_PIN4 4U
|
||||
#define GPIOI_PIN5 5U
|
||||
#define GPIOI_PIN6 6U
|
||||
#define GPIOI_PIN7 7U
|
||||
#define GPIOI_PIN8 8U
|
||||
#define GPIOI_PIN9 9U
|
||||
#define GPIOI_PIN10 10U
|
||||
#define GPIOI_PIN11 11U
|
||||
#define GPIOI_PIN12 12U
|
||||
#define GPIOI_PIN13 13U
|
||||
#define GPIOI_PIN14 14U
|
||||
#define GPIOI_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -34,18 +34,18 @@
|
|||
* NOTE: HSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 0
|
||||
#define STM32_LSECLK 0U
|
||||
#endif
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 0
|
||||
#define STM32_HSECLK 0U
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 300
|
||||
#define STM32_VDD 300U
|
||||
|
||||
/*
|
||||
* MCU type as defined in the ST header.
|
||||
|
@ -55,180 +55,180 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_PIN0 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_USART_TX 2
|
||||
#define GPIOA_USART_RX 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_LED_GREEN 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_PIN7 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_OTG_FS_DM 11
|
||||
#define GPIOA_OTG_FS_DP 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_PIN15 15
|
||||
#define GPIOA_PIN0 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_USART_TX 2U
|
||||
#define GPIOA_USART_RX 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_LED_GREEN 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_PIN7 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_OTG_FS_DM 11U
|
||||
#define GPIOA_OTG_FS_DP 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_PIN15 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_SWO 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_SWO 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_PIN7 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_PIN9 9
|
||||
#define GPIOC_PIN10 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_BUTTON 13
|
||||
#define GPIOC_PIN14 14
|
||||
#define GPIOC_PIN15 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_PIN7 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_PIN9 9U
|
||||
#define GPIOC_PIN10 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_BUTTON 13U
|
||||
#define GPIOC_PIN14 14U
|
||||
#define GPIOC_PIN15 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_PIN0 0
|
||||
#define GPIOF_PIN1 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_PIN0 0U
|
||||
#define GPIOF_PIN1 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
#define GPIOG_PIN0 0
|
||||
#define GPIOG_PIN1 1
|
||||
#define GPIOG_PIN2 2
|
||||
#define GPIOG_PIN3 3
|
||||
#define GPIOG_PIN4 4
|
||||
#define GPIOG_PIN5 5
|
||||
#define GPIOG_PIN6 6
|
||||
#define GPIOG_PIN7 7
|
||||
#define GPIOG_PIN8 8
|
||||
#define GPIOG_PIN9 9
|
||||
#define GPIOG_PIN10 10
|
||||
#define GPIOG_PIN11 11
|
||||
#define GPIOG_PIN12 12
|
||||
#define GPIOG_PIN13 13
|
||||
#define GPIOG_PIN14 14
|
||||
#define GPIOG_PIN15 15
|
||||
#define GPIOG_PIN0 0U
|
||||
#define GPIOG_PIN1 1U
|
||||
#define GPIOG_PIN2 2U
|
||||
#define GPIOG_PIN3 3U
|
||||
#define GPIOG_PIN4 4U
|
||||
#define GPIOG_PIN5 5U
|
||||
#define GPIOG_PIN6 6U
|
||||
#define GPIOG_PIN7 7U
|
||||
#define GPIOG_PIN8 8U
|
||||
#define GPIOG_PIN9 9U
|
||||
#define GPIOG_PIN10 10U
|
||||
#define GPIOG_PIN11 11U
|
||||
#define GPIOG_PIN12 12U
|
||||
#define GPIOG_PIN13 13U
|
||||
#define GPIOG_PIN14 14U
|
||||
#define GPIOG_PIN15 15U
|
||||
|
||||
#define GPIOH_OSC_IN 0
|
||||
#define GPIOH_OSC_OUT 1
|
||||
#define GPIOH_PIN2 2
|
||||
#define GPIOH_PIN3 3
|
||||
#define GPIOH_PIN4 4
|
||||
#define GPIOH_PIN5 5
|
||||
#define GPIOH_PIN6 6
|
||||
#define GPIOH_PIN7 7
|
||||
#define GPIOH_PIN8 8
|
||||
#define GPIOH_PIN9 9
|
||||
#define GPIOH_PIN10 10
|
||||
#define GPIOH_PIN11 11
|
||||
#define GPIOH_PIN12 12
|
||||
#define GPIOH_PIN13 13
|
||||
#define GPIOH_PIN14 14
|
||||
#define GPIOH_PIN15 15
|
||||
#define GPIOH_OSC_IN 0U
|
||||
#define GPIOH_OSC_OUT 1U
|
||||
#define GPIOH_PIN2 2U
|
||||
#define GPIOH_PIN3 3U
|
||||
#define GPIOH_PIN4 4U
|
||||
#define GPIOH_PIN5 5U
|
||||
#define GPIOH_PIN6 6U
|
||||
#define GPIOH_PIN7 7U
|
||||
#define GPIOH_PIN8 8U
|
||||
#define GPIOH_PIN9 9U
|
||||
#define GPIOH_PIN10 10U
|
||||
#define GPIOH_PIN11 11U
|
||||
#define GPIOH_PIN12 12U
|
||||
#define GPIOH_PIN13 13U
|
||||
#define GPIOH_PIN14 14U
|
||||
#define GPIOH_PIN15 15U
|
||||
|
||||
#define GPIOI_PIN0 0
|
||||
#define GPIOI_PIN1 1
|
||||
#define GPIOI_PIN2 2
|
||||
#define GPIOI_PIN3 3
|
||||
#define GPIOI_PIN4 4
|
||||
#define GPIOI_PIN5 5
|
||||
#define GPIOI_PIN6 6
|
||||
#define GPIOI_PIN7 7
|
||||
#define GPIOI_PIN8 8
|
||||
#define GPIOI_PIN9 9
|
||||
#define GPIOI_PIN10 10
|
||||
#define GPIOI_PIN11 11
|
||||
#define GPIOI_PIN12 12
|
||||
#define GPIOI_PIN13 13
|
||||
#define GPIOI_PIN14 14
|
||||
#define GPIOI_PIN15 15
|
||||
#define GPIOI_PIN0 0U
|
||||
#define GPIOI_PIN1 1U
|
||||
#define GPIOI_PIN2 2U
|
||||
#define GPIOI_PIN3 3U
|
||||
#define GPIOI_PIN4 4U
|
||||
#define GPIOI_PIN5 5U
|
||||
#define GPIOI_PIN6 6U
|
||||
#define GPIOI_PIN7 7U
|
||||
#define GPIOI_PIN8 8U
|
||||
#define GPIOI_PIN9 9U
|
||||
#define GPIOI_PIN10 10U
|
||||
#define GPIOI_PIN11 11U
|
||||
#define GPIOI_PIN12 12U
|
||||
#define GPIOI_PIN13 13U
|
||||
#define GPIOI_PIN14 14U
|
||||
#define GPIOI_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -33,11 +33,11 @@
|
|||
* NOTE: HSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 0
|
||||
#define STM32_HSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_HSE_BYPASS
|
||||
|
@ -50,163 +50,163 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_PIN0 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_USART_TX 2
|
||||
#define GPIOA_USART_RX 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_LED_GREEN 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_PIN7 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_OTG_FS_DM 11
|
||||
#define GPIOA_OTG_FS_DP 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_PIN15 15
|
||||
#define GPIOA_PIN0 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_USART_TX 2U
|
||||
#define GPIOA_USART_RX 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_LED_GREEN 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_PIN7 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_OTG_FS_DM 11U
|
||||
#define GPIOA_OTG_FS_DP 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_PIN15 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_SWO 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_SWO 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_PIN7 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_PIN9 9
|
||||
#define GPIOC_PIN10 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_BUTTON 13
|
||||
#define GPIOC_PIN14 14
|
||||
#define GPIOC_PIN15 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_PIN7 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_PIN9 9U
|
||||
#define GPIOC_PIN10 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_BUTTON 13U
|
||||
#define GPIOC_PIN14 14U
|
||||
#define GPIOC_PIN15 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_PIN0 0
|
||||
#define GPIOF_PIN1 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_PIN0 0U
|
||||
#define GPIOF_PIN1 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
#define GPIOG_PIN0 0
|
||||
#define GPIOG_PIN1 1
|
||||
#define GPIOG_PIN2 2
|
||||
#define GPIOG_PIN3 3
|
||||
#define GPIOG_PIN4 4
|
||||
#define GPIOG_PIN5 5
|
||||
#define GPIOG_PIN6 6
|
||||
#define GPIOG_PIN7 7
|
||||
#define GPIOG_PIN8 8
|
||||
#define GPIOG_PIN9 9
|
||||
#define GPIOG_PIN10 10
|
||||
#define GPIOG_PIN11 11
|
||||
#define GPIOG_PIN12 12
|
||||
#define GPIOG_PIN13 13
|
||||
#define GPIOG_PIN14 14
|
||||
#define GPIOG_PIN15 15
|
||||
#define GPIOG_PIN0 0U
|
||||
#define GPIOG_PIN1 1U
|
||||
#define GPIOG_PIN2 2U
|
||||
#define GPIOG_PIN3 3U
|
||||
#define GPIOG_PIN4 4U
|
||||
#define GPIOG_PIN5 5U
|
||||
#define GPIOG_PIN6 6U
|
||||
#define GPIOG_PIN7 7U
|
||||
#define GPIOG_PIN8 8U
|
||||
#define GPIOG_PIN9 9U
|
||||
#define GPIOG_PIN10 10U
|
||||
#define GPIOG_PIN11 11U
|
||||
#define GPIOG_PIN12 12U
|
||||
#define GPIOG_PIN13 13U
|
||||
#define GPIOG_PIN14 14U
|
||||
#define GPIOG_PIN15 15U
|
||||
|
||||
#define GPIOH_OSC_IN 0
|
||||
#define GPIOH_OSC_OUT 1
|
||||
#define GPIOH_PIN2 2
|
||||
#define GPIOH_PIN3 3
|
||||
#define GPIOH_PIN4 4
|
||||
#define GPIOH_PIN5 5
|
||||
#define GPIOH_PIN6 6
|
||||
#define GPIOH_PIN7 7
|
||||
#define GPIOH_PIN8 8
|
||||
#define GPIOH_PIN9 9
|
||||
#define GPIOH_PIN10 10
|
||||
#define GPIOH_PIN11 11
|
||||
#define GPIOH_PIN12 12
|
||||
#define GPIOH_PIN13 13
|
||||
#define GPIOH_PIN14 14
|
||||
#define GPIOH_PIN15 15
|
||||
#define GPIOH_OSC_IN 0U
|
||||
#define GPIOH_OSC_OUT 1U
|
||||
#define GPIOH_PIN2 2U
|
||||
#define GPIOH_PIN3 3U
|
||||
#define GPIOH_PIN4 4U
|
||||
#define GPIOH_PIN5 5U
|
||||
#define GPIOH_PIN6 6U
|
||||
#define GPIOH_PIN7 7U
|
||||
#define GPIOH_PIN8 8U
|
||||
#define GPIOH_PIN9 9U
|
||||
#define GPIOH_PIN10 10U
|
||||
#define GPIOH_PIN11 11U
|
||||
#define GPIOH_PIN12 12U
|
||||
#define GPIOH_PIN13 13U
|
||||
#define GPIOH_PIN14 14U
|
||||
#define GPIOH_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_400K(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_2M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_10M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_400K(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_2M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_10M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -31,13 +31,13 @@
|
|||
* Board oscillators-related settings.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3 << 3)
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 8000000
|
||||
#define STM32_HSECLK 8000000U
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
@ -48,129 +48,129 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_WKUP_BUTTON 0
|
||||
#define GPIOA_LDR_OUT 1
|
||||
#define GPIOA_KEY_BUTTON 2
|
||||
#define GPIOA_PIN3 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_PIN5 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_COMP2_OUT 7
|
||||
#define GPIOA_I2C2_SMB 8
|
||||
#define GPIOA_I2C2_SCL 9
|
||||
#define GPIOA_I2C2_SDA 10
|
||||
#define GPIOA_USB_DM 11
|
||||
#define GPIOA_USB_DP 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_JTDI 15
|
||||
#define GPIOA_WKUP_BUTTON 0U
|
||||
#define GPIOA_LDR_OUT 1U
|
||||
#define GPIOA_KEY_BUTTON 2U
|
||||
#define GPIOA_PIN3 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_PIN5 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_COMP2_OUT 7U
|
||||
#define GPIOA_I2C2_SMB 8U
|
||||
#define GPIOA_I2C2_SCL 9U
|
||||
#define GPIOA_I2C2_SDA 10U
|
||||
#define GPIOA_USB_DM 11U
|
||||
#define GPIOA_USB_DP 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_JTDI 15U
|
||||
|
||||
#define GPIOB_MIC_IN 0
|
||||
#define GPIOB_ADC_POT_IN 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_SWO 3
|
||||
#define GPIOB_JTRST 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_I2C1_SCL 6
|
||||
#define GPIOB_I2C1_SDA 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_MIC_IN 0U
|
||||
#define GPIOB_ADC_POT_IN 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_SWO 3U
|
||||
#define GPIOB_JTRST 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_I2C1_SCL 6U
|
||||
#define GPIOB_I2C1_SDA 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_LED1 0
|
||||
#define GPIOC_LED2 1
|
||||
#define GPIOC_LED3 2
|
||||
#define GPIOC_LED4 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_USB_DISCONNECT 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_PIN7 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_PIN9 9
|
||||
#define GPIOC_SPI3_SCK 10
|
||||
#define GPIOC_SPI3_MISO 11
|
||||
#define GPIOC_SPI3_MOSI 12
|
||||
#define GPIOC_PIN13 13
|
||||
#define GPIOC_OSC32_IN 14
|
||||
#define GPIOC_OSC32_OUT 15
|
||||
#define GPIOC_LED1 0U
|
||||
#define GPIOC_LED2 1U
|
||||
#define GPIOC_LED3 2U
|
||||
#define GPIOC_LED4 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_USB_DISCONNECT 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_PIN7 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_PIN9 9U
|
||||
#define GPIOC_SPI3_SCK 10U
|
||||
#define GPIOC_SPI3_MISO 11U
|
||||
#define GPIOC_SPI3_MOSI 12U
|
||||
#define GPIOC_PIN13 13U
|
||||
#define GPIOC_OSC32_IN 14U
|
||||
#define GPIOC_OSC32_OUT 15U
|
||||
|
||||
#define GPIOD_CAN_RX 0
|
||||
#define GPIOD_CAN_TX 1
|
||||
#define GPIOD_LCD_CS 2
|
||||
#define GPIOD_USART2_CTS 3
|
||||
#define GPIOD_USART2_RST 4
|
||||
#define GPIOD_USART2_TX 5
|
||||
#define GPIOD_USART2_RX 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_AUDIO_RST 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_CAN_RX 0U
|
||||
#define GPIOD_CAN_TX 1U
|
||||
#define GPIOD_LCD_CS 2U
|
||||
#define GPIOD_USART2_CTS 3U
|
||||
#define GPIOD_USART2_RST 4U
|
||||
#define GPIOD_USART2_TX 5U
|
||||
#define GPIOD_USART2_RX 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_AUDIO_RST 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_SD_CS 2
|
||||
#define GPIOE_SD_DETECT 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_JOY_SEL 6
|
||||
#define GPIOE_RTD_IN 7
|
||||
#define GPIOE_PRESSUREP 8
|
||||
#define GPIOE_PRESSUREN 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PRESSURE_TEPM 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_SD_CS 2U
|
||||
#define GPIOE_SD_DETECT 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_JOY_SEL 6U
|
||||
#define GPIOE_RTD_IN 7U
|
||||
#define GPIOE_PRESSUREP 8U
|
||||
#define GPIOE_PRESSUREN 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PRESSURE_TEPM 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_OSC_IN 0
|
||||
#define GPIOF_OSC_OUT 1
|
||||
#define GPIOF_JOY_DOWN 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_JOY_LEFT 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_JOY_RIGHT 9
|
||||
#define GPIOF_JOY_UP 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_OSC_IN 0U
|
||||
#define GPIOF_OSC_OUT 1U
|
||||
#define GPIOF_JOY_DOWN 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_JOY_LEFT 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_JOY_RIGHT 9U
|
||||
#define GPIOF_JOY_UP 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
* NOTE: HSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 0
|
||||
#define STM32_LSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3 << 3)
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 0
|
||||
#define STM32_HSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_HSE_BYPASS
|
||||
|
@ -52,128 +52,128 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_BUTTON 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_PIN2 2
|
||||
#define GPIOA_PIN3 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_PIN5 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_PIN7 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_USB_DM 11
|
||||
#define GPIOA_USB_DP 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_PIN15 15
|
||||
#define GPIOA_BUTTON 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_PIN2 2U
|
||||
#define GPIOA_PIN3 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_PIN5 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_PIN7 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_USB_DM 11U
|
||||
#define GPIOA_USB_DP 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_PIN15 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_PIN3 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_SPI2_SCK 13
|
||||
#define GPIOB_SPI2_MISO 14
|
||||
#define GPIOB_SPI2_MOSI 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_PIN3 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_SPI2_SCK 13U
|
||||
#define GPIOB_SPI2_MISO 14U
|
||||
#define GPIOB_SPI2_MOSI 15U
|
||||
|
||||
#define GPIOC_MEMS_CS 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_LED_RED 6
|
||||
#define GPIOC_LED_BLUE 7
|
||||
#define GPIOC_LED_ORANGE 8
|
||||
#define GPIOC_LED_GREEN 9
|
||||
#define GPIOC_PIN10 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_PIN13 13
|
||||
#define GPIOC_OSC32_IN 14
|
||||
#define GPIOC_OSC32_OUT 15
|
||||
#define GPIOC_MEMS_CS 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_LED_RED 6U
|
||||
#define GPIOC_LED_BLUE 7U
|
||||
#define GPIOC_LED_ORANGE 8U
|
||||
#define GPIOC_LED_GREEN 9U
|
||||
#define GPIOC_PIN10 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_PIN13 13U
|
||||
#define GPIOC_OSC32_IN 14U
|
||||
#define GPIOC_OSC32_OUT 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_OSC_IN 0
|
||||
#define GPIOF_OSC_OUT 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_OSC_IN 0U
|
||||
#define GPIOF_OSC_OUT 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_10M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_10M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
@ -646,22 +646,22 @@
|
|||
/*
|
||||
* GPIOE setup:
|
||||
*
|
||||
* PF0 - PIN0 (input pullup).
|
||||
* PF1 - PIN1 (input pullup).
|
||||
* PF2 - PIN2 (input pullup).
|
||||
* PF3 - PIN3 (input pullup).
|
||||
* PF4 - PIN4 (input pullup).
|
||||
* PF5 - PIN5 (input pullup).
|
||||
* PF6 - PIN6 (input pullup).
|
||||
* PF7 - PIN7 (input pullup).
|
||||
* PF8 - PIN8 (input pullup).
|
||||
* PF9 - PIN9 (input pullup).
|
||||
* PF10 - PIN10 (input pullup).
|
||||
* PF11 - PIN11 (input pullup).
|
||||
* PF12 - PIN12 (input pullup).
|
||||
* PF13 - PIN13 (input pullup).
|
||||
* PF14 - PIN14 (input pullup).
|
||||
* PF15 - PIN15 (input pullup).
|
||||
* PE0 - PIN0 (input pullup).
|
||||
* PE1 - PIN1 (input pullup).
|
||||
* PE2 - PIN2 (input pullup).
|
||||
* PE3 - PIN3 (input pullup).
|
||||
* PE4 - PIN4 (input pullup).
|
||||
* PE5 - PIN5 (input pullup).
|
||||
* PE6 - PIN6 (input pullup).
|
||||
* PE7 - PIN7 (input pullup).
|
||||
* PE8 - PIN8 (input pullup).
|
||||
* PE9 - PIN9 (input pullup).
|
||||
* PE10 - PIN10 (input pullup).
|
||||
* PE11 - PIN11 (input pullup).
|
||||
* PE12 - PIN12 (input pullup).
|
||||
* PE13 - PIN13 (input pullup).
|
||||
* PE14 - PIN14 (input pullup).
|
||||
* PE15 - PIN15 (input pullup).
|
||||
*/
|
||||
#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
|
||||
PIN_MODE_INPUT(GPIOE_PIN1) | \
|
||||
|
|
|
@ -535,6 +535,40 @@
|
|||
Mode="Input"
|
||||
Alternate="0" />
|
||||
</GPIOD>
|
||||
<GPIOE>
|
||||
<pin0 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin1 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin2 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin3 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin4 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin5 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin6 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin7 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin8 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin9 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin10 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin11 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin12 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin13 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin14 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
<pin15 ID="" Type="PushPull" Speed="Minimum" Resistor="PullUp"
|
||||
Level="High" Mode="Input" Alternate="0" />
|
||||
</GPIOE>
|
||||
<GPIOF>
|
||||
<pin0
|
||||
ID="OSC_IN"
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
* NOTE: HSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 0
|
||||
#define STM32_LSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3 << 3)
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 0
|
||||
#define STM32_HSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_HSE_BYPASS
|
||||
|
@ -52,111 +52,111 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_BUTTON 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_PIN2 2
|
||||
#define GPIOA_PIN3 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_PIN5 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_PIN7 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_PIN11 11
|
||||
#define GPIOA_PIN12 12
|
||||
#define GPIOA_SWDAT 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_PIN15 15
|
||||
#define GPIOA_BUTTON 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_PIN2 2U
|
||||
#define GPIOA_PIN3 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_PIN5 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_PIN7 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_PIN11 11U
|
||||
#define GPIOA_PIN12 12U
|
||||
#define GPIOA_SWDAT 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_PIN15 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_PIN3 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_PIN6 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_PIN3 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_PIN6 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_PIN7 7
|
||||
#define GPIOC_LED4 8
|
||||
#define GPIOC_LED3 9
|
||||
#define GPIOC_PIN10 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_PIN13 13
|
||||
#define GPIOC_OSC32_IN 14
|
||||
#define GPIOC_OSC32_OUT 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_PIN7 7U
|
||||
#define GPIOC_LED4 8U
|
||||
#define GPIOC_LED3 9U
|
||||
#define GPIOC_PIN10 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_PIN13 13U
|
||||
#define GPIOC_OSC32_IN 14U
|
||||
#define GPIOC_OSC32_OUT 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOF_OSC_IN 0
|
||||
#define GPIOF_OSC_OUT 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_OSC_IN 0U
|
||||
#define GPIOF_OSC_OUT 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_10M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_10M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
* NOTE: LSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 0
|
||||
#define STM32_LSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_LSEDRV (3 << 3)
|
||||
#define STM32_LSEDRV (3U << 3U)
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 8000000
|
||||
#define STM32_HSECLK 8000000U
|
||||
#endif
|
||||
|
||||
#define STM32_HSE_BYPASS
|
||||
|
@ -51,129 +51,129 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_BUTTON 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_PIN2 2
|
||||
#define GPIOA_PIN3 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_SPI1_SCK 5
|
||||
#define GPIOA_SPI1_MISO 6
|
||||
#define GPIOA_SPI1_MOSI 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_USB_DM 11
|
||||
#define GPIOA_USB_DP 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_PIN15 15
|
||||
#define GPIOA_BUTTON 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_PIN2 2U
|
||||
#define GPIOA_PIN3 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_SPI1_SCK 5U
|
||||
#define GPIOA_SPI1_MISO 6U
|
||||
#define GPIOA_SPI1_MOSI 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_USB_DM 11U
|
||||
#define GPIOA_USB_DP 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_PIN15 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_SWO 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_I2C1_SCL 6
|
||||
#define GPIOB_I2C1_SDA 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_SWO 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_I2C1_SCL 6U
|
||||
#define GPIOB_I2C1_SDA 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_PIN7 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_PIN9 9
|
||||
#define GPIOC_PIN10 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_PIN13 13
|
||||
#define GPIOC_OSC32_IN 14
|
||||
#define GPIOC_OSC32_OUT 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_PIN7 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_PIN9 9U
|
||||
#define GPIOC_PIN10 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_PIN13 13U
|
||||
#define GPIOC_OSC32_IN 14U
|
||||
#define GPIOC_OSC32_OUT 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_L3GD20_INT1 0
|
||||
#define GPIOE_L3GD20_INT2 1
|
||||
#define GPIOE_LSM303_DRDY 2
|
||||
#define GPIOE_SPI1_CS 3
|
||||
#define GPIOE_LSM303_INT1 4
|
||||
#define GPIOE_LSM303_INT2 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_LED4_BLUE 8
|
||||
#define GPIOE_LED3_RED 9
|
||||
#define GPIOE_LED5_ORANGE 10
|
||||
#define GPIOE_LED7_GREEN 11
|
||||
#define GPIOE_LED9_BLUE 12
|
||||
#define GPIOE_LED10_RED 13
|
||||
#define GPIOE_LED8_ORANGE 14
|
||||
#define GPIOE_LED6_GREEN 15
|
||||
#define GPIOE_L3GD20_INT1 0U
|
||||
#define GPIOE_L3GD20_INT2 1U
|
||||
#define GPIOE_LSM303_DRDY 2U
|
||||
#define GPIOE_SPI1_CS 3U
|
||||
#define GPIOE_LSM303_INT1 4U
|
||||
#define GPIOE_LSM303_INT2 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_LED4_BLUE 8U
|
||||
#define GPIOE_LED3_RED 9U
|
||||
#define GPIOE_LED5_ORANGE 10U
|
||||
#define GPIOE_LED7_GREEN 11U
|
||||
#define GPIOE_LED9_BLUE 12U
|
||||
#define GPIOE_LED10_RED 13U
|
||||
#define GPIOE_LED8_ORANGE 14U
|
||||
#define GPIOE_LED6_GREEN 15U
|
||||
|
||||
#define GPIOF_OSC_IN 0
|
||||
#define GPIOF_OSC_OUT 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_OSC_IN 0U
|
||||
#define GPIOF_OSC_OUT 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -33,18 +33,18 @@
|
|||
* NOTE: LSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 0
|
||||
#define STM32_LSECLK 0U
|
||||
#endif
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 8000000
|
||||
#define STM32_HSECLK 8000000U
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 300
|
||||
#define STM32_VDD 300U
|
||||
|
||||
/*
|
||||
* MCU type as defined in the ST header.
|
||||
|
@ -54,180 +54,180 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_BUTTON 0
|
||||
#define GPIOA_MEMS_INT1 1
|
||||
#define GPIOA_MEMS_INT2 2
|
||||
#define GPIOA_LCD_B5 3
|
||||
#define GPIOA_LCD_VSYNC 4
|
||||
#define GPIOA_PIN5 5
|
||||
#define GPIOA_LCD_G2 6
|
||||
#define GPIOA_ACP_RST 7
|
||||
#define GPIOA_I2C3_SCL 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_LCD_R4 11
|
||||
#define GPIOA_LCD_R5 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_TP_INT 15
|
||||
#define GPIOA_BUTTON 0U
|
||||
#define GPIOA_MEMS_INT1 1U
|
||||
#define GPIOA_MEMS_INT2 2U
|
||||
#define GPIOA_LCD_B5 3U
|
||||
#define GPIOA_LCD_VSYNC 4U
|
||||
#define GPIOA_PIN5 5U
|
||||
#define GPIOA_LCD_G2 6U
|
||||
#define GPIOA_ACP_RST 7U
|
||||
#define GPIOA_I2C3_SCL 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_LCD_R4 11U
|
||||
#define GPIOA_LCD_R5 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_TP_INT 15U
|
||||
|
||||
#define GPIOB_LCD_R3 0
|
||||
#define GPIOB_LCD_R6 1
|
||||
#define GPIOB_BOOT1 2
|
||||
#define GPIOB_SWO 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_FMC_SDCKE1 5
|
||||
#define GPIOB_FMC_SDNE1 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_LCD_B6 8
|
||||
#define GPIOB_LCD_B7 9
|
||||
#define GPIOB_LCD_G4 10
|
||||
#define GPIOB_LCD_G5 11
|
||||
#define GPIOB_OTG_HS_ID 12
|
||||
#define GPIOB_OTG_HS_VBUS 13
|
||||
#define GPIOB_OTG_HS_DM 14
|
||||
#define GPIOB_OTG_HS_DP 15
|
||||
#define GPIOB_LCD_R3 0U
|
||||
#define GPIOB_LCD_R6 1U
|
||||
#define GPIOB_BOOT1 2U
|
||||
#define GPIOB_SWO 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_FMC_SDCKE1 5U
|
||||
#define GPIOB_FMC_SDNE1 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_LCD_B6 8U
|
||||
#define GPIOB_LCD_B7 9U
|
||||
#define GPIOB_LCD_G4 10U
|
||||
#define GPIOB_LCD_G5 11U
|
||||
#define GPIOB_OTG_HS_ID 12U
|
||||
#define GPIOB_OTG_HS_VBUS 13U
|
||||
#define GPIOB_OTG_HS_DM 14U
|
||||
#define GPIOB_OTG_HS_DP 15U
|
||||
|
||||
#define GPIOC_FMC_SDNWE 0
|
||||
#define GPIOC_SPI5_MEMS_CS 1
|
||||
#define GPIOC_SPI5_LCD_CS 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_OTG_HS_PSO 4
|
||||
#define GPIOC_OTG_HS_OC 5
|
||||
#define GPIOC_LCD_HSYNC 6
|
||||
#define GPIOC_LCD_G6 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_I2C3_SDA 9
|
||||
#define GPIOC_LCD_R2 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_PIN13 13
|
||||
#define GPIOC_OSC32_IN 14
|
||||
#define GPIOC_OSC32_OUT 15
|
||||
#define GPIOC_FMC_SDNWE 0U
|
||||
#define GPIOC_SPI5_MEMS_CS 1U
|
||||
#define GPIOC_SPI5_LCD_CS 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_OTG_HS_PSO 4U
|
||||
#define GPIOC_OTG_HS_OC 5U
|
||||
#define GPIOC_LCD_HSYNC 6U
|
||||
#define GPIOC_LCD_G6 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_I2C3_SDA 9U
|
||||
#define GPIOC_LCD_R2 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_PIN13 13U
|
||||
#define GPIOC_OSC32_IN 14U
|
||||
#define GPIOC_OSC32_OUT 15U
|
||||
|
||||
#define GPIOD_FMC_D2 0
|
||||
#define GPIOD_FMC_D3 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_LCD_G7 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_LCD_B2 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_FMC_D13 8
|
||||
#define GPIOD_FMC_D14 9
|
||||
#define GPIOD_FMC_D15 10
|
||||
#define GPIOD_LCD_TE 11
|
||||
#define GPIOD_LCD_RDX 12
|
||||
#define GPIOD_LCD_WRX 13
|
||||
#define GPIOD_FMC_D0 14
|
||||
#define GPIOD_FMC_D1 15
|
||||
#define GPIOD_FMC_D2 0U
|
||||
#define GPIOD_FMC_D3 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_LCD_G7 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_LCD_B2 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_FMC_D13 8U
|
||||
#define GPIOD_FMC_D14 9U
|
||||
#define GPIOD_FMC_D15 10U
|
||||
#define GPIOD_LCD_TE 11U
|
||||
#define GPIOD_LCD_RDX 12U
|
||||
#define GPIOD_LCD_WRX 13U
|
||||
#define GPIOD_FMC_D0 14U
|
||||
#define GPIOD_FMC_D1 15U
|
||||
|
||||
#define GPIOE_FMC_NBL0 0
|
||||
#define GPIOE_FMC_NBL1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_FMC_D4 7
|
||||
#define GPIOE_FMC_D5 8
|
||||
#define GPIOE_FMC_D6 9
|
||||
#define GPIOE_FMC_D7 10
|
||||
#define GPIOE_FMC_D8 11
|
||||
#define GPIOE_FMC_D9 12
|
||||
#define GPIOE_FMC_D10 13
|
||||
#define GPIOE_FMC_D11 14
|
||||
#define GPIOE_FMC_D12 15
|
||||
#define GPIOE_FMC_NBL0 0U
|
||||
#define GPIOE_FMC_NBL1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_FMC_D4 7U
|
||||
#define GPIOE_FMC_D5 8U
|
||||
#define GPIOE_FMC_D6 9U
|
||||
#define GPIOE_FMC_D7 10U
|
||||
#define GPIOE_FMC_D8 11U
|
||||
#define GPIOE_FMC_D9 12U
|
||||
#define GPIOE_FMC_D10 13U
|
||||
#define GPIOE_FMC_D11 14U
|
||||
#define GPIOE_FMC_D12 15U
|
||||
|
||||
#define GPIOF_FMC_A0 0
|
||||
#define GPIOF_FMC_A1 1
|
||||
#define GPIOF_FMC_A2 2
|
||||
#define GPIOF_FMC_A3 3
|
||||
#define GPIOF_FMC_A4 4
|
||||
#define GPIOF_FMC_A5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_LCD_DCX 7
|
||||
#define GPIOF_SPI5_MISO 8
|
||||
#define GPIOF_SPI5_MOSI 9
|
||||
#define GPIOF_LCD_DE 10
|
||||
#define GPIOF_FMC_SDNRAS 11
|
||||
#define GPIOF_FMC_A6 12
|
||||
#define GPIOF_FMC_A7 13
|
||||
#define GPIOF_FMC_A8 14
|
||||
#define GPIOF_FMC_A9 15
|
||||
#define GPIOF_FMC_A0 0U
|
||||
#define GPIOF_FMC_A1 1U
|
||||
#define GPIOF_FMC_A2 2U
|
||||
#define GPIOF_FMC_A3 3U
|
||||
#define GPIOF_FMC_A4 4U
|
||||
#define GPIOF_FMC_A5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_LCD_DCX 7U
|
||||
#define GPIOF_SPI5_MISO 8U
|
||||
#define GPIOF_SPI5_MOSI 9U
|
||||
#define GPIOF_LCD_DE 10U
|
||||
#define GPIOF_FMC_SDNRAS 11U
|
||||
#define GPIOF_FMC_A6 12U
|
||||
#define GPIOF_FMC_A7 13U
|
||||
#define GPIOF_FMC_A8 14U
|
||||
#define GPIOF_FMC_A9 15U
|
||||
|
||||
#define GPIOG_FMC_A10 0
|
||||
#define GPIOG_FMC_A11 1
|
||||
#define GPIOG_PIN2 2
|
||||
#define GPIOG_PIN3 3
|
||||
#define GPIOG_FMC_BA0 4
|
||||
#define GPIOG_FMC_BA1 5
|
||||
#define GPIOG_LCD_R7 6
|
||||
#define GPIOG_LCD_CLK 7
|
||||
#define GPIOG_FMC_SDCLK 8
|
||||
#define GPIOG_PIN9 9
|
||||
#define GPIOG_LCD_G3 10
|
||||
#define GPIOG_LCD_B3 11
|
||||
#define GPIOG_LCD_B4 12
|
||||
#define GPIOG_LED3_GREEN 13
|
||||
#define GPIOG_LED4_RED 14
|
||||
#define GPIOG_FMC_SDNCAS 15
|
||||
#define GPIOG_FMC_A10 0U
|
||||
#define GPIOG_FMC_A11 1U
|
||||
#define GPIOG_PIN2 2U
|
||||
#define GPIOG_PIN3 3U
|
||||
#define GPIOG_FMC_BA0 4U
|
||||
#define GPIOG_FMC_BA1 5U
|
||||
#define GPIOG_LCD_R7 6U
|
||||
#define GPIOG_LCD_CLK 7U
|
||||
#define GPIOG_FMC_SDCLK 8U
|
||||
#define GPIOG_PIN9 9U
|
||||
#define GPIOG_LCD_G3 10U
|
||||
#define GPIOG_LCD_B3 11U
|
||||
#define GPIOG_LCD_B4 12U
|
||||
#define GPIOG_LED3_GREEN 13U
|
||||
#define GPIOG_LED4_RED 14U
|
||||
#define GPIOG_FMC_SDNCAS 15U
|
||||
|
||||
#define GPIOH_OSC_IN 0
|
||||
#define GPIOH_OSC_OUT 1
|
||||
#define GPIOH_PIN2 2
|
||||
#define GPIOH_PIN3 3
|
||||
#define GPIOH_PIN4 4
|
||||
#define GPIOH_PIN5 5
|
||||
#define GPIOH_PIN6 6
|
||||
#define GPIOH_PIN7 7
|
||||
#define GPIOH_PIN8 8
|
||||
#define GPIOH_PIN9 9
|
||||
#define GPIOH_PIN10 10
|
||||
#define GPIOH_PIN11 11
|
||||
#define GPIOH_PIN12 12
|
||||
#define GPIOH_PIN13 13
|
||||
#define GPIOH_PIN14 14
|
||||
#define GPIOH_PIN15 15
|
||||
#define GPIOH_OSC_IN 0U
|
||||
#define GPIOH_OSC_OUT 1U
|
||||
#define GPIOH_PIN2 2U
|
||||
#define GPIOH_PIN3 3U
|
||||
#define GPIOH_PIN4 4U
|
||||
#define GPIOH_PIN5 5U
|
||||
#define GPIOH_PIN6 6U
|
||||
#define GPIOH_PIN7 7U
|
||||
#define GPIOH_PIN8 8U
|
||||
#define GPIOH_PIN9 9U
|
||||
#define GPIOH_PIN10 10U
|
||||
#define GPIOH_PIN11 11U
|
||||
#define GPIOH_PIN12 12U
|
||||
#define GPIOH_PIN13 13U
|
||||
#define GPIOH_PIN14 14U
|
||||
#define GPIOH_PIN15 15U
|
||||
|
||||
#define GPIOI_PIN0 0
|
||||
#define GPIOI_PIN1 1
|
||||
#define GPIOI_PIN2 2
|
||||
#define GPIOI_PIN3 3
|
||||
#define GPIOI_PIN4 4
|
||||
#define GPIOI_PIN5 5
|
||||
#define GPIOI_PIN6 6
|
||||
#define GPIOI_PIN7 7
|
||||
#define GPIOI_PIN8 8
|
||||
#define GPIOI_PIN9 9
|
||||
#define GPIOI_PIN10 10
|
||||
#define GPIOI_PIN11 11
|
||||
#define GPIOI_PIN12 12
|
||||
#define GPIOI_PIN13 13
|
||||
#define GPIOI_PIN14 14
|
||||
#define GPIOI_PIN15 15
|
||||
#define GPIOI_PIN0 0U
|
||||
#define GPIOI_PIN1 1U
|
||||
#define GPIOI_PIN2 2U
|
||||
#define GPIOI_PIN3 3U
|
||||
#define GPIOI_PIN4 4U
|
||||
#define GPIOI_PIN5 5U
|
||||
#define GPIOI_PIN6 6U
|
||||
#define GPIOI_PIN7 7U
|
||||
#define GPIOI_PIN8 8U
|
||||
#define GPIOI_PIN9 9U
|
||||
#define GPIOI_PIN10 10U
|
||||
#define GPIOI_PIN11 11U
|
||||
#define GPIOI_PIN12 12U
|
||||
#define GPIOI_PIN13 13U
|
||||
#define GPIOI_PIN14 14U
|
||||
#define GPIOI_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -33,18 +33,18 @@
|
|||
* NOTE: LSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 0
|
||||
#define STM32_LSECLK 0U
|
||||
#endif
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 8000000
|
||||
#define STM32_HSECLK 8000000U
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Board voltages.
|
||||
* Required for performance limits calculation.
|
||||
*/
|
||||
#define STM32_VDD 300
|
||||
#define STM32_VDD 300U
|
||||
|
||||
/*
|
||||
* MCU type as defined in the ST header.
|
||||
|
@ -54,180 +54,180 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_BUTTON 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_PIN2 2
|
||||
#define GPIOA_PIN3 3
|
||||
#define GPIOA_LRCK 4
|
||||
#define GPIOA_SPC 5
|
||||
#define GPIOA_SDO 6
|
||||
#define GPIOA_SDI 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_VBUS_FS 9
|
||||
#define GPIOA_OTG_FS_ID 10
|
||||
#define GPIOA_OTG_FS_DM 11
|
||||
#define GPIOA_OTG_FS_DP 12
|
||||
#define GPIOA_SWDIO 13
|
||||
#define GPIOA_SWCLK 14
|
||||
#define GPIOA_PIN15 15
|
||||
#define GPIOA_BUTTON 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_PIN2 2U
|
||||
#define GPIOA_PIN3 3U
|
||||
#define GPIOA_LRCK 4U
|
||||
#define GPIOA_SPC 5U
|
||||
#define GPIOA_SDO 6U
|
||||
#define GPIOA_SDI 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_VBUS_FS 9U
|
||||
#define GPIOA_OTG_FS_ID 10U
|
||||
#define GPIOA_OTG_FS_DM 11U
|
||||
#define GPIOA_OTG_FS_DP 12U
|
||||
#define GPIOA_SWDIO 13U
|
||||
#define GPIOA_SWCLK 14U
|
||||
#define GPIOA_PIN15 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_PIN2 2
|
||||
#define GPIOB_SWO 3
|
||||
#define GPIOB_PIN4 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_SCL 6
|
||||
#define GPIOB_PIN7 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_SDA 9
|
||||
#define GPIOB_CLK_IN 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_PIN2 2U
|
||||
#define GPIOB_SWO 3U
|
||||
#define GPIOB_PIN4 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_SCL 6U
|
||||
#define GPIOB_PIN7 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_SDA 9U
|
||||
#define GPIOB_CLK_IN 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_OTG_FS_POWER_ON 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PDM_OUT 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_MCLK 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_PIN9 9
|
||||
#define GPIOC_SCLK 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_SDIN 12
|
||||
#define GPIOC_PIN13 13
|
||||
#define GPIOC_PIN14 14
|
||||
#define GPIOC_PIN15 15
|
||||
#define GPIOC_OTG_FS_POWER_ON 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PDM_OUT 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_MCLK 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_PIN9 9U
|
||||
#define GPIOC_SCLK 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_SDIN 12U
|
||||
#define GPIOC_PIN13 13U
|
||||
#define GPIOC_PIN14 14U
|
||||
#define GPIOC_PIN15 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_RESET 4
|
||||
#define GPIOD_OVER_CURRENT 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_LED4 12
|
||||
#define GPIOD_LED3 13
|
||||
#define GPIOD_LED5 14
|
||||
#define GPIOD_LED6 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_RESET 4U
|
||||
#define GPIOD_OVER_CURRENT 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_LED4 12U
|
||||
#define GPIOD_LED3 13U
|
||||
#define GPIOD_LED5 14U
|
||||
#define GPIOD_LED6 15U
|
||||
|
||||
#define GPIOE_INT1 0
|
||||
#define GPIOE_INT2 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_CS_SPI 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_INT1 0U
|
||||
#define GPIOE_INT2 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_CS_SPI 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOF_PIN0 0
|
||||
#define GPIOF_PIN1 1
|
||||
#define GPIOF_PIN2 2
|
||||
#define GPIOF_PIN3 3
|
||||
#define GPIOF_PIN4 4
|
||||
#define GPIOF_PIN5 5
|
||||
#define GPIOF_PIN6 6
|
||||
#define GPIOF_PIN7 7
|
||||
#define GPIOF_PIN8 8
|
||||
#define GPIOF_PIN9 9
|
||||
#define GPIOF_PIN10 10
|
||||
#define GPIOF_PIN11 11
|
||||
#define GPIOF_PIN12 12
|
||||
#define GPIOF_PIN13 13
|
||||
#define GPIOF_PIN14 14
|
||||
#define GPIOF_PIN15 15
|
||||
#define GPIOF_PIN0 0U
|
||||
#define GPIOF_PIN1 1U
|
||||
#define GPIOF_PIN2 2U
|
||||
#define GPIOF_PIN3 3U
|
||||
#define GPIOF_PIN4 4U
|
||||
#define GPIOF_PIN5 5U
|
||||
#define GPIOF_PIN6 6U
|
||||
#define GPIOF_PIN7 7U
|
||||
#define GPIOF_PIN8 8U
|
||||
#define GPIOF_PIN9 9U
|
||||
#define GPIOF_PIN10 10U
|
||||
#define GPIOF_PIN11 11U
|
||||
#define GPIOF_PIN12 12U
|
||||
#define GPIOF_PIN13 13U
|
||||
#define GPIOF_PIN14 14U
|
||||
#define GPIOF_PIN15 15U
|
||||
|
||||
#define GPIOG_PIN0 0
|
||||
#define GPIOG_PIN1 1
|
||||
#define GPIOG_PIN2 2
|
||||
#define GPIOG_PIN3 3
|
||||
#define GPIOG_PIN4 4
|
||||
#define GPIOG_PIN5 5
|
||||
#define GPIOG_PIN6 6
|
||||
#define GPIOG_PIN7 7
|
||||
#define GPIOG_PIN8 8
|
||||
#define GPIOG_PIN9 9
|
||||
#define GPIOG_PIN10 10
|
||||
#define GPIOG_PIN11 11
|
||||
#define GPIOG_PIN12 12
|
||||
#define GPIOG_PIN13 13
|
||||
#define GPIOG_PIN14 14
|
||||
#define GPIOG_PIN15 15
|
||||
#define GPIOG_PIN0 0U
|
||||
#define GPIOG_PIN1 1U
|
||||
#define GPIOG_PIN2 2U
|
||||
#define GPIOG_PIN3 3U
|
||||
#define GPIOG_PIN4 4U
|
||||
#define GPIOG_PIN5 5U
|
||||
#define GPIOG_PIN6 6U
|
||||
#define GPIOG_PIN7 7U
|
||||
#define GPIOG_PIN8 8U
|
||||
#define GPIOG_PIN9 9U
|
||||
#define GPIOG_PIN10 10U
|
||||
#define GPIOG_PIN11 11U
|
||||
#define GPIOG_PIN12 12U
|
||||
#define GPIOG_PIN13 13U
|
||||
#define GPIOG_PIN14 14U
|
||||
#define GPIOG_PIN15 15U
|
||||
|
||||
#define GPIOH_OSC_IN 0
|
||||
#define GPIOH_OSC_OUT 1
|
||||
#define GPIOH_PIN2 2
|
||||
#define GPIOH_PIN3 3
|
||||
#define GPIOH_PIN4 4
|
||||
#define GPIOH_PIN5 5
|
||||
#define GPIOH_PIN6 6
|
||||
#define GPIOH_PIN7 7
|
||||
#define GPIOH_PIN8 8
|
||||
#define GPIOH_PIN9 9
|
||||
#define GPIOH_PIN10 10
|
||||
#define GPIOH_PIN11 11
|
||||
#define GPIOH_PIN12 12
|
||||
#define GPIOH_PIN13 13
|
||||
#define GPIOH_PIN14 14
|
||||
#define GPIOH_PIN15 15
|
||||
#define GPIOH_OSC_IN 0U
|
||||
#define GPIOH_OSC_OUT 1U
|
||||
#define GPIOH_PIN2 2U
|
||||
#define GPIOH_PIN3 3U
|
||||
#define GPIOH_PIN4 4U
|
||||
#define GPIOH_PIN5 5U
|
||||
#define GPIOH_PIN6 6U
|
||||
#define GPIOH_PIN7 7U
|
||||
#define GPIOH_PIN8 8U
|
||||
#define GPIOH_PIN9 9U
|
||||
#define GPIOH_PIN10 10U
|
||||
#define GPIOH_PIN11 11U
|
||||
#define GPIOH_PIN12 12U
|
||||
#define GPIOH_PIN13 13U
|
||||
#define GPIOH_PIN14 14U
|
||||
#define GPIOH_PIN15 15U
|
||||
|
||||
#define GPIOI_PIN0 0
|
||||
#define GPIOI_PIN1 1
|
||||
#define GPIOI_PIN2 2
|
||||
#define GPIOI_PIN3 3
|
||||
#define GPIOI_PIN4 4
|
||||
#define GPIOI_PIN5 5
|
||||
#define GPIOI_PIN6 6
|
||||
#define GPIOI_PIN7 7
|
||||
#define GPIOI_PIN8 8
|
||||
#define GPIOI_PIN9 9
|
||||
#define GPIOI_PIN10 10
|
||||
#define GPIOI_PIN11 11
|
||||
#define GPIOI_PIN12 12
|
||||
#define GPIOI_PIN13 13
|
||||
#define GPIOI_PIN14 14
|
||||
#define GPIOI_PIN15 15
|
||||
#define GPIOI_PIN0 0U
|
||||
#define GPIOI_PIN1 1U
|
||||
#define GPIOI_PIN2 2U
|
||||
#define GPIOI_PIN3 3U
|
||||
#define GPIOI_PIN4 4U
|
||||
#define GPIOI_PIN5 5U
|
||||
#define GPIOI_PIN6 6U
|
||||
#define GPIOI_PIN7 7U
|
||||
#define GPIOI_PIN8 8U
|
||||
#define GPIOI_PIN9 9U
|
||||
#define GPIOI_PIN10 10U
|
||||
#define GPIOI_PIN11 11U
|
||||
#define GPIOI_PIN12 12U
|
||||
#define GPIOI_PIN13 13U
|
||||
#define GPIOI_PIN14 14U
|
||||
#define GPIOI_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_2M(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_25M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_50M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_100M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -33,11 +33,11 @@
|
|||
* NOTE: HSE not fitted.
|
||||
*/
|
||||
#if !defined(STM32_LSECLK)
|
||||
#define STM32_LSECLK 32768
|
||||
#define STM32_LSECLK 32768U
|
||||
#endif
|
||||
|
||||
#if !defined(STM32_HSECLK)
|
||||
#define STM32_HSECLK 0
|
||||
#define STM32_HSECLK 0U
|
||||
#endif
|
||||
|
||||
#define STM32_HSE_BYPASS
|
||||
|
@ -50,129 +50,129 @@
|
|||
/*
|
||||
* IO pins assignments.
|
||||
*/
|
||||
#define GPIOA_BUTTON 0
|
||||
#define GPIOA_PIN1 1
|
||||
#define GPIOA_PIN2 2
|
||||
#define GPIOA_PIN3 3
|
||||
#define GPIOA_PIN4 4
|
||||
#define GPIOA_PIN5 5
|
||||
#define GPIOA_PIN6 6
|
||||
#define GPIOA_PIN7 7
|
||||
#define GPIOA_PIN8 8
|
||||
#define GPIOA_PIN9 9
|
||||
#define GPIOA_PIN10 10
|
||||
#define GPIOA_PIN11 11
|
||||
#define GPIOA_PIN12 12
|
||||
#define GPIOA_JTAG_TMS 13
|
||||
#define GPIOA_JTAG_TCK 14
|
||||
#define GPIOA_JTAG_TDI 15
|
||||
#define GPIOA_BUTTON 0U
|
||||
#define GPIOA_PIN1 1U
|
||||
#define GPIOA_PIN2 2U
|
||||
#define GPIOA_PIN3 3U
|
||||
#define GPIOA_PIN4 4U
|
||||
#define GPIOA_PIN5 5U
|
||||
#define GPIOA_PIN6 6U
|
||||
#define GPIOA_PIN7 7U
|
||||
#define GPIOA_PIN8 8U
|
||||
#define GPIOA_PIN9 9U
|
||||
#define GPIOA_PIN10 10U
|
||||
#define GPIOA_PIN11 11U
|
||||
#define GPIOA_PIN12 12U
|
||||
#define GPIOA_JTAG_TMS 13U
|
||||
#define GPIOA_JTAG_TCK 14U
|
||||
#define GPIOA_JTAG_TDI 15U
|
||||
|
||||
#define GPIOB_PIN0 0
|
||||
#define GPIOB_PIN1 1
|
||||
#define GPIOB_BOOT1 2
|
||||
#define GPIOB_JTAG_TDO 3
|
||||
#define GPIOB_JTAG_TRST 4
|
||||
#define GPIOB_PIN5 5
|
||||
#define GPIOB_LED4 6
|
||||
#define GPIOB_LED3 7
|
||||
#define GPIOB_PIN8 8
|
||||
#define GPIOB_PIN9 9
|
||||
#define GPIOB_PIN10 10
|
||||
#define GPIOB_PIN11 11
|
||||
#define GPIOB_PIN12 12
|
||||
#define GPIOB_PIN13 13
|
||||
#define GPIOB_PIN14 14
|
||||
#define GPIOB_PIN15 15
|
||||
#define GPIOB_PIN0 0U
|
||||
#define GPIOB_PIN1 1U
|
||||
#define GPIOB_BOOT1 2U
|
||||
#define GPIOB_JTAG_TDO 3U
|
||||
#define GPIOB_JTAG_TRST 4U
|
||||
#define GPIOB_PIN5 5U
|
||||
#define GPIOB_LED4 6U
|
||||
#define GPIOB_LED3 7U
|
||||
#define GPIOB_PIN8 8U
|
||||
#define GPIOB_PIN9 9U
|
||||
#define GPIOB_PIN10 10U
|
||||
#define GPIOB_PIN11 11U
|
||||
#define GPIOB_PIN12 12U
|
||||
#define GPIOB_PIN13 13U
|
||||
#define GPIOB_PIN14 14U
|
||||
#define GPIOB_PIN15 15U
|
||||
|
||||
#define GPIOC_PIN0 0
|
||||
#define GPIOC_PIN1 1
|
||||
#define GPIOC_PIN2 2
|
||||
#define GPIOC_PIN3 3
|
||||
#define GPIOC_PIN4 4
|
||||
#define GPIOC_PIN5 5
|
||||
#define GPIOC_PIN6 6
|
||||
#define GPIOC_PIN7 7
|
||||
#define GPIOC_PIN8 8
|
||||
#define GPIOC_PIN9 9
|
||||
#define GPIOC_PIN10 10
|
||||
#define GPIOC_PIN11 11
|
||||
#define GPIOC_PIN12 12
|
||||
#define GPIOC_PIN13 13
|
||||
#define GPIOC_OSC32_IN 14
|
||||
#define GPIOC_OSC32_OUT 15
|
||||
#define GPIOC_PIN0 0U
|
||||
#define GPIOC_PIN1 1U
|
||||
#define GPIOC_PIN2 2U
|
||||
#define GPIOC_PIN3 3U
|
||||
#define GPIOC_PIN4 4U
|
||||
#define GPIOC_PIN5 5U
|
||||
#define GPIOC_PIN6 6U
|
||||
#define GPIOC_PIN7 7U
|
||||
#define GPIOC_PIN8 8U
|
||||
#define GPIOC_PIN9 9U
|
||||
#define GPIOC_PIN10 10U
|
||||
#define GPIOC_PIN11 11U
|
||||
#define GPIOC_PIN12 12U
|
||||
#define GPIOC_PIN13 13U
|
||||
#define GPIOC_OSC32_IN 14U
|
||||
#define GPIOC_OSC32_OUT 15U
|
||||
|
||||
#define GPIOD_PIN0 0
|
||||
#define GPIOD_PIN1 1
|
||||
#define GPIOD_PIN2 2
|
||||
#define GPIOD_PIN3 3
|
||||
#define GPIOD_PIN4 4
|
||||
#define GPIOD_PIN5 5
|
||||
#define GPIOD_PIN6 6
|
||||
#define GPIOD_PIN7 7
|
||||
#define GPIOD_PIN8 8
|
||||
#define GPIOD_PIN9 9
|
||||
#define GPIOD_PIN10 10
|
||||
#define GPIOD_PIN11 11
|
||||
#define GPIOD_PIN12 12
|
||||
#define GPIOD_PIN13 13
|
||||
#define GPIOD_PIN14 14
|
||||
#define GPIOD_PIN15 15
|
||||
#define GPIOD_PIN0 0U
|
||||
#define GPIOD_PIN1 1U
|
||||
#define GPIOD_PIN2 2U
|
||||
#define GPIOD_PIN3 3U
|
||||
#define GPIOD_PIN4 4U
|
||||
#define GPIOD_PIN5 5U
|
||||
#define GPIOD_PIN6 6U
|
||||
#define GPIOD_PIN7 7U
|
||||
#define GPIOD_PIN8 8U
|
||||
#define GPIOD_PIN9 9U
|
||||
#define GPIOD_PIN10 10U
|
||||
#define GPIOD_PIN11 11U
|
||||
#define GPIOD_PIN12 12U
|
||||
#define GPIOD_PIN13 13U
|
||||
#define GPIOD_PIN14 14U
|
||||
#define GPIOD_PIN15 15U
|
||||
|
||||
#define GPIOE_PIN0 0
|
||||
#define GPIOE_PIN1 1
|
||||
#define GPIOE_PIN2 2
|
||||
#define GPIOE_PIN3 3
|
||||
#define GPIOE_PIN4 4
|
||||
#define GPIOE_PIN5 5
|
||||
#define GPIOE_PIN6 6
|
||||
#define GPIOE_PIN7 7
|
||||
#define GPIOE_PIN8 8
|
||||
#define GPIOE_PIN9 9
|
||||
#define GPIOE_PIN10 10
|
||||
#define GPIOE_PIN11 11
|
||||
#define GPIOE_PIN12 12
|
||||
#define GPIOE_PIN13 13
|
||||
#define GPIOE_PIN14 14
|
||||
#define GPIOE_PIN15 15
|
||||
#define GPIOE_PIN0 0U
|
||||
#define GPIOE_PIN1 1U
|
||||
#define GPIOE_PIN2 2U
|
||||
#define GPIOE_PIN3 3U
|
||||
#define GPIOE_PIN4 4U
|
||||
#define GPIOE_PIN5 5U
|
||||
#define GPIOE_PIN6 6U
|
||||
#define GPIOE_PIN7 7U
|
||||
#define GPIOE_PIN8 8U
|
||||
#define GPIOE_PIN9 9U
|
||||
#define GPIOE_PIN10 10U
|
||||
#define GPIOE_PIN11 11U
|
||||
#define GPIOE_PIN12 12U
|
||||
#define GPIOE_PIN13 13U
|
||||
#define GPIOE_PIN14 14U
|
||||
#define GPIOE_PIN15 15U
|
||||
|
||||
#define GPIOH_OSC_IN 0
|
||||
#define GPIOH_OSC_OUT 1
|
||||
#define GPIOH_PIN2 2
|
||||
#define GPIOH_PIN3 3
|
||||
#define GPIOH_PIN4 4
|
||||
#define GPIOH_PIN5 5
|
||||
#define GPIOH_PIN6 6
|
||||
#define GPIOH_PIN7 7
|
||||
#define GPIOH_PIN8 8
|
||||
#define GPIOH_PIN9 9
|
||||
#define GPIOH_PIN10 10
|
||||
#define GPIOH_PIN11 11
|
||||
#define GPIOH_PIN12 12
|
||||
#define GPIOH_PIN13 13
|
||||
#define GPIOH_PIN14 14
|
||||
#define GPIOH_PIN15 15
|
||||
#define GPIOH_OSC_IN 0U
|
||||
#define GPIOH_OSC_OUT 1U
|
||||
#define GPIOH_PIN2 2U
|
||||
#define GPIOH_PIN3 3U
|
||||
#define GPIOH_PIN4 4U
|
||||
#define GPIOH_PIN5 5U
|
||||
#define GPIOH_PIN6 6U
|
||||
#define GPIOH_PIN7 7U
|
||||
#define GPIOH_PIN8 8U
|
||||
#define GPIOH_PIN9 9U
|
||||
#define GPIOH_PIN10 10U
|
||||
#define GPIOH_PIN11 11U
|
||||
#define GPIOH_PIN12 12U
|
||||
#define GPIOH_PIN13 13U
|
||||
#define GPIOH_PIN14 14U
|
||||
#define GPIOH_PIN15 15U
|
||||
|
||||
/*
|
||||
* I/O ports initial setup, this configuration is established soon after reset
|
||||
* in the initialization code.
|
||||
* Please refer to the STM32 Reference Manual for details.
|
||||
*/
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2))
|
||||
#define PIN_MODE_INPUT(n) (0U << ((n) * 2U))
|
||||
#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U))
|
||||
#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U))
|
||||
#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U))
|
||||
#define PIN_ODR_LOW(n) (0U << (n))
|
||||
#define PIN_ODR_HIGH(n) (1U << (n))
|
||||
#define PIN_OTYPE_PUSHPULL(n) (0U << (n))
|
||||
#define PIN_OTYPE_OPENDRAIN(n) (1U << (n))
|
||||
#define PIN_OSPEED_400K(n) (0U << ((n) * 2))
|
||||
#define PIN_OSPEED_2M(n) (1U << ((n) * 2))
|
||||
#define PIN_OSPEED_10M(n) (2U << ((n) * 2))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2))
|
||||
#define PIN_AFIO_AF(n, v) ((v##U) << (((n) % 8) * 4))
|
||||
#define PIN_OSPEED_400K(n) (0U << ((n) * 2U))
|
||||
#define PIN_OSPEED_2M(n) (1U << ((n) * 2U))
|
||||
#define PIN_OSPEED_10M(n) (2U << ((n) * 2U))
|
||||
#define PIN_OSPEED_40M(n) (3U << ((n) * 2U))
|
||||
#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U))
|
||||
#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U))
|
||||
#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U))
|
||||
|
||||
/*
|
||||
* GPIOA setup:
|
||||
|
|
|
@ -260,17 +260,25 @@ THD_FUNCTION(lwip_thread, p) {
|
|||
/* Goes to the final priority after initialization.*/
|
||||
chThdSetPriority(LWIP_THREAD_PRIORITY);
|
||||
|
||||
while (TRUE) {
|
||||
while (true) {
|
||||
eventmask_t mask = chEvtWaitAny(ALL_EVENTS);
|
||||
if (mask & PERIODIC_TIMER_ID) {
|
||||
bool current_link_status = macPollLinkStatus(ÐD1);
|
||||
if (current_link_status != netif_is_link_up(&thisif)) {
|
||||
if (current_link_status)
|
||||
if (current_link_status) {
|
||||
tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_up,
|
||||
&thisif, 0);
|
||||
else
|
||||
#if LWIP_DHCP
|
||||
dhcp_start(&thisif);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
tcpip_callback_with_block((tcpip_callback_fn) netif_set_link_down,
|
||||
&thisif, 0);
|
||||
#if LWIP_DHCP
|
||||
dhcp_stop(&thisif);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mask & FRAME_RECEIVED_ID) {
|
||||
|
@ -296,7 +304,6 @@ THD_FUNCTION(lwip_thread, p) {
|
|||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
|
Loading…
Reference in New Issue