MODSERIAL with support for more devices
Fork of MODSERIAL by
Device/MODSERIAL_NUCLEO_F746ZG.cpp@46:6571cd7f896e, 2018-07-11 (annotated)
- Committer:
- fahadmirza
- Date:
- Wed Jul 11 08:17:03 2018 +0000
- Revision:
- 46:6571cd7f896e
- Parent:
- 45:da0788f0bd77
Added support for NUCLEO_L053R8
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rvasquez6089 | 45:da0788f0bd77 | 1 | #ifdef TARGET_NUCLEO_F746ZG |
rvasquez6089 | 45:da0788f0bd77 | 2 | #include "MODSERIAL.h" |
rvasquez6089 | 45:da0788f0bd77 | 3 | |
rvasquez6089 | 45:da0788f0bd77 | 4 | void MODSERIAL::setBase(void ) { |
rvasquez6089 | 45:da0788f0bd77 | 5 | #if DEVICE_SERIAL_ASYNCH |
rvasquez6089 | 45:da0788f0bd77 | 6 | switch( _serial.serial.index ) { |
rvasquez6089 | 45:da0788f0bd77 | 7 | #else |
rvasquez6089 | 45:da0788f0bd77 | 8 | switch( _serial.index ) { |
rvasquez6089 | 45:da0788f0bd77 | 9 | #endif |
rvasquez6089 | 45:da0788f0bd77 | 10 | case 0: _base = USART1; _IRQ = USART1_IRQn; break; |
rvasquez6089 | 45:da0788f0bd77 | 11 | case 1: _base = USART2; _IRQ = USART2_IRQn; break; |
rvasquez6089 | 45:da0788f0bd77 | 12 | case 2: _base = USART3; _IRQ = USART3_IRQn; break; |
rvasquez6089 | 45:da0788f0bd77 | 13 | case 3: _base = USART6; _IRQ = USART6_IRQn; break; |
rvasquez6089 | 45:da0788f0bd77 | 14 | default: _base = NULL; _IRQ = (IRQn_Type)NULL; break; |
rvasquez6089 | 45:da0788f0bd77 | 15 | } |
rvasquez6089 | 45:da0788f0bd77 | 16 | } |
rvasquez6089 | 45:da0788f0bd77 | 17 | |
rvasquez6089 | 45:da0788f0bd77 | 18 | void MODSERIAL::initDevice(void) {}; |
rvasquez6089 | 45:da0788f0bd77 | 19 | |
rvasquez6089 | 45:da0788f0bd77 | 20 | bool MODSERIAL::txIsBusy( void ) |
rvasquez6089 | 45:da0788f0bd77 | 21 | { |
rvasquez6089 | 45:da0788f0bd77 | 22 | return ( (((USART_TypeDef*)_base)->ISR & ( 1UL << 6 )) == 0 ) ? true : false; |
rvasquez6089 | 45:da0788f0bd77 | 23 | } |
rvasquez6089 | 45:da0788f0bd77 | 24 | |
rvasquez6089 | 45:da0788f0bd77 | 25 | #endif |