1
0
Fork 0
forked from nuttx/nuttx-update

Updated VS1053 audio driver from Ken Pettit

This commit is contained in:
Gregory Nutt 2013-10-27 08:00:16 -06:00
parent c785f7e69e
commit 5fe465749f
6 changed files with 1601 additions and 47 deletions

View file

@ -5888,4 +5888,8 @@
CC3000 driver update from David Sidrane (2013-10-25).
* arch/arm/src/sama5/chip/sam_isi.h: Camera interface register
definitions added (2013-10-26).
* audio/ and include/nuttx/audio/audio.h: Updated audio subsystem
from Ken Pettit (2013-10-27).
* drivers/audio/ and include/nuttx/audio/vs1053.h: Updated
VS1053 driver from ken Pettit (2013-10-27).

View file

@ -12,3 +12,35 @@ config VS1053
Vorbis format audio. It also has a general DSP which is user
programmable to perform special audio (or any DSP) functions.
if VS1053
config VS1053_DEVICE_COUNT
int "Number of VS1053 devices attached"
default 1
---help---
Sets the number of VS1053 type devices availalbe to the system.
This is required to reserve global, static lower-half driver
context pointers for the DREQ ISR to use for lookup when it needs
to signal that additional data is being requested.
if AUDIO_DRIVER_SPECIFIC_BUFFERS
config VS1053_NUM_BUFFERS
int "Number of Audio Pipeline Buffers to use"
default 2
---help---
Sets the number of the Audio Pipeline Buffers used to deliver audio
data to the VS1053 driver. The minimum you should set this is
2 buffers, which should be adequate for most media types.
config VS1053_BUFFER_SIZE
int "Size of Audio Pipeline Buffers to use"
default 8192
---help---
Sets the size of the Audio Pipeline Buffers used to deliver audio
data to the VS1053 driver. The minimum you should set this is
2048 bytes. The larger the buffer, the better CPU performance.
endif
endif

View file

@ -1,6 +1,6 @@
############################################################################
# drivers/audio/Make.defs
# These drivers support various Audio devices using the NuttX Audio
# These drivers support various Audio devices using the NuttX Audio
# interface.
#
# Copyright (C) 2013 Ken Pettit. All rights reserved.

File diff suppressed because it is too large Load diff

View file

@ -60,7 +60,7 @@
#define VS1053_SCI_MODE 0x00
#define VS1053_SCI_STATUS 0x01
#define VS1053_SCI_BASE 0x02
#define VS1053_SCI_BASS 0x02
#define VS1053_SCI_CLOCKF 0x03
#define VS1053_SCI_DECODE_TIME 0x04
#define VS1053_SCI_AUDATA 0x05
@ -115,7 +115,7 @@
#define VS1053_VER_VS1063 6
#define VS1053_VER_VS1103 7
/* BASE register bit definitions ******************************************/
/* BASS register bit definitions ******************************************/
#define VS1053_ST_AMPLITUDE 0xF000
#define VS1053_ST_FREQLIMIT 0x0F00
@ -125,7 +125,9 @@
/* CLOCKF register bit definitions ****************************************/
#define VS1053_SC_MULT 0xE000
#define VS1053_SC_MULT_SHIFT 13
#define VS1053_SC_ADD 0x1800
#define VS1053_SC_ADD_SHIFT 11
#define VS1053_SC_FREQ 0x07FF
#define VS1053_SC_MULT_XTALIx10 0
@ -206,6 +208,8 @@
#define VS1053_MP3_MODE_JSTEREO 1
#define VS1053_MP3_MODE_STEREO 0
#define VS1053_END_FILL_BYTE 0x1e06
/****************************************************************************
* Public Types
****************************************************************************/

View file

@ -33,8 +33,8 @@
*
****************************************************************************/
#ifndef __INCLUDE_NUTTX_NET_VS1053_H
#define __INCLUDE_NUTTX_NET_VS1053_H
#ifndef __INCLUDE_NUTTX_AUDIO_VS1053_H
#define __INCLUDE_NUTTX_AUDIO_VS1053_H
/****************************************************************************
* Included Files
@ -42,7 +42,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <nuttx/irq.h>
/****************************************************************************
@ -59,8 +59,8 @@
* Public Types
****************************************************************************/
/* The VS1053 provides Data Request (DREQ) interrupts to the MCU via a GPIO
* pin and also has a chip reset GPIO. The following structure provides an
/* The VS1053 provides Data Request (DREQ) interrupts to the MCU via a GPIO
* pin and also has a chip reset GPIO. The following structure provides an
* MCU-independent mechanism for controlling the VS1053 GPIOs.
*/
@ -70,6 +70,8 @@ struct vs1053_lower_s
void (*enable)(FAR const struct vs1053_lower_s *lower);
void (*disable)(FAR const struct vs1053_lower_s *lower);
void (*reset)(FAR const struct vs1053_lower_s *lower, bool state);
int (*read_dreq)(FAR const struct vs1053_lower_s *lower);
int irq;
};
/****************************************************************************
@ -78,7 +80,8 @@ struct vs1053_lower_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -91,7 +94,7 @@ extern "C" {
* Function: vs1053_initialize
*
* Description:
* Initialize the VS1053 driver. This will perform a chip reset of the
* Initialize the VS1053 driver. This will perform a chip reset of the
* device as part of initialization.
*
* Parameters:
@ -110,7 +113,7 @@ extern "C" {
struct spi_dev_s; /* see nuttx/spi/spi.h */
struct audio_lowerhalf_s; /* see nutt/audio.h */
EXTERN FAR struct audio_lowerhalf_s *vs1053_initialize(FAR struct spi_dev_s *spi,
FAR struct audio_lowerhalf_s *vs1053_initialize(FAR struct spi_dev_s *spi,
FAR const struct vs1053_lower_s *lower,
unsigned int devno);
@ -119,4 +122,4 @@ EXTERN FAR struct audio_lowerhalf_s *vs1053_initialize(FAR struct spi_dev_s *spi
}
#endif
#endif /* __INCLUDE_NUTTX_NET_VS1053_H */
#endif /* __INCLUDE_NUTTX_AUDIO_VS1053_H */