# arch/arm/src/stm32n6/Kconfig
#
# SPDX-License-Identifier: Apache-2.0
#
# 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
#
#   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.

if ARCH_CHIP_STM32N6

comment "STM32N6 Configuration Options"

config STM32N6_STM32N6XXXX
	bool
	default y

choice
	prompt "STM32 N6 Chip Selection"
	default ARCH_CHIP_STM32N657X0
	depends on ARCH_CHIP_STM32N6

config ARCH_CHIP_STM32N657X0
	bool "STM32N657X0"
	select STM32N6_STM32N6XXXX

endchoice

menu "STM32N6 Peripheral Selection"

config STM32N6_USART1
	bool "USART1"
	default n
	select STM32N6_USART
	select USART1_SERIALDRIVER
	select STM32N6_USART1_SERIALDRIVER
	select ARCH_HAVE_SERIAL_TERMIOS

config STM32N6_USART1_SERIALDRIVER
	bool
	default n

config STM32N6_USART
	bool

if STM32N6_USART

config STM32N6_SERIAL_DISABLE_REORDERING
	bool "Disable reordering of ttySx devices."
	depends on STM32N6_USART1
	default n
	---help---
		NuttX per default reorders the serial ports (/dev/ttySx) so that the
		console is always on /dev/ttyS0. If more than one UART is in use this
		can, however, have the side-effect that all port mappings
		(hardware USART1 -> /dev/ttyS0) change if the console is moved to
		another UART. This option disables that reordering so port names
		stay stable when the console is moved.

config STM32N6_FLOWCONTROL_BROKEN
	bool "Use Software UART RTS flow control"
	default n
	---help---
		Enable this option to use software RTS flow control rather than
		the hardware RTS line.  Useful in cases where the silicon RTS
		behaviour does not match the application's needs.

config STM32N6_SERIALBRK_BSDCOMPAT
	bool "Use GPIO to send Break"
	default n
	---help---
		Enable this option to send break by reconfiguring TX as a GPIO
		held low for the requested duration, matching BSD-compatible
		semantics.

config STM32N6_PM_SERIAL_ACTIVITY
	int "PM serial activity"
	default 10
	---help---
		PM activity reported to power management logic on every serial
		interrupt.

endif # STM32N6_USART

if USART1_SERIALDRIVER

config USART1_UNCONFIG_RX_ON_CLOSE
	bool "Unconfigure USART1 RX pin on close"
	default n

config USART1_UNCONFIG_TX_ON_CLOSE
	bool "Unconfigure USART1 TX pin on close"
	default n

endif # USART1_SERIALDRIVER

endmenu

endif # ARCH_CHIP_STM32N6
