Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NuttX RTOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
f4grx
NuttX RTOS
Commits
c33fe29c
Commit
c33fe29c
authored
11 years ago
by
Gregory Nutt
Browse files
Options
Downloads
Patches
Plain Diff
I2S character driver now supports configurable timeouts
parent
a29e6f93
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
drivers/audio/Kconfig
+20
-0
20 additions, 0 deletions
drivers/audio/Kconfig
drivers/audio/i2schar.c
+14
-2
14 additions, 2 deletions
drivers/audio/i2schar.c
with
34 additions
and
2 deletions
drivers/audio/Kconfig
+
20
−
0
View file @
c33fe29c
...
...
@@ -15,6 +15,26 @@ config AUDIO_I2SCHAR
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 VS1053
bool "VS1053 codec chip"
default n
...
...
This diff is collapsed.
Click to expand it.
drivers/audio/i2schar.c
+
14
−
2
View file @
c33fe29c
...
...
@@ -61,7 +61,17 @@
/****************************************************************************
* Private Definitions
****************************************************************************/
/* Configuration ************************************************************/
#ifndef CONFIG_AUDIO_I2SCHAR_RXTIMEOUT
# define CONFIG_AUDIO_I2SCHAR_RXTIMEOUT 0
#endif
#ifndef CONFIG_AUDIO_I2SCHAR_TXTIMEOUT
# define CONFIG_AUDIO_I2SCHAR_TXTIMEOUT 0
#endif
/* Device naming ************************************************************/
#define DEVNAME_FMT "/dev/i2schar%d"
#define DEVNAME_FMTLEN (12 + 3 + 1)
...
...
@@ -268,7 +278,8 @@ static ssize_t i2schar_read(FAR struct file *filep, FAR char *buffer,
/* Give the buffer to the I2S driver */
ret
=
I2S_RECEIVE
(
priv
->
i2s
,
apb
,
i2schar_rxcallback
,
priv
,
0
);
ret
=
I2S_RECEIVE
(
priv
->
i2s
,
apb
,
i2schar_rxcallback
,
priv
,
CONFIG_AUDIO_I2SCHAR_RXTIMEOUT
);
if
(
ret
<
0
)
{
i2sdbg
(
"ERROR: I2S_RECEIVE returned: %d
\n
"
,
ret
);
...
...
@@ -342,7 +353,8 @@ static ssize_t i2schar_write(FAR struct file *filep, FAR const char *buffer,
/* Give the audio buffer to the I2S driver */
ret
=
I2S_SEND
(
priv
->
i2s
,
apb
,
i2schar_txcallback
,
priv
,
0
);
ret
=
I2S_SEND
(
priv
->
i2s
,
apb
,
i2schar_txcallback
,
priv
,
CONFIG_AUDIO_I2SCHAR_TXTIMEOUT
);
if
(
ret
<
0
)
{
i2sdbg
(
"ERROR: I2S_SEND returned: %d
\n
"
,
ret
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment