MODSERIAL with support for more devices - Added target NUCLEO_F103RB
Device/MODSERIAL_NUCLEO_F401RE.h@46:d2a5e26fd658, 2019-05-05 (annotated)
- Committer:
- riaancillie
- Date:
- Sun May 05 14:57:11 2019 +0000
- Revision:
- 46:d2a5e26fd658
- Parent:
- 40:6ffa97119f4f
Added support for target NUCLEO_F103RB
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
garyservin | 40:6ffa97119f4f | 1 | #if defined(TARGET_NUCLEO_F401RE) |
garyservin | 40:6ffa97119f4f | 2 | |
garyservin | 40:6ffa97119f4f | 3 | #define MODSERIAL_IRQ_REG ((USART_TypeDef*)_base)->CR1 |
garyservin | 40:6ffa97119f4f | 4 | #define DISABLE_TX_IRQ MODSERIAL_IRQ_REG &= ~USART_CR1_TXEIE |
garyservin | 40:6ffa97119f4f | 5 | #define DISABLE_RX_IRQ MODSERIAL_IRQ_REG &= ~USART_CR1_RXNEIE |
garyservin | 40:6ffa97119f4f | 6 | #define ENABLE_TX_IRQ MODSERIAL_IRQ_REG |= USART_CR1_TXEIE |
garyservin | 40:6ffa97119f4f | 7 | #define ENABLE_RX_IRQ MODSERIAL_IRQ_REG |= USART_CR1_RXNEIE |
garyservin | 40:6ffa97119f4f | 8 | |
garyservin | 40:6ffa97119f4f | 9 | #define MODSERIAL_READ_REG ((USART_TypeDef*)_base)->DR |
garyservin | 40:6ffa97119f4f | 10 | #define MODSERIAL_WRITE_REG ((USART_TypeDef*)_base)->DR |
garyservin | 40:6ffa97119f4f | 11 | #define MODSERIAL_READABLE ((((USART_TypeDef*)_base)->SR & USART_SR_RXNE) != 0) |
garyservin | 40:6ffa97119f4f | 12 | #define MODSERIAL_WRITABLE ((((USART_TypeDef*)_base)->SR & USART_SR_TXE) != 0) |
garyservin | 40:6ffa97119f4f | 13 | |
garyservin | 40:6ffa97119f4f | 14 | #define RESET_TX_FIFO while(0 == 1) |
garyservin | 40:6ffa97119f4f | 15 | #define RESET_RX_FIFO while(MODSERIAL_READABLE) char dummy = MODSERIAL_READ_REG |
garyservin | 40:6ffa97119f4f | 16 | |
garyservin | 40:6ffa97119f4f | 17 | #define RX_IRQ_ENABLED ((MODSERIAL_IRQ_REG & USART_CR1_RXNEIE) != 0) |
garyservin | 40:6ffa97119f4f | 18 | #define TX_IRQ_ENABLED ((MODSERIAL_IRQ_REG & USART_CR1_TXEIE) != 0) |
garyservin | 40:6ffa97119f4f | 19 | |
garyservin | 40:6ffa97119f4f | 20 | #endif |