あ
Dependents: Autoflight2018_22_MODSERIAL
Fork of MODSERIAL by
Device/MODSERIAL_PAC_F401RB.h@47:8d2e26e2345c, 2018-09-18 (annotated)
- Committer:
- TUATBM
- Date:
- Tue Sep 18 08:03:54 2018 +0000
- Revision:
- 47:8d2e26e2345c
- Parent:
- 41:d8422efe4761
401????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Gary Servin |
41:d8422efe4761 | 1 | #if defined(TARGET_PAC_F401RB) |
Gary Servin |
41:d8422efe4761 | 2 | |
Gary Servin |
41:d8422efe4761 | 3 | #define MODSERIAL_IRQ_REG ((USART_TypeDef*)_base)->CR1 |
Gary Servin |
41:d8422efe4761 | 4 | #define DISABLE_TX_IRQ MODSERIAL_IRQ_REG &= ~USART_CR1_TXEIE |
Gary Servin |
41:d8422efe4761 | 5 | #define DISABLE_RX_IRQ MODSERIAL_IRQ_REG &= ~USART_CR1_RXNEIE |
Gary Servin |
41:d8422efe4761 | 6 | #define ENABLE_TX_IRQ MODSERIAL_IRQ_REG |= USART_CR1_TXEIE |
Gary Servin |
41:d8422efe4761 | 7 | #define ENABLE_RX_IRQ MODSERIAL_IRQ_REG |= USART_CR1_RXNEIE |
Gary Servin |
41:d8422efe4761 | 8 | |
Gary Servin |
41:d8422efe4761 | 9 | #define MODSERIAL_READ_REG ((USART_TypeDef*)_base)->DR |
Gary Servin |
41:d8422efe4761 | 10 | #define MODSERIAL_WRITE_REG ((USART_TypeDef*)_base)->DR |
Gary Servin |
41:d8422efe4761 | 11 | #define MODSERIAL_READABLE ((((USART_TypeDef*)_base)->SR & USART_SR_RXNE) != 0) |
Gary Servin |
41:d8422efe4761 | 12 | #define MODSERIAL_WRITABLE ((((USART_TypeDef*)_base)->SR & USART_SR_TXE) != 0) |
Gary Servin |
41:d8422efe4761 | 13 | |
Gary Servin |
41:d8422efe4761 | 14 | #define RESET_TX_FIFO while(0 == 1) |
Gary Servin |
41:d8422efe4761 | 15 | #define RESET_RX_FIFO while(MODSERIAL_READABLE) char dummy = MODSERIAL_READ_REG |
Gary Servin |
41:d8422efe4761 | 16 | |
Gary Servin |
41:d8422efe4761 | 17 | #define RX_IRQ_ENABLED ((MODSERIAL_IRQ_REG & USART_CR1_RXNEIE) != 0) |
Gary Servin |
41:d8422efe4761 | 18 | #define TX_IRQ_ENABLED ((MODSERIAL_IRQ_REG & USART_CR1_TXEIE) != 0) |
Gary Servin |
41:d8422efe4761 | 19 | |
Gary Servin |
41:d8422efe4761 | 20 | #endif |