pure sdk for main
This commit is contained in:
@@ -0,0 +1,192 @@
|
||||
#ifndef _AUFADE_H
|
||||
#define _AUFADE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* @brief AUFADE calculate mode types
|
||||
*/
|
||||
enum aufade_mode {
|
||||
AUFADE_IN = BIT(0),
|
||||
|
||||
AUFADE_OUT = BIT(1),
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief AUFADE step types
|
||||
*/
|
||||
enum aufade_step {
|
||||
AUFADE_STEP_1,
|
||||
|
||||
AUFADE_STEP_2,
|
||||
|
||||
AUFADE_STEP_4,
|
||||
|
||||
AUFADE_STEP_8,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief AUFADE sample types
|
||||
*/
|
||||
enum aufade_sample {
|
||||
AUFADE_SAMPLE_1,
|
||||
|
||||
AUFADE_SAMPLE_2,
|
||||
|
||||
AUFADE_SAMPLE_3,
|
||||
|
||||
AUFADE_SAMPLE_4,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief AUFADE irq_flag type
|
||||
*/
|
||||
enum aufade_irq_flag {
|
||||
|
||||
/*!
|
||||
* @brief:
|
||||
*
|
||||
*/
|
||||
AUFADE_IRQ_FLAG_NONE = BIT(0),
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief AUFADE ioctl_cmd type
|
||||
*/
|
||||
enum aufade_ioctl_cmd {
|
||||
|
||||
AUFADE_IOCTL_CMD_SET_STEP = BIT(0),
|
||||
|
||||
AUFADE_IOCTL_CMD_SET_SAMPLE = BIT(1),
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* User interrupt handle */
|
||||
typedef void (*aufade_irq_hdl)(uint32 irq, uint32 irq_data);
|
||||
|
||||
/* AUFADE api for user */
|
||||
|
||||
struct aufade_device {
|
||||
struct dev_obj dev;
|
||||
};
|
||||
|
||||
struct aufade_hal_ops {
|
||||
struct devobj_ops ops;
|
||||
int32(*open)(struct aufade_device *aufade);
|
||||
int32(*close)(struct aufade_device *aufade);
|
||||
int32(*start)(struct aufade_device *aufade, enum aufade_mode mode);
|
||||
int32(*ioctl)(struct aufade_device *aufade, enum aufade_ioctl_cmd ioctl_cmd, uint32 param1, uint32 param2);
|
||||
int32(*request_irq)(struct aufade_device *aufade, enum aufade_irq_flag irq_flag, aufade_irq_hdl irq_hdl, uint32 irq_data);
|
||||
int32(*release_irq)(struct aufade_device *aufade, enum aufade_irq_flag irq_flag);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* AUFADE API functions */
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief aufade_open
|
||||
*
|
||||
*
|
||||
* @note .
|
||||
*
|
||||
* @param aufade The address of aufade device in the RTOS.
|
||||
* @param .
|
||||
* @param .
|
||||
*
|
||||
* @return
|
||||
* - RET_OK Success
|
||||
* - RET_ERR Fail
|
||||
*/
|
||||
int32 aufade_open(struct aufade_device *aufade);
|
||||
|
||||
/**
|
||||
* @brief aufade_close
|
||||
*
|
||||
*
|
||||
* @note .
|
||||
*
|
||||
* @param aufade The address of aufade device in the RTOS.
|
||||
* @param .
|
||||
* @param .
|
||||
*
|
||||
* @return
|
||||
* - RET_OK Success
|
||||
* - RET_ERR Fail
|
||||
*/
|
||||
int32 aufade_close(struct aufade_device *aufade);
|
||||
|
||||
/**
|
||||
* @brief aufade_start
|
||||
*
|
||||
*
|
||||
* @note .
|
||||
*
|
||||
* @param aufade The address of aufade device in the RTOS.
|
||||
* @param .
|
||||
* @param .
|
||||
*
|
||||
* @return
|
||||
* - RET_OK Success
|
||||
* - RET_ERR Fail
|
||||
*/
|
||||
int32 aufade_start(struct aufade_device *aufade, enum aufade_mode mode);
|
||||
|
||||
/**
|
||||
* @brief aufade_ioctl
|
||||
*
|
||||
*
|
||||
* @note .
|
||||
*
|
||||
* @param aufade The address of aufade device in the RTOS.
|
||||
* @param .
|
||||
* @param .
|
||||
*
|
||||
* @return
|
||||
* - RET_OK Success
|
||||
* - RET_ERR Fail
|
||||
*/
|
||||
int32 aufade_ioctl(struct aufade_device *aufade, enum aufade_ioctl_cmd ioctl_cmd, uint32 param1, uint32 param2);
|
||||
|
||||
/**
|
||||
* @brief aufade_request_irq
|
||||
*
|
||||
*
|
||||
* @note .
|
||||
*
|
||||
* @param aufade The address of aufade device in the RTOS.
|
||||
* @param .
|
||||
* @param .
|
||||
*
|
||||
* @return
|
||||
* - RET_OK Success
|
||||
* - RET_ERR Fail
|
||||
*/
|
||||
int32 aufade_request_irq(struct aufade_device *aufade, enum aufade_irq_flag irq_flag, aufade_irq_hdl irq_hdl, uint32 irq_data);
|
||||
|
||||
/**
|
||||
* @brief aufade_release_irq
|
||||
*
|
||||
*
|
||||
* @note .
|
||||
*
|
||||
* @param aufade The address of aufade device in the RTOS.
|
||||
* @param .
|
||||
* @param .
|
||||
*
|
||||
* @return
|
||||
* - RET_OK Success
|
||||
* - RET_ERR Fail
|
||||
*/
|
||||
int32 aufade_release_irq(struct aufade_device *aufade, enum aufade_irq_flag irq_flag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef _HG_AUFADE_V0_H_
|
||||
#define _HG_AUFADE_V0_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "dev/audio/components/fade/aufade.h"
|
||||
#include "hg_audio_v0_hw.h"
|
||||
|
||||
int32 hg_aufade_v0_init(void);
|
||||
int32 hg_aufade_v0_open(struct aufade_device *aufade);
|
||||
int32 hg_aufade_v0_close(struct aufade_device *aufade);
|
||||
int32 hg_aufade_v0_start(struct aufade_device *aufade, enum aufade_mode mode);
|
||||
int32 hg_aufade_v0_ioctl(struct aufade_device *aufade, enum aufade_ioctl_cmd ioctl_cmd, uint32 param1, uint32 param2);
|
||||
int32 hg_aufade_v0_request_irq(struct aufade_device *aufade, enum aufade_irq_flag irq_flag, aufade_irq_hdl irq_hdl, uint32 irq_data);
|
||||
int32 hg_aufade_v0_release_irq(struct aufade_device *aufade, enum aufade_irq_flag irq_flag);
|
||||
int32 hg_aufade_v0_set_gain(struct hg_audio_hw_v0 *audio_hw, uint32 gain);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HG_AUFADE_V0_H_ */
|
||||
Reference in New Issue
Block a user