Dependents:   Autoflight2018_22_MODSERIAL

Fork of MODSERIAL by Erik -

Committer:
rvasquez6089
Date:
Sun Apr 01 18:39:35 2018 +0000
Revision:
45:da0788f0bd77
Added support for Nucleo F746ZG

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rvasquez6089 45:da0788f0bd77 1 #if defined(TARGET_NUCLEO_F746ZG)
rvasquez6089 45:da0788f0bd77 2
rvasquez6089 45:da0788f0bd77 3
rvasquez6089 45:da0788f0bd77 4 #define MODSERIAL_IRQ_REG ((USART_TypeDef*)_base)->CR1 //found in mbed-dev\targets\TARGET_STM\TARGET_STM32F7\TARGET_STM32F746xG\device\stm32f746xx.h
rvasquez6089 45:da0788f0bd77 5 #define DISABLE_TX_IRQ MODSERIAL_IRQ_REG &= ~USART_CR1_TXEIE
rvasquez6089 45:da0788f0bd77 6 #define DISABLE_RX_IRQ MODSERIAL_IRQ_REG &= ~USART_CR1_RXNEIE
rvasquez6089 45:da0788f0bd77 7 #define ENABLE_TX_IRQ MODSERIAL_IRQ_REG |= USART_CR1_TXEIE
rvasquez6089 45:da0788f0bd77 8 #define ENABLE_RX_IRQ MODSERIAL_IRQ_REG |= USART_CR1_RXNEIE
rvasquez6089 45:da0788f0bd77 9
rvasquez6089 45:da0788f0bd77 10 #define MODSERIAL_READ_REG ((USART_TypeDef*)_base)->RDR
rvasquez6089 45:da0788f0bd77 11 #define MODSERIAL_WRITE_REG ((USART_TypeDef*)_base)->TDR
rvasquez6089 45:da0788f0bd77 12 #define MODSERIAL_READABLE ((((USART_TypeDef*)_base)->ISR & USART_ISR_RXNE) != 0)
rvasquez6089 45:da0788f0bd77 13 #define MODSERIAL_WRITABLE ((((USART_TypeDef*)_base)->ISR & USART_ISR_TXE) != 0)
rvasquez6089 45:da0788f0bd77 14
rvasquez6089 45:da0788f0bd77 15 #define RESET_TX_FIFO while(0 == 1)
rvasquez6089 45:da0788f0bd77 16 #define RESET_RX_FIFO while(MODSERIAL_READABLE) char dummy = MODSERIAL_READ_REG
rvasquez6089 45:da0788f0bd77 17
rvasquez6089 45:da0788f0bd77 18 #define RX_IRQ_ENABLED ((MODSERIAL_IRQ_REG & USART_CR1_RXNEIE) != 0)
rvasquez6089 45:da0788f0bd77 19 #define TX_IRQ_ENABLED ((MODSERIAL_IRQ_REG & USART_CR1_TXEIE) != 0)
rvasquez6089 45:da0788f0bd77 20 #endif