Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions examples/comp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ##############################################################################
# apps/examples/comp/CMakeLists.txt
#
# 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(CONFIG_EXAMPLES_COMP)
nuttx_add_application(
NAME
${CONFIG_EXAMPLES_COMP_PROGNAME}
PRIORITY
${CONFIG_EXAMPLES_COMP_PRIORITY}
STACKSIZE
${CONFIG_EXAMPLES_COMP_STACKSIZE}
MODULE
${CONFIG_EXAMPLES_COMP}
SRCS
comp_main.c)
endif()
43 changes: 43 additions & 0 deletions examples/comp/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#

config EXAMPLES_COMP
tristate "Comparator tool"
default n
depends on COMP
---help---
Enable support for the comparator tool.

if EXAMPLES_COMP

config EXAMPLES_COMP_PROGNAME
string "Program name"
default "comp"
---help---
This is the name of the program that will be used in the shell

config EXAMPLES_COMP_PRIORITY
int "Comparator tool task priority"
default 100

config EXAMPLES_COMP_STACKSIZE
int "Comparator tool stack size"
default DEFAULT_TASK_STACKSIZE

config EXAMPLES_COMP_DEVPATH
string "Comparator device path"
default "/dev/comp0"
---help---
The default path to the comparator device. Default: /dev/comp0

config EXAMPLES_COMP_DACPATH
string "DAC device path for ramp test"
default "/dev/dac5" if ARCH_CHIP_STM32G4
default "/dev/dac0"
depends on DAC
---help---
The default path to the DAC device for generating a voltage ramp.

endif
25 changes: 25 additions & 0 deletions examples/comp/Make.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
############################################################################
# apps/examples/comp/Make.defs
#
# 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.
#
############################################################################

ifneq ($(CONFIG_EXAMPLES_COMP),)
CONFIGURED_APPS += $(APPDIR)/examples/comp
endif
36 changes: 36 additions & 0 deletions examples/comp/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
############################################################################
# apps/examples/comp/Makefile
#
# 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.
#
############################################################################

include $(APPDIR)/Make.defs

# Comparator tool

MAINSRC = comp_main.c

# application info

PROGNAME = $(CONFIG_EXAMPLES_COMP_PROGNAME)
PRIORITY = $(CONFIG_EXAMPLES_COMP_PRIORITY)
STACKSIZE = $(CONFIG_EXAMPLES_COMP_STACKSIZE)
MODULE = $(CONFIG_EXAMPLES_COMP)

include $(APPDIR)/Application.mk
Loading
Loading