drivers/audio: Move the I2S character driver to a dedicated folder.

This commit is contained in:
Xiang Xiao 2018-08-27 07:26:22 -06:00 committed by Gregory Nutt
parent 0308a86435
commit eb02b28428
8 changed files with 86 additions and 37 deletions

View file

@ -137,6 +137,7 @@ menuconfig I2S
See include/nuttx/audio/i2s.h for further I2S driver information.
if I2S
source drivers/i2s/Kconfig
endif # I2S
source drivers/timers/Kconfig

View file

@ -55,6 +55,7 @@ include bch$(DELIM)Make.defs
include can$(DELIM)Make.defs
include crypto$(DELIM)Make.defs
include i2c$(DELIM)Make.defs
include i2s$(DELIM)Make.defs
include input$(DELIM)Make.defs
include ioexpander$(DELIM)Make.defs
include lcd$(DELIM)Make.defs

View file

@ -75,6 +75,9 @@ eeprom/
i2c/
I2C drivers and support logic. See include/nuttx/i2c/i2c_master.h
i2s/
I2S drivers and support logic. See include/nuttx/audio/i2s.h
input/
This directory holds implementations of human input device (HID)
drivers. This includes such things as mouse, touchscreen, joystick,

View file

@ -3,38 +3,6 @@
# see the file kconfig-language.txt in the NuttX tools repository.
#
config AUDIO_I2SCHAR
bool "I2S character driver (for testing only)"
default n
depends on I2S && AUDIO
---help---
This selection enables a simple character driver that supports I2S
transfers via a read() and write(). The intent of this driver is to
support I2S testing. It is not an audio driver but does conform to
some of the buffer management heuristics of an audio driver. It is
not suitable for use in any real driver application in its current
form.
if AUDIO_I2SCHAR
config AUDIO_I2SCHAR_RXTIMEOUT
int "RX timeout"
default 0
---help---
This is a fixed timeout value that will be used for all receiver
transfers. This is in units of system clock ticks (configurable).
The special value of zero disables RX timeouts. Default: 0
config AUDIO_I2SCHAR_TXTIMEOUT
int "TX timeout"
default 0
---help---
This is a fixed timeout value that will be used for all transmitter
transfers. This is in units of system clock ticks (configurable).
The special value of zero disables RX timeouts. Default: 0
endif # AUDIO_I2SCHAR
config AUDIO_TONE
bool "Audio Tone Generator using PWM"
default n

View file

@ -73,10 +73,6 @@ ifeq ($(CONFIG_AUDIO_NULL),y)
CSRCS += audio_null.c
endif
ifeq ($(CONFIG_AUDIO_I2SCHAR),y)
CSRCS += i2schar.c
endif
ifeq ($(CONFIG_AUDIO_TONE),y)
CSRCS += tone.c
endif

35
drivers/i2s/Kconfig Normal file
View file

@ -0,0 +1,35 @@
#
# For a description of the syntax of this configuration file,
# see the file kconfig-language.txt in the NuttX tools repository.
#
config AUDIO_I2SCHAR
bool "I2S character driver (for testing only)"
default n
---help---
This selection enables a simple character driver that supports I2S
transfers via a read() and write(). The intent of this driver is to
support I2S testing. It is not an audio driver but does conform to
some of the buffer management heuristics of an audio driver. It is
not suitable for use in any real driver application in its current
form.
if AUDIO_I2SCHAR
config AUDIO_I2SCHAR_RXTIMEOUT
int "RX timeout"
default 0
---help---
This is a fixed timeout value that will be used for all receiver
transfers. This is in units of system clock ticks (configurable).
The special value of zero disables RX timeouts. Default: 0
config AUDIO_I2SCHAR_TXTIMEOUT
int "TX timeout"
default 0
---help---
This is a fixed timeout value that will be used for all transmitter
transfers. This is in units of system clock ticks (configurable).
The special value of zero disables RX timeouts. Default: 0
endif # AUDIO_I2SCHAR

45
drivers/i2s/Make.defs Normal file
View file

@ -0,0 +1,45 @@
############################################################################
# drivers/i2s/Make.defs
#
# Copyright (C) 2018 Pinecone Inc. All rights reserved.
# Author: Xiang Xiao <xiaoxiang@pinecone.net>
#
# 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_I2S),y)
ifeq ($(CONFIG_AUDIO_I2SCHAR),y)
CSRCS += i2schar.c
endif
DEPPATH += --dep-path i2s
VPATH += :i2s
endif

View file

@ -1,5 +1,5 @@
/****************************************************************************
* drivers/audio/i2schar.c
* drivers/i2s/i2schar.c
*
* This is a simple character driver for testing I2C. It is not an audio
* driver but does conform to some of the buffer management heuristics of an