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>
123 lines
3.1 KiB
Text
123 lines
3.1 KiB
Text
# Kconfig - NBLE configuration options
|
|
|
|
#
|
|
# Copyright (c) 2016 Intel Corporation
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
#
|
|
|
|
config NBLE
|
|
bool "Support for custom Nordic Semiconductor BLE protocol"
|
|
default n
|
|
select BLUETOOTH_PERIPHERAL
|
|
select BLUETOOTH_CENTRAL
|
|
select BLUETOOTH_GATT_CLIENT
|
|
select BLUETOOTH_SMP
|
|
select UART_INTERRUPT_DRIVEN
|
|
select NANO_TIMEOUTS
|
|
select NET_BUF
|
|
help
|
|
Enables support for using Nordic Semiconductor nRF51 Bluetooth
|
|
LE chips with a custom firmware. The API for this is a subset of
|
|
the normal Bluetooth API (include/bluetooth/*.h). This driver can
|
|
only be enabled if CONFIG_BLUETOOTH has not been enabled.
|
|
|
|
A fundamental assumption that the driver makes is that it is
|
|
run on an architecture with the same ABI (e.g. struct packing
|
|
& endianess) as the nRF51 chip. The driver cannot be used on
|
|
any architecture that doesn't fulfill this requirement.
|
|
|
|
if !BLUETOOTH && NBLE
|
|
config BLUETOOTH_PERIPHERAL
|
|
bool
|
|
default n
|
|
|
|
config BLUETOOTH_CENTRAL
|
|
bool
|
|
default n
|
|
|
|
config BLUETOOTH_GATT_CLIENT
|
|
bool
|
|
default n
|
|
|
|
config BLUETOOTH_SMP
|
|
bool
|
|
default n
|
|
|
|
config BLUETOOTH_MAX_CONN
|
|
int
|
|
default 6
|
|
|
|
config BLUETOOTH_MAX_PAIRED
|
|
int
|
|
default 7
|
|
|
|
config BLUETOOTH_DEBUG
|
|
bool "Enable Debug"
|
|
default n
|
|
select STDOUT_CONSOLE
|
|
|
|
config BLUETOOTH_RX_STACK_SIZE
|
|
int "Size of the receiving fiber stack"
|
|
default 1024
|
|
range 1024 65536
|
|
help
|
|
Size of the receiving fiber stack. This is the context from
|
|
which all event callbacks to the application occur. The
|
|
default value is sufficient for basic operation, but if the
|
|
application needs to do advanced things in its callbacks that
|
|
require extra stack space, this value can be increased to
|
|
accomodate for that.
|
|
|
|
if BLUETOOTH_DEBUG
|
|
|
|
config BLUETOOTH_DEBUG_DRIVER
|
|
bool "Bluetooth driver debug"
|
|
default n
|
|
help
|
|
This option enables debug support for the chosen
|
|
Bluetooth UART driver to Nordic chip.
|
|
|
|
config BLUETOOTH_DEBUG_GATT
|
|
bool "Bluetooth Generic Attribute Profile (GATT) debug"
|
|
default n
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
Generic Attribute Profile (GATT).
|
|
|
|
config NBLE_DEBUG_GAP
|
|
bool "NBLE Generic Access Profile (GAP) debug"
|
|
default n
|
|
help
|
|
This option enables debug support for the Bluetooth
|
|
Generic Access Profile (GAP) in the interfaces to the
|
|
Nordic chip.
|
|
|
|
config NBLE_DEBUG_RPC
|
|
bool "NBLE RPC debug"
|
|
default n
|
|
help
|
|
This option enables debug for RPC interface to the Nordic
|
|
Bluetooth LE chip.
|
|
|
|
endif # BLUETOOTH_DEBUG
|
|
|
|
config NBLE_UART_ON_DEV_NAME
|
|
string "Device Name of UART Device for Nordic BLE"
|
|
default "UART_0"
|
|
depends on NBLE
|
|
help
|
|
This option specifies the name of UART device to be used
|
|
for Nordic BLE.
|
|
|
|
endif
|