STM32 LPUART1 support added.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8539 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
03f609e27c
commit
56cf40e555
|
@ -127,8 +127,10 @@
|
||||||
*/
|
*/
|
||||||
#define STM32_SERIAL_USE_USART1 FALSE
|
#define STM32_SERIAL_USE_USART1 FALSE
|
||||||
#define STM32_SERIAL_USE_USART2 TRUE
|
#define STM32_SERIAL_USE_USART2 TRUE
|
||||||
|
#define STM32_SERIAL_USE_LPUART1 FALSE
|
||||||
#define STM32_SERIAL_USART1_PRIORITY 3
|
#define STM32_SERIAL_USART1_PRIORITY 3
|
||||||
#define STM32_SERIAL_USART2_PRIORITY 3
|
#define STM32_SERIAL_USART2_PRIORITY 3
|
||||||
|
#define STM32_SERIAL_LPUART1_PRIORITY 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SPI driver system settings.
|
* SPI driver system settings.
|
||||||
|
|
|
@ -77,6 +77,7 @@
|
||||||
#define STM32_USART3SEL STM32_USART3SEL_SYSCLK
|
#define STM32_USART3SEL STM32_USART3SEL_SYSCLK
|
||||||
#define STM32_UART4SEL STM32_UART4SEL_SYSCLK
|
#define STM32_UART4SEL STM32_UART4SEL_SYSCLK
|
||||||
#define STM32_UART5SEL STM32_UART5SEL_SYSCLK
|
#define STM32_UART5SEL STM32_UART5SEL_SYSCLK
|
||||||
|
#define STM32_LPUART1SEL STM32_LPUART1SEL_SYSCLK
|
||||||
#define STM32_I2C1SEL STM32_I2C1SEL_SYSCLK
|
#define STM32_I2C1SEL STM32_I2C1SEL_SYSCLK
|
||||||
#define STM32_I2C2SEL STM32_I2C2SEL_SYSCLK
|
#define STM32_I2C2SEL STM32_I2C2SEL_SYSCLK
|
||||||
#define STM32_I2C3SEL STM32_I2C3SEL_SYSCLK
|
#define STM32_I2C3SEL STM32_I2C3SEL_SYSCLK
|
||||||
|
@ -96,9 +97,11 @@
|
||||||
#define STM32_SERIAL_USE_USART1 FALSE
|
#define STM32_SERIAL_USE_USART1 FALSE
|
||||||
#define STM32_SERIAL_USE_USART2 TRUE
|
#define STM32_SERIAL_USE_USART2 TRUE
|
||||||
#define STM32_SERIAL_USE_USART3 FALSE
|
#define STM32_SERIAL_USE_USART3 FALSE
|
||||||
|
#define STM32_SERIAL_USE_LPUART1 FALSE
|
||||||
#define STM32_SERIAL_USART1_PRIORITY 12
|
#define STM32_SERIAL_USART1_PRIORITY 12
|
||||||
#define STM32_SERIAL_USART2_PRIORITY 12
|
#define STM32_SERIAL_USART2_PRIORITY 12
|
||||||
#define STM32_SERIAL_USART3_PRIORITY 12
|
#define STM32_SERIAL_USART3_PRIORITY 12
|
||||||
|
#define STM32_SERIAL_LPUART1_PRIORITY 12
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ST driver system settings.
|
* ST driver system settings.
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USART1 driver enable switch.
|
* @brief USART1 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USART1 is included.
|
* @details If set to @p TRUE the support for USART1 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_USART1) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_USART1) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_USART1 FALSE
|
#define STM32_SERIAL_USE_USART1 FALSE
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USART2 driver enable switch.
|
* @brief USART2 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USART2 is included.
|
* @details If set to @p TRUE the support for USART2 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_USART2) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_USART2) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_USART2 FALSE
|
#define STM32_SERIAL_USE_USART2 FALSE
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USART3 driver enable switch.
|
* @brief USART3 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USART3 is included.
|
* @details If set to @p TRUE the support for USART3 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_USART3) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_USART3) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_USART3 FALSE
|
#define STM32_SERIAL_USE_USART3 FALSE
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART4 driver enable switch.
|
* @brief UART4 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for UART4 is included.
|
* @details If set to @p TRUE the support for UART4 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_UART4) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_UART4) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_UART4 FALSE
|
#define STM32_SERIAL_USE_UART4 FALSE
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART5 driver enable switch.
|
* @brief UART5 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for UART5 is included.
|
* @details If set to @p TRUE the support for UART5 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_UART5) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_UART5) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_UART5 FALSE
|
#define STM32_SERIAL_USE_UART5 FALSE
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USART6 driver enable switch.
|
* @brief USART6 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USART6 is included.
|
* @details If set to @p TRUE the support for USART6 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_USART6) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_USART6) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_USART6 FALSE
|
#define STM32_SERIAL_USE_USART6 FALSE
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART7 driver enable switch.
|
* @brief UART7 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for UART7 is included.
|
* @details If set to @p TRUE the support for UART7 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_UART7) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_UART7) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_UART7 FALSE
|
#define STM32_SERIAL_USE_UART7 FALSE
|
||||||
|
@ -105,7 +105,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART8 driver enable switch.
|
* @brief UART8 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for UART8 is included.
|
* @details If set to @p TRUE the support for UART8 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_UART8) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_UART8) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_UART8 FALSE
|
#define STM32_SERIAL_USE_UART8 FALSE
|
||||||
|
|
|
@ -98,6 +98,11 @@ SerialDriver SD7;
|
||||||
SerialDriver SD8;
|
SerialDriver SD8;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** @brief LPUART1 serial driver identifier.*/
|
||||||
|
#if STM32_SERIAL_USE_LPUART1 || defined(__DOXYGEN__)
|
||||||
|
SerialDriver LPSD1;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver local variables and types. */
|
/* Driver local variables and types. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -126,6 +131,13 @@ static void usart_init(SerialDriver *sdp, const SerialConfig *config) {
|
||||||
USART_TypeDef *u = sdp->usart;
|
USART_TypeDef *u = sdp->usart;
|
||||||
|
|
||||||
/* Baud rate setting.*/
|
/* Baud rate setting.*/
|
||||||
|
#if STM32_SERIAL_USE_LPUART1
|
||||||
|
if ( sdp == &LPSD1 )
|
||||||
|
{
|
||||||
|
u->BRR = (uint32_t)( ( (uint64_t)sdp->clock * 256 ) / config->speed);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
#endif
|
||||||
u->BRR = (uint32_t)(sdp->clock / config->speed);
|
u->BRR = (uint32_t)(sdp->clock / config->speed);
|
||||||
|
|
||||||
/* Note that some bits are enforced.*/
|
/* Note that some bits are enforced.*/
|
||||||
|
@ -292,6 +304,14 @@ static void notify8(io_queue_t *qp) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if STM32_SERIAL_USE_LPUART1 || defined(__DOXYGEN__)
|
||||||
|
static void notifylp1(io_queue_t *qp) {
|
||||||
|
|
||||||
|
(void)qp;
|
||||||
|
LPUART1->CR1 |= USART_CR1_TXEIE;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver interrupt handlers. */
|
/* Driver interrupt handlers. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -482,6 +502,25 @@ OSAL_IRQ_HANDLER(STM32_UART8_HANDLER) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if STM32_SERIAL_USE_LPUART1 || defined(__DOXYGEN__)
|
||||||
|
#if !defined(STM32_LPUART1_HANDLER)
|
||||||
|
#error "STM32_LPUART1_HANDLER not defined"
|
||||||
|
#endif
|
||||||
|
/**
|
||||||
|
* @brief LPUART1 interrupt handler.
|
||||||
|
*
|
||||||
|
* @isr
|
||||||
|
*/
|
||||||
|
OSAL_IRQ_HANDLER(STM32_LPUART1_HANDLER) {
|
||||||
|
|
||||||
|
OSAL_IRQ_PROLOGUE();
|
||||||
|
|
||||||
|
serve_interrupt(&LPSD1);
|
||||||
|
|
||||||
|
OSAL_IRQ_EPILOGUE();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver exported functions. */
|
/* Driver exported functions. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -565,6 +604,15 @@ void sd_lld_init(void) {
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if STM32_SERIAL_USE_LPUART1
|
||||||
|
sdObjectInit(&LPSD1, NULL, notifylp1);
|
||||||
|
LPSD1.usart = LPUART1;
|
||||||
|
LPSD1.clock = STM32_LPUART1CLK;
|
||||||
|
#if defined(STM32_LPUART1_NUMBER)
|
||||||
|
nvicEnableVector(STM32_LPUART1_NUMBER, STM32_SERIAL_LPUART1_PRIORITY);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if STM32_SERIAL_USE_USART3 || STM32_SERIAL_USE_UART4 || \
|
#if STM32_SERIAL_USE_USART3 || STM32_SERIAL_USE_UART4 || \
|
||||||
STM32_SERIAL_USE_UART5 || STM32_SERIAL_USE_USART6 || \
|
STM32_SERIAL_USE_UART5 || STM32_SERIAL_USE_USART6 || \
|
||||||
STM32_SERIAL_USE_UART7 || STM32_SERIAL_USE_UART8 || defined(__DOXYGEN__)
|
STM32_SERIAL_USE_UART7 || STM32_SERIAL_USE_UART8 || defined(__DOXYGEN__)
|
||||||
|
@ -629,6 +677,11 @@ void sd_lld_start(SerialDriver *sdp, const SerialConfig *config) {
|
||||||
if (&SD8 == sdp) {
|
if (&SD8 == sdp) {
|
||||||
rccEnableUART8(FALSE);
|
rccEnableUART8(FALSE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if STM32_SERIAL_USE_LPUART1
|
||||||
|
if (&LPSD1 == sdp) {
|
||||||
|
rccEnableLPUART1(FALSE);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
usart_init(sdp, config);
|
usart_init(sdp, config);
|
||||||
|
@ -696,6 +749,12 @@ void sd_lld_stop(SerialDriver *sdp) {
|
||||||
rccDisableUART8(FALSE);
|
rccDisableUART8(FALSE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#if STM32_SERIAL_USE_LPUART1
|
||||||
|
if (&LPSD1 == sdp) {
|
||||||
|
rccDisableLPUART1(FALSE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USART1 driver enable switch.
|
* @brief USART1 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USART1 is included.
|
* @details If set to @p TRUE the support for USART1 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_USART1) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_USART1) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_USART1 FALSE
|
#define STM32_SERIAL_USE_USART1 FALSE
|
||||||
|
@ -51,7 +51,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USART2 driver enable switch.
|
* @brief USART2 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USART2 is included.
|
* @details If set to @p TRUE the support for USART2 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_USART2) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_USART2) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_USART2 FALSE
|
#define STM32_SERIAL_USE_USART2 FALSE
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USART3 driver enable switch.
|
* @brief USART3 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USART3 is included.
|
* @details If set to @p TRUE the support for USART3 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_USART3) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_USART3) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_USART3 FALSE
|
#define STM32_SERIAL_USE_USART3 FALSE
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART4 driver enable switch.
|
* @brief UART4 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for UART4 is included.
|
* @details If set to @p TRUE the support for UART4 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_UART4) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_UART4) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_UART4 FALSE
|
#define STM32_SERIAL_USE_UART4 FALSE
|
||||||
|
@ -78,7 +78,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART5 driver enable switch.
|
* @brief UART5 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for UART5 is included.
|
* @details If set to @p TRUE the support for UART5 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_UART5) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_UART5) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_UART5 FALSE
|
#define STM32_SERIAL_USE_UART5 FALSE
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief USART6 driver enable switch.
|
* @brief USART6 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for USART6 is included.
|
* @details If set to @p TRUE the support for USART6 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_USART6) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_USART6) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_USART6 FALSE
|
#define STM32_SERIAL_USE_USART6 FALSE
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART7 driver enable switch.
|
* @brief UART7 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for UART7 is included.
|
* @details If set to @p TRUE the support for UART7 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_UART7) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_UART7) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_UART7 FALSE
|
#define STM32_SERIAL_USE_UART7 FALSE
|
||||||
|
@ -105,12 +105,21 @@
|
||||||
/**
|
/**
|
||||||
* @brief UART8 driver enable switch.
|
* @brief UART8 driver enable switch.
|
||||||
* @details If set to @p TRUE the support for UART8 is included.
|
* @details If set to @p TRUE the support for UART8 is included.
|
||||||
* @note The default is @p TRUE.
|
* @note The default is @p FALSE.
|
||||||
*/
|
*/
|
||||||
#if !defined(STM32_SERIAL_USE_UART8) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_USE_UART8) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_USE_UART8 FALSE
|
#define STM32_SERIAL_USE_UART8 FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief LPUART1 driver enable switch.
|
||||||
|
* @details If set to @p TRUE the support for LPUART is included.
|
||||||
|
* @note The default is @p FALSE.
|
||||||
|
*/
|
||||||
|
#if !defined(STM32_SERIAL_USE_LPUART1) || defined(__DOXYGEN__)
|
||||||
|
#define STM32_SERIAL_USE_LPUART1 FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief USART1 interrupt priority level setting.
|
* @brief USART1 interrupt priority level setting.
|
||||||
*/
|
*/
|
||||||
|
@ -174,6 +183,13 @@
|
||||||
#if !defined(STM32_SERIAL_UART8_PRIORITY) || defined(__DOXYGEN__)
|
#if !defined(STM32_SERIAL_UART8_PRIORITY) || defined(__DOXYGEN__)
|
||||||
#define STM32_SERIAL_UART8_PRIORITY 12
|
#define STM32_SERIAL_UART8_PRIORITY 12
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief LPUART1 interrupt priority level setting.
|
||||||
|
*/
|
||||||
|
#if !defined(STM32_SERIAL_LPUART1_PRIORITY) || defined(__DOXYGEN__)
|
||||||
|
#define STM32_SERIAL_LPUART1_PRIORITY 12
|
||||||
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -212,10 +228,15 @@
|
||||||
#error "UART8 not present in the selected device"
|
#error "UART8 not present in the selected device"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if STM32_SERIAL_USE_LPUART1 && !STM32_HAS_LPUART1
|
||||||
|
#error "LPUART1 not present in the selected device"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !STM32_SERIAL_USE_USART1 && !STM32_SERIAL_USE_USART2 && \
|
#if !STM32_SERIAL_USE_USART1 && !STM32_SERIAL_USE_USART2 && \
|
||||||
!STM32_SERIAL_USE_USART3 && !STM32_SERIAL_USE_UART4 && \
|
!STM32_SERIAL_USE_USART3 && !STM32_SERIAL_USE_UART4 && \
|
||||||
!STM32_SERIAL_USE_UART5 && !STM32_SERIAL_USE_USART6 && \
|
!STM32_SERIAL_USE_UART5 && !STM32_SERIAL_USE_USART6 && \
|
||||||
!STM32_SERIAL_USE_UART7 && !STM32_SERIAL_USE_UART8
|
!STM32_SERIAL_USE_UART7 && !STM32_SERIAL_USE_UART8 && \
|
||||||
|
!STM32_SERIAL_USE_LPUART1
|
||||||
#error "SERIAL driver activated but no USART/UART peripheral assigned"
|
#error "SERIAL driver activated but no USART/UART peripheral assigned"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -259,6 +280,11 @@
|
||||||
#error "Invalid IRQ priority assigned to UART8"
|
#error "Invalid IRQ priority assigned to UART8"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if STM32_SERIAL_USE_LPUART1 && \
|
||||||
|
!OSAL_IRQ_IS_VALID_PRIORITY(STM32_SERIAL_LPUART1_PRIORITY)
|
||||||
|
#error "Invalid IRQ priority assigned to LPUART1"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* Driver data structures and types. */
|
/* Driver data structures and types. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
@ -352,6 +378,9 @@ extern SerialDriver SD7;
|
||||||
#if STM32_SERIAL_USE_UART8 && !defined(__DOXYGEN__)
|
#if STM32_SERIAL_USE_UART8 && !defined(__DOXYGEN__)
|
||||||
extern SerialDriver SD8;
|
extern SerialDriver SD8;
|
||||||
#endif
|
#endif
|
||||||
|
#if STM32_SERIAL_USE_LPUART1 && !defined(__DOXYGEN__)
|
||||||
|
extern SerialDriver LPSD1;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
|
@ -241,6 +241,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -490,6 +491,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#if defined(STM32F072xB) || defined(STM32F078xx)
|
#if defined(STM32F072xB) || defined(STM32F078xx)
|
||||||
|
@ -703,6 +705,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -901,6 +904,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -1102,6 +1106,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -1375,6 +1380,7 @@
|
||||||
|
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
#else
|
#else
|
||||||
#define STM32_HAS_USART3 FALSE
|
#define STM32_HAS_USART3 FALSE
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
|
@ -1382,6 +1388,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
|
@ -1619,6 +1626,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -1983,6 +1991,8 @@
|
||||||
STM32_DMA_STREAM_ID_MSK(2, 5))
|
STM32_DMA_STREAM_ID_MSK(2, 5))
|
||||||
#define STM32_UART8_TX_DMA_CHN 0x0F0FF0FF
|
#define STM32_UART8_TX_DMA_CHN 0x0F0FF0FF
|
||||||
|
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
#define STM32_HAS_OTG1 FALSE
|
#define STM32_HAS_OTG1 FALSE
|
||||||
|
|
|
@ -233,6 +233,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -401,6 +402,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -582,6 +584,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -822,6 +825,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -1059,6 +1063,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -1278,6 +1283,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
|
|
@ -253,6 +253,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -496,6 +497,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
|
|
@ -247,6 +247,9 @@
|
||||||
#define STM32_HAS_UART5 TRUE
|
#define STM32_HAS_UART5 TRUE
|
||||||
|
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -449,6 +452,9 @@
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
#define STM32_HAS_UART5 FALSE
|
#define STM32_HAS_UART5 FALSE
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -647,6 +653,9 @@
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
#define STM32_HAS_UART5 FALSE
|
#define STM32_HAS_UART5 FALSE
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -845,6 +854,9 @@
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
#define STM32_HAS_UART5 FALSE
|
#define STM32_HAS_UART5 FALSE
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -1068,6 +1080,9 @@
|
||||||
#define STM32_HAS_UART5 TRUE
|
#define STM32_HAS_UART5 TRUE
|
||||||
|
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -1268,6 +1283,9 @@
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
#define STM32_HAS_UART5 FALSE
|
#define STM32_HAS_UART5 FALSE
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -1464,6 +1482,9 @@
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
#define STM32_HAS_UART5 FALSE
|
#define STM32_HAS_UART5 FALSE
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -1686,6 +1707,9 @@
|
||||||
#define STM32_HAS_UART5 TRUE
|
#define STM32_HAS_UART5 TRUE
|
||||||
|
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -1885,6 +1909,9 @@
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
#define STM32_HAS_UART5 FALSE
|
#define STM32_HAS_UART5 FALSE
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
|
|
@ -386,6 +386,8 @@
|
||||||
#define STM32_UART8_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
|
#define STM32_UART8_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
|
||||||
#define STM32_UART8_TX_DMA_CHN 0x00000005
|
#define STM32_UART8_TX_DMA_CHN 0x00000005
|
||||||
|
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
#define STM32_HAS_OTG1 TRUE
|
#define STM32_HAS_OTG1 TRUE
|
||||||
|
@ -721,6 +723,7 @@
|
||||||
|
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -1011,6 +1014,7 @@
|
||||||
|
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
@ -1292,6 +1296,7 @@
|
||||||
|
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
|
|
@ -450,6 +450,8 @@
|
||||||
#define STM32_UART8_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
|
#define STM32_UART8_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(1, 0)
|
||||||
#define STM32_UART8_TX_DMA_CHN 0x00000005
|
#define STM32_UART8_TX_DMA_CHN 0x00000005
|
||||||
|
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
|
||||||
|
|
|
@ -584,6 +584,31 @@
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
#define rccResetUSART3() rccResetAPB1(RCC_APB1RSTR_USART3RST)
|
#define rccResetUSART3() rccResetAPB1(RCC_APB1RSTR_USART3RST)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables the LPUART1 peripheral clock.
|
||||||
|
*
|
||||||
|
* @param[in] lp low power enable flag
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
#define rccEnableLPUART1(lp) rccEnableAPB1(RCC_APB1ENR_LPUART1EN, lp)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disables the LPUART1 peripheral clock.
|
||||||
|
*
|
||||||
|
* @param[in] lp low power enable flag
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
#define rccDisableLPUART1(lp) rccDisableAPB1(RCC_APB1ENR_LPUART1EN, lp)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Resets the USART1 peripheral.
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
#define rccResetLPUART1() rccResetAPB1(RCC_APB1RSTR_LPUART1RST)
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -249,6 +249,10 @@
|
||||||
STM32_DMA_STREAM_ID_MSK(1, 7))
|
STM32_DMA_STREAM_ID_MSK(1, 7))
|
||||||
#define STM32_USART2_TX_DMA_CHN 0x04004000
|
#define STM32_USART2_TX_DMA_CHN 0x04004000
|
||||||
|
|
||||||
|
#define STM32_HAS_LPUART1 TRUE
|
||||||
|
#define STM32_LPUART1_HANDLER VectorB4
|
||||||
|
#define STM32_LPUART1_NUMBER 29
|
||||||
|
|
||||||
#define STM32_HAS_USART3 FALSE
|
#define STM32_HAS_USART3 FALSE
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
#define STM32_HAS_UART5 FALSE
|
#define STM32_HAS_UART5 FALSE
|
||||||
|
@ -491,10 +495,16 @@
|
||||||
STM32_DMA_STREAM_ID_MSK(1, 7))
|
STM32_DMA_STREAM_ID_MSK(1, 7))
|
||||||
#define STM32_USART2_TX_DMA_CHN 0x04004000
|
#define STM32_USART2_TX_DMA_CHN 0x04004000
|
||||||
|
|
||||||
|
#define STM32_HAS_LPUART1 TRUE
|
||||||
|
#define STM32_LPUART1_HANDLER VectorB4
|
||||||
|
#define STM32_LPUART1_NUMBER 29
|
||||||
|
|
||||||
#define STM32_HAS_USART3 FALSE
|
#define STM32_HAS_USART3 FALSE
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
#define STM32_HAS_UART5 FALSE
|
#define STM32_HAS_UART5 FALSE
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
@ -739,10 +749,16 @@
|
||||||
STM32_DMA_STREAM_ID_MSK(1, 7))
|
STM32_DMA_STREAM_ID_MSK(1, 7))
|
||||||
#define STM32_USART2_TX_DMA_CHN 0x04004000
|
#define STM32_USART2_TX_DMA_CHN 0x04004000
|
||||||
|
|
||||||
|
#define STM32_HAS_LPUART1 TRUE
|
||||||
|
#define STM32_LPUART1_HANDLER VectorB4
|
||||||
|
#define STM32_LPUART1_NUMBER 29
|
||||||
|
|
||||||
#define STM32_HAS_USART3 FALSE
|
#define STM32_HAS_USART3 FALSE
|
||||||
#define STM32_HAS_UART4 FALSE
|
#define STM32_HAS_UART4 FALSE
|
||||||
#define STM32_HAS_UART5 FALSE
|
#define STM32_HAS_UART5 FALSE
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
|
#define STM32_HAS_UART7 FALSE
|
||||||
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
|
|
@ -313,6 +313,7 @@
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
#define STM32_HAS_LPUART1 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB TRUE
|
#define STM32_HAS_USB TRUE
|
||||||
|
|
|
@ -243,7 +243,7 @@ void stm32_clock_init(void) {
|
||||||
STM32_CLK48SEL | STM32_LPTIM2SEL | STM32_LPTIM1SEL |
|
STM32_CLK48SEL | STM32_LPTIM2SEL | STM32_LPTIM1SEL |
|
||||||
STM32_I2C3SEL | STM32_I2C2SEL | STM32_I2C1SEL |
|
STM32_I2C3SEL | STM32_I2C2SEL | STM32_I2C1SEL |
|
||||||
STM32_UART5SEL | STM32_UART4SEL | STM32_USART3SEL |
|
STM32_UART5SEL | STM32_UART4SEL | STM32_USART3SEL |
|
||||||
STM32_USART2SEL | STM32_USART1SEL;
|
STM32_USART2SEL | STM32_USART1SEL | STM32_LPUART1SEL;
|
||||||
#if STM32_SAI2SEL != STM32_SAI2SEL_OFF
|
#if STM32_SAI2SEL != STM32_SAI2SEL_OFF
|
||||||
ccipr |= STM32_SAI2SEL;
|
ccipr |= STM32_SAI2SEL;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -644,6 +644,13 @@
|
||||||
#define STM32_UART5SEL STM32_UART5SEL_SYSCLK
|
#define STM32_UART5SEL STM32_UART5SEL_SYSCLK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief LPUART1 clock source.
|
||||||
|
*/
|
||||||
|
#if !defined(STM32_LPUART1SEL) || defined(__DOXYGEN__)
|
||||||
|
#define STM32_LPUART1SEL STM32_LPUART1SEL_SYSCLK
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief I2C1 clock source.
|
* @brief I2C1 clock source.
|
||||||
*/
|
*/
|
||||||
|
@ -1832,6 +1839,21 @@
|
||||||
#error "invalid source selected for UART5 clock"
|
#error "invalid source selected for UART5 clock"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief LPUART1 clock frequency.
|
||||||
|
*/
|
||||||
|
#if (STM32_LPUART1SEL == STM32_LPUART1SEL_PCLK1) || defined(__DOXYGEN)
|
||||||
|
#define STM32_LPUART1CLK STM32_PCLK1
|
||||||
|
#elif STM32_LPUART1SEL == STM32_LPUART1SEL_SYSCLK
|
||||||
|
#define STM32_LPUART1CLK STM32_SYSCLK
|
||||||
|
#elif STM32_LPUART1SEL == STM32_LPUART1SEL_HSI16
|
||||||
|
#define STM32_LPUART1CLK STM32_HSI16CLK
|
||||||
|
#elif STM32_LPUART1SEL == STM32_LPUART1SEL_LSE
|
||||||
|
#define STM32_LPUART1CLK STM32_LSECLK
|
||||||
|
#else
|
||||||
|
#error "invalid source selected for LPUART1 clock"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief I2C1 clock frequency.
|
* @brief I2C1 clock frequency.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1064,6 +1064,38 @@
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
#define rccDisableUART5(lp) rccDisableAPB1R1(RCC_APB1ENR1_UART5EN, lp)
|
#define rccDisableUART5(lp) rccDisableAPB1R1(RCC_APB1ENR1_UART5EN, lp)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Resets the UART5 peripheral.
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
#define rccResetUART5() rccResetAPB1R1(RCC_APB1RSTR1_UART5RST)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables the LPUART1 peripheral clock.
|
||||||
|
*
|
||||||
|
* @param[in] lp low power enable flag
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
#define rccEnableLPUART1(lp) rccEnableAPB1R2(RCC_APB1ENR2_LPUART1EN, lp)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disables the LPUART1 peripheral clock.
|
||||||
|
*
|
||||||
|
* @param[in] lp low power enable flag
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
#define rccDisableLPUART1(lp) rccDisableAPB1R2(RCC_APB1ENR2_LPUART1EN, lp)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Resets the USART1 peripheral.
|
||||||
|
*
|
||||||
|
* @api
|
||||||
|
*/
|
||||||
|
#define rccResetLPUART1() rccResetAPB1R2(RCC_APB1RSTR2_LPUART1RST)
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
|
@ -370,13 +370,16 @@
|
||||||
#define STM32_UART5_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(2, 1)
|
#define STM32_UART5_TX_DMA_MSK STM32_DMA_STREAM_ID_MSK(2, 1)
|
||||||
#define STM32_UART5_TX_DMA_CHN 0x00000002
|
#define STM32_UART5_TX_DMA_CHN 0x00000002
|
||||||
|
|
||||||
|
#define STM32_HAS_LPUART1 TRUE
|
||||||
|
#define STM32_LPUART1_HANDLER Vector158
|
||||||
|
#define STM32_LPUART1_NUMBER 70
|
||||||
|
|
||||||
#define STM32_HAS_USART6 FALSE
|
#define STM32_HAS_USART6 FALSE
|
||||||
#define STM32_HAS_UART7 FALSE
|
#define STM32_HAS_UART7 FALSE
|
||||||
#define STM32_HAS_UART8 FALSE
|
#define STM32_HAS_UART8 FALSE
|
||||||
|
|
||||||
/* USB attributes.*/
|
/* USB attributes.*/
|
||||||
#define STM32_HAS_USB FALSE
|
#define STM32_HAS_USB FALSE
|
||||||
|
|
||||||
#define STM32_HAS_OTG1 TRUE
|
#define STM32_HAS_OTG1 TRUE
|
||||||
#define STM32_OTG1_HANDLER Vector14C
|
#define STM32_OTG1_HANDLER Vector14C
|
||||||
#define STM32_OTG1_NUMBER 67
|
#define STM32_OTG1_NUMBER 67
|
||||||
|
|
|
@ -119,7 +119,8 @@
|
||||||
- HAL: Added support for I2C3 and I2C4 to the STM32 I2Cv2 I2C driver.
|
- HAL: Added support for I2C3 and I2C4 to the STM32 I2Cv2 I2C driver.
|
||||||
- HAL: Added support for SPI4...SPI6 to the STM32 SPIv2 SPI driver.
|
- HAL: Added support for SPI4...SPI6 to the STM32 SPIv2 SPI driver.
|
||||||
- HAL: Added support for UART4...UART8 to the STM32 UARTv2 UART driver.
|
- HAL: Added support for UART4...UART8 to the STM32 UARTv2 UART driver.
|
||||||
- HAL: Added support for UART7 and UART8 to the STM32 UARTv2 serial driver.
|
- HAL: Added support for UART7 and UART8,LPUART1 to the STM32 UARTv2 serial
|
||||||
|
driver.
|
||||||
- HAL: STM32F2xx, STM32F4xx and STM32F7xx devices now share the same ADCv2
|
- HAL: STM32F2xx, STM32F4xx and STM32F7xx devices now share the same ADCv2
|
||||||
and DMAv2 drivers.
|
and DMAv2 drivers.
|
||||||
- HAL: STM32F0xx and STM32L0xx devices now share the same ADCv1 driver.
|
- HAL: STM32F0xx and STM32L0xx devices now share the same ADCv1 driver.
|
||||||
|
|
|
@ -41,9 +41,9 @@
|
||||||
#define STM32_PVD_ENABLE FALSE
|
#define STM32_PVD_ENABLE FALSE
|
||||||
#define STM32_PLS STM32_PLS_LEV0
|
#define STM32_PLS STM32_PLS_LEV0
|
||||||
#define STM32_HSI16_ENABLED TRUE
|
#define STM32_HSI16_ENABLED TRUE
|
||||||
#define STM32_LSI_ENABLED TRUE
|
#define STM32_LSI_ENABLED FALSE
|
||||||
#define STM32_HSE_ENABLED FALSE
|
#define STM32_HSE_ENABLED FALSE
|
||||||
#define STM32_LSE_ENABLED FALSE
|
#define STM32_LSE_ENABLED TRUE
|
||||||
#define STM32_ADC_CLOCK_ENABLED TRUE
|
#define STM32_ADC_CLOCK_ENABLED TRUE
|
||||||
#define STM32_USB_CLOCK_ENABLED TRUE
|
#define STM32_USB_CLOCK_ENABLED TRUE
|
||||||
#define STM32_MSIRANGE STM32_MSIRANGE_2M
|
#define STM32_MSIRANGE STM32_MSIRANGE_2M
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
#define STM32_PPRE2 STM32_PPRE2_DIV1
|
#define STM32_PPRE2 STM32_PPRE2_DIV1
|
||||||
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||||
#define STM32_MCOPRE STM32_MCOPRE_DIV1
|
#define STM32_MCOPRE STM32_MCOPRE_DIV1
|
||||||
#define STM32_RTCSEL STM32_RTCSEL_LSI
|
#define STM32_RTCSEL STM32_RTCSEL_LSE
|
||||||
#define STM32_RTCPRE STM32_RTCPRE_DIV2
|
#define STM32_RTCPRE STM32_RTCPRE_DIV2
|
||||||
#define STM32_USART1SEL STM32_USART1SEL_APB
|
#define STM32_USART1SEL STM32_USART1SEL_APB
|
||||||
#define STM32_USART2SEL STM32_USART2SEL_APB
|
#define STM32_USART2SEL STM32_USART2SEL_APB
|
||||||
|
@ -127,8 +127,10 @@
|
||||||
*/
|
*/
|
||||||
#define STM32_SERIAL_USE_USART1 FALSE
|
#define STM32_SERIAL_USE_USART1 FALSE
|
||||||
#define STM32_SERIAL_USE_USART2 FALSE
|
#define STM32_SERIAL_USE_USART2 FALSE
|
||||||
|
#define STM32_SERIAL_USE_LPUART1 FALSE
|
||||||
#define STM32_SERIAL_USART1_PRIORITY 3
|
#define STM32_SERIAL_USART1_PRIORITY 3
|
||||||
#define STM32_SERIAL_USART2_PRIORITY 3
|
#define STM32_SERIAL_USART2_PRIORITY 3
|
||||||
|
#define STM32_SERIAL_LPUART1_PRIORITY 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SPI driver system settings.
|
* SPI driver system settings.
|
||||||
|
|
|
@ -41,9 +41,9 @@
|
||||||
#define STM32_PVD_ENABLE FALSE
|
#define STM32_PVD_ENABLE FALSE
|
||||||
#define STM32_PLS STM32_PLS_LEV0
|
#define STM32_PLS STM32_PLS_LEV0
|
||||||
#define STM32_HSI16_ENABLED TRUE
|
#define STM32_HSI16_ENABLED TRUE
|
||||||
#define STM32_LSI_ENABLED TRUE
|
#define STM32_LSI_ENABLED FALSE
|
||||||
#define STM32_HSE_ENABLED FALSE
|
#define STM32_HSE_ENABLED FALSE
|
||||||
#define STM32_LSE_ENABLED FALSE
|
#define STM32_LSE_ENABLED TRUE
|
||||||
#define STM32_ADC_CLOCK_ENABLED TRUE
|
#define STM32_ADC_CLOCK_ENABLED TRUE
|
||||||
#define STM32_USB_CLOCK_ENABLED TRUE
|
#define STM32_USB_CLOCK_ENABLED TRUE
|
||||||
#define STM32_MSIRANGE STM32_MSIRANGE_2M
|
#define STM32_MSIRANGE STM32_MSIRANGE_2M
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
#define STM32_PPRE2 STM32_PPRE2_DIV1
|
#define STM32_PPRE2 STM32_PPRE2_DIV1
|
||||||
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||||
#define STM32_MCOPRE STM32_MCOPRE_DIV1
|
#define STM32_MCOPRE STM32_MCOPRE_DIV1
|
||||||
#define STM32_RTCSEL STM32_RTCSEL_LSI
|
#define STM32_RTCSEL STM32_RTCSEL_LSE
|
||||||
#define STM32_RTCPRE STM32_RTCPRE_DIV2
|
#define STM32_RTCPRE STM32_RTCPRE_DIV2
|
||||||
#define STM32_USART1SEL STM32_USART1SEL_APB
|
#define STM32_USART1SEL STM32_USART1SEL_APB
|
||||||
#define STM32_USART2SEL STM32_USART2SEL_APB
|
#define STM32_USART2SEL STM32_USART2SEL_APB
|
||||||
|
@ -127,8 +127,10 @@
|
||||||
*/
|
*/
|
||||||
#define STM32_SERIAL_USE_USART1 FALSE
|
#define STM32_SERIAL_USE_USART1 FALSE
|
||||||
#define STM32_SERIAL_USE_USART2 FALSE
|
#define STM32_SERIAL_USE_USART2 FALSE
|
||||||
|
#define STM32_SERIAL_USE_LPUART1 FALSE
|
||||||
#define STM32_SERIAL_USART1_PRIORITY 3
|
#define STM32_SERIAL_USART1_PRIORITY 3
|
||||||
#define STM32_SERIAL_USART2_PRIORITY 3
|
#define STM32_SERIAL_USART2_PRIORITY 3
|
||||||
|
#define STM32_SERIAL_LPUART1_PRIORITY 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SPI driver system settings.
|
* SPI driver system settings.
|
||||||
|
|
|
@ -41,9 +41,9 @@
|
||||||
#define STM32_PVD_ENABLE FALSE
|
#define STM32_PVD_ENABLE FALSE
|
||||||
#define STM32_PLS STM32_PLS_LEV0
|
#define STM32_PLS STM32_PLS_LEV0
|
||||||
#define STM32_HSI16_ENABLED TRUE
|
#define STM32_HSI16_ENABLED TRUE
|
||||||
#define STM32_LSI_ENABLED TRUE
|
#define STM32_LSI_ENABLED FALSE
|
||||||
#define STM32_HSE_ENABLED FALSE
|
#define STM32_HSE_ENABLED FALSE
|
||||||
#define STM32_LSE_ENABLED FALSE
|
#define STM32_LSE_ENABLED TRUE
|
||||||
#define STM32_ADC_CLOCK_ENABLED TRUE
|
#define STM32_ADC_CLOCK_ENABLED TRUE
|
||||||
#define STM32_USB_CLOCK_ENABLED TRUE
|
#define STM32_USB_CLOCK_ENABLED TRUE
|
||||||
#define STM32_MSIRANGE STM32_MSIRANGE_2M
|
#define STM32_MSIRANGE STM32_MSIRANGE_2M
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
#define STM32_PPRE2 STM32_PPRE2_DIV1
|
#define STM32_PPRE2 STM32_PPRE2_DIV1
|
||||||
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||||
#define STM32_MCOPRE STM32_MCOPRE_DIV1
|
#define STM32_MCOPRE STM32_MCOPRE_DIV1
|
||||||
#define STM32_RTCSEL STM32_RTCSEL_LSI
|
#define STM32_RTCSEL STM32_RTCSEL_LSE
|
||||||
#define STM32_RTCPRE STM32_RTCPRE_DIV2
|
#define STM32_RTCPRE STM32_RTCPRE_DIV2
|
||||||
#define STM32_USART1SEL STM32_USART1SEL_APB
|
#define STM32_USART1SEL STM32_USART1SEL_APB
|
||||||
#define STM32_USART2SEL STM32_USART2SEL_APB
|
#define STM32_USART2SEL STM32_USART2SEL_APB
|
||||||
|
@ -127,8 +127,10 @@
|
||||||
*/
|
*/
|
||||||
#define STM32_SERIAL_USE_USART1 FALSE
|
#define STM32_SERIAL_USE_USART1 FALSE
|
||||||
#define STM32_SERIAL_USE_USART2 FALSE
|
#define STM32_SERIAL_USE_USART2 FALSE
|
||||||
|
#define STM32_SERIAL_USE_LPUART1 FALSE
|
||||||
#define STM32_SERIAL_USART1_PRIORITY 3
|
#define STM32_SERIAL_USART1_PRIORITY 3
|
||||||
#define STM32_SERIAL_USART2_PRIORITY 3
|
#define STM32_SERIAL_USART2_PRIORITY 3
|
||||||
|
#define STM32_SERIAL_LPUART1_PRIORITY 3
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SPI driver system settings.
|
* SPI driver system settings.
|
||||||
|
|
Loading…
Reference in New Issue