mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
feature:add awinic88266a smart pa nuttx driver
awinic88266a smart pa driver use nuttx/audio framework to register audio device, use i2c to control smart pa configuration Signed-off-by: genghuihui <genghuihui@xiaomi.com> Change-Id: I05361a582dde49af71c5dbd08ab9365b4ea0f80a
This commit is contained in:
@@ -389,4 +389,8 @@ config AUDIO_I2S
|
||||
depends on AUDIO
|
||||
depends on I2S
|
||||
|
||||
config AUDIO_AW88266A
|
||||
bool "Audio AWINIC88266A chip"
|
||||
default n
|
||||
|
||||
endif # DRIVERS_AUDIO
|
||||
|
||||
@@ -86,6 +86,10 @@ ifeq ($(CONFIG_AUDIO_I2S),y)
|
||||
CSRCS += audio_i2s.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_AUDIO_AW88266A),y)
|
||||
CSRCS += aw88266a.c
|
||||
endif
|
||||
|
||||
# Include Audio driver support
|
||||
|
||||
DEPPATH += --dep-path audio
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/audio/aw88266a.h
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_AUDIO_AW88266A_H
|
||||
#define __INCLUDE_NUTTX_AUDIO_AW88266A_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <nuttx/audio/audio.h>
|
||||
#include <nuttx/i2c/i2c_master.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CHSEL_LEFT = 0,
|
||||
CHSEL_RIGHT = 1,
|
||||
CHSEL_MONO = 2,
|
||||
CHSEL_NUM,
|
||||
}aw_i2s_channel_t;
|
||||
|
||||
struct aw88266a_lower_s
|
||||
{
|
||||
uint32_t frequency; /* I2C frequency */
|
||||
uint8_t address; /* I2C device address */
|
||||
aw_i2s_channel_t channelfmt; /* IIS channel fmt */
|
||||
int bclk_factor; /* BCLK factor */
|
||||
CODE void (*reset)(FAR const struct aw88266a_lower_s *lower);
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: aw88266a_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initializa awinic88266a smart pa
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR struct audio_lowerhalf_s *
|
||||
aw88266a_initialize(FAR struct i2c_master_s *i2c,
|
||||
FAR struct aw88266a_lower_s *lower);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user