18#ifndef __VSF_AUDIO_H__
19#define __VSF_AUDIO_H__
23#include "../vsf_av_cfg.h"
25#if VSF_USE_AUDIO == ENABLED
32#if defined(__VSF_AUDIO_CLASS_IMPLEMENT)
33# undef __VSF_AUDIO_CLASS_IMPLEMENT
34# define __VSF_CLASS_IMPLEMENT__
36#elif defined(__VSF_AUDIO_CLASS_INHERIT__)
37# undef __VSF_AUDIO_CLASS_INHERIT__
38# define __VSF_CLASS_INHERIT__
41# define PUBLIC_CONST const
52#if VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL != ENABLED
53# error VSF_KERNEL_CFG_EDA_SUPPORT_SUB_CALL is needed to use audio
56#define __describe_audio_ticktock_stream_adapter(__name, __stream_tx, __stream_rx, __frame_size)\
57 vsf_audio_ticktock_stream_adapter_t __name = { \
58 VSF_STREAM_ADAPTER_INIT((__stream_tx), (__stream_rx), (__frame_size), (__frame_size))\
62#define describe_audio_ticktock_stream_adapter(__name, __stream_tx, __stream_rx, __frame_size)\
63 __describe_audio_ticktock_stream_adapter(__name, (__stream_tx), (__stream_rx), __frame_size)
83#define VSF_AUDIO_DATA_TYPE_IS_FLOAT(__VALUE) ((__VALUE) & VSF_AUDIO_DATA_TYPE_FLOAT)
84#define VSF_AUDIO_DATA_TYPE_IS_INT(__VALUE) !VSF_AUDIO_DATA_TYPE_IS_FLOAT(__VALUE)
88#define VSF_AUDIO_DATA_TYPE_IS_SIGNED(__VALUE) ((__VALUE) & VSF_AUDIO_DATA_TYPE_SIGNED)
89#define VSF_AUDIO_DATA_TYPE_IS_UNSIGNED(__VALUE) !VSF_AUDIO_DATA_TYPE_IS_SIGNED(__VALUE)
93#define VSF_AUDIO_DATA_TYPE_IS_BE(__VALUE) ((__VALUE) & VSF_AUDIO_DATA_TYPE_BE)
94#define VSF_AUDIO_DATA_TYPE_IS_LE(__VALUE) !VSF_AUDIO_DATA_TYPE_IS_LE(__VALUE)
97#define __VSF_AUDIO_DATA_TYPE_BITLEN(__LEN) (((((__LEN) - 1) >> 1) & 0x1F) << 3)
98#define VSF_AUDIO_DATA_TYPE_BITLEN(__VALUE) (((((__VALUE) >> 3) & 0x1F) + 1) << 1)
100#define VSF_AUDIO_DATA_TYPE_BEUL(__LEN) (VSF_AUDIO_DATA_TYPE_BEU | __VSF_AUDIO_DATA_TYPE_BITLEN(__LEN))
101#define VSF_AUDIO_DATA_TYPE_BESL(__LEN) (VSF_AUDIO_DATA_TYPE_BES | __VSF_AUDIO_DATA_TYPE_BITLEN(__LEN))
102#define VSF_AUDIO_DATA_TYPE_LEUL(__LEN) (VSF_AUDIO_DATA_TYPE_LEU | __VSF_AUDIO_DATA_TYPE_BITLEN(__LEN))
103#define VSF_AUDIO_DATA_TYPE_LESL(__LEN) (VSF_AUDIO_DATA_TYPE_LES | __VSF_AUDIO_DATA_TYPE_BITLEN(__LEN))
205#if VSF_AUDIO_USE_PLAYBACK == ENABLED
209#if VSF_AUDIO_USE_CAPTURE == ENABLED
219#if VSF_AUDIO_USE_DECODER_WAV == ENABLED
223#if VSF_AUDIO_USE_WINSOUND == ENABLED
227#if VSF_AUDIO_USE_DUMMY == ENABLED
231#if VSF_HAL_USE_I2S == ENABLED
234# if VSF_AUDIO_USE_AIC1000A == ENABLED
vsf_err_t
Definition __type.h:42
Definition vsf_audio.h:158
Definition vsf_audio.h:74
Definition vsf_audio.h:145
Definition vsf_audio.h:184
Definition vsf_simple_stream.h:286
Definition vsf_simple_stream.h:254
vsf_arch_prio_t
Definition cortex_a_generic.h:88
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
#define vsf_dcl_class
Definition ooc_class.h:46
#define vsf_class(__name)
Definition ooc_class.h:48
unsigned char uint_fast8_t
Definition stdint.h:23
Definition vsf_audio.h:68
vsf_peda_evthandler_t stop
Definition vsf_audio.h:71
vsf_peda_evthandler_t control
Definition vsf_audio.h:69
vsf_peda_evthandler_t start
Definition vsf_audio.h:70
vsf_err_t vk_audio_control(vk_audio_dev_t *pthis, uint_fast8_t stream_idx, vk_av_control_type_t type, vk_av_control_value_t value)
Definition vsf_audio.c:72
vsf_err_t vk_audio_stop(vk_audio_dev_t *pthis, uint_fast8_t stream_idx)
Definition vsf_audio.c:111
vk_audio_stream_t * audio_stream
Definition vsf_audio.h:169
#define VSF_AUDIO_DATA_TYPE_BESL(__LEN)
Definition vsf_audio.h:101
vk_audio_data_type_t
Definition vsf_audio.h:80
@ VSF_AUDIO_DATA_TYPE_LEU32
Definition vsf_audio.h:119
@ VSF_AUDIO_DATA_TYPE_BES32
Definition vsf_audio.h:115
@ VSF_AUDIO_DATA_TYPE_BES
Definition vsf_audio.h:105
@ VSF_AUDIO_DATA_TYPE_BEU16
Definition vsf_audio.h:109
@ VSF_AUDIO_DATA_TYPE_LES8
Definition vsf_audio.h:120
@ VSF_AUDIO_DATA_TYPE_INT
Definition vsf_audio.h:82
@ VSF_AUDIO_DATA_TYPE_BEU
Definition vsf_audio.h:104
@ VSF_AUDIO_DATA_TYPE_FLOAT
Definition vsf_audio.h:81
@ VSF_AUDIO_DATA_TYPE_BE
Definition vsf_audio.h:91
@ VSF_AUDIO_DATA_TYPE_LES
Definition vsf_audio.h:107
@ VSF_AUDIO_DATA_TYPE_LES32
Definition vsf_audio.h:123
@ VSF_AUDIO_DATA_TYPE_LEU8
Definition vsf_audio.h:116
@ VSF_AUDIO_DATA_TYPE_LEU16
Definition vsf_audio.h:117
@ VSF_AUDIO_DATA_TYPE_BEU8
Definition vsf_audio.h:108
@ VSF_AUDIO_DATA_TYPE_BES16
Definition vsf_audio.h:113
@ VSF_AUDIO_DATA_TYPE_LEU
Definition vsf_audio.h:106
@ VSF_AUDIO_DATA_TYPE_BEU24
Definition vsf_audio.h:110
@ VSF_AUDIO_DATA_TYPE_BES8
Definition vsf_audio.h:112
@ VSF_AUDIO_DATA_TYPE_BES24
Definition vsf_audio.h:114
@ VSF_AUDIO_DATA_TYPE_LE
Definition vsf_audio.h:92
@ VSF_AUDIO_DATA_TYPE_LES24
Definition vsf_audio.h:122
@ VSF_AUDIO_DATA_TYPE_BEU32
Definition vsf_audio.h:111
@ VSF_AUDIO_DATA_TYPE_LES16
Definition vsf_audio.h:121
@ VSF_AUDIO_DATA_TYPE_LEU24
Definition vsf_audio.h:118
@ VSF_AUDIO_DATA_TYPE_SIGNED
Definition vsf_audio.h:86
@ VSF_AUDIO_DATA_TYPE_UNSIGNED
Definition vsf_audio.h:87
void vsf_audio_capture_ticktock_stream_adapter_init(vsf_audio_ticktock_stream_adapter_t *adapter)
Definition vsf_audio.c:204
#define VSF_AUDIO_DATA_TYPE_LESL(__LEN)
Definition vsf_audio.h:103
#define VSF_AUDIO_DATA_TYPE_BEUL(__LEN)
Definition vsf_audio.h:100
#define PUBLIC_CONST
Definition vsf_audio.h:41
vk_av_control_value_t value
Definition vsf_audio.h:171
vk_av_control_type_t type
Definition vsf_audio.h:170
vsf_err_t vk_audio_init(vk_audio_dev_t *pthis)
Definition vsf_audio.c:56
void vsf_audio_playback_ticktock_stream_adapter_init(vsf_audio_ticktock_stream_adapter_t *adapter)
Definition vsf_audio.c:164
vsf_err_t vk_audio_start(vk_audio_dev_t *pthis, uint_fast8_t stream_idx, vsf_stream_t *stream, vk_audio_format_t *format)
Definition vsf_audio.c:90
#define VSF_AUDIO_DATA_TYPE_LEUL(__LEN)
Definition vsf_audio.h:102
vk_av_control_type_t
Definition vsf_av.h:38
#define __vsf_component_peda_ifs(__peda_name,...)
Definition vsf_component_cfg.h:62
#define vsf_peda_evthandler_t
Definition vsf_component_cfg.h:37