Skip to content

Commit

Permalink
feat: Supported configurable uart commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ustccw committed Jan 30, 2024
1 parent 8f09599 commit 62abafd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 26 deletions.
3 changes: 3 additions & 0 deletions components/at/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ list(APPEND srcs "src/at_default_config.c")
list(APPEND srcs "src/at_init.c")
list(APPEND srcs "src/at_workaround.c")
list(APPEND srcs "src/at_cmd_register.c")
if (CONFIG_AT_UART_COMMAND_SUPPORT)
list(APPEND srcs "src/at_uart_cmd.c")
endif()
if (CONFIG_BOOTLOADER_COMPRESSED_ENABLED)
list(APPEND srcs "src/at_compress_ota.c")
endif()
Expand Down
2 changes: 1 addition & 1 deletion components/at/src/at_uart_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <stdbool.h>
#include "sdkconfig.h"

#ifdef CONFIG_AT_BASE_ON_UART
#ifdef CONFIG_AT_UART_COMMAND_SUPPORT
#include "driver/uart.h"
#include "hal/uart_types.h"
#include "freertos/FreeRTOS.h"
Expand Down
55 changes: 30 additions & 25 deletions main/interface/uart/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,38 @@ config AT_BASE_ON_UART
bool "AT through UART"

if AT_BASE_ON_UART
menu "AT uart settings"

config AT_UART_DEFAULT_DATABITS
int "the uart data bits for AT port, the range is [5, 8]"
default 8
range 5 8
depends on AT_BASE_ON_UART
config AT_UART_COMMAND_SUPPORT
bool "Support UART AT commands"
default "y"

config AT_UART_DEFAULT_STOPBITS
int "the uart stop bit for AT port, the range is [1, 3]"
help
1: 1-bit stop bit; 2: 1.5-bit stop bit; 3: 2-bit stop bit
default 1
range 1 3
menu "AT uart settings"
config AT_UART_DEFAULT_DATABITS
int "the uart data bits for AT port, the range is [5, 8]"
default 8
range 5 8
depends on AT_BASE_ON_UART

config AT_UART_DEFAULT_PARITY_BITS
int "the uart parity bit for AT port, the range is [0, 2]"
help
0: None; 1: Odd; 2: Even
default 0
range 0 2
config AT_UART_DEFAULT_STOPBITS
int "the uart stop bit for AT port, the range is [1, 3]"
help
1: 1-bit stop bit; 2: 1.5-bit stop bit; 3: 2-bit stop bit
default 1
range 1 3

config AT_UART_DEFAULT_PARITY_BITS
int "the uart parity bit for AT port, the range is [0, 2]"
help
0: None; 1: Odd; 2: Even
default 0
range 0 2

config AT_UART_DEFAULT_FLOW_CONTROL
int "the uart flow control for AT port, the range is [0, 3]"
help
0: flow control is disabled; 1: enable RTS; 2: enable CTS; 3: enable RTS and CTS
default 1
range 0 3
endmenu

config AT_UART_DEFAULT_FLOW_CONTROL
int "the uart flow control for AT port, the range is [0, 3]"
help
0: flow control is disabled; 1: enable RTS; 2: enable CTS; 3: enable RTS and CTS
default 1
range 0 3
endmenu
endif

0 comments on commit 62abafd

Please sign in to comment.