diff --git a/apps/examples/sensor_test/Kconfig b/apps/examples/sensor_test/Kconfig new file mode 100644 index 0000000000..71eb59924e --- /dev/null +++ b/apps/examples/sensor_test/Kconfig @@ -0,0 +1,15 @@ +# +# For a description of the syntax of this configuration file, +# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt +# + +config EXAMPLES_SENSOR + bool "Sensor Test example" + default n + ---help--- + Enable the Sensor Test example + +config USER_ENTRYPOINT + string + default "sensor_test" if ENTRY_SENSOR + diff --git a/apps/examples/sensor_test/Kconfig_ENTRY b/apps/examples/sensor_test/Kconfig_ENTRY new file mode 100644 index 0000000000..988d5062b4 --- /dev/null +++ b/apps/examples/sensor_test/Kconfig_ENTRY @@ -0,0 +1,3 @@ +config ENTRY_HELLO + bool "\"Hello, World!\" example" + depends on EXAMPLES_HELLO diff --git a/apps/examples/sensor_test/Make.defs b/apps/examples/sensor_test/Make.defs new file mode 100644 index 0000000000..9e55626393 --- /dev/null +++ b/apps/examples/sensor_test/Make.defs @@ -0,0 +1,56 @@ +########################################################################### +# +# Copyright 2017 Samsung Electronics All Rights Reserved. +# +# Licensed 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. +# +########################################################################### +############################################################################ +# apps/examples/sensor_test/Make.defs +# Adds selected applications to apps/ build +# +# Copyright (C) 2015 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +ifeq ($(CONFIG_EXAMPLES_SENSOR),y) +CONFIGURED_APPS += examples/sensor_test +endif diff --git a/apps/examples/sensor_test/Makefile b/apps/examples/sensor_test/Makefile new file mode 100644 index 0000000000..805cfda570 --- /dev/null +++ b/apps/examples/sensor_test/Makefile @@ -0,0 +1,158 @@ +########################################################################### +# +# Copyright 2016 Samsung Electronics All Rights Reserved. +# +# Licensed 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. +# +########################################################################### +############################################################################ +# apps/examples/sensor_test/Makefile +# +# Copyright (C) 2008, 2010-2013 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +-include $(TOPDIR)/.config +-include $(TOPDIR)/Make.defs +include $(APPDIR)/Make.defs + +# Hello, World! built-in application info + +APPNAME = sensor +FUNCNAME = $(APPNAME)_main +THREADEXEC = TASH_EXECMD_ASYNC + +# Hello, World! Example + +ASRCS = +CSRCS = +MAINSRC = sensor_main.c + +AOBJS = $(ASRCS:.S=$(OBJEXT)) +COBJS = $(CSRCS:.c=$(OBJEXT)) +MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) + +SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) +OBJS = $(AOBJS) $(COBJS) + +ifneq ($(CONFIG_BUILD_KERNEL),y) + OBJS += $(MAINOBJ) +endif + +ifeq ($(CONFIG_WINDOWS_NATIVE),y) + BIN = $(APPDIR)\libapps$(LIBEXT) +else +ifeq ($(WINTOOL),y) + BIN = $(APPDIR)\\libapps$(LIBEXT) +else + BIN = $(APPDIR)/libapps$(LIBEXT) +endif +endif + +ifeq ($(WINTOOL),y) + INSTALL_DIR = "${shell cygpath -w $(BIN_DIR)}" +else + INSTALL_DIR = $(BIN_DIR) +endif + +CONFIG_EXAMPLES_HELLO_PROGNAME ?= sensor$(EXEEXT) +PROGNAME = $(CONFIG_EXAMPLES_HELLO_PROGNAME) + +ROOTDEPPATH = --dep-path . + +# Common build + +VPATH = + +all: .built +.PHONY: clean depend distclean + +$(AOBJS): %$(OBJEXT): %.S + $(call ASSEMBLE, $<, $@) + +$(COBJS) $(MAINOBJ): %$(OBJEXT): %.c + $(call COMPILE, $<, $@) + +.built: $(OBJS) + $(call ARCHIVE, $(BIN), $(OBJS)) + @touch .built + +ifeq ($(CONFIG_BUILD_KERNEL),y) +$(BIN_DIR)$(DELIM)$(PROGNAME): $(OBJS) $(MAINOBJ) + @echo "LD: $(PROGNAME)" + $(Q) $(LD) $(LDELFFLAGS) $(LDLIBPATH) -o $(INSTALL_DIR)$(DELIM)$(PROGNAME) $(ARCHCRT0OBJ) $(MAINOBJ) $(LDLIBS) + $(Q) $(NM) -u $(INSTALL_DIR)$(DELIM)$(PROGNAME) + +install: $(BIN_DIR)$(DELIM)$(PROGNAME) + +else +install: + +endif + +ifeq ($(CONFIG_BUILTIN_APPS)$(CONFIG_EXAMPLES_HELLO),yy) +$(BUILTIN_REGISTRY)$(DELIM)$(FUNCNAME).bdat: $(DEPCONFIG) Makefile + $(Q) $(call REGISTER,$(APPNAME),$(FUNCNAME),$(THREADEXEC),$(PRIORITY),$(STACKSIZE)) + +context: $(BUILTIN_REGISTRY)$(DELIM)$(FUNCNAME).bdat + +else +context: + +endif + +.depend: Makefile $(SRCS) + @$(MKDEP) $(ROOTDEPPATH) "$(CC)" -- $(CFLAGS) -- $(SRCS) >Make.dep + @touch $@ + +depend: .depend + +clean: + $(call DELFILE, .built) + $(call CLEAN) + +distclean: clean + $(call DELFILE, Make.dep) + $(call DELFILE, .depend) + +-include Make.dep +.PHONY: preconfig +preconfig: diff --git a/apps/examples/sensor_test/sensor_main.c b/apps/examples/sensor_test/sensor_main.c new file mode 100644 index 0000000000..88e061290f --- /dev/null +++ b/apps/examples/sensor_test/sensor_main.c @@ -0,0 +1,99 @@ +/**************************************************************************** + * + * Copyright 2016 Samsung Electronics All Rights Reserved. + * + * Licensed 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. + * + ****************************************************************************/ +/**************************************************************************** + * examples/sensor_test/sensor_main.c + * + * Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#define IR_SENSOR_PATH "/dev/sensor0" +#define MEMS_SENSOR_PATH "/dev/sensor1" + +static void temp_read() +{ + int fd = 0; + int fd1 = 0; + fd = open(IR_SENSOR_PATH, O_RDWR | O_SYNC, 0666); + if (fd < 0) { + printf("ERROR: Failed to open sensor port error:%d\n", fd); + return; + } + fd1 = open(MEMS_SENSOR_PATH, O_RDWR | O_SYNC, 0666); + if (fd1 < 0) { + printf("ERROR: Failed to open sensor port error:%d\n", fd1); + return; + } + char buf[2]; + int samp = 32000; + /*printf("Read from IR sensor\n"); + read(fd, buf, 2);*/ + ioctl(fd1, SENSOR_SET_SAMPRATE, samp); + printf("Read from MEMS sensor\n"); + read(fd1, buf, 2); + printf("sensor test complete \n"); + close(fd); + close(fd1); +} + +#ifdef CONFIG_BUILD_KERNEL +int main(int argc, FAR char *argv[]) +#else +int sensor_main(int argc, char *argv[]) +#endif +{ + printf("Sensor test!!\n"); + temp_read(); + return 0; +} diff --git a/build/configs/rtl8730e/audio/defconfig b/build/configs/rtl8730e/audio/defconfig deleted file mode 100644 index 68697c7283..0000000000 --- a/build/configs/rtl8730e/audio/defconfig +++ /dev/null @@ -1,1708 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# TinyAra Configuration -# - -# -# Build Setup -# -# CONFIG_EXPERIMENTAL is not set -# CONFIG_DEFAULT_SMALL is not set -CONFIG_DOCKER_VERSION="2.0.0" -CONFIG_HOST_LINUX=y -# CONFIG_HOST_OSX is not set -# CONFIG_HOST_WINDOWS is not set -# CONFIG_HOST_OTHER is not set -# CONFIG_WINDOWS_NATIVE is not set - -# -# Build Configuration -# -CONFIG_APPS_DIR="../apps" -CONFIG_FRAMEWORK_DIR="../framework" -CONFIG_TOOLS_DIR="../tools" -CONFIG_BUILD_FLAT=y -# CONFIG_APP_BINARY_SEPARATION is not set -# CONFIG_BUILD_2PASS is not set -CONFIG_BOARD_BUILD_DATE="200204" -# CONFIG_BINARY_SIGNING is not set - -# -# Binary Output Formats -# -CONFIG_INTELHEX_BINARY=y -# CONFIG_MOTOROLA_SREC is not set -CONFIG_RAW_BINARY=y -# CONFIG_UBOOT_UIMAGE is not set -# CONFIG_DOWNLOAD_IMAGE is not set - -# -# Customize Header Files -# -# CONFIG_ARCH_STDINT_H is not set -# CONFIG_ARCH_STDBOOL_H is not set -# CONFIG_ARCH_MATH_H is not set -# CONFIG_ARCH_FLOAT_H is not set -CONFIG_ARCH_STDARG_H=y -CONFIG_ARCH_HAVE_CUSTOMOPT=y -# CONFIG_DEBUG_NOOPT is not set -# CONFIG_DEBUG_CUSTOMOPT is not set -CONFIG_DEBUG_FULLOPT=y - -# -# Chip Selection -# -CONFIG_ARCH_ARM=y -# CONFIG_ARCH_XTENSA is not set -CONFIG_ARCH="arm" -# CONFIG_ARCH_CHIP_LM is not set -# CONFIG_ARCH_CHIP_S5J is not set -# CONFIG_ARCH_CHIP_BCM4390X is not set -# CONFIG_ARCH_CHIP_IMX6 is not set -# CONFIG_ARCH_CHIP_STM32 is not set -# CONFIG_ARCH_CHIP_IMXRT is not set -# CONFIG_ARCH_CHIP_STM32L4 is not set -# CONFIG_ARCH_CHIP_AMEBAD is not set -# CONFIG_ARCH_CHIP_STM32H745 is not set -# CONFIG_ARCH_CHIP_AMEBALITE is not set -CONFIG_ARCH_CHIP_AMEBASMART=y -CONFIG_ARCH_CHIP="amebasmart" -CONFIG_ARM_THUMB=y -CONFIG_ARM_HAVE_DPFPU32=y -CONFIG_ARM_HAVE_WFE_SEV=y -CONFIG_ARM_HAVE_NEON=y -# CONFIG_ARM_FPU_ABI_SOFT is not set -CONFIG_ARM_DPFPU32=y -CONFIG_ARM_NEON=y -# CONFIG_ARM_HAVE_MPCORE is not set - -# -# ARM Options -# -# CONFIG_ARCH_CORTEXM3 is not set -# CONFIG_ARCH_CORTEXM4 is not set -# CONFIG_ARCH_CORTEXM7 is not set -# CONFIG_ARCH_CORTEXM33 is not set -# CONFIG_ARCH_CORTEXM55 is not set -# CONFIG_ARCH_CORTEXA9 is not set -# CONFIG_ARCH_CORTEXR4 is not set -CONFIG_ARCH_CORTEXA32=y -# CONFIG_ARCH_ARMV7M_FAMILY is not set -# CONFIG_ARCH_ARMV8M_FAMILY is not set -# CONFIG_ARCH_ARMV7R_FAMILY is not set -CONFIG_ARCH_ARMV7A_FAMILY=y -CONFIG_ARCH_FAMILY="armv7-a" -CONFIG_ARCH_HAVE_FPU=y -CONFIG_ARCH_HAVE_DPFPU=y -CONFIG_ARCH_FPU=y -CONFIG_ARCH_DPFPU=y -# CONFIG_ARM_HAVE_MPU_UNIFIED is not set -# CONFIG_ARM_MPU is not set -CONFIG_ARCH_HAVE_LOWVECTORS=y -CONFIG_ARCH_LOWVECTORS=y -# CONFIG_ARCH_ROMPGTABLE is not set -CONFIG_ARCH_HAVE_TICKSUPPRESS=y - -# -# Exception stack options -# -# CONFIG_ARCH_HAVE_DABORTSTACK is not set -CONFIG_SW_STACK_OVERFLOW_DETECTION=y -# CONFIG_STACK_OVERFLOW_PROTECTION_DISABLE is not set -CONFIG_SYSTEM_REBOOT_REASON=y - -# -# ARMv7-A Configuration Options -# -CONFIG_ARMV7A_HAVE_GICv2=y -# CONFIG_ARMV7A_HAVE_GTM is not set -# CONFIG_ARMV7A_HAVE_PTM is not set -# CONFIG_ARMV7A_HAVE_L2CC is not set -# CONFIG_ARMV7A_HAVE_L2CC_PL310 is not set - -# -# L2 Cache Configuration -# -# CONFIG_PL310_LOCKDOWN_BY_MASTER is not set -# CONFIG_PL310_LOCKDOWN_BY_LINE is not set -# CONFIG_PL310_ADDRESS_FILTERING is not set -CONFIG_ARMV7A_ASSOCIATIVITY_8WAY=y -# CONFIG_ARMV7A_ASSOCIATIVITY_16WAY is not set -CONFIG_ARMV7A_WAYSIZE_16KB=y -# CONFIG_ARMV7A_WAYSIZE_32KB is not set -# CONFIG_ARMV7A_WAYSIZE_64KB is not set -# CONFIG_ARMV7A_WAYSIZE_128KB is not set -# CONFIG_ARMV7A_WAYSIZE_256KB is not set -# CONFIG_ARMV7A_WAYSIZE_512KB is not set -# CONFIG_ARMV7A_TOOLCHAIN_BUILDROOT is not set -CONFIG_ARMV7A_TOOLCHAIN_GNU_EABI=y -# CONFIG_ARMV7A_TOOLCHAIN_GNU_OABI is not set -# CONFIG_ARMV7A_DECODEFIQ is not set - -# -# AMEBASMART Configuration Options -# -CONFIG_ARCH_CHIP_RTL8730E=y - -# -# Realtek RTL8730E Peripheral Support -# -CONFIG_RTL8730E_UART=y -CONFIG_RTL8730E_UART0=y -CONFIG_RTL8730E_UART1=y -# CONFIG_RTL8730E_UART2 is not set -# CONFIG_RTL8730E_UART3 is not set -CONFIG_RTL8730E_UART4=y -CONFIG_RTL8730E_SERIAL_FIFO=y -# CONFIG_AMEBASMART_MIPI is not set -# CONFIG_AMEBASMART_USBDEVICE is not set -CONFIG_AMEBASMART_SPI=y -CONFIG_AMEBASMART_SPI0=y -# CONFIG_AMEBASMART_SPI1 is not set -CONFIG_AMEBASMART_SPI_EXCHANGE=y -# CONFIG_AMEBASMART_SPI_DMA is not set -# CONFIG_SPI_CS is not set -CONFIG_AMEBASMART_I2C=y -CONFIG_AMEBASMART_I2C0=y -CONFIG_AMEBASMART_I2C1=y -CONFIG_AMEBASMART_I2C2=y -# CONFIG_AMEBASMART_I2C_DYNTIMEO is not set -CONFIG_AMEBASMART_I2CTIMEOSEC=0 -CONFIG_AMEBASMART_I2CTIMEOMS=500 -CONFIG_AMEBASMART_I2CTIMEOTICKS=500 -CONFIG_AMEBASMART_I2S=y -CONFIG_AMEBASMART_I2S2=y -# CONFIG_AMEBASMART_I2S3 is not set -# CONFIG_AMEBASMART_I2S_RX is not set -CONFIG_AMEBASMART_I2S_TX=y -CONFIG_AMEBASMART_I2S_TXCL=16 - -# -# Realtek RTL8730E WIFI Support -# -CONFIG_AMEBASMART_WIFI=y - -# -# Realtek RTL8730E BLE Support -# -CONFIG_AMEBASMART_BLE=y -CONFIG_AMEBASMART_FTL=y -# CONFIG_AMEBASMART_BLE_DEBUG is not set -CONFIG_AMEBASMART_BLE_PERIPHERAL=y -CONFIG_AMEBASMART_BLE_CENTRAL=y -CONFIG_AMEBASMART_BLE_SCATTERNET=y - -# -# Realtek RTL8730E TrustZone Support -# -CONFIG_AMEBASMART_TRUSTZONE=y - -# -# Realtek RTL8730E KM4/KM0 Status Check Timer -# -CONFIG_AMEBASMART_NP_LP_CHECK_INTERVAL=5000000 - -# -# Architecture Options -# -# CONFIG_ARCH_NOINTC is not set -# CONFIG_ARCH_VECNOTIRQ is not set -# CONFIG_ARCH_DMA is not set -CONFIG_ARCH_HAVE_IRQPRIO=y -# CONFIG_ARCH_L2CACHE is not set -# CONFIG_ARCH_HAVE_COHERENT_DCACHE is not set -CONFIG_ARCH_HAVE_ADDRENV=y -CONFIG_ARCH_NEED_ADDRENV_MAPPING=y -CONFIG_ARCH_HAVE_MULTICPU=y -CONFIG_ARCH_HAVE_TESTSET=y -CONFIG_ARCH_HAVE_VFORK=y -CONFIG_ARCH_HAVE_MMU=y -# CONFIG_ARCH_HAVE_MPU is not set -# CONFIG_ARCH_NAND_HWECC is not set -# CONFIG_ARCH_HAVE_EXTCLK is not set -# CONFIG_ARCH_HAVE_POWEROFF is not set -CONFIG_ARCH_HAVE_RESET=y -CONFIG_ARCH_HAVE_DVFS=y -CONFIG_ARCH_USE_MMU=y -CONFIG_ARCH_HAVE_FETCHADD=y -# CONFIG_ARCH_ADDRENV is not set -# CONFIG_PAGING is not set -CONFIG_ARCH_IRQPRIO=y -# CONFIG_ARCH_MMUDUMP is not set -# CONFIG_ARCH_TASKDUMP is not set -CONFIG_ARCH_STACKDUMP=y -CONFIG_ARCH_STACKDUMP_MAX_LENGTH=0 -# CONFIG_ENDIAN_BIG is not set -# CONFIG_ARCH_IDLE_CUSTOM is not set -# CONFIG_ARCH_HAVE_RAMFUNCS is not set -# CONFIG_ARCH_HAVE_RAMVECTORS is not set -# CONFIG_SUPPRESS_INTERRUPTS is not set -# CONFIG_SUPPRESS_TIMER_INTS is not set - -# -# Board Settings -# -CONFIG_BOARD_LOOPSPERMSEC=149300 -# CONFIG_ARCH_CALIBRATION is not set - -# -# Interrupt options -# -CONFIG_ARCH_HAVE_INTERRUPTSTACK=y -CONFIG_ARCH_INTERRUPTSTACK=1024 -# CONFIG_ARCH_HAVE_NESTED_INTERRUPT is not set -# CONFIG_ARCH_HAVE_HIPRI_INTERRUPT is not set - -# -# Boot options -# -# CONFIG_BOOT_RUNFROMEXTSRAM is not set -# CONFIG_BOOT_RUNFROMFLASH is not set -# CONFIG_BOOT_RUNFROMISRAM is not set -CONFIG_BOOT_RUNFROMSDRAM=y -# CONFIG_BOOT_COPYTORAM is not set - -# -# Boot Memory Configuration -# -CONFIG_RAM_START=0x60100000 -CONFIG_RAM_VSTART=0x60100000 -CONFIG_RAM_SIZE=7340032 -CONFIG_RAM_KREGIONx_START="0x60100000," -CONFIG_RAM_KREGIONx_SIZE="7340032," -# CONFIG_DDR is not set -CONFIG_ARCH_HAVE_SDRAM=y - -# -# Board Selection -# -CONFIG_ARCH_BOARD_RTL8730E=y -# CONFIG_ARCH_BOARD_ARTIK05X_FAMILY is not set -# CONFIG_ARCH_BOARD_ESP32_FAMILY is not set -CONFIG_ARCH_BOARD="rtl8730e" - -# -# Common Board Options -# -CONFIG_ARCH_HAVE_BUTTONS=y -CONFIG_ARCH_BUTTONS=y -CONFIG_ARCH_HAVE_IRQBUTTONS=y -# CONFIG_ARCH_IRQBUTTONS is not set -CONFIG_ARCH_HAVE_RAM_KERNEL_TEXT=y -# CONFIG_BOARD_CRASHDUMP is not set -CONFIG_BOARD_ASSERT_AUTORESET=y -CONFIG_LIB_BOARDCTL=y -CONFIG_BOARDCTL_RESET=y -# CONFIG_BOARDCTL_BOARD_HEADER is not set -# CONFIG_BOARDCTL_UNIQUEID is not set -# CONFIG_BOARD_FOTA_SUPPORT is not set - -# -# Board-Specific Options -# -CONFIG_FLASH_START_ADDR=0x8000000 -CONFIG_FLASH_SIZE=16777216 -CONFIG_FLASH_STATUS_BITS=0x28 -CONFIG_FLASH_VSTART=0x8000000 -CONFIG_BOARD_FLASH_16M=y -# CONFIG_BOARD_FLASH_32M is not set -CONFIG_RTL8730E_BOARD_REVISION=6 -# CONFIG_RAM_DDR is not set -CONFIG_RAM_PSRAM=y - -# -# SPI Flash driver -# -CONFIG_AMEBASMART_FLASH_BASE=0x0 -CONFIG_AMEBASMART_FLASH_CAPACITY=0x1000000 -CONFIG_AMEBASMART_FLASH_PAGE_SIZE=256 -CONFIG_AMEBASMART_FLASH_BLOCK_SIZE=4096 -CONFIG_AMEBASMART_SECURE_WORLD_ADDRESS=0x70383020 -CONFIG_ARCH_BOARD_HAVE_FLASH=y - -# -# Board-Partition Options -# -CONFIG_FLASH_PARTITION=y -CONFIG_FLASH_MINOR=0 -CONFIG_FLASH_PART_SIZE="60,40,12,400,5036,5036,5280,512,8," -CONFIG_FLASH_PART_TYPE="none,none,none,none,kernel,kernel,smartfs,ftl,bootparam," -CONFIG_FLASH_PART_NAME="bl1,reserved,ftl,ss,kernel,kernel,userfs,micom,bootparam," -CONFIG_ARCH_BOARD_HAVE_SECOND_FLASH=y - -# -# Second Flash Partition Options -# -# CONFIG_SECOND_FLASH_PARTITION is not set -CONFIG_AUTOMOUNT=y -CONFIG_AUTOMOUNT_USERFS=y -# CONFIG_BOARD_USBDEV_SERIALSTR is not set - -# -# SE Selection -# -CONFIG_SE=y -# CONFIG_DEBUG_SECURE_ELEMENT_ERROR is not set -# CONFIG_SE_SSS is not set -# CONFIG_SE_KONAI is not set -# CONFIG_SE_VIRTUAL is not set -CONFIG_SE_AMEBA=y -CONFIG_HW_RNG=y -CONFIG_HW_DH_PARAM=y -CONFIG_HW_ECDH_PARAM=y -# CONFIG_HW_RSA_VERIFICATION is not set -CONFIG_HW_ECDSA_VERIFICATION=y -# CONFIG_HW_RSA_ENC is not set -CONFIG_HW_SE_STORAGE=y -# CONFIG_HW_AES_ENC is not set -# CONFIG_HW_GCM_ENC is not set -CONFIG_SE_SECURE_CONTEXT_SIZE=9216 -CONFIG_SECURITY_LEVEL=y - -# -# Crypto Module -# -# CONFIG_CRYPTO is not set - -# -# Kernel Features -# -# CONFIG_DISABLE_OS_API is not set - -# -# Clocks and Timers -# -CONFIG_SCHED_TICKSUPPRESS=y -CONFIG_SCHED_WAKEUPSOURCE=y -CONFIG_USEC_PER_TICK=1000 -CONFIG_SYSTEM_TIME64=y -CONFIG_CLOCK_MONOTONIC=y -# CONFIG_JULIAN_TIME is not set -CONFIG_INIT_SYSTEM_TIME=y -CONFIG_INIT_SYSTEM_TIME_WITH_MIDNIGHT=y -CONFIG_MAX_WDOGPARMS=2 -CONFIG_PREALLOC_WDOGS=8 -CONFIG_WDOG_INTRESERVE=0 -CONFIG_PREALLOC_TIMERS=2 - -# -# Tasks and Scheduling -# -# CONFIG_SPINLOCK is not set -CONFIG_INIT_ENTRYPOINT=y -# CONFIG_IRQCOUNT is not set -# CONFIG_SCHED_RESUMESCHEDULER is not set -# CONFIG_SMP is not set -CONFIG_RR_INTERVAL=10 -CONFIG_TASK_NAME_SIZE=31 -CONFIG_MAX_TASKS=128 -CONFIG_SCHED_HAVE_PARENT=y -# CONFIG_SCHED_CHILD_STATUS is not set -CONFIG_SCHED_WAITPID=y -CONFIG_SIGKILL_HANDLER=y - -# -# Pthread Options -# -CONFIG_PTHREAD_MUTEX_TYPES=y -# CONFIG_PTHREAD_MUTEX_ROBUST is not set -CONFIG_PTHREAD_MUTEX_UNSAFE=y -# CONFIG_PTHREAD_MUTEX_BOTH is not set -CONFIG_NPTHREAD_KEYS=4 -CONFIG_NPTHREAD_DESTRUCTOR_ITERATIONS=4 -# CONFIG_PTHREAD_CLEANUP is not set -# CONFIG_CANCELLATION_POINTS is not set - -# -# Performance Monitoring -# -# CONFIG_SCHED_CPULOAD is not set - -# -# Latency optimization -# -# CONFIG_SCHED_YIELD_OPTIMIZATION is not set - -# -# Files and I/O -# -CONFIG_DEV_CONSOLE=y -# CONFIG_FDCLONE_DISABLE is not set -# CONFIG_FDCLONE_STDIO is not set -CONFIG_SDCLONE_DISABLE=y -CONFIG_NFILE_DESCRIPTORS=64 -CONFIG_NFILE_STREAMS=8 -CONFIG_NAME_MAX=32 -CONFIG_PRIORITY_INHERITANCE=y -CONFIG_SEM_PREALLOCHOLDERS=16 -CONFIG_SEM_NNESTPRIO=16 - -# -# RTOS hooks -# -CONFIG_BOARD_INITIALIZE=y -CONFIG_BOARD_INITTHREAD=y -CONFIG_BOARD_INITTHREAD_STACKSIZE=4096 -CONFIG_BOARD_INITTHREAD_PRIORITY=240 -# CONFIG_SCHED_STARTHOOK is not set -CONFIG_SCHED_ATEXIT=y -CONFIG_SCHED_ONEXIT=y - -# -# Signal Numbers -# -CONFIG_SIG_SIGUSR1=1 -CONFIG_SIG_SIGUSR2=2 -CONFIG_SIG_SIGALARM=3 -CONFIG_SIG_SIGCHLD=4 -CONFIG_SIG_SIGBM_STATE=15 -CONFIG_SIG_SIGCONDTIMEDOUT=16 -CONFIG_SIG_SIGWORK=17 - -# -# POSIX Message Queue Options -# -CONFIG_PREALLOC_MQ_MSGS=4 -CONFIG_MQ_MAXMSGSIZE=600 - -# -# Stack size information -# -CONFIG_IDLETHREAD_STACKSIZE=8192 -CONFIG_USERMAIN_STACKSIZE=2048 -# CONFIG_MPU_STACKGAURD is not set -CONFIG_PTHREAD_STACK_MIN=256 -CONFIG_PTHREAD_STACK_DEFAULT=2048 -CONFIG_LOG_DUMP=y -CONFIG_LOG_DUMP_PRIO=200 -CONFIG_LOG_DUMP_CHUNK_SIZE=4096 -CONFIG_LOG_DUMP_MAX_SIZE=262144 -CONFIG_LOG_DUMP_MEMCHECK_SIZE=1024 -CONFIG_LOG_DUMP_MAX_FREE_HEAP=20 -CONFIG_LOG_DUMP_NUMBUFS=2 -# CONFIG_LOG_DUMP_DEBUG_DETECT_HANG is not set - -# -# Device Drivers -# -# CONFIG_DISABLE_POLL is not set -CONFIG_DEV_NULL=y -CONFIG_DEV_URANDOM=y -CONFIG_DEV_URANDOM_XORSHIFT128=y -# CONFIG_DEV_URANDOM_CONGRUENTIAL is not set -CONFIG_DEV_ZERO=y -# CONFIG_VIRTKEY is not set -# CONFIG_DRVR_WRITEBUFFER is not set -# CONFIG_DRVR_READAHEAD is not set -# CONFIG_CAN is not set -# CONFIG_ARCH_HAVE_PWM_PULSECOUNT is not set -# CONFIG_ARCH_HAVE_PWM_MULTICHAN is not set -# CONFIG_PWM is not set -# CONFIG_ARCH_HAVE_I2CRESET is not set -CONFIG_I2C=y -# CONFIG_I2C_SLAVE is not set -CONFIG_I2C_USERIO=y -CONFIG_I2C_TRANSFER=y -CONFIG_I2C_POLLED=y -# CONFIG_I2C_TRACE is not set -# CONFIG_I2C_WRITEREAD is not set -CONFIG_SPI=y -CONFIG_SPI_USERIO=y -# CONFIG_SPI_OWNBUS is not set -CONFIG_SPI_EXCHANGE=y -# CONFIG_SPI_CMDDATA is not set -# CONFIG_SPI_BITBANG is not set -# CONFIG_MIPI_DSI is not set -# CONFIG_GPIO is not set -CONFIG_I2S=y -CONFIG_AUDIO_DEVICES=y -CONFIG_AUDIO_MAX_INPUT_CARD_NUM=2 -CONFIG_AUDIO_MAX_OUTPUT_CARD_NUM=2 -CONFIG_AUDIO_MAX_DEVICE_NUM=3 -CONFIG_AUDIO_PROCESSING_FEATURES=y - -# -# Audio Processing Features -# -CONFIG_AUDIO_SPEECH_DETECT_FEATURES=y -CONFIG_AUDIO_KEYWORD_DETECT=y -# CONFIG_AUDIO_ENDPOINT_DETECT is not set -# CONFIG_AUDIO_I2SCHAR is not set -# CONFIG_AUDIO_ALC5658 is not set -# CONFIG_AUDIO_NULL is not set -# CONFIG_AUDIO_CX20921 is not set -# CONFIG_AUDIO_ALC1019 is not set -CONFIG_AUDIO_SYU645B=y -CONFIG_AUDIO_NDP120=y -# CONFIG_AUDIO_TAS5749 is not set -# CONFIG_DRIVERS_VIDEO is not set - -# -# AI SoC devices -# -CONFIG_NDP120=y -CONFIG_NDP120_AEC_SUPPORT=y - -# -# LCD Driver Support -# -# CONFIG_LCD is not set -CONFIG_BCH=y -CONFIG_RTC=y -# CONFIG_RTC_DATETIME is not set -# CONFIG_RTC_HIRES is not set -# CONFIG_RTC_ALARM is not set -CONFIG_RTC_DRIVER=y -# CONFIG_RTC_IOCTL is not set -CONFIG_WATCHDOG=y -CONFIG_WATCHDOG_DEVPATH="/dev/watchdog0" -# CONFIG_WATCHDOG_FOR_IRQ is not set -# CONFIG_TIMER is not set -CONFIG_MMINFO=y -CONFIG_PRODCONFIG=y -# CONFIG_ANALOG is not set -# CONFIG_DRIVERS_OS_API_TEST is not set -# CONFIG_NETDEVICES is not set -CONFIG_PIPES=y -CONFIG_DEV_PIPE_SIZE=1024 -# CONFIG_POWER is not set -CONFIG_SERIAL=y -# CONFIG_DEV_LOWCONSOLE is not set -# CONFIG_SERIAL_REMOVABLE is not set -CONFIG_SERIAL_CONSOLE=y -# CONFIG_16550_UART is not set -# CONFIG_ARCH_HAVE_UART is not set -CONFIG_ARCH_HAVE_UART0=y -CONFIG_ARCH_HAVE_UART1=y -# CONFIG_ARCH_HAVE_UART2 is not set -# CONFIG_ARCH_HAVE_UART3 is not set -CONFIG_ARCH_HAVE_UART4=y -# CONFIG_ARCH_HAVE_UART5 is not set -# CONFIG_ARCH_HAVE_UART6 is not set -# CONFIG_ARCH_HAVE_UART7 is not set -# CONFIG_ARCH_HAVE_UART8 is not set -# CONFIG_ARCH_HAVE_SCI0 is not set -# CONFIG_ARCH_HAVE_SCI1 is not set -# CONFIG_ARCH_HAVE_USART0 is not set -# CONFIG_ARCH_HAVE_USART1 is not set -# CONFIG_ARCH_HAVE_USART2 is not set -# CONFIG_ARCH_HAVE_USART3 is not set -# CONFIG_ARCH_HAVE_USART4 is not set -# CONFIG_ARCH_HAVE_USART5 is not set -# CONFIG_ARCH_HAVE_USART6 is not set -# CONFIG_ARCH_HAVE_USART7 is not set -# CONFIG_ARCH_HAVE_USART8 is not set -# CONFIG_ARCH_HAVE_OTHER_UART is not set - -# -# USART Configuration -# -# CONFIG_OTHER_UART_SERIALDRIVER is not set -CONFIG_MCU_SERIAL=y -CONFIG_STANDARD_SERIAL=y -CONFIG_SERIAL_NPOLLWAITERS=2 -# CONFIG_SERIAL_IFLOWCONTROL is not set -# CONFIG_SERIAL_OFLOWCONTROL is not set -# CONFIG_SERIAL_TIOCSERGSTRUCT is not set -CONFIG_ARCH_HAVE_SERIAL_TERMIOS=y -CONFIG_SERIAL_TERMIOS=y -# CONFIG_UART0_SERIAL_CONSOLE is not set -# CONFIG_UART1_SERIAL_CONSOLE is not set -CONFIG_UART4_SERIAL_CONSOLE=y -# CONFIG_OTHER_SERIAL_CONSOLE is not set -# CONFIG_NO_SERIAL_CONSOLE is not set - -# -# UART0 Configuration -# -CONFIG_UART0_RXBUFSIZE=1024 -CONFIG_UART0_TXBUFSIZE=1024 -CONFIG_UART0_BAUD=115200 -CONFIG_UART0_BITS=8 -CONFIG_UART0_PARITY=0 -CONFIG_UART0_2STOP=0 -# CONFIG_UART0_IFLOWCONTROL is not set -# CONFIG_UART0_OFLOWCONTROL is not set -# CONFIG_UART_SERIALDRIVER is not set -# CONFIG_UART0_SERIALDRIVER is not set -# CONFIG_UART1_SERIALDRIVER is not set -# CONFIG_UART2_SERIALDRIVER is not set -# CONFIG_UART3_SERIALDRIVER is not set -# CONFIG_UART4_SERIALDRIVER is not set -# CONFIG_UART5_SERIALDRIVER is not set -# CONFIG_UART6_SERIALDRIVER is not set -# CONFIG_UART7_SERIALDRIVER is not set -# CONFIG_UART8_SERIALDRIVER is not set -CONFIG_UART1_RXBUFSIZE=1024 -CONFIG_UART1_TXBUFSIZE=1024 -CONFIG_UART1_BAUD=115200 -CONFIG_UART1_BITS=8 -CONFIG_UART1_PARITY=0 -CONFIG_UART1_2STOP=0 -# CONFIG_UART1_IFLOWCONTROL is not set -# CONFIG_UART1_OFLOWCONTROL is not set -CONFIG_UART4_RXBUFSIZE=1024 -CONFIG_UART4_TXBUFSIZE=1024 -CONFIG_UART4_BAUD=115200 -CONFIG_UART4_BITS=8 -CONFIG_UART4_PARITY=0 -CONFIG_UART4_2STOP=0 -# CONFIG_UART4_IFLOWCONTROL is not set -# CONFIG_UART4_OFLOWCONTROL is not set -# CONFIG_LPUART_SERIALDRIVER is not set -# CONFIG_LPUART0_SERIALDRIVER is not set -# CONFIG_LPUART1_SERIALDRIVER is not set -# CONFIG_LPUART2_SERIALDRIVER is not set -# CONFIG_LPUART3_SERIALDRIVER is not set -# CONFIG_LPUART4_SERIALDRIVER is not set -# CONFIG_LPUART5_SERIALDRIVER is not set -# CONFIG_LPUART6_SERIALDRIVER is not set -# CONFIG_LPUART7_SERIALDRIVER is not set -# CONFIG_LPUART8_SERIALDRIVER is not set - -# -# UART1 Configuration -# - -# -# UART4 Configuration -# -# CONFIG_SENSOR is not set -# CONFIG_USBDEV is not set -# CONFIG_USBHOST is not set -# CONFIG_FOTA_DRIVER is not set - -# -# System Logging -# -# CONFIG_RAMLOG is not set -# CONFIG_SYSLOG_CONSOLE is not set - -# -# T-trace -# -# CONFIG_TTRACE is not set -# CONFIG_IOTDEV is not set - -# -# Wireless Device Options -# -CONFIG_DRIVERS_WIRELESS=y -CONFIG_DRIVERS_BLUETOOTH=y -# CONFIG_DRIVERS_BR_EDR is not set -CONFIG_DRIVERS_BLE=y -# CONFIG_VIRTUAL_BLE is not set -CONFIG_RTK_BLE=y -# CONFIG_OTP is not set -CONFIG_SECURITY_LINK_DRV=y -CONFIG_SECURITY_LINK=y - -# -# Networking Support -# -CONFIG_ARCH_HAVE_NET=y -# CONFIG_ARCH_HAVE_PHY is not set -CONFIG_NET=y -CONFIG_NET_LWIP=y - -# -# LwIP options -# -CONFIG_NET_IPv4=y -CONFIG_NET_IP_DEFAULT_TTL=255 -# CONFIG_NET_IP_FORWARD is not set -CONFIG_NET_IP_OPTIONS_ALLOWED=y -CONFIG_NET_IP_FRAG=y -CONFIG_NET_IP_REASSEMBLY=y -CONFIG_NET_IPV4_REASS_MAX_PBUFS=60 -CONFIG_NET_IPV4_REASS_MAXAGE=5 -CONFIG_NET_ICMP=y -CONFIG_NET_ICMP_TTL=255 -# CONFIG_NET_BROADCAST_PING is not set -# CONFIG_NET_MULTICAST_PING4 is not set -CONFIG_NET_LWIP_IGMP=y -CONFIG_NET_LWIP_MEMP_NUM_IGMP_GROUP=8 -CONFIG_NET_ARP=y -CONFIG_NET_ARP_TABLESIZE=10 -CONFIG_NET_ARP_QUEUEING=y -CONFIG_NET_ETHARP_TRUST_IP_MAC=y -CONFIG_NET_ETH_PAD_SIZE=0 -CONFIG_NET_ARP_STATIC_ENTRIES=y -CONFIG_NET_UDP=y -# CONFIG_NET_NETBUF_RECVINFO is not set -CONFIG_NET_UDP_TTL=255 -# CONFIG_NET_UDPLITE is not set -CONFIG_NET_TCP=y -CONFIG_NET_TCP_TTL=255 -CONFIG_NET_TCP_WND=26280 -# CONFIG_NET_WND_SCALE is not set -CONFIG_NET_TCP_MAXRTX=7 -CONFIG_NET_TCP_SYNMAXRTX=7 -CONFIG_NET_TCP_QUEUE_OOSEQ=y -CONFIG_NET_TCP_MSS=1460 -CONFIG_NET_TCP_CALCULATE_EFF_SEND_MSS=y -CONFIG_NET_TCP_SND_BUF=20440 -CONFIG_NET_TCP_SND_QUEUELEN=84 -CONFIG_NET_TCP_OOSEQ_MAX_BYTES=0 -CONFIG_NET_TCP_OOSEQ_MAX_PBUFS=0 -# CONFIG_NET_TCP_LISTEN_BACKLOG is not set -CONFIG_NET_TCP_OVERSIZE=1460 -# CONFIG_NET_TCP_TIMESTAMPS is not set -CONFIG_NET_TCP_WND_UPDATE_THRESHOLD=20440 -CONFIG_NET_IPv6=y -CONFIG_NET_IPv6_NUM_ADDRESSES=3 -# CONFIG_NET_IPv6_FORWARD is not set -# CONFIG_NET_IPv6_FRAG is not set -CONFIG_NET_IPv6_REASS=y -CONFIG_NET_IPV6_REASS_MAXAGE=60 -CONFIG_NET_IPv6_SEND_ROUTER_SOLICIT=y -CONFIG_NET_IPv6_AUTOCONFIG=y -CONFIG_NET_IPv6_DUP_DETECT_ATTEMPTS=1 -# CONFIG_NET_IPv6_PMTU_FOR_MULTICAST is not set - -# -# Neighbor Discovery (RFC 4861) -# -CONFIG_NET_IPv6_ND=y -CONFIG_NET_IPv6_ND_QUEUEING=y -CONFIG_NET_IPv6_ND_QUEUE=20 -CONFIG_NET_IPv6_ND_NUM_NEIGHBORS=10 -CONFIG_NET_IPv6_ND_NUM_DESTINATIONS=10 -CONFIG_NET_IPv6_ND_NUM_PREFIXES=5 -CONFIG_NET_IPv6_ND_NUM_ROUTERS=3 -CONFIG_NET_IPv6_ND_MAX_MULTICAST_SOLICIT=3 -CONFIG_NET_IPv6_ND_MAX_UNICAST_SOLICIT=3 -CONFIG_NET_IPv6_ND_MAX_SOLICIT_INTERVAL=4000 -CONFIG_NET_IPv6_ND_REACHABLE_TIME=30000 -CONFIG_NET_IPv6_ND_RETRANS_TIMER=1000 -CONFIG_NET_IPv6_ND_DELAY_FIRST_PROBE_TIME=5000 -CONFIG_NET_IPv6_ND_ALLOW_RA_UPDATES=y -CONFIG_NET_IPv6_ND_TCP_REACHABILITY_HINTS=y -CONFIG_NET_IPv6_ND_RDNSS_MAX_DNS_SERVERS=0 - -# -# ICMPv6 (RFC 4443) -# -CONFIG_NET_IPv6_ICMP=y -CONFIG_NET_IPv6_ICMP_DATASIZE=8 -CONFIG_NET_IPv6_ICMP_HL=255 -# CONFIG_NET_MULTICAST_PING6 is not set -CONFIG_NET_IPv6_MLD=y -CONFIG_NET_IPv6_MLD_GROUP=4 -# CONFIG_NET_IPv6_DHCP is not set - -# -# Socket support -# -CONFIG_NET_SOCKET=y -CONFIG_NBSDSOCKET_DESCRIPTORS=20 -CONFIG_NET_TCP_KEEPALIVE=y -CONFIG_NET_RAW=y -# CONFIG_NET_SOCKET_OPTION_BROADCAST is not set -# CONFIG_NET_RANDOMIZE_INITIAL_LOCAL_PORTS is not set -CONFIG_NET_SO_SNDTIMEO=y -CONFIG_NET_SO_RCVTIMEO=y -CONFIG_NET_SO_RCVBUF=y -CONFIG_NET_SO_REUSE=y -# CONFIG_NET_SO_REUSE_RXTOALL is not set - -# -# LWIP Mailbox Configurations -# -CONFIG_NET_TCPIP_MBOX_SIZE=64 -CONFIG_NET_DEFAULT_ACCEPTMBOX_SIZE=64 -CONFIG_NET_DEFAULT_RAW_RECVMBOX_SIZE=64 -CONFIG_NET_DEFAULT_TCP_RECVMBOX_SIZE=64 -CONFIG_NET_DEFAULT_UDP_RECVMBOX_SIZE=64 - -# -# Memory Configurations -# -CONFIG_NET_MEM_ALIGNMENT=4 -# CONFIG_NET_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT is not set -# CONFIG_NET_MEM_LIBC_MALLOC is not set -CONFIG_NET_MEMP_MEM_MALLOC=y -# CONFIG_NET_MEM_USE_POOLS is not set -CONFIG_NET_MEM_SIZE=34816 - -# -# LWIP Task Configurations -# -# CONFIG_NET_TCPIP_CORE_LOCKING is not set -# CONFIG_NET_TCPIP_CORE_LOCKING_INPUT is not set -CONFIG_NET_TCPIP_THREAD_NAME="LWIP_TCP/IP" -CONFIG_NET_TCPIP_THREAD_PRIO=105 -CONFIG_NET_TCPIP_THREAD_STACKSIZE=4096 -CONFIG_NET_COMPAT_MUTEX=y -CONFIG_NET_SYS_LIGHTWEIGHT_PROT=y -CONFIG_NET_DEFAULT_THREAD_NAME="lwIP" -CONFIG_NET_DEFAULT_THREAD_PRIO=1 -CONFIG_NET_DEFAULT_THREAD_STACKSIZE=0 - -# -# Debug Options for Network -# -# CONFIG_NET_LWIP_ASSERT is not set -CONFIG_NET_LWIP_ERROR=y -# CONFIG_NET_LWIP_DEBUG is not set - -# -# Enable Statistics -# -CONFIG_NET_STATS=y -CONFIG_NET_STATS_DISPLAY=y -CONFIG_NET_LINK_STATS=y -CONFIG_NET_ETHARP_STATS=y -CONFIG_NET_IP_STATS=y -# CONFIG_NET_IPFRAG_STATS is not set -# CONFIG_NET_ICMP_STATS is not set -CONFIG_NET_UDP_STATS=y -CONFIG_NET_TCP_STATS=y -CONFIG_NET_MEM_STATS=y -# CONFIG_NET_SYS_STATS is not set -# CONFIG_NET_IPv6_STATS is not set -# CONFIG_NET_IPv6_ICMP_STATS is not set -# CONFIG_NET_IPv6_MLD_STATS is not set -# CONFIG_NET_IPv6_ND_STATS is not set -# CONFIG_NET_LWIP_VLAN is not set -# CONFIG_NET_LWIP_SLIP_INTERFACE is not set -# CONFIG_NET_LWIP_PPP_SUPPORT is not set -# CONFIG_NET_LWIP_SNMP is not set -CONFIG_NET_LWIP_NETDB=y -CONFIG_NET_DNS_TABLE_SIZE=4 -CONFIG_NET_DNS_MAX_NAME_LENGTH=256 -CONFIG_NET_DNS_MAX_SERVERS=3 -# CONFIG_NET_DNS_DOES_NAME_CHECK is not set -CONFIG_NET_DNS_SECURE=4 -CONFIG_NET_DNS_MAX_TTL=604800 -CONFIG_NET_DNS_MAX_RETRIES=4 -# CONFIG_NET_DNS_LOCAL_HOSTLIST is not set -# CONFIG_NET_LWIP_SINGLE_PBUF is not set - -# -# Driver buffer configuration -# -CONFIG_NET_ETH_MTU=1500 -CONFIG_NET_GUARDSIZE=2 - -# -# Data link support -# -# CONFIG_NET_MULTILINK is not set -CONFIG_NET_ETHERNET=y - -# -# Protocols -# - -# -# Dynamic Host Configuration Protocol (DHCP) -# -# CONFIG_NET_DHCP is not set -CONFIG_NET_LWIP_DHCP=y -CONFIG_LWIP_DHCP_HOSTNAME=y -CONFIG_NETUTILS_DHCPC=y -CONFIG_LWIP_DHCPC=y -CONFIG_LWIP_DHCPC_TIMEOUT=10000 -CONFIG_NETUTILS_DHCPD=y -CONFIG_LWIP_DHCPS=y -CONFIG_LWIP_DHCPS_LEASE_DEF=120 -CONFIG_LWIP_DHCPS_SERVER_IP="192.168.47.1" -CONFIG_LWIP_DHCPS_SERVER_NETMASK="255.255.255.0" -CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 -CONFIG_LWIP_DHCPS_UNICAST=y -# CONFIG_LWIP_DHCPS_ADDITIONAL_DNS is not set -# CONFIG_NETUTILS_XMLRPC is not set -# CONFIG_NETUTILS_NTPCLIENT is not set -CONFIG_NETUTILS_WEBSERVER=y -CONFIG_NETUTILS_WEBSERVER_MAX_CLIENT_HANDLER=1 -# CONFIG_NETUTILS_WEBSERVER_LOGD is not set -# CONFIG_NETUTILS_WEBSERVER_LOGE is not set -CONFIG_NETUTILS_WEBSERVER_MAX_CLIENT_RCV_TIMEOUT=360 -CONFIG_NETUTILS_WEBSERVER_MIN_CLIENT_RCV_TIMEOUT=50 -# CONFIG_NETUTILS_FTPC is not set -# CONFIG_NETUTILS_MDNS is not set -# CONFIG_NETUTILS_WEBCLIENT is not set -# CONFIG_NETUTILS_FTPD is not set -# CONFIG_NETUTILS_WEBSOCKET is not set -# CONFIG_NETUTILS_LIBCOAP is not set -# CONFIG_NETUTILS_TFTPC is not set -# CONFIG_NETUTILS_TELNETD is not set -# CONFIG_NETUTILS_SMTP is not set -# CONFIG_GRPC is not set -# CONFIG_NETUTILS_MQTT is not set -CONFIG_NET_SECURITY_TLS=y -CONFIG_TLS_WITH_HW_ACCEL=y -CONFIG_TLS_MPI_MAX_SIZE=512 -# CONFIG_TLS_HAVE_NO_TIME_DATE is not set - -# -# HW Options -# -CONFIG_TLS_HW_RNG=y -CONFIG_TLS_HW_DH_PARAM=y -CONFIG_TLS_HW_ECDH_PARAM=y -CONFIG_TLS_HW_ECDSA_VERIFICATION=y - -# -# Wireless -# -CONFIG_WIFI_MANAGER=y -# CONFIG_SELECT_WLAN_VIRTUAL is not set -# CONFIG_SELECT_SCSC_WLAN is not set -# CONFIG_SELECT_RTK_WLAN is not set -CONFIG_SELECT_PROPRIETARY_WLAN=y -CONFIG_SELECT_PROPRIETARY_SUPPLICANT=y -# CONFIG_WIFI_MANAGER_SAVE_CONFIG is not set -CONFIG_WIFIMGR_SOFTAP_IFNAME="wlan0" -CONFIG_WIFIMGR_STA_IFNAME="wlan0" -# CONFIG_WIFIMGR_DISABLE_DHCPC is not set -# CONFIG_WIFIMGR_DISABLE_DHCPS is not set -CONFIG_DISABLE_EXTERNAL_AUTOCONNECT=y - -# -# Bluetooth -# -CONFIG_BLE_MANAGER=y - -# -# Network utilities -# -CONFIG_NETUTILS_NETLIB=y -CONFIG_NET_NETMON=y -CONFIG_NETUTILS_STATS_DISPLAY_TOOL=y - -# -# Network Manager -# -CONFIG_NET_NETMGR=y -# CONFIG_NET_NETMGR_ZEROCOPY is not set -# CONFIG_NET_TASK_BIND is not set - -# -# Network Device Operations -# -# CONFIG_NETDEV_PHY_IOCTL is not set -CONFIG_LWNL80211=y -# CONFIG_DEBUG_LWNL80211_ERROR is not set -# CONFIG_DEBUG_LWNL80211_VENDOR_DRV_ERROR is not set -CONFIG_NET_LOOPBACK_INTERFACE=y - -# -# Audio Support -# -CONFIG_AUDIO=y -# CONFIG_AUDIO_MULTI_SESSION is not set - -# -# Audio Buffer Configuration -# -# CONFIG_AUDIO_LARGE_BUFFERS is not set -CONFIG_AUDIO_NUM_BUFFERS=2 -CONFIG_AUDIO_BUFSIZE=2048 -# CONFIG_AUDIO_DRIVER_SPECIFIC_BUFFERS is not set - -# -# Exclude Specific Audio Features -# -# CONFIG_AUDIO_EXCLUDE_GAIN is not set -# CONFIG_AUDIO_EXCLUDE_VOLUME is not set -# CONFIG_AUDIO_EXCLUDE_BALANCE is not set -CONFIG_AUDIO_EXCLUDE_EQUALIZER=y -# CONFIG_AUDIO_EXCLUDE_TONE is not set -# CONFIG_AUDIO_EXCLUDE_PAUSE_RESUME is not set -# CONFIG_AUDIO_EXCLUDE_STOP is not set -# CONFIG_AUDIO_EXCLUDE_FFORWARD is not set -CONFIG_AUDIO_EXCLUDE_REWIND=y -# CONFIG_AUDIO_CUSTOM_DEV_PATH is not set - -# -# Media Support -# -CONFIG_MEDIA=y -CONFIG_MEDIA_PLAYER=y -CONFIG_MEDIA_PLAYER_STACKSIZE=4096 -CONFIG_MEDIA_PLAYER_OBSERVER_STACKSIZE=2048 -CONFIG_INPUT_DATASOURCE_STACKSIZE=4096 -CONFIG_HTTPSOURCE_DOWNLOAD_BUFFER_SIZE=4096 -CONFIG_HTTPSOURCE_DOWNLOAD_BUFFER_THRESHOLD=2048 -CONFIG_HTTPSOURCE_DOWNLOAD_STACKSIZE=8192 -CONFIG_DATASOURCE_PREPARSE_BUFFER_SIZE=4096 -CONFIG_CONTAINER_FORMAT=y - -# -# Containers for multi-media -# -CONFIG_CONTAINER_MPEG2TS=y -# CONFIG_CONTAINER_MP4 is not set -# CONFIG_CONTAINER_OGG is not set - -# -# Containers exclusive to audio -# -# CONFIG_CONTAINER_WAV is not set -CONFIG_DEMUX_BUFFER_SIZE=4096 -CONFIG_MEDIA_RECORDER=y -CONFIG_MEDIA_RECORDER_STACKSIZE=12288 -CONFIG_MEDIA_RECORDER_OBSERVER_STACKSIZE=2048 -CONFIG_OUTPUT_DATASOURCE_STACKSIZE=4096 -CONFIG_MEDIA_VOICE_SPEECH_DETECTOR=y - -# -# Speech Detector Options -# -# CONFIG_SPEECH_DETECTOR_LISTENER_STACKSIZE is not set -# CONFIG_SPEECH_DETECTOR_STACKSIZE is not set -# CONFIG_MEDIA_SOFTWARE_EPD is not set -# CONFIG_MEDIA_HARDWARE_EPD is not set -# CONFIG_MEDIA_SOFTWARE_KD is not set -CONFIG_MEDIA_HARDWARE_KD=y -CONFIG_AUDIO_RESAMPLER_BUFSIZE=4096 -CONFIG_FILE_DATASOURCE_STREAM_BUFFER_SIZE=4096 -CONFIG_FILE_DATASOURCE_STREAM_BUFFER_THRESHOLD=2048 -CONFIG_BUFFER_DATASOURCE_STREAM_BUFFER_SIZE=4096 -CONFIG_BUFFER_DATASOURCE_STREAM_BUFFER_THRESHOLD=1 -CONFIG_HANDLER_STREAM_BUFFER_SIZE=4096 -CONFIG_HANDLER_STREAM_BUFFER_THRESHOLD=2048 -CONFIG_AUDIO_CODEC=y -CONFIG_AUDIO_CODEC_RINGBUFFER_SIZE=16384 -# CONFIG_CODEC_AAC is not set -CONFIG_CODEC_MP3=y - -# -# File Systems -# -# CONFIG_DISABLE_MOUNTPOINT is not set -# CONFIG_DISABLE_PSEUDOFS_OPERATIONS is not set -CONFIG_FS_READABLE=y -CONFIG_FS_WRITABLE=y -# CONFIG_RESOURCE_FS is not set -# CONFIG_FS_AIO is not set -# CONFIG_FS_NAMED_SEMAPHORES is not set -CONFIG_FS_MQUEUE_MPATH="/var/mqueue" -CONFIG_FS_SMARTFS=y - -# -# SMARTFS options -# -CONFIG_SMARTFS_ERASEDSTATE=0xff -CONFIG_SMARTFS_MAXNAMLEN=32 -# CONFIG_SMARTFS_MULTI_ROOT_DIRS is not set -CONFIG_SMARTFS_ALIGNED_ACCESS=y -# CONFIG_SMARTFS_DYNAMIC_HEADER is not set -CONFIG_SMARTFS_ENTRY_TIMESTAMP=y -CONFIG_FS_PROCFS=y -CONFIG_FS_AUTOMOUNT_PROCFS=y - -# -# Exclude individual procfs entries -# -# CONFIG_FS_PROCFS_EXCLUDE_PROCESS is not set -# CONFIG_FS_PROCFS_EXCLUDE_UPTIME is not set -# CONFIG_FS_PROCFS_EXCLUDE_VERSION is not set -# CONFIG_FS_PROCFS_EXCLUDE_IRQS is not set -# CONFIG_FS_PROCFS_EXCLUDE_MTD is not set -# CONFIG_FS_PROCFS_EXCLUDE_PARTITIONS is not set -# CONFIG_FS_PROCFS_EXCLUDE_SMARTFS is not set -# CONFIG_FS_ROMFS is not set -CONFIG_FS_TMPFS=y - -# -# TMPFS options -# -CONFIG_FS_AUTOMOUNT_TMPFS=y -CONFIG_FS_TMPFS_BLOCKSIZE=512 -CONFIG_FS_TMPFS_DIRECTORY_ALLOCGUARD=64 -CONFIG_FS_TMPFS_DIRECTORY_FREEGUARD=128 -CONFIG_FS_TMPFS_FILE_ALLOCGUARD=512 -CONFIG_FS_TMPFS_FILE_FREEGUARD=1024 - -# -# Block Driver Configurations -# -# CONFIG_RAMDISK is not set - -# -# MTD Configuration -# -CONFIG_MTD=y -CONFIG_MTD_PARTITION=y -CONFIG_MTD_PARTITION_NAMES=y -# CONFIG_MTD_PROGMEM is not set -CONFIG_MTD_FTL=y - -# -# MTD_FTL Configurations -# -# CONFIG_MTD_CONFIG is not set -CONFIG_MTD_BYTE_WRITE=y - -# -# MTD Device Drivers -# -# CONFIG_MTD_M25P is not set -# CONFIG_RAMMTD is not set -CONFIG_MTD_SMART=y - -# -# SMART Device options -# -CONFIG_MTD_SMART_SECTOR_SIZE=1024 -CONFIG_MTD_SMART_WEAR_LEVEL=y -CONFIG_MTD_SMART_ENABLE_CRC=y -# CONFIG_SMART_CRC_8 is not set -CONFIG_SMART_CRC_16=y -CONFIG_MTD_SMART_JOURNALING=y -# CONFIG_MTD_SMART_SECTOR_ERASE_DEBUG is not set -# CONFIG_MTD_SMART_ALLOC_DEBUG is not set -# CONFIG_MTD_W25 is not set -# CONFIG_MTD_JEDEC is not set - -# -# System Logging -# -# CONFIG_SYSLOG is not set -# CONFIG_SYSLOG_TIMESTAMP is not set -CONFIG_GENERATE_FS_IMAGE=y - -# -# Database -# -# CONFIG_ARASTORAGE is not set - -# -# AI Framework -# -# CONFIG_AIFW is not set - -# -# AraUI Framework -# -# CONFIG_UI is not set - -# -# Memory Management -# -CONFIG_MM_KERNEL_HEAP=y -# CONFIG_REALLOC_DISABLE_NEIGHBOR_EXTENSION is not set -# CONFIG_MM_SMALL is not set -CONFIG_KMM_REGIONS=1 -CONFIG_KMM_NHEAPS=1 -# CONFIG_GRAN is not set -# CONFIG_MM_PGALLOC is not set -CONFIG_MM_ASSERT_ON_FAIL=y -# CONFIG_MM_DUMP_CORRPUTED_HEAP is not set - -# -# Work Queue Support -# -CONFIG_SCHED_WORKQUEUE=y - -# -# Kernel Work Queue -# -CONFIG_SCHED_HPWORK=y -CONFIG_SCHED_HPWORKPRIORITY=201 -CONFIG_SCHED_HPWORKSTACKSIZE=8192 -CONFIG_SCHED_LPWORK=y -CONFIG_SCHED_LPNTHREADS=1 -CONFIG_SCHED_LPWORKPRIORITY=50 -CONFIG_SCHED_LPWORKPRIOMAX=176 -CONFIG_SCHED_LPWORKSTACKSIZE=2048 -# CONFIG_DEBUG_WORKQUEUE is not set - -# -# Power Management -# -CONFIG_PM=y -# CONFIG_PM_METRICS is not set -CONFIG_PM_NDOMAINS=32 -# CONFIG_PM_DVFS is not set -CONFIG_PM_TICKSUPPRESS=y -CONFIG_PM_TIMEDWAKEUP=y -CONFIG_PM_SLEEP_ENTRY_WAIT_MS=10 -CONFIG_PM_DOMAIN_NAME_SIZE=32 - -# -# Debug Options -# -CONFIG_DEBUG=y -CONFIG_DEBUG_ERROR=y -# CONFIG_DEBUG_WARN is not set -# CONFIG_DEBUG_VERBOSE is not set - -# -# Subsystem Debug Options -# -CONFIG_DEBUG_AUDIO=y -CONFIG_DEBUG_AUDIO_ERROR=y -CONFIG_DEBUG_BINMGR=y -CONFIG_DEBUG_BINMGR_ERROR=y -CONFIG_DEBUG_FS=y -CONFIG_DEBUG_FS_ERROR=y -# CONFIG_DEBUG_LIB is not set -# CONFIG_DEBUG_LOGDUMP is not set -# CONFIG_DEBUG_MM is not set -# CONFIG_DEBUG_NET is not set -CONFIG_DEBUG_BLE=y -CONFIG_DEBUG_BLE_ERROR=y -# CONFIG_DEBUG_PM is not set -# CONFIG_DEBUG_SCHED is not set -# CONFIG_DEBUG_TASH is not set - -# -# Framework Debug Options -# -CONFIG_DEBUG_MEDIA=y -CONFIG_DEBUG_MEDIA_ERROR=y -# CONFIG_DEBUG_REBOOT_REASON is not set - -# -# OS Function Debug Options -# -CONFIG_ARCH_HAVE_HEAPCHECK=y -# CONFIG_DEBUG_HEAP is not set -CONFIG_DEBUG_MM_HEAPINFO=y -# CONFIG_DEBUG_CHECK_FRAGMENTATION is not set -# CONFIG_DEBUG_IRQ is not set - -# -# Driver Debug Options -# -# CONFIG_DEBUG_ANALOG is not set -# CONFIG_DEBUG_I2S is not set -# CONFIG_DEBUG_RTC is not set -# CONFIG_DEBUG_SPI is not set -# CONFIG_DEBUG_WATCHDOG is not set - -# -# System Debug Options -# -# CONFIG_DEBUG_SYSTEM is not set - -# -# Stack Debug Options -# -CONFIG_ARCH_HAVE_STACKCHECK=y -CONFIG_STACK_COLORATION=y - -# -# Build Debug Options -# -CONFIG_DEBUG_SYMBOLS=y -# CONFIG_FRAME_POINTER is not set - -# -# Logger Module -# -# CONFIG_LOGM is not set - -# -# Built-in Libraries -# - -# -# Standard C Library Options -# -CONFIG_STDIO_BUFFER_SIZE=64 -CONFIG_STDIO_LINEBUFFER=y -CONFIG_NUNGET_CHARS=2 -CONFIG_LIB_HOMEDIR="/" -CONFIG_LIBM=y -# CONFIG_NOPRINTF_FIELDWIDTH is not set -CONFIG_LIBC_FLOATINGPOINT=y -CONFIG_LIBC_LONG_LONG=y -CONFIG_LIBC_FLOATPRECISION=6 -CONFIG_LIBC_SCANSET=y -# CONFIG_NOPRINTF_LONGLONG_TO_ASCII is not set -CONFIG_LIBC_IOCTL_VARIADIC=y -CONFIG_LIBC_WCHAR=y -CONFIG_LIBC_LOCALE=y -CONFIG_LIB_RAND_ORDER=1 -# CONFIG_EOL_IS_CR is not set -# CONFIG_EOL_IS_LF is not set -# CONFIG_EOL_IS_BOTH_CRLF is not set -CONFIG_EOL_IS_EITHER_CRLF=y -CONFIG_LIBC_STRERROR=y -# CONFIG_LIBC_STRERROR_SHORT is not set -# CONFIG_LIBC_PERROR_STDOUT is not set -CONFIG_LIBC_TMPDIR="/tmp" -CONFIG_LIBC_MAX_TMPFILE=32 -CONFIG_ARCH_LOWPUTC=y -CONFIG_LIBC_LOCALTIME=y -CONFIG_LIBC_TZ_MAX_TIMES=320 -CONFIG_LIBC_TZ_MAX_TYPES=20 -CONFIG_LIBC_TZDIR="/etc/zoneinfo" -# CONFIG_LIBC_DOWNLOAD_ZONEINFO is not set -CONFIG_LIB_SENDFILE_BUFSIZE=512 -# CONFIG_LIBC_ARCH_ELF is not set -CONFIG_ARCH_OPTIMIZED_FUNCTIONS=y -# CONFIG_ARCH_MEMCPY is not set -CONFIG_MEMCPY_VIK=y -CONFIG_MEMCPY_PRE_INC_PTRS=y -# CONFIG_MEMCPY_INDEXED_COPY is not set -# CONFIG_MEMCPY_64BIT is not set -# CONFIG_ARCH_MEMCMP is not set -# CONFIG_ARCH_MEMMOVE is not set -# CONFIG_ARCH_MEMSET is not set -CONFIG_MEMSET_OPTSPEED=y -# CONFIG_MEMSET_64BIT is not set -# CONFIG_ARCH_STPNCPY is not set -# CONFIG_ARCH_STRCHR is not set -# CONFIG_ARCH_STRCMP is not set -# CONFIG_ARCH_STRCPY is not set -# CONFIG_ARCH_STRNCPY is not set -# CONFIG_ARCH_STRLEN is not set -# CONFIG_ARCH_STRNLEN is not set -# CONFIG_ARCH_BZERO is not set -# CONFIG_LIB_ENVPATH is not set -CONFIG_LIB_HASHMAP=y - -# -# Program Execution Options -# -# CONFIG_LIBC_SYMTAB is not set - -# -# Basic CXX Support -# -CONFIG_C99_BOOL8=y -CONFIG_HAVE_CXX=y -# CONFIG_CXX_VERSION_11 is not set -CONFIG_CXX_VERSION_14=y -# CONFIG_CXX_VERSION_17 is not set -CONFIG_CXX_NEWLONG=y - -# -# LLVM C++ Library (libcxx) -# -CONFIG_LIBCXX=y -CONFIG_LIBCXX_EXCEPTION=y -CONFIG_LIBCXX_IOSTREAM_BUFSIZE=32 -CONFIG_LIBCXX_HAVE_LIBSUPCXX=y - -# -# External Libraries -# -# CONFIG_AVS_DEVICE_SDK is not set -# CONFIG_AWS_SDK is not set -# CONFIG_NETUTILS_CODECS is not set - -# -# CURL Options -# -CONFIG_ENABLE_CURL=y -# CONFIG_DISABLE_HTTP is not set -# CONFIG_USE_ZLIB is not set -# CONFIG_DISABLE_COOKIES is not set -CONFIG_DISABLE_DICT=y -CONFIG_DISABLE_FILE=y -CONFIG_DISABLE_FTP=y -CONFIG_DISABLE_TFTP=y -CONFIG_DISABLE_GOPHER=y -CONFIG_DISABLE_SCP=y -CONFIG_DISABLE_TELNET=y -CONFIG_DISABLE_LDAP=y -CONFIG_DISABLE_SMB=y -CONFIG_DISABLE_SMTP=y -CONFIG_DISABLE_POP3=y -CONFIG_DISABLE_PROXY=y -CONFIG_DISABLE_IMAP=y -CONFIG_DISABLE_RTSP=y -CONFIG_DISABLE_NTLM=y -# CONFIG_DISABLE_CRYPTO_AUTH is not set -CONFIG_CA_PATH="/rom" -CONFIG_CA_BUNDLE="/rom/curl-certificates.crt" -# CONFIG_CA_FALLBACK is not set -# CONFIG_CURL_DEBUG is not set -# CONFIG_ERROR_REPORT is not set -# CONFIG_GMOCK is not set -# CONFIG_ENABLE_IOTIVITY is not set -CONFIG_NETUTILS_JSON=y -# CONFIG_LIBTUV is not set -# CONFIG_PROTOBUF is not set -# CONFIG_LWM2M_WAKAAMA is not set -# CONFIG_WIFI_MBOX is not set -CONFIG_STRESS_TOOL=y -CONFIG_VOICE_SOFTWARE_EPD=y -CONFIG_VOICE_SOFTWARE_EPD_FRAMESIZE=256 -# CONFIG_EXTERNAL_VEC is not set -# CONFIG_LIB_LZMA is not set -CONFIG_LIB_MINIZ=y -# CONFIG_NANOPB is not set -# CONFIG_LIBSODIUM is not set -# CONFIG_OPENSSL_WRAPPER is not set -# CONFIG_STDK_IOT_CORE is not set -# CONFIG_EXTERNAL_TFMICRO is not set -# CONFIG_EXTERNAL_CMSIS_DSP is not set -# CONFIG_EXTERNAL_CMSIS_NN is not set - -# -# Binary Loader -# -# CONFIG_BINFMT_ENABLE is not set - -# -# Compression -# -CONFIG_COMPRESSION=y -CONFIG_COMPRESSION_TYPE=2 - -# -# Application Configuration -# - -# -# Application entry point list -# -# CONFIG_ENTRY_MANUAL is not set -CONFIG_ENTRY_HELLO=y -CONFIG_ENTRY_WAKEREC=y -CONFIG_USER_ENTRYPOINT="hello_main" -CONFIG_BUILTIN_APPS=y - -# -# Examples -# -# CONFIG_EXAMPLES_AVS_TEST is not set -# CONFIG_EXAMPLES_AWS is not set -# CONFIG_EXAMPLES_BLE_PERFS is not set -# CONFIG_EXAMPLES_BLE_RMC is not set -# CONFIG_EXAMPLES_BLE_TESTER is not set - -# -# Board Specific Demos -# -# CONFIG_EXAMPLES_AMEBA_MIPI is not set -# CONFIG_EXAMPLES_SSTORAGE is not set -# CONFIG_EXAMPLES_WIFICSI is not set -# CONFIG_EXAMPLES_CONNECT_TEST is not set -# CONFIG_EXAMPLES_CURLTEST is not set -# CONFIG_EXAMPLES_CXXTEST is not set -# CONFIG_EXAMPLES_DNSCLIENT_TEST is not set - -# -# dTLS -# -# CONFIG_EXAMPLES_DTLS_CLIENT is not set -# CONFIG_EXAMPLES_DTLS_SERVER is not set -# CONFIG_EXAMPLES_EEPROM_TEST is not set -# CONFIG_EXAMPLES_EVENTLOOP is not set -# CONFIG_EXAMPLES_FOTA_SAMPLE is not set -# CONFIG_FILESYSTEM_TEST is not set - -# -# gRPC -# -# CONFIG_EXAMPLES_HEAVY_SIGNAL_MESSAGE_TEST is not set -CONFIG_EXAMPLES_HELLO=y -# CONFIG_EXAMPLES_HELLOXX is not set -# CONFIG_EXAMPLES_IOTBUS_TEST is not set -# CONFIG_EXAMPLES_IOTJS_STARTUP is not set -# CONFIG_EXAMPLES_KERNEL_SAMPLE is not set -# CONFIG_EXAMPLES_KERNEL_UPDATE is not set -# CONFIG_EXAMPLES_LCD is not set - -# -# Libcoap -# -# CONFIG_EXAMPLES_LIBTUV is not set -# CONFIG_EXAMPLES_LOG_DUMP is not set -# CONFIG_EXAMPLES_LWNL_SAMPLE is not set -# CONFIG_EXAMPLES_MEDIAPLAYER is not set -# CONFIG_EXAMPLES_MEDIARECORDER is not set -# CONFIG_EXAMPLES_MEDIASTREAMER is not set -CONFIG_EXAMPLES_SOUNDPLAYER=y -# CONFIG_EXAMPLES_MEMORY_FRAGMENTATION_TEST is not set -# CONFIG_EXAMPLES_NETTEST is not set - -# -# Performance -# -# CONFIG_EXAMPLES_CTX_SWITCH_PERFORMANCE is not set -# CONFIG_EXAMPLES_HEAP_PERFORMANCE_TEST is not set -# CONFIG_EXAMPLES_SYSCALL_PERFORMANCE is not set -# CONFIG_EXAMPLES_TLS_BENCHMARK is not set -# CONFIG_EXAMPLES_TLS_HANDSHAKE is not set -# CONFIG_EXAMPLES_TLS_SECLINK is not set - -# -# Protocol Buffer -# -# CONFIG_EXAMPLES_REBOOT_REASON is not set -# CONFIG_EXAMPLES_RSSI_REPORT is not set - -# -# Security Test -# -# CONFIG_EXAMPLES_SECURITY_HAL_TEST is not set -# CONFIG_EXAMPLES_MBEDTLS_SELF_TEST is not set -# CONFIG_EXAMPLES_SECLINK_TEST is not set -# CONFIG_EXAMPLES_SECURITY_API_TEST is not set -# CONFIG_EXAMPLES_SECURITY_SEE_TEST is not set -# CONFIG_EXAMPLES_SECLINK_TOOL is not set -# CONFIG_EXAMPLES_SELECT_TEST is not set -# CONFIG_EXAMPLES_SENSORBOARD is not set -# CONFIG_EXAMPLES_SETJMP_TEST is not set -# CONFIG_EXAMPLES_SIMPLE_FILE_TRANSFER is not set - -# -# SmartFs Test Applications -# -# CONFIG_EXAMPLES_SMART is not set -# CONFIG_EXAMPLES_SMART_TEST is not set -# CONFIG_EXAMPLES_SMARTFS_POWERCUT is not set -# CONFIG_EXAMPLES_SPEECH_DETECTOR_TEST is not set -# CONFIG_EXAMPLES_ST_THINGS is not set -# CONFIG_EXAMPLES_TESTCASE is not set - -# -# TLS -# -# CONFIG_EXAMPLES_TLS_CLIENT is not set -# CONFIG_EXAMPLES_TLS_SELFTEST is not set -# CONFIG_EXAMPLES_TLS_SERVER is not set -# CONFIG_UART_HW_TEST is not set -# CONFIG_EXAMPLES_VIRTKEY is not set -CONFIG_EXAMPLES_WAKEREC=y -# CONFIG_EXAMPLES_WAVE_GEN is not set -# CONFIG_EXAMPLES_WEBSERVER is not set -# CONFIG_EXAMPLES_WEBSERVER_TEST is not set - -# -# Wifi Manager -# -# CONFIG_EXAMPLES_TAHI is not set -# CONFIG_EXAMPLES_WIFIMANAGER_TEST is not set - -# -# Platform-specific Support -# -# CONFIG_PLATFORM_CONFIGDATA is not set -CONFIG_HAVE_CXXINITIALIZE=y - -# -# Shell -# -CONFIG_TASH=y -CONFIG_TASH_MAX_STORE_COMMANDS=10 -# CONFIG_TASH_USLEEP is not set -CONFIG_TASH_REBOOT=y -# CONFIG_TASH_COMMAND_INTERFACE is not set -CONFIG_TASH_CMDTASK_STACKSIZE=8192 -CONFIG_TASH_CMDTASK_PRIORITY=100 -# CONFIG_TASH_SCRIPT is not set -# CONFIG_SECURED_TASH is not set - -# -# System Libraries and Add-Ons -# -# CONFIG_SYSTEM_CLE is not set -# CONFIG_SYSTEM_CUTERM is not set -# CONFIG_SYSTEM_FLASH_READ is not set -# CONFIG_SYSTEM_FOTA_HAL is not set -# CONFIG_SYSTEM_I2CTOOL is not set -# CONFIG_SYSTEM_INIFILE is not set -CONFIG_SYSTEM_PREAPP_INIT=y -CONFIG_SYSTEM_PREAPP_STACKSIZE=2048 -CONFIG_SYSTEM_IPERF=y -CONFIG_IPERF_PRIORITY=106 -CONFIG_IPERF_STACKSIZE=4096 -# CONFIG_MEM_LEAK_CHECKER is not set -CONFIG_SYSTEM_NETDB=y -CONFIG_SYSTEM_NETDB_STACKSIZE=2048 -CONFIG_SYSTEM_NETDB_PRIORITY=100 -# CONFIG_SYSTEM_RAMTEST is not set -# CONFIG_SYSTEM_READLINE is not set -CONFIG_SYSTEM_INFORMATION=y -CONFIG_SYSTEM_CMDS=y -CONFIG_SECURITY_LEVEL_CMDS=y -CONFIG_FS_CMDS=y -CONFIG_FSCMD_BUFFER_LEN=256 -CONFIG_NET_CMDS=y -CONFIG_NET_PING_CMD=y -CONFIG_NET_PING_CMD_ICOUNT=5 -CONFIG_ENABLE_DATE=y -# CONFIG_ENABLE_ENV_GET is not set -# CONFIG_ENABLE_ENV_SET is not set -# CONFIG_ENABLE_ENV_UNSET is not set -CONFIG_ENABLE_FREE=y -CONFIG_ENABLE_HEAPINFO=y -# CONFIG_HEAPINFO_USER_GROUP is not set -CONFIG_ENABLE_PRODCONFIG=y -# CONFIG_ENABLE_TZSELECT is not set -CONFIG_ENABLE_KILL=y -CONFIG_ENABLE_KILLALL=y -CONFIG_ENABLE_PS=y -# CONFIG_ENABLE_STACKMONITOR is not set -CONFIG_ENABLE_UPTIME=y -# CONFIG_SYSTEM_VI is not set - -# -# Loadable apps Configuration -# - -# -# Runtime Environment -# -# CONFIG_ENABLE_IOTJS is not set - -# -# Device Management -# -# CONFIG_DM is not set - -# -# Binary manager -# -CONFIG_USE_BP=y -CONFIG_BINARY_MANAGER=y -CONFIG_BM_PRIORITY_MAX=205 -CONFIG_BM_PRIORITY_MIN=200 -CONFIG_BINMGR_UPDATE=y -CONFIG_BINMGR_UPDATE_SAME_VERSION=y -# CONFIG_BINMGR_RELOAD_REBOOT is not set - -# -# Task Monitor -# -# CONFIG_TASK_MONITOR is not set - -# -# Task manager -# -# CONFIG_TASK_MANAGER is not set - -# -# Event Loop Framework -# -# CONFIG_EVENTLOOP is not set - -# -# Messaging Framework -# -# CONFIG_MESSAGING_IPC is not set - -# -# Preference Support -# -# CONFIG_PREFERENCE is not set - -# -# Things Management -# - -# -# IoTBus Framework -# -# CONFIG_IOTBUS is not set - -# -# Security Framework -# -CONFIG_SECURITY_API=y -# CONFIG_DEBUG_SECURITY_FRAMEWORK_ERROR is not set -CONFIG_SECURITY_AUTH=y -CONFIG_SECURITY_CRYPTO=y -CONFIG_SECURITY_KEYMGR=y -CONFIG_SECURITY_SS=y diff --git a/os/arch/arm/src/amebasmart/amebasmart_i2c.c b/os/arch/arm/src/amebasmart/amebasmart_i2c.c index 2a9e92bdcf..8d9db33077 100644 --- a/os/arch/arm/src/amebasmart/amebasmart_i2c.c +++ b/os/arch/arm/src/amebasmart/amebasmart_i2c.c @@ -825,32 +825,36 @@ static int amebasmart_i2c_isr_process(struct amebasmart_i2c_priv_s *priv) int ret = 0; struct i2c_msg_s *w_msgv = priv->msgv; + uint8_t *reg = w_msgv->buffer; #ifdef CONFIG_I2C_WRITEREAD struct i2c_msg_s *r_msgv = ++priv->msgv; uint8_t read_restart; uint8_t write_restart; - + uint8_t no_read = (r_msgv->flags & I2C_M_READ) == 0; if ((w_msgv->flags & I2C_M_READ) == 0) { - i2cinfo("i2c writing"); + if(w_msgv->length == 2) + //lldbg("i2c writing %d %8x %8x\n", write_restart, reg[0], reg[1]); #ifdef CONFIG_I2C_SLAVE i2c_slave_read(priv->i2c_object, &read_restart, 1); i2c_slave_set_for_rd_req(priv->i2c_object, 1); ret = i2c_slave_write(priv->i2c_object, w_msgv->buffer, w_msgv->length); #else - ret = rtk_i2c_write(priv->i2c_object, w_msgv->addr, &write_restart, 1, 0); + //ret = rtk_i2c_write(priv->i2c_object, w_msgv->addr, &write_restart, 1, 0); + ret = rtk_i2c_write(priv->i2c_object, w_msgv->addr, w_msgv->buffer, w_msgv->length, 1); #endif } if ((r_msgv->flags & I2C_M_READ) != 0) { - i2cinfo("i2c reading"); + //lldbg("i2c iiiiiii reading %d %d\n", write_restart, no_read); #ifdef CONFIG_I2C_SLAVE ret = i2c_slave_read(priv->i2c_object, r_msgv->buffer, r_msgv->length); #else - rtk_i2c_write(priv->i2c_object, r_msgv->addr, &write_restart, 1, 0); + //rtk_i2c_write(priv->i2c_object, r_msgv->addr, &write_restart, 1, 0); + ret = rtk_i2c_write(priv->i2c_object, w_msgv->addr, w_msgv->buffer, w_msgv->length, 0); ret = rtk_i2c_read(priv->i2c_object, r_msgv->addr, r_msgv->buffer, r_msgv->length, 1); #endif } @@ -859,7 +863,7 @@ static int amebasmart_i2c_isr_process(struct amebasmart_i2c_priv_s *priv) if ((w_msgv->flags & I2C_M_READ) == 0) { - i2cinfo("i2c writing"); + //lldbg("no cofi i2c write read i2c writing\n"); #ifdef CONFIG_I2C_SLAVE i2c_slave_set_for_rd_req(priv->i2c_object, 1); @@ -870,7 +874,7 @@ static int amebasmart_i2c_isr_process(struct amebasmart_i2c_priv_s *priv) } else if ((w_msgv->flags & I2C_M_READ) != 0) { - i2cinfo("i2c reading"); + //lldbg("no confi i2c reading\n"); #ifdef CONFIG_I2C_SLAVE ret = i2c_slave_read(priv->i2c_object, w_msgv->buffer, w_msgv->length); diff --git a/os/arch/arm/src/amebasmart/amebasmart_i2s.c b/os/arch/arm/src/amebasmart/amebasmart_i2s.c index d1a495b33c..6bc46e0c80 100644 --- a/os/arch/arm/src/amebasmart/amebasmart_i2s.c +++ b/os/arch/arm/src/amebasmart/amebasmart_i2s.c @@ -222,11 +222,11 @@ static const struct amebasmart_i2s_config_s amebasmart_i2s2_config = { .i2s_sclk_pin = PB_21, .i2s_ws_pin = PA_16, .i2s_sd_tx_pin = PB_10, - .i2s_sd_rx_pin = PB_19, + .i2s_sd_rx_pin = PB_20, .i2s_idx = I2S_NUM_2, - .rxenab = 0, - .txenab = 1, + .rxenab = 1, + .txenab = 0, }; static const struct amebasmart_i2s_config_s amebasmart_i2s3_config = { @@ -814,13 +814,13 @@ static int i2s_rx_start(struct amebasmart_i2s_s *priv) /* Check if the DMA is IDLE */ if (!sq_empty(&priv->rx.act)) { - i2sinfo("[RX start] RX active!\n"); + lldbg("[RX start] RX active!\n"); return OK; } /* If there are no pending transfer, then bail returning success */ if (sq_empty(&priv->rx.pend)) { - i2sinfo("[RX start] RX pend empty!\n"); + lldbg("[RX start] RX pend empty!\n"); return OK; } @@ -1050,7 +1050,7 @@ static int i2s_receive(struct i2s_dev_s *dev, struct ap_buffer_s *apb, i2s_callb DEBUGASSERT(bfcontainer); i2s_exclsem_take(priv); - i2sinfo("RX Exclusive Enter\n"); + printf("RX Exclusive Enter\n"); /* Add a reference to the audio buffer */ apb_reference(apb); @@ -1068,12 +1068,12 @@ static int i2s_receive(struct i2s_dev_s *dev, struct ap_buffer_s *apb, i2s_callb flags = enter_critical_section(); sq_addlast((sq_entry_t *)bfcontainer, &priv->rx.pend); leave_critical_section(flags); - i2sinfo("i2s_rx_start\n"); + printf("i2s_rx_start\n"); /* Start transfer */ ret = i2s_rx_start(priv); i2s_exclsem_give(priv); - i2sinfo("RX Exclusive Exit\n"); + printf("RX Exclusive Exit\n"); return OK; @@ -1092,6 +1092,7 @@ static int i2s_receive(struct i2s_dev_s *dev, struct ap_buffer_s *apb, i2s_callb */ void i2s_transfer_rx_handleirq(void *data, char *pbuf) { + lldbg("handle irq\n"); struct amebasmart_i2s_s *priv = (struct amebasmart_i2s_s *)data; i2s_t *obj = priv->i2s_object; diff --git a/os/board/rtl8730e/src/Make.defs b/os/board/rtl8730e/src/Make.defs index 342156947f..0680611819 100644 --- a/os/board/rtl8730e/src/Make.defs +++ b/os/board/rtl8730e/src/Make.defs @@ -80,3 +80,15 @@ endif ifeq ($(CONFIG_AUDIO_NDP120),y) CSRCS += rtl8730e_ndp120.c endif + +ifeq ($(CONFIG_SENSOR),y) + +ifeq ($(CONFIG_SENSOR_MLX90617),y) +CSRCS += rtl8730e_mlx90617.c +endif + +ifeq ($(CONFIG_SENSOR_AIS25BA),y) +CSRCS += rtl8730e_ais25ba.c +endif + +endif diff --git a/os/board/rtl8730e/src/component/mbed/targets/hal/rtl8730e/i2s_api.c b/os/board/rtl8730e/src/component/mbed/targets/hal/rtl8730e/i2s_api.c index 11c027b24e..f14c396d31 100755 --- a/os/board/rtl8730e/src/component/mbed/targets/hal/rtl8730e/i2s_api.c +++ b/os/board/rtl8730e/src/component/mbed/targets/hal/rtl8730e/i2s_api.c @@ -589,6 +589,7 @@ void i2s_send_page(i2s_t *obj, uint32_t *pbuf) #ifdef CONFIG_AMEBASMART_I2S_RX void i2s_recv_page(i2s_t *obj) { + lldbg("i2s rcv page called\n"); uint8_t i2s_index = obj->i2s_idx; pRX_BLOCK prx_block = &(sp_rx_info.rx_block[sp_rx_info.rx_usr_cnt]); diff --git a/os/board/rtl8730e/src/rtl8730e_ais25ba.c b/os/board/rtl8730e/src/rtl8730e_ais25ba.c new file mode 100644 index 0000000000..6a34fd9928 --- /dev/null +++ b/os/board/rtl8730e/src/rtl8730e_ais25ba.c @@ -0,0 +1,268 @@ +/**************************************************************************** + * + * Copyright 2024 Samsung Electronics All Rights Reserved. + * + * Licensed 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. + * + ****************************************************************************/ +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/*#include "objects.h" +#include "gpio_irq_api.h" +#include "PinNames.h" +#include "gpio_api.h"*/ +#include "amebasmart_i2s.h" +#define PIN_LOW 0 +#define PIN_HIGH 1 + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* i2c config */ +#if CONFIG_RTL8730E_BOARD_REVISION >= 6 +#define AIS25BA_I2C_PORT 0 +#else +#define AIS25BA_I2C_PORT 0 +#endif + +#define AIS25BA_I2C_FREQ 100000 +#define AIS25BA_I2C_ADDRLEN 7 +#define AIS25BA_I2C_ADDR 0x19 +#define AIS25BA_I2S_PORT 2 + +/*other pin config */ +#define AIS25BA_GPIO_RESET_PIN PA_5 +#if CONFIG_RTL8730E_BOARD_REVISION >= 6 +#define AIS25BA_GPIO_I2C_PIN PA_4 +#else +#define AIS25BA_GPIO_I2C_PIN PA_2 +#endif + +/**************************************************************************** + * Private Types + ****************************************************************************/ +struct rtl8730e_ais25ba_s { + //struct lcd_touch_config touch_config; +}; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ +//extern FAR struct i2s_dev_s *amebasmart_i2s_initialize(uint16_t port, bool is_reinit); + +static void rtl8730e_verify_sensor(struct i2c_dev_s *i2c, struct i2c_config_s config); +static void rtl8730e_ctrl_tdm(struct i2c_dev_s *i2c, struct i2c_config_s config); + +/**************************************************************************** + * Private Data + ****************************************************************************/ +static struct rtl8730e_ais25ba_s g_rtl8730e_ais25ba_priv0 = { +}; + +static struct ais25ba_dev_s g_ais25ba_dev0 = { + .i2c = NULL, + .i2c_config = { + .frequency = AIS25BA_I2C_FREQ, + .address = AIS25BA_I2C_ADDR, + .addrlen = AIS25BA_I2C_ADDRLEN, + }, + .priv = &g_rtl8730e_ais25ba_priv0, +}; + + +/**************************************************************************** + * Private Functions + ****************************************************************************/ +static float ais25ba_from_raw_to_mg(int16_t lsb) +{ + return ((float)lsb) * 0.122f; +} + +static void rtl8730e_verify_sensor(struct i2c_dev_s *i2c, struct i2c_config_s config) +{ + int ret = 0; + int reg[1]; + uint8_t data[1]; + reg[0] = 0x0F; //WHO_AM_I + lldbg("add %8x, freq %d, len%d\n", config.address, config.frequency, config.addrlen); + ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 1); + lldbg("data read is %8x\n", data[0]); // this should be 0x20 + } +} + +static void rtl8730e_ctrl_tdm(struct i2c_dev_s *i2c, struct i2c_config_s config) +{ + int ret = 0; + int reg[2]; + uint8_t data[2]; + reg[0] = 0x26; // CTRL_REG_1 + reg[1] = 0x00; //PD : normal mode - enabling device + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); + lldbg("ret ctrl reg1 %d\n", ret); + + reg[0] = 0x2F; // CTRL_REG_2 + reg[1] = 0xE1; //auto_odr : 1 + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); + lldbg("ret ctrl reg2 %d\n", ret); + + reg[0] = 0x30; //accelerometer FS(full scale) selection CTRL_REG_FS + reg[1] = 0x00; //FS = 3.85g ---> 0.122 sensitivity + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); + lldbg("ret fs = %d\n", ret); + /*if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 2); + lldbg("data read is %8x\n", data[0]); + }*/ + + reg[0] = 0x2E; //tdm ctrl register TDM_CTRL_REG + reg[1] = 0x02; //WCLK = 16KHz , enable TDM, no delayed configuration, valid data, tdm mapping 0 + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); + lldbg("ret tdm ctrl= %d\n", ret); + /*if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 2); + lldbg("data read is %8x\n", data[0]); + }*/ +} + +/*static void ais25ba_gpio_reset() +{ + GPIO_WriteBit(ais25ba_GPIO_RESET_PIN, PIN_HIGH); + DelayMs(500); + GPIO_WriteBit(ais25ba_GPIO_RESET_PIN, PIN_LOW); + DelayMs(500); + GPIO_WriteBit(ais25ba_GPIO_RESET_PIN, PIN_HIGH); + DelayMs(500); + return; +} + +static void ais25ba_gpio_init() +{ + Pinmux_Config(ais25ba_GPIO_RESET_PIN, PINMUX_FUNCTION_GPIO); + GPIO_InitTypeDef TouchResetPin; + TouchResetPin.GPIO_Pin = ais25ba_GPIO_RESET_PIN; + TouchResetPin.GPIO_PuPd = GPIO_PuPd_NOPULL; + TouchResetPin.GPIO_Mode = GPIO_Mode_OUT; + GPIO_Init(&TouchResetPin); +}*/ + +void ais25ba_callback(FAR struct i2s_dev_s *dev, FAR struct ap_buffer_s *apb, FAR void *arg, int result) +{ + lldbg("in callback..........................................\n"); + lldbg("apb=%p nbytes=%d result=%d\n", apb, apb->nbytes, result); + + /* REVISIT: If you want this to actually do something other than + * test I2S data transfer, then this is the point where you would + * want to let some application know that the transfer has complete. + */ + + /* Release our reference to the audio buffer. Hopefully it will be freed + * now. + */ + /*uint8_t *ptr; + uint8_t data; + int j = 0; + for (ptr = apb->samp; j < 1; j++) { + data = ptr[j]; + j++; + if(data !=NULL) { + lldbg("data %d\n", data); + } + }*/ + + /*int8_t x1 = 0; + int8_t x2 = 0; + int16_t x = x1 << 8 || x2; + float x_f = ais25ba_from_raw_to_mg(x); + for (i = 0U; i < 3U; i++) + { + data->xl.raw[i] = (int16_t) tdm_stream[i + offset]; + data->xl.mg[i] = ais25ba_from_raw_to_mg(data->xl.raw[i]); + } + lldbg("Freeing apb=%p crefs=%d\n", apb, apb->crefs); + apb_free(apb);*/ + +} + +static void read_i2s(struct i2s_dev_s *i2s) +{ + struct ap_buffer_s *apb; + //apb_reference(&apb); + struct audio_buf_desc_s desc; + desc.numbytes = 256; + desc.u.ppBuffer = &apb; + + int ret = apb_alloc(&desc); + if (ret < 0) { + lldbg("alloc fail\n"); + return; + } + ret = I2S_RECEIVE(i2s, apb, ais25ba_callback, NULL, 100);/* 100 ms timeout for read data */ + if (ret < 0) { + lldbg("ERROR: I2S_RECEIVE returned: %d\n", ret); + kmm_free(apb); + // apb_free(&apb); + return; + } +} +/**************************************************************************** + * Public Functions + ****************************************************************************/ + +void rtl8730e_ais25ba_initialize() +{ + FAR struct i2c_dev_s *i2c; + struct i2s_dev_s *i2s; + i2s = amebasmart_i2s_initialize(AIS25BA_I2S_PORT, 0); + if (!i2s) { + lldbg("ERROR: Failed to initialize I2S\n"); + } + int ret = 0; + + i2c = up_i2cinitialize(AIS25BA_I2C_PORT); + if (!i2c) { + lldbg("ERROR: Failed to initialize I2C\n"); + } + /*struct i2c_config_s config; + config.frequency = AIS25BA_I2C_FREQ; + config.address = AIS25BA_I2C_ADDR; + config.addrlen = AIS25BA_I2C_ADDRLEN; + rtl8730e_verify_sensor(i2c, config); + rtl8730e_ctrl_tdm(i2c, config);*/ + //read_i2s(i2s); + g_ais25ba_dev0.i2c = i2c; + g_ais25ba_dev0.i2s = i2s; + ret = ais25ba_initialize("/dev/sensor1", &g_ais25ba_dev0); + if (ret < 0) { + lldbg("ERROR: MEMS ais25ba driver register fail\n"); + return; + } + lldbg("MEMS ais25ba driver register success\n"); +} diff --git a/os/board/rtl8730e/src/rtl8730e_boot.c b/os/board/rtl8730e/src/rtl8730e_boot.c index 55b02a40b6..f0f45fa605 100644 --- a/os/board/rtl8730e/src/rtl8730e_boot.c +++ b/os/board/rtl8730e/src/rtl8730e_boot.c @@ -444,6 +444,18 @@ void board_initialize(void) board_spi_initialize(); board_i2s_initialize(); +#ifdef CONFIG_SENSOR + +#ifdef CONFIG_SENSOR_MLX90617 + rtl8730e_mlx90617_initialize(); +#endif + +#ifdef CONFIG_SENSOR_AIS25BA + rtl8730e_ais25ba_initialize(); +#endif + +#endif + #ifdef CONFIG_LCD_ST7789 rtl8730_st7789_initialize(); #endif @@ -455,6 +467,7 @@ void board_initialize(void) #ifdef CONFIG_WATCHDOG amebasmart_wdg_initialize(CONFIG_WATCHDOG_DEVPATH, 5000); #endif + #ifdef CONFIG_TIMER int i; char path[CONFIG_PATH_MAX]; diff --git a/os/board/rtl8730e/src/rtl8730e_mlx90617.c b/os/board/rtl8730e/src/rtl8730e_mlx90617.c new file mode 100644 index 0000000000..d0628f50b5 --- /dev/null +++ b/os/board/rtl8730e/src/rtl8730e_mlx90617.c @@ -0,0 +1,167 @@ +/**************************************************************************** + * + * Copyright 2024 Samsung Electronics All Rights Reserved. + * + * Licensed 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. + * + ****************************************************************************/ +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +//#include +#include +#include +#include +#include +#include "objects.h" +#include "gpio_irq_api.h" +#include "PinNames.h" +#include "gpio_api.h" + +#define PIN_LOW 0 +#define PIN_HIGH 1 + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ +/* i2c config */ + +/*#if CONFIG_RTL8730E_BOARD_REVISION >= 6 +#define MLX90617_I2C_PORT 0 +#else +#define MLX90617_I2C_PORT 1 +#endif*/ + +#define MLX90617_I2C_PORT 2 + + +#define MLX90617_SPI_PORT 0 +#define MLX90617_SPI_BPW 8 +#define MLX90617_SPI_CS 0 +#define MLX90617_SPI_MODE 0 +#define MLX90617_SPI_FREQ 1000000 + +#define MLX90617_I2C_FREQ 50000 +//#define MLX90617_I2C_FREQ 100000 +#define MLX90617_I2C_ADDRLEN 7 + +#define MLX90617_I2C_ADDR 0x5D +#define MLX90614_N_I2C_ADDR 0x5A +/*other pin config */ +#define MLX90617_GPIO_I2C_PIN PA_29 +#define MLX90617_GPIO_RESET_PIN PA_2 +/* +#if CONFIG_RTL8730E_BOARD_REVISION >= 6 +#define MLX90617_GPIO_I2C_PIN PA_28 +#else +#define MLX90617_GPIO_I2C_PIN PA_2 +#endif +*/ +/**************************************************************************** + * Private Types + ****************************************************************************/ +struct rtl8730e_mlx90617_s { + gpio_irq_t data_ready; +}; + +struct rtl8730e_mlx90617_s g_rtl8730e_mlx90617_priv0; + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +/**************************************************************************** + * Private Data +****************************************************************************/ + +static struct mlx90617_dev_s g_mlx90617_dev0 = { + .i2c = NULL, + .i2c_config = { + .frequency = MLX90617_I2C_FREQ, + .address = MLX90617_I2C_ADDR, + .addrlen = MLX90617_I2C_ADDRLEN, + }, + .spi = NULL, + .priv = &g_rtl8730e_mlx90617_priv0, +}; + + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +static void mlx90617_gpio_reset() +{ + GPIO_WriteBit(MLX90617_GPIO_RESET_PIN, PIN_HIGH); + DelayMs(500); + GPIO_WriteBit(MLX90617_GPIO_RESET_PIN, PIN_LOW); + DelayMs(500); + GPIO_WriteBit(MLX90617_GPIO_RESET_PIN, PIN_HIGH); + DelayMs(500); + + return; +} + +static void mlx90617_gpio_init() +{ + Pinmux_Config(MLX90617_GPIO_RESET_PIN, PINMUX_FUNCTION_GPIO); + GPIO_InitTypeDef ResetPin; + ResetPin.GPIO_Pin = MLX90617_GPIO_RESET_PIN; + ResetPin.GPIO_PuPd = GPIO_PuPd_NOPULL; + ResetPin.GPIO_Mode = GPIO_Mode_OUT; + GPIO_Init(&ResetPin); +} + +void rtl8730e_mlx90617_initialize() +{ + struct spi_dev_s *spi = up_spiinitialize(MLX90617_SPI_PORT); + if (!spi) { + lldbg("ERROR: Failed to initialize SPI\n"); + } + FAR struct i2c_dev_s *i2c; + + //mlx90617_gpio_init(); + //mlx90617_gpio_reset(); + lldbg("i2c port %d\n", MLX90617_I2C_PORT); + i2c = up_i2cinitialize(MLX90617_I2C_PORT); + if (!i2c) { + lldbg("ERROR: Failed to initialize I2C\n"); + } + //struct spi_io_config spi_configg; + SPI_SETMODE(spi, MLX90617_SPI_MODE); + SPI_SETFREQUENCY(spi, MLX90617_SPI_FREQ); + SPI_SETBITS(spi, MLX90617_SPI_BPW); + + int ret = 0; + + g_mlx90617_dev0.i2c = i2c; + g_mlx90617_dev0.spi = spi; + + ret = mlx90617_initialize("/dev/sensor0", &g_mlx90617_dev0); + //ret = mlx90617_register("/dev/sensor0", i2c, &(g_mlx90617info.s_config), spi); + if (ret < 0) { + lldbg("ERROR: Sensor driver register fail\n"); + return; + } + + lldbg("Sensor driver register success\n"); +} diff --git a/os/drivers/sensors/Kconfig b/os/drivers/sensors/Kconfig index b100785c93..9b5a977a1a 100644 --- a/os/drivers/sensors/Kconfig +++ b/os/drivers/sensors/Kconfig @@ -2,6 +2,17 @@ # For a description of the syntax of this configuration file, # see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt # +config SENSOR_MLX90617 + bool "IR MLX90617/MLX90614 Sensor" + default n + ---help--- + Enable driver support for the IR Sensor MLX90617/MLX90614 + +config SENSOR_AIS25BA + bool "MEMS AIS25BA Sensor" + default n + ---help--- + Enable driver support for the MEMS AIS25BA Sensor config SENSOR_PPD42NS bool "Shinyei PPD42NS Dust Sensor" diff --git a/os/drivers/sensors/Make.defs b/os/drivers/sensors/Make.defs index 84378da638..66bdfb7b82 100644 --- a/os/drivers/sensors/Make.defs +++ b/os/drivers/sensors/Make.defs @@ -19,6 +19,16 @@ # Include nothing if CONFIG_SENSOR is disabled ifeq ($(CONFIG_SENSOR),y) +CSRCS += sensor.c + +ifeq ($(CONFIG_SENSOR_MLX90617),y) +CSRCS += mlx90617.c +endif + +ifeq ($(CONFIG_SENSOR_AIS25BA),y) +CSRCS += ais25ba.c +endif + ifeq ($(CONFIG_SENSOR_PPD42NS),y) CSRCS += ppd42ns.c endif diff --git a/os/drivers/sensors/ais25ba.c b/os/drivers/sensors/ais25ba.c new file mode 100644 index 0000000000..5fa17d4d76 --- /dev/null +++ b/os/drivers/sensors/ais25ba.c @@ -0,0 +1,404 @@ +/**************************************************************************** + * drivers/input/ist415.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ +/**************************************************************************** + * Private Types + ****************************************************************************/ +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ +static ssize_t ais25ba_read(FAR struct sensor_upperhalf_s *dev, FAR char *buffer); +static void ais25ba_set_mclk(struct sensor_upperhalf_s *priv, int mclk); +static void ais25ba_set_bclk(struct sensor_upperhalf_s *priv, int bclk); +static void ais25ba_start(struct sensor_upperhalf_s *priv); +static void ais25ba_stop(struct sensor_upperhalf_s *priv); +static void ais25ba_setchannel_count(struct sensor_upperhalf_s *priv, int channel_count); +static void ais25ba_setbit_perchannel(struct sensor_upperhalf_s *priv, int bit_per_channel); +static void ais25ba_set_samprate(struct sensor_upperhalf_s *priv, int samp_rate); + +/**************************************************************************** + * Private Data + ****************************************************************************/ +struct sensor_ops_s g_ais25ba_ops = { + .sensor_read = ais25ba_read, + .sensor_set_mclk = ais25ba_set_mclk, + .sensor_set_bclk = ais25ba_set_bclk, + .sensor_start = ais25ba_start, + .sensor_stop = ais25ba_stop, + .sensor_setchannel_count = ais25ba_setchannel_count, + .sensor_setbit_perchannel = ais25ba_setbit_perchannel, + .sensor_set_samprate = ais25ba_set_samprate, +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ +static void ais25ba_i2s_callback(FAR struct i2s_dev_s *dev, FAR struct ap_buffer_s *apb, FAR void *arg, int result) +{ + lldbg("in callback..........................................\n"); + lldbg("apb=%p nbytes=%d result=%d\n", apb, apb->nbytes, result); + +} + +static void ais25ba_set_mclk(struct sensor_upperhalf_s *priv, int mclk) +{ +} + +static void ais25ba_set_bclk(struct sensor_upperhalf_s *priv, int bclk) +{ +} + +static void ais25ba_start(struct sensor_upperhalf_s *upper) +{ + + struct ais25ba_dev_s *priv = upper->priv; + struct i2s_dev_s *i2s = priv->i2s; + struct ap_buffer_s *apb; + //apb_reference(&apb); + struct audio_buf_desc_s desc; + desc.numbytes = 64; + desc.u.ppBuffer = &apb; + + int ret = apb_alloc(&desc); + if (ret < 0) { + printf("alloc fail\n"); + return; + } + ret = I2S_RECEIVE(i2s, apb, ais25ba_i2s_callback, NULL, 1000);/* 100 ms timeout for read data */ + printf("i2s receive return %d\n", ret); + if (ret < 0) { + printf("ERROR: I2S_RECEIVE returned: %d\n", ret); + } + +} + +static void ais25ba_stop(struct sensor_upperhalf_s *upper) +{ + struct ais25ba_dev_s *priv = upper->priv; + I2S_STOP(priv->i2s, I2S_RX); +} + +static void ais25ba_setchannel_count(struct sensor_upperhalf_s *priv, int channel_count) +{ + +} + +static void ais25ba_setbit_perchannel(struct sensor_upperhalf_s *upper, int bit_per_channel) +{ + struct ais25ba_dev_s *priv = upper->priv; + + I2S_RXDATAWIDTH(priv->i2s, bit_per_channel); + +} + +static void ais25ba_set_samprate(struct sensor_upperhalf_s *upper, int samp_rate) +{ + FAR struct ais25ba_dev_s *priv = upper->priv; + printf("sample rate %d\n", samp_rate); + I2S_RXSAMPLERATE(priv->i2s, samp_rate); +} + +static void ais25ba_verify_sensor(struct i2c_dev_s *i2c, struct i2c_config_s config) +{ + int ret = 0; + int reg[2]; + uint8_t data[2]; + reg[0] = 0x0F; //WHO_AM_I + printf("add %8x, freq %d, len%d\n", config.address, config.frequency, config.addrlen); +#ifdef CONFIG_I2C_WRITEREAD + ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 1, data, 1); + printf("ret %d data : %8x\n", ret, data[0]); +#else + ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read is %8x\n", data[0]); // this should be 0x20 + } +#endif +} + +static void read_data(struct i2c_dev_s *i2c, struct i2c_config_s config) +{ + int ret = 0; + uint8_t reg[2]; + uint8_t data[2]; +#ifdef CONFIG_I2C_WRITEREAD + reg[0] = 0x0B; + ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 1, data, 1); + printf("ret 0B data : %8x\n", data[0]); + + reg[0] = 0x26; + ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 1, data, 1); + printf("ret 26 data : %8x\n", data[0]); + + reg[0] = 0x2F; + ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 1, data, 1); + printf("ret 2F data : %8x\n", data[0]); + + reg[0] = 0x30; + ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 1, data, 1); + printf("ret 30 data : %8x\n", data[0]); + + reg[0] = 0x2E; + ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 1, data, 1); + printf("ret 2E data : %8x\n", data[0]); + +#else + reg[0] = 0x0B; + ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read 0B : %8x\n", data[0]); // this should be 0x20 + } + + reg[0] = 0x26; + ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read 26 : %8x\n", data[0]); // this should be 0x20 + } + + reg[0] = 0x2F; + ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read 2F : %8x\n", data[0]); // this should be 0x20 + } + + reg[0] = 0x30; + ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read 30 : %8x\n", data[0]); // this should be 0x20 + } + + reg[0] = 0x2E; + ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read 2E : %8x\n", data[0]); // this should be 0x20 + } +#endif +} + +static void write_data(struct i2c_dev_s *i2c, struct i2c_config_s config) +{ + + int ret = 0; + uint8_t reg[2]; + uint8_t data[2]; +#ifdef CONFIG_I2C_WRITEREAD + reg[0] = 0x26; + reg[1] = 0x00; + ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 2, data, 0); + //printf("\nret 26 data : %8x\n", data[0]); + DelayMs(100); + reg[0] = 0x2E; + reg[1] = 0x32; + ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 2, data, 0); + //printf("\nret 2E data : %8x\n", data[0]); +#else + reg[0] = 0x26; + reg[1] = 0x00; + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); + + reg[0] = 0x2E; + reg[1] = 0x32; + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); +#endif +} + +/*static void ais25ba_ctrl_tdm(struct i2c_dev_s *i2c, struct i2c_config_s config) +{ + int ret = 0; + int reg[2]; + uint8_t data[2]; + + reg[0] = 0x0B; + //ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + //ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 1, data, 1); + // printf("ret self test %d data : 0b %8x\n", ret, data[0]); + + reg[0] = 0x26; // CTRL_REG_1 + reg[1] = 0x00; //PD : normal mode - enabling device + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); + if (ret == 2) { + ret = i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read 26 is %8x\n", data[0]); + } + //printf("writing ctrl reg1 ret: %d\n", ret); + //ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 2, data, 1); + printf("ret ctrl reg1 %d data : 26 %8x\n", ret, data[0]); + + reg[0] = 0x2F; // CTRL_REG_2 + reg[1] = 0xE1; //auto_odr : 1 + //ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 2, data, 1); + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); + if (ret == 2) { + ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret == 1) { + ret = i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read 2F is %8x\n", data[0]); + } + } + printf("ret ctrl reg2 %d data : 2f %8x\n", ret, data[0]); + + reg[0] = 0x30; //accelerometer FS(full scale) selection CTRL_REG_FS + reg[1] = 0x00; //FS = 3.85g ---> 0.122 sensitivity + //ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 2, data, 1); + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); + if (ret == 2) { + ret = i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read 30 is %8x\n", data[0]); + } + printf("ret fs = %d data : 30 %8x\n", ret, data[0]); + if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 2); + lldbg("data read is %8x\n", data[0]); + } + + reg[0] = 0x2E; //tdm ctrl register TDM_CTRL_REG + reg[1] = 0x32; //WCLK = 16KHz , enable TDM, no delayed configuration, valid data, tdm mapping 0 + ret = i2c_write(i2c, &config, (uint8_t *)reg, 2); + //printf("writing tdm ctrl ret: %d\n", ret); + //ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 2, data, 1); + if (ret == 2) { + ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret == 1) { + ret = i2c_read(i2c, &config, (uint8_t *)data, 1); + printf("data read 2e is %8x\n", data[0]); + } + } + printf("\nret tdm ctrl= %d data : 2e %8x\n", ret, data[0]); + if (ret == 1) { + i2c_read(i2c, &config, (uint8_t *)data, 2); + lldbg("data read is %8x\n", data[0]); + } +}*/ + +static void ais25ba_read_i2c(struct i2c_dev_s *i2c,struct i2c_config_s config, uint8_t reg[], int len, uint16_t *data) +{ + lldbg("%d %d %d\n", config.address, config.addrlen, config.frequency); + uint8_t buffer[3]; + if (i2c) { +#ifdef CONFIG_I2C_WRITEREAD + int ret = i2c_writeread(i2c, &config, (uint8_t *)reg, 1, buffer, len); + printf("ret %d\n", ret); +#else + int ret = i2c_write(i2c, &config, (uint8_t *)reg, 1); + if (ret != 1) { + printf("ERROR: i2c write not working\n"); + return; + } + ret = i2c_read(i2c, &config, buffer, len); +#endif + data[0] = (uint16_t)(buffer[0] | (buffer[1] << 8)); + printf("value[0]: %8x | value[1]: %8x | value[2]: %8x | %8x ret: %d\n", + buffer[0], buffer[1], buffer[2], ret); + } +} + +static int ais25ba_read_i2s(struct i2s_dev_s *i2s) +{ + struct ap_buffer_s *apb; + //apb_reference(&apb); + struct audio_buf_desc_s desc; + desc.numbytes = 64; + desc.u.ppBuffer = &apb; + + int ret = apb_alloc(&desc); + if (ret < 0) { + printf("alloc fail\n"); + return; + } + ret = I2S_RECEIVE(i2s, apb, ais25ba_i2s_callback, NULL, 1000);/* 100 ms timeout for read data */ + printf("i2s receive return %d\n", ret); + if (ret < 0) { + printf("ERROR: I2S_RECEIVE returned: %d\n", ret); + } + return ret; +} + +static ssize_t ais25ba_read(FAR struct sensor_upperhalf_s *dev, FAR char *buffer) +{ + FAR struct ais25ba_dev_s *priv = dev->priv; + size_t outlen; + irqstate_t flags; + int ret; + uint8_t reg[2]; + uint16_t data[3]; + float Ta_N, To_N; + + struct i2c_dev_s *i2c = priv->i2c; + struct i2s_dev_s *i2s = priv->i2s; + struct i2c_config_s config = priv->i2c_config; + /* Wait for semaphore to prevent concurrent reads */ + ais25ba_verify_sensor(i2c, config); + read_data(i2c, config); + DelayMs(2000); + write_data(i2c, config); + DelayMs(2000); + read_data(i2c, config); + /*ais25ba_ctrl_tdm(i2c, config);*/ + ais25ba_read_i2s(i2s); + + return OK; +} + + +int ais25ba_initialize(const char *devpath, struct ais25ba_dev_s *priv) +{ + int ret = 0; + + /* Setup device structure. */ + + struct sensor_upperhalf_s *upper = (struct sensor_upperhalf_s *)kmm_zalloc(sizeof(struct sensor_upperhalf_s)); + upper->ops = &g_ais25ba_ops; + upper->priv = priv; + priv->upper = upper; + + printf("sensor registered success\n"); + return sensor_register(devpath, upper); +} diff --git a/os/drivers/sensors/mlx90617.c b/os/drivers/sensors/mlx90617.c new file mode 100644 index 0000000000..08f7fada1c --- /dev/null +++ b/os/drivers/sensors/mlx90617.c @@ -0,0 +1,180 @@ +/**************************************************************************** + * drivers/input/ist415.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ +static ssize_t mlx90617_read(struct sensor_upperhalf_s *dev, FAR char *buffer); + +/**************************************************************************** + * Private Data + ****************************************************************************/ +struct sensor_ops_s g_mlx90617_ops = { + .sensor_read = mlx90617_read, +}; +/**************************************************************************** + * Private Functions + ****************************************************************************/ +uint8_t Calculate_PEC(uint8_t initPEC, uint8_t newData) +{ + uint8_t data; + uint8_t bitCheck; + data = initPEC ^ newData; + for (int i=0; i<8; i++ ) { + bitCheck = data & 0x80; + data = data << 1; + if (bitCheck != 0) {data = data ^ 0x07;} + } + return data; +} + +static void mlx90617_read_i2c(struct i2c_dev_s *i2c,struct i2c_config_s config, uint8_t reg[], int len, uint16_t *data) +{ + lldbg("\n%d %d %d\n", config.address, config.addrlen, config.frequency); + uint8_t buffer[3]; + buffer[0] = 0; + buffer[1] = 0; + buffer[2] = 0; + + if (!i2c) { + lldbg("ERROR: i2c not initialized\n"); + return; + } + +#ifdef CONFIG_I2C_WRITEREAD + int ret = i2c_writeread(i2c, &config, reg, 1, buffer, len); + lldbg("ret %d\n", ret); +#else + int ret = i2c_write(i2c, &config, reg, 1); + if (ret != 1) { + lldbg("ERROR: i2c write not working\n"); + return; + } + ret = i2c_read(i2c, &config, buffer, len); +#endif + + //PEC error checking + uint8_t pec; + uint8_t sa; + uint8_t cmd = 0; + + sa = config.address << 1; + pec = sa; + cmd = reg[0]; + + pec = Calculate_PEC(0, pec); + pec = Calculate_PEC(pec, cmd); + pec = Calculate_PEC(pec, (sa|0x01)); + pec = Calculate_PEC(pec, buffer[0]); + pec = Calculate_PEC(pec, buffer[1]); + lldbg("\nreg value: %d, config.address: %x, pec value: %8x, r[2]: %8x\n", reg[0], config.address, pec, buffer[2]); + if(pec != buffer[2]){ + lldbg("PEC error\n"); + } else { + lldbg("PEC success\n"); + } + + data[0] = (uint16_t)(buffer[0] | (buffer[1] << 8)); + lldbg("\nvalue[0]: %8x | value[1]: %8x | value[2]: %8x ret: %d\n", buffer[0], buffer[1], buffer[2], ret); + + if (reg == 0x6 || reg == 0x7) { + if (data[0] > 32767){ + lldbg("Above data should be ignored\n"); + } + } +} + +static ssize_t mlx90617_read(struct sensor_upperhalf_s *dev, FAR char *buffer) +{ + FAR struct mlx90617_dev_s *priv = (struct mlx90617_dev_s *)dev->priv; + int ret; + uint8_t reg[2] = {0, 0}; + uint16_t data[3] = {0, 0, 0}; + float Ta_N, To_N; + + struct i2c_dev_s *i2c = priv->i2c; + struct i2c_config_s config = priv->i2c_config; + /* Wait for semaphore to prevent concurrent reads */ + + config.address = 0x5A; + reg[0] = 0x06; + mlx90617_read_i2c(i2c, config, reg, 3, data); + Ta_N = (float)(data[0]) * 0.02 - 273.15; // MLX90614 Ta + lldbg("mlx90614 Ta_N %f\n", Ta_N); + + reg[0] = 0x07; + mlx90617_read_i2c(i2c, config, reg, 3, data); + To_N = (float)(data[0]) * 0.02 - 273.15; // MLX90614 To + lldbg("mlx90614 To_N %f\n", To_N); + + config.address = 0x5D; + reg[0] = 0x06; + mlx90617_read_i2c(i2c, config, reg, 3, data); + Ta_N = (float)(data[0]) * 0.02 - 273.15; // MLX90614 Ta + lldbg("mlx90617 Ta_N %f\n", Ta_N); + + reg[0] = 0x07; + mlx90617_read_i2c(i2c, config, reg, 3, data); + To_N = (float)(data[0]) * 0.02 - 273.15; // MLX90614 To + lldbg("mlx90617 To_N %f\n", To_N); + + return 0; +} + +int mlx90617_initialize(FAR const char *devpath, struct mlx90617_dev_s *priv) +{ + int ret = 0; + + /* Setup device structure. */ + struct sensor_upperhalf_s *upper = (struct sensor_upperhalf_s *)kmm_zalloc(sizeof(struct sensor_upperhalf_s)); + upper->ops = &g_mlx90617_ops; + upper->priv = priv; + priv->upper = upper; + + return sensor_register(devpath, upper); +} diff --git a/os/drivers/sensors/sensor.c b/os/drivers/sensors/sensor.c new file mode 100644 index 0000000000..d76346b622 --- /dev/null +++ b/os/drivers/sensors/sensor.c @@ -0,0 +1,276 @@ +/**************************************************************************** + * drivers/sensors/sensor.c + * + * 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. + * + ****************************************************************************/ + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/**************************************************************************** + * Pre-processor Definitions + ****************************************************************************/ + +/**************************************************************************** + * Private Types + ****************************************************************************/ + +/**************************************************************************** + * Private Function Prototypes + ****************************************************************************/ + +static void sensor_pollnotify(FAR struct sensor_upperhalf_s *upper, + pollevent_t eventset); +static int sensor_open(FAR struct file *filep); +static int sensor_close(FAR struct file *filep); +static ssize_t sensor_read(FAR struct file *filep, FAR char *buffer, + size_t buflen); +static ssize_t sensor_write(FAR struct file *filep, FAR const char *buffer, + size_t buflen); +static int sensor_ioctl(FAR struct file *filep, int cmd, + unsigned long arg); +static int sensor_poll(FAR struct file *filep, FAR struct pollfd *fds, + bool setup); +static ssize_t sensor_push_event(FAR void *priv, FAR const void *data, + size_t bytes); + +/**************************************************************************** + * Private Data + ****************************************************************************/ + +static const struct file_operations g_sensor_fops = +{ + sensor_open, /* open */ + sensor_close, /* close */ + sensor_read, /* read */ + sensor_write, /* write */ + NULL, /* seek */ + sensor_ioctl, /* ioctl */ + NULL, /* mmap */ + NULL, /* truncate */ + sensor_poll /* poll */ +}; + +/**************************************************************************** + * Private Functions + ****************************************************************************/ + +/***************************************************************************** + * Name: sensor_semtake + ****************************************************************************/ + +static inline int sensor_semtake(FAR sem_t *sem, bool errout) +{ + /* Take a count from the semaphore, possibly waiting */ + while (sem_wait(sem) != OK) { + /* EINTR is the only error that we expect */ + ASSERT(get_errno() == EINTR); + if (errout) { + return -EINTR; + } + } + return OK; +} + +/**************************************************************************** + * Name: sensor_semgive + ****************************************************************************/ + +static inline void sensor_semgive(sem_t *sem) +{ + sem_post(sem); +} + + +static void sensor_pollnotify(FAR struct sensor_upperhalf_s *dev, + pollevent_t eventset) +{ + int itr; + for (itr = 0; itr < CONFIG_SENSOR_NPOLLWAITERS; itr++) { + struct pollfd *fds = dev->fds[itr]; + if (fds) { + fds->revents |= (fds->events & eventset); + if (fds->revents != 0) { + sem_post(fds->sem); + } + } + } +} + +static int sensor_open(FAR struct file *filep) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct sensor_upperhalf_s *priv = inode->i_private; + + if (!priv) { + return -EINVAL; + } + + sensor_semtake(&priv->sem, false); + priv->crefs++; + DEBUGASSERT(priv->crefs > 0); + sensor_semgive(&priv->sem); + return OK; +} + +static int sensor_close(FAR struct file *filep) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct sensor_upperhalf_s *priv = inode->i_private; + if (!priv) { + return -EINVAL; + } + + sensor_semtake(&priv->sem, false); + DEBUGASSERT(priv->crefs > 0); + priv->crefs--; + if (priv->crefs == 0) { +#ifndef CONFIG_DISABLE_POLL + /* Check if this file is registered in a list of waiters for polling. + * For example, when task A is blocked by calling poll and task B try to terminate task A, + * a pollfd of A remains in this list. If it is, it should be cleared. + */ + (void)sensor_semtake(&priv->pollsem, false); + for (int i = 0; i < CONFIG_SENSOR_NPOLLWAITERS; i++) { + struct pollfd *fds = priv->fds[i]; + if (fds && (FAR struct file *)fds->filep == filep) { + priv->fds[i] = NULL; + } + } + sensor_semgive(&priv->pollsem); +#endif + } + + sensor_semgive(&priv->sem); + return OK; + +} + +static ssize_t sensor_read(FAR struct file *filep, FAR char *buffer, + size_t len) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct sensor_upperhalf_s *upper = inode->i_private; + upper->ops->sensor_read(upper, buffer); + return OK; +} + +static ssize_t sensor_write(FAR struct file *filep, FAR const char *buffer, + size_t buflen) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct sensor_upperhalf_s *upper = inode->i_private; + return OK; +} + +static int sensor_ioctl(FAR struct file *filep, int cmd, unsigned long arg) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct sensor_upperhalf_s *priv = inode->i_private; + printf("cmd %d arg %d, aa:%d\n", cmd, arg, SENSOR_SET_SAMPRATE); + if (!priv || !priv->ops) { + printf("privs is null\n"); + return -1; + } + switch (cmd) { + case SENSOR_SET_MCLK: { + priv->ops->sensor_set_mclk(priv, arg); + } + break; + + case SENSOR_SET_BCLK: { + priv->ops->sensor_set_bclk(priv, arg); + } + break; + + case SENSOR_SET_SAMPRATE: { + priv->ops->sensor_set_samprate(priv, arg); + } + break; + + case SENSOR_SET_CHANNEL: { + priv->ops->sensor_setchannel_count(priv, arg); + } + break; + + case SENSOR_SET_DATABIT: { + priv->ops->sensor_setbit_perchannel(priv, arg); + } + break; + + case SENSOR_START: { + priv->ops->sensor_start(priv); + } + break; + + case SENSOR_STOP: { + priv->ops->sensor_stop(priv); + } + break; + + default: + break; + } + return OK; +} + +static int sensor_poll(FAR struct file *filep, + FAR struct pollfd *fds, bool setup) +{ + FAR struct inode *inode = filep->f_inode; + FAR struct sensor_upperhalf_s *upper = inode->i_private; + return OK; +} + +int sensor_register(const char *path, struct sensor_upperhalf_s *dev) +{ + sem_init(&dev->sem, 0, 1); + sem_init(&dev->pollsem, 0, 1); + +#ifndef CONFIG_DISABLE_POLL + (void)sensor_semtake(&dev->pollsem, false); + for (int i = 0; i < CONFIG_SENSOR_NPOLLWAITERS; i++) { + dev->fds[i] = NULL; + } + sensor_semgive(&dev->pollsem); +#endif + int ret = register_driver(path, &g_sensor_fops, 0666, dev); + if (ret < 0) { + kmm_free(dev); + sem_destroy(&dev->sem); + sem_destroy(&dev->pollsem); + lldbg("Sensor Driver registration failed\n"); + return ret; + } + lldbg("Sensor Driver registered Successfully\n"); + return OK; +} diff --git a/os/include/tinyara/sensors/ais25ba.h b/os/include/tinyara/sensors/ais25ba.h new file mode 100644 index 0000000000..a9845c54e4 --- /dev/null +++ b/os/include/tinyara/sensors/ais25ba.h @@ -0,0 +1,42 @@ +/**************************************************************************** + * + * Copyright 2024 Samsung Electronics All Rights Reserved. + * + * Licensed 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. + * + ****************************************************************************/ + +#ifndef __DRIVERS_SENSOR_AIS25BA_H +#define __DRIVERS_SENSOR_AIS25BA_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include + +struct ais25ba_dev_s +{ + /* I2C bus and address for device. */ + + struct i2c_dev_s *i2c; + struct i2c_config_s i2c_config; + struct i2s_dev_s *i2s; + /* Configuration for device. */ + struct sensor_upperhalf_s *upper; + void *priv; +}; + +#endif /* __DRIVERS_SENSOR_AIS25BA_H */ diff --git a/os/include/tinyara/sensors/mlx90617.h b/os/include/tinyara/sensors/mlx90617.h new file mode 100644 index 0000000000..0f0e345b93 --- /dev/null +++ b/os/include/tinyara/sensors/mlx90617.h @@ -0,0 +1,46 @@ +/**************************************************************************** + * + * Copyright 2024 Samsung Electronics All Rights Reserved. + * + * Licensed 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. + * + ****************************************************************************/ + +#ifndef __DRIVERS_SENSOR_MLX90617_H +#define __DRIVERS_SENSOR_MLX90617_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ +#include +#include +#include +#include +#include + +/* MLX90617 Device */ + +struct mlx90617_dev_s +{ + /* I2C bus and address for device. */ + struct i2c_dev_s *i2c; + struct i2c_config_s i2c_config; + struct spi_dev_s *spi; + struct sensor_upperhalf_s *upper; + void *priv; +}; + +int mlx90617_initialize(FAR const char *devpath, struct mlx90617_dev_s *priv); + +#endif /* __DRIVERS_SENSOR_MLX90617_H */ + diff --git a/os/include/tinyara/sensors/sensor.h b/os/include/tinyara/sensors/sensor.h new file mode 100644 index 0000000000..751eef4538 --- /dev/null +++ b/os/include/tinyara/sensors/sensor.h @@ -0,0 +1,113 @@ + /* + * Copyright 2019 Samsung Electronics All Rights Reserved. + * + * Licensed 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/tinyara/sensor/sensor.h + * + * Copyright (C) 2011-2012, 2017 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ************************************************************************************/ + +#ifndef __INCLUDE_TINYARA_SENSOR_H +#define __INCLUDE_TINYARA_SENSOR_H + +/************************************************************************************ + * Included Files + ************************************************************************************/ + +#include +#include + + +#define SENSOR_TEST _SNIOC(1) +#define SENSOR_SET_MCLK _SNIOC(2) +#define SENSOR_START _SNIOC(3) +#define SENSOR_STOP _SNIOC(4) +#define SENSOR_SET_CHANNEL _SNIOC(5) +#define SENSOR_SET_DATABIT _SNIOC(6) +#define SENSOR_SET_SAMPRATE _SNIOC(7) +#define SENSOR_SET_BCLK _SNIOC(8) + +struct sensor_ops_s { + int (*sensor_read)(struct sensor_upperhalf_s *priv, FAR char *buffer); + void (*sensor_set_mclk)(struct sensor_upperhalf_s *priv, int mclk); + void (*sensor_set_bclk)(struct sensor_upperhalf_s *priv, int bclk); + void (*sensor_start)(struct sensor_upperhalf_s *priv); + void (*sensor_stop)(struct sensor_upperhalf_s *priv); + void (*sensor_setchannel_count)(struct sensor_upperhalf_s *priv, int channel_count); + void (*sensor_setbit_perchannel)(struct sensor_upperhalf_s *priv, int bit_per_channel); + void (*sensor_set_samprate)(struct sensor_upperhalf_s *priv, int samp_rate); +}; + +#define CONFIG_SENSOR_NPOLLWAITERS 2 +/* This structure describes the state of the upper half driver */ + +struct sensor_upperhalf_s +{ + sem_t sem; + uint8_t crefs; +#ifndef CONFIG_DISABLE_POLL + sem_t pollsem; + struct pollfd *fds[CONFIG_SENSOR_NPOLLWAITERS]; +#endif + + const struct sensor_ops_s *ops; /* Arch-specific operations */ + void *priv; + void (*func)(void); +}; + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __INCLUDE_TINYARA_SENSOR_H */ +