2019-09-21 15:16:37 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* drivers/wireless/bluetooth/bt_uart_shim.c
|
|
|
|
*
|
2021-05-27 11:12:43 +02:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you 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
|
2019-09-21 15:16:37 +02:00
|
|
|
*
|
2021-05-27 11:12:43 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2019-09-21 15:16:37 +02:00
|
|
|
*
|
2021-05-27 11:12:43 +02:00
|
|
|
* 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.
|
2019-09-21 15:16:37 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <debug.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <poll.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/types.h>
|
2020-12-27 12:15:58 +01:00
|
|
|
#include <termios.h>
|
2019-09-21 15:16:37 +02:00
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <nuttx/fs/ioctl.h>
|
2021-05-14 04:03:23 +02:00
|
|
|
#include <nuttx/spinlock.h>
|
2019-09-21 15:16:37 +02:00
|
|
|
#include <nuttx/kmalloc.h>
|
|
|
|
#include <nuttx/serial/tioctl.h>
|
2019-10-04 17:29:51 +02:00
|
|
|
#include <nuttx/wireless/bluetooth/bt_uart_shim.h>
|
2019-09-21 15:16:37 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* This structure is the variable state of the binding to the UART */
|
|
|
|
|
|
|
|
struct hciuart_state_s
|
2019-10-04 17:29:51 +02:00
|
|
|
{
|
|
|
|
/* Registered Rx callback */
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2019-10-04 17:29:51 +02:00
|
|
|
btuart_rxcallback_t callback; /* Rx callback function */
|
|
|
|
FAR void *arg; /* Rx callback argument */
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2020-12-27 16:02:13 +01:00
|
|
|
struct file f; /* File structure */
|
2022-10-01 22:28:53 +02:00
|
|
|
struct pollfd p; /* Poll structure */
|
2019-10-04 17:29:51 +02:00
|
|
|
};
|
2019-09-21 15:16:37 +02:00
|
|
|
|
|
|
|
struct hciuart_config_s
|
2019-10-04 17:29:51 +02:00
|
|
|
{
|
|
|
|
/* Setup the interface from the upper to the lower */
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2019-10-04 17:29:51 +02:00
|
|
|
struct btuart_lowerhalf_s lower; /* Generic UART lower half */
|
|
|
|
struct hciuart_state_s state; /* Variable state */
|
|
|
|
};
|
2019-09-21 15:16:37 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* UART Lower-Half Methods */
|
|
|
|
|
2019-10-04 17:29:51 +02:00
|
|
|
static void hciuart_rxattach(FAR const struct btuart_lowerhalf_s *lower,
|
|
|
|
btuart_rxcallback_t callback, FAR void *arg);
|
2022-10-01 22:28:53 +02:00
|
|
|
static void hciuart_rxpollcb(FAR struct pollfd *fds);
|
2019-10-04 17:29:51 +02:00
|
|
|
static void hciuart_rxenable(FAR const struct btuart_lowerhalf_s *lower,
|
2019-09-21 15:16:37 +02:00
|
|
|
bool enable);
|
2019-10-04 17:29:51 +02:00
|
|
|
static int hciuart_setbaud(FAR const struct btuart_lowerhalf_s *lower,
|
2019-09-21 15:16:37 +02:00
|
|
|
uint32_t baud);
|
2019-10-04 17:29:51 +02:00
|
|
|
static ssize_t hciuart_read(FAR const struct btuart_lowerhalf_s *lower,
|
|
|
|
FAR void *buffer, size_t buflen);
|
|
|
|
static ssize_t hciuart_write(FAR const struct btuart_lowerhalf_s *lower,
|
|
|
|
FAR const void *buffer, size_t buflen);
|
|
|
|
static ssize_t hciuart_rxdrain(FAR const struct btuart_lowerhalf_s *lower);
|
2022-10-01 21:50:45 +02:00
|
|
|
static int hciuart_ioctl(FAR const struct btuart_lowerhalf_s *lower,
|
|
|
|
int cmd, unsigned long arg);
|
2019-10-04 17:29:51 +02:00
|
|
|
|
2019-09-21 15:16:37 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: hciuart_rxattach
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Attach/detach the upper half Rx callback.
|
|
|
|
*
|
|
|
|
* rxattach() allows the upper half logic to attach a callback function
|
|
|
|
* that will be used to inform the upper half that an Rx frame is
|
|
|
|
* available. This callback will, most likely, be invoked in the
|
|
|
|
* context of an interrupt callback. The receive() method should then
|
|
|
|
* be invoked in order to receive the obtain the Rx frame data.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void
|
2019-10-04 17:29:51 +02:00
|
|
|
hciuart_rxattach(FAR const struct btuart_lowerhalf_s *lower,
|
|
|
|
btuart_rxcallback_t callback, FAR void *arg)
|
2019-09-21 15:16:37 +02:00
|
|
|
{
|
2020-12-27 12:15:58 +01:00
|
|
|
struct hciuart_config_s *config = (FAR struct hciuart_config_s *)lower;
|
2019-09-21 15:16:37 +02:00
|
|
|
struct hciuart_state_s *state;
|
|
|
|
irqstate_t flags;
|
|
|
|
|
|
|
|
state = &config->state;
|
|
|
|
|
|
|
|
/* If the callback is NULL, then we are detaching */
|
|
|
|
|
arch, boards, drivers, include, sched, wireless: Change spinlock APIs.
Summary:
- This commit changes spinlock APIs (spin_lock_irqsave/spin_unlock_irqrestore)
- In the previous implementation, the global spinlock (i.e. g_irq_spin) was used.
- This commit allows to use caller specific spinlock but also supports to use
g_irq_spin for backword compatibility (In this case, NULL must be specified)
Impact:
- None
Testing:
- Tested with the following configurations
- spresnse:wifi, spresense:wifi_smp
- esp32-devkitc:smp (QEMU), sabre6-quad:smp (QEMU)
- maxi-bit:smp (QEMU), sim:smp
- stm32f4discovery:wifi
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-02-08 01:21:26 +01:00
|
|
|
flags = spin_lock_irqsave(NULL);
|
2019-09-21 15:16:37 +02:00
|
|
|
if (callback == NULL)
|
|
|
|
{
|
|
|
|
/* Disable Rx callbacks and detach the Rx callback */
|
|
|
|
|
|
|
|
state->callback = NULL;
|
|
|
|
state->arg = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Otherwise, we are attaching */
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
state->arg = arg;
|
|
|
|
state->callback = callback;
|
|
|
|
}
|
|
|
|
|
arch, boards, drivers, include, sched, wireless: Change spinlock APIs.
Summary:
- This commit changes spinlock APIs (spin_lock_irqsave/spin_unlock_irqrestore)
- In the previous implementation, the global spinlock (i.e. g_irq_spin) was used.
- This commit allows to use caller specific spinlock but also supports to use
g_irq_spin for backword compatibility (In this case, NULL must be specified)
Impact:
- None
Testing:
- Tested with the following configurations
- spresnse:wifi, spresense:wifi_smp
- esp32-devkitc:smp (QEMU), sabre6-quad:smp (QEMU)
- maxi-bit:smp (QEMU), sim:smp
- stm32f4discovery:wifi
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2021-02-08 01:21:26 +01:00
|
|
|
spin_unlock_irqrestore(NULL, flags);
|
2019-09-21 15:16:37 +02:00
|
|
|
}
|
|
|
|
|
2022-10-01 22:28:53 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: hciuart_rxpollcb
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Callback to receive the UART driver POLLIN notification.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static void hciuart_rxpollcb(FAR struct pollfd *fds)
|
|
|
|
{
|
|
|
|
FAR struct hciuart_config_s *n = (FAR struct hciuart_config_s *)fds->arg;
|
|
|
|
FAR struct hciuart_state_s *s = &n->state;
|
|
|
|
|
|
|
|
if (fds->revents & POLLIN)
|
|
|
|
{
|
|
|
|
fds->revents = 0;
|
|
|
|
if (s->callback != NULL)
|
|
|
|
{
|
|
|
|
wlinfo("Activating callback\n");
|
|
|
|
s->callback(&n->lower, s->arg);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wlwarn("Dropping data (no CB)\n");
|
|
|
|
hciuart_rxdrain(&n->lower);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-21 15:16:37 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: hciuart_rxenable
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Enable/disable RX callbacks from the HCI UART.
|
|
|
|
*
|
|
|
|
* hciuart_rxenable() may be used to enable or disable callback events.
|
|
|
|
* This probably translates to enabling and disabled Rx interrupts at
|
|
|
|
* the UART. NOTE: Rx event notification should be done sparingly:
|
|
|
|
* Rx data overrun may occur when Rx events are disabled!
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2019-10-04 17:29:51 +02:00
|
|
|
static void hciuart_rxenable(FAR const struct btuart_lowerhalf_s *lower,
|
2019-09-21 15:16:37 +02:00
|
|
|
bool enable)
|
|
|
|
{
|
2019-10-04 17:29:51 +02:00
|
|
|
FAR struct hciuart_config_s *config = (FAR struct hciuart_config_s *)lower;
|
|
|
|
FAR struct hciuart_state_s *s = &config->state;
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2022-10-01 22:28:53 +02:00
|
|
|
if (enable != !!s->p.priv)
|
2019-09-21 15:16:37 +02:00
|
|
|
{
|
2022-10-01 22:28:53 +02:00
|
|
|
file_poll(&s->f, &s->p, enable);
|
2019-09-21 15:16:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: hciuart_setbaud
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* The HCI UART comes up with some initial BAUD rate. Some support
|
|
|
|
* auto-BAUD detection, some support writing a configuration file to
|
|
|
|
* select the initial BAUD. The simplest strategy, however, is simply
|
|
|
|
* to use the HCI UART's default initial BAUD to perform the basic
|
|
|
|
* bring up, then send a vendor-specific command to increase the HCI
|
|
|
|
* UARTs BAUD. This method then may be used to adjust the lower half
|
|
|
|
* driver to the new HCI UART BAUD.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static int
|
2019-10-04 17:29:51 +02:00
|
|
|
hciuart_setbaud(FAR const struct btuart_lowerhalf_s *lower, uint32_t baud)
|
2019-09-21 15:16:37 +02:00
|
|
|
{
|
2020-12-27 12:15:58 +01:00
|
|
|
#ifdef CONFIG_SERIAL_TERMIOS
|
2019-09-21 15:16:37 +02:00
|
|
|
struct termios tio;
|
2020-12-27 12:15:58 +01:00
|
|
|
int ret;
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2022-10-01 21:50:45 +02:00
|
|
|
ret = hciuart_ioctl(lower, TCGETS, (unsigned long)&tio);
|
2019-09-21 15:16:37 +02:00
|
|
|
if (ret)
|
|
|
|
{
|
2020-05-17 16:47:40 +02:00
|
|
|
wlerr("ERROR during TCGETS\n");
|
2019-09-21 15:16:37 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (baud != 0)
|
|
|
|
{
|
|
|
|
cfsetspeed(&tio, baud);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* To be a H4 interface, CTS/RTS are needed */
|
|
|
|
|
|
|
|
tio.c_cflag |= CRTS_IFLOW | CCTS_OFLOW;
|
|
|
|
|
2022-10-01 21:50:45 +02:00
|
|
|
ret = hciuart_ioctl(lower, TCSETS, (unsigned long)&tio);
|
2019-09-21 15:16:37 +02:00
|
|
|
if (ret)
|
|
|
|
{
|
2020-05-17 16:47:40 +02:00
|
|
|
wlerr("ERROR during TCSETS, does UART support CTS/RTS?\n");
|
2019-09-21 15:16:37 +02:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
return OK;
|
2020-12-27 12:15:58 +01:00
|
|
|
#else
|
|
|
|
return -ENOSYS;
|
|
|
|
#endif
|
2019-09-21 15:16:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: hciuart_read
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Read UART data.
|
|
|
|
*
|
|
|
|
* hciuart_read() after receipt of a callback notifying the upper half of
|
|
|
|
* the availability of Rx frame, the upper half may call the receive()
|
|
|
|
* method in order to obtain the buffered Rx frame data.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static ssize_t
|
2019-10-04 17:29:51 +02:00
|
|
|
hciuart_read(FAR const struct btuart_lowerhalf_s *lower,
|
|
|
|
FAR void *buffer, size_t buflen)
|
2019-09-21 15:16:37 +02:00
|
|
|
{
|
2019-10-04 17:29:51 +02:00
|
|
|
FAR struct hciuart_config_s *config = (FAR struct hciuart_config_s *)lower;
|
|
|
|
FAR struct hciuart_state_s *state = &config->state;
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2022-10-01 21:23:04 +02:00
|
|
|
wlinfo("config %p buffer %p buflen %zu\n", config, buffer, buflen);
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2020-05-17 16:47:40 +02:00
|
|
|
/* NOTE: This assumes that the caller has exclusive access to the Rx
|
|
|
|
* buffer, i.e., one lower half instance can server only one upper half!
|
2019-09-21 15:16:37 +02:00
|
|
|
*/
|
|
|
|
|
2020-12-27 12:15:58 +01:00
|
|
|
return file_read(&state->f, buffer, buflen);
|
2019-09-21 15:16:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: hciuart_write
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Write UART data.
|
|
|
|
*
|
|
|
|
* hciuart_write() will add the outgoing frame to the Tx buffer and will
|
|
|
|
* return immediately. This function may block only in the event that
|
|
|
|
* there is insufficient buffer space to hold the Tx frame data. In that
|
|
|
|
* case the lower half will block until there is sufficient to buffer
|
|
|
|
* the entire outgoing packet.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static ssize_t
|
2019-10-04 17:29:51 +02:00
|
|
|
hciuart_write(FAR const struct btuart_lowerhalf_s *lower,
|
|
|
|
FAR const void *buffer, size_t buflen)
|
2019-09-21 15:16:37 +02:00
|
|
|
{
|
2020-12-27 12:15:58 +01:00
|
|
|
FAR struct hciuart_config_s *config = (FAR struct hciuart_config_s *)lower;
|
|
|
|
FAR struct hciuart_state_s *state = &config->state;
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2022-10-01 21:23:04 +02:00
|
|
|
wlinfo("config %p buffer %p buflen %zu\n", config, buffer, buflen);
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2020-12-27 12:15:58 +01:00
|
|
|
return file_write(&state->f, buffer, buflen);
|
2019-09-21 15:16:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: hciuart_rxdrain
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Flush/drain all buffered RX data
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2019-10-04 17:29:51 +02:00
|
|
|
static ssize_t hciuart_rxdrain(FAR const struct btuart_lowerhalf_s *lower)
|
2022-10-01 21:50:45 +02:00
|
|
|
{
|
|
|
|
return hciuart_ioctl(lower, TCDRN, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: hciuart_ioctl
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static int hciuart_ioctl(FAR const struct btuart_lowerhalf_s *lower,
|
|
|
|
int cmd, unsigned long arg)
|
2019-09-21 15:16:37 +02:00
|
|
|
{
|
2019-10-04 17:29:51 +02:00
|
|
|
FAR struct hciuart_config_s *config = (FAR struct hciuart_config_s *)lower;
|
|
|
|
FAR struct hciuart_state_s *s = &config->state;
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2022-10-01 21:50:45 +02:00
|
|
|
return file_ioctl(&s->f, cmd, arg);
|
2019-09-21 15:16:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2021-01-17 20:58:53 +01:00
|
|
|
* Name: btuart_shim_getdevice
|
2019-09-21 15:16:37 +02:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Get a pointer to the device that will be used to communicate with the
|
|
|
|
* regular serial port on the HCI.
|
|
|
|
*
|
2019-10-04 17:29:51 +02:00
|
|
|
* Input Parameters:
|
|
|
|
* Entry in filesystem hierarchy for device
|
2019-09-21 15:16:37 +02:00
|
|
|
*
|
|
|
|
* Returned Value:
|
|
|
|
* Pointer to device interface
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2021-01-17 20:58:53 +01:00
|
|
|
FAR struct btuart_lowerhalf_s *btuart_shim_getdevice(FAR const char *path)
|
2019-09-21 15:16:37 +02:00
|
|
|
{
|
2020-12-27 10:16:21 +01:00
|
|
|
FAR struct hciuart_config_s *n;
|
2019-10-04 17:29:51 +02:00
|
|
|
FAR struct hciuart_state_s *s;
|
2020-09-21 09:02:23 +02:00
|
|
|
int ret;
|
2019-09-21 15:16:37 +02:00
|
|
|
|
|
|
|
/* Get the memory for this shim instance */
|
|
|
|
|
2020-12-27 10:16:21 +01:00
|
|
|
n = (FAR struct hciuart_config_s *)
|
2020-05-17 16:47:40 +02:00
|
|
|
kmm_zalloc(sizeof(struct hciuart_config_s));
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2020-12-27 10:16:21 +01:00
|
|
|
if (!n)
|
2019-09-21 15:16:37 +02:00
|
|
|
{
|
2020-12-27 10:16:21 +01:00
|
|
|
return NULL;
|
2019-09-21 15:16:37 +02:00
|
|
|
}
|
|
|
|
|
2020-12-27 10:16:21 +01:00
|
|
|
s = &n->state;
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2023-09-13 15:08:13 +02:00
|
|
|
ret = file_open(&s->f, path, O_RDWR | O_CLOEXEC);
|
2020-09-21 09:02:23 +02:00
|
|
|
if (ret < 0)
|
2019-09-21 15:16:37 +02:00
|
|
|
{
|
2020-12-27 10:16:21 +01:00
|
|
|
kmm_free(n);
|
|
|
|
return NULL;
|
2019-09-21 15:16:37 +02:00
|
|
|
}
|
|
|
|
|
2022-10-01 22:28:53 +02:00
|
|
|
/* Setup poll structure */
|
|
|
|
|
|
|
|
s->p.events = POLLIN;
|
|
|
|
s->p.arg = n;
|
|
|
|
s->p.cb = hciuart_rxpollcb;
|
|
|
|
|
2019-09-21 15:16:37 +02:00
|
|
|
/* Hook the routines in */
|
|
|
|
|
2020-12-27 11:54:24 +01:00
|
|
|
n->lower.rxattach = hciuart_rxattach;
|
|
|
|
n->lower.rxenable = hciuart_rxenable;
|
|
|
|
n->lower.setbaud = hciuart_setbaud;
|
|
|
|
n->lower.read = hciuart_read;
|
|
|
|
n->lower.write = hciuart_write;
|
|
|
|
n->lower.rxdrain = hciuart_rxdrain;
|
2022-10-01 21:50:45 +02:00
|
|
|
n->lower.ioctl = hciuart_ioctl;
|
2019-09-21 15:16:37 +02:00
|
|
|
|
2020-12-27 10:16:21 +01:00
|
|
|
return (FAR struct btuart_lowerhalf_s *)n;
|
2019-09-21 15:16:37 +02:00
|
|
|
}
|