nrf52: support configuring no console/serial

This commit is contained in:
Matias N 2020-10-30 18:20:04 -03:00 committed by Xiang Xiao
parent 4aa9b80d2b
commit 1fa0aac36b
2 changed files with 10 additions and 0 deletions

View File

@ -113,6 +113,7 @@ static const struct uart_config_s g_console_config =
* *
****************************************************************************/ ****************************************************************************/
#ifdef HAVE_UART_DEVICE
static void nrf52_setbaud(uintptr_t base, const struct uart_config_s *config) static void nrf52_setbaud(uintptr_t base, const struct uart_config_s *config)
{ {
uint32_t br = 0; uint32_t br = 0;
@ -234,11 +235,13 @@ static void nrf52_setbaud(uintptr_t base, const struct uart_config_s *config)
putreg32(br, base + NRF52_UART_BAUDRATE_OFFSET); putreg32(br, base + NRF52_UART_BAUDRATE_OFFSET);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: nrf52_setparity * Name: nrf52_setparity
****************************************************************************/ ****************************************************************************/
#ifdef HAVE_UART_DEVICE
static void nrf52_setparity(uintptr_t base, static void nrf52_setparity(uintptr_t base,
const struct uart_config_s *config) const struct uart_config_s *config)
{ {
@ -261,6 +264,7 @@ static void nrf52_setparity(uintptr_t base,
putreg32(regval, base + NRF52_UART_CONFIG_OFFSET); putreg32(regval, base + NRF52_UART_CONFIG_OFFSET);
} }
#endif
/**************************************************************************** /****************************************************************************
* Name: nrf52_setstops * Name: nrf52_setstops
@ -291,11 +295,13 @@ static void nrf52_setstops(uintptr_t base,
* Name: nrf52_sethwflow * Name: nrf52_sethwflow
****************************************************************************/ ****************************************************************************/
#ifdef HAVE_UART_DEVICE
static void nrf52_sethwflow(uintptr_t base, static void nrf52_sethwflow(uintptr_t base,
const struct uart_config_s *config) const struct uart_config_s *config)
{ {
/* TODO */ /* TODO */
} }
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
@ -442,6 +448,7 @@ void arm_lowputc(char ch)
* *
****************************************************************************/ ****************************************************************************/
#ifdef HAVE_UART_DEVICE
void nrf52_usart_setformat(uintptr_t base, void nrf52_usart_setformat(uintptr_t base,
FAR const struct uart_config_s *config) FAR const struct uart_config_s *config)
{ {
@ -463,3 +470,4 @@ void nrf52_usart_setformat(uintptr_t base,
nrf52_sethwflow(base, config); nrf52_sethwflow(base, config);
} }
#endif

View File

@ -123,7 +123,9 @@ void nrf52_usart_disable(uintptr_t base,
* *
****************************************************************************/ ****************************************************************************/
#ifdef HAVE_UART_DEVICE
void nrf52_usart_setformat(uintptr_t base, void nrf52_usart_setformat(uintptr_t base,
FAR const struct uart_config_s *config); FAR const struct uart_config_s *config);
#endif
#endif /* __ARCH_ARM_SRC_NRF52_NRF52_LOWPUTC_H */ #endif /* __ARCH_ARM_SRC_NRF52_NRF52_LOWPUTC_H */