mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
Merged in alinjerpelea/nuttx (pull request #1046)
boards: spresense: add audio implementation
* boards: arm: cxd56xx: add audio implementation
Add the board audio control implemantation
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* boards: arm: cxd56xx: update audio defconfig
Small updates to build the platforms specific audio driver
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* boards: arm: cxd56xx: drivers: add audio implementation
Add the audio implementation for CXD56XX chip
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
* boards: arm: cxd56xx: fix Load switch GPIO
During the initial bringup the grong GPIO was set.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
committed by
Gregory Nutt
parent
3a28d2e6f7
commit
33d0de4d57
@@ -21,6 +21,7 @@ CONFIG_BOARD_LOOPSPERMSEC=5434
|
||||
CONFIG_BOOT_RUNFROMISRAM=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_CLOCK_MONOTONIC=y
|
||||
CONFIG_CXD56_AUDIO=y
|
||||
CONFIG_CXD56_BINARY=y
|
||||
CONFIG_CXD56_I2C0=y
|
||||
CONFIG_CXD56_I2C=y
|
||||
@@ -28,7 +29,6 @@ CONFIG_CXD56_SDIO=y
|
||||
CONFIG_CXD56_SPI4=y
|
||||
CONFIG_CXD56_SPI5=y
|
||||
CONFIG_CXD56_SPI=y
|
||||
CONFIG_CXD56_AUDIO=y
|
||||
CONFIG_CXD56_USBDEV=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
@@ -42,6 +42,7 @@ CONFIG_FS_SMARTFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_LIBM=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MMCSD=y
|
||||
@@ -70,6 +71,7 @@ CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_SMARTFS_ALIGNED_ACCESS=y
|
||||
CONFIG_SMARTFS_MAXNAMLEN=30
|
||||
CONFIG_SMARTFS_MULTI_ROOT_DIRS=y
|
||||
CONFIG_SPECIFIC_DRIVERS=y
|
||||
CONFIG_SPI=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
#include "cxd56_wdt.h"
|
||||
#include "cxd56_gpioif.h"
|
||||
|
||||
#include "cxd56_audio.h"
|
||||
#include "cxd56_ak09912.h"
|
||||
#include "cxd56_apds9930.h"
|
||||
#include "cxd56_apds9960.h"
|
||||
@@ -214,12 +215,13 @@ enum board_power_device
|
||||
|
||||
POWER_AUDIO_DVDD = PMIC_LSW(2),
|
||||
POWER_FLASH = PMIC_LSW(3),
|
||||
POWER_TCXO = PMIC_LSW(3),
|
||||
POWER_TCXO = PMIC_LSW(4),
|
||||
POWER_LNA = PMIC_LSW(4),
|
||||
|
||||
/* GPO */
|
||||
|
||||
POWER_AUDIO_AVDD = PMIC_GPO(0),
|
||||
POWER_AUDIO_AVDD = PMIC_GPO(1),
|
||||
POWER_AUDIO_MUTE = PMIC_GPO(6),
|
||||
POWER_SENSOR_18V = PMIC_GPO(1),
|
||||
POWER_SENSOR_33V = PMIC_GPO(2),
|
||||
POWER_BMI160 = POWER_SENSOR_18V,
|
||||
|
||||
@@ -0,0 +1,160 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/cxd56xx/spresense/include/cxd56_audio.h
|
||||
*
|
||||
* Copyright 2018 Sony Semiconductor Solutions Corporation
|
||||
*
|
||||
* 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 of Sony Semiconductor Solutions Corporation 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 __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_AUDIO_H
|
||||
#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_AUDIO_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_aca_power_control
|
||||
*
|
||||
* Description:
|
||||
* Power on/off the Aca device on the board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_aca_power_control(int target, bool en);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_aca_power_monitor
|
||||
*
|
||||
* Description:
|
||||
* Get status of Power on/off the Aca device on the board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool board_aca_power_monitor(int target);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_external_amp_mute_control
|
||||
*
|
||||
* Description:
|
||||
* External Amp. Mute on/off.
|
||||
* true: Mute on
|
||||
* false: Mute off
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_external_amp_mute_control(bool en);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_external_amp_mute_monitor
|
||||
*
|
||||
* Description:
|
||||
* Get External Amp. Mute status.
|
||||
* true: Mute on
|
||||
* false: Mute off
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
bool board_external_amp_mute_monitor(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_audio_i2s_enable
|
||||
*
|
||||
* Description:
|
||||
* Enable I2S on the board.
|
||||
* Used by the audio driver. Do not use by users.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_audio_i2s_enable(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_audio_i2s_disable
|
||||
*
|
||||
* Description:
|
||||
* Disable I2S on the board.
|
||||
* Used by the audio driver. Do not use by users.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_audio_i2s_disable(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_audio_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize audio I/O on the board.
|
||||
* Used by the audio driver. Do not use by users.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_audio_initialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_audio_finalize
|
||||
*
|
||||
* Description:
|
||||
* Finalize audio I/O on the board.
|
||||
* Used by the audio driver. Do not use by users.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_audio_finalize(void);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_AUDIO_H */
|
||||
Reference in New Issue
Block a user