uart: add ISR callback mechanism for UART drivers
The peripherals utilizing UART were required to register their own ISR rountines. This means that all those peripherals drivers need to know which IRQ line is attached to a UART controller, and all the other config values required to register a ISR. This causes scalibility issue as every board and peripherals have to define those values. Another reason for this patch is to support virtual serial ports. Virtual serial ports do not have physical interrupt lines to attach, and thus would not work. This patch adds a simple callback mechanism, which calls a function when UART interrupts are triggered. The low level plumbing still needs to be done by the peripheral drivers, as these drivers may need to access low level capability of UART to function correctly. This simply moves the interrupt setup into the UART drivers themselves. By doing this, the peripheral drivers do not need to know all the config values to properly setup the interrupts and attaching the ISR. One drawback is that this adds to the interrupt latency. Note that this patch breaks backward compatibility in terms of setting up interrupt for UART controller. How to use UART is still the same. This also addresses the following issues: () UART driver for Atmel SAM3 currently does not support interrupts. So remove the code from vector table. This will be updated when there is interrupt support for the driver. () Corrected some config options for Stellaris UART driver. This was tested with samples/shell on Arduino 101, and on QEMU (Cortex-M3 and x86). Origin: original code Change-Id: Ib4593d8ccd711f4e97d388c7293205d213be1aec Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
f8bf86c95f
commit
e643cede3a
30 changed files with 492 additions and 238 deletions
|
@ -141,10 +141,6 @@ if UART_CONSOLE
|
|||
|
||||
config UART_CONSOLE_ON_DEV_NAME
|
||||
default "UART_0"
|
||||
config UART_CONSOLE_IRQ
|
||||
default 31
|
||||
config UART_CONSOLE_IRQ_PRI
|
||||
default 3
|
||||
|
||||
endif
|
||||
|
||||
|
@ -152,10 +148,6 @@ if BLUETOOTH_UART
|
|||
|
||||
config BLUETOOTH_UART_ON_DEV_NAME
|
||||
default "UART_1"
|
||||
config BLUETOOTH_UART_IRQ
|
||||
default 33
|
||||
config BLUETOOTH_UART_IRQ_PRI
|
||||
default 3
|
||||
|
||||
endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue