18#if VSF_HAL_USE_I2S == ENABLED
23#define vsf_real_i2s_t VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_t)
24#define vsf_real_i2s_capability VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_capability)
26#ifndef VSF_I2S_CFG_REIMPLEMENT_API_CAPABILITY
27# define VSF_I2S_CFG_REIMPLEMENT_API_CAPABILITY DISABLED
30#ifdef VSF_I2S_CFG_IMP_REMAP_PREFIX
31# undef VSF_I2S_CFG_REIMPLEMENT_API_CAPABILITY
32# define VSF_I2S_CFG_REIMPLEMENT_API_CAPABILITY ENABLED
35#if VSF_I2S_CFG_REIMPLEMENT_API_CAPABILITY == DISABLED
36# ifndef VSF_I2S_CFG_CAPABILITY_IS_SRC_SUPPORTED
37# define VSF_I2S_CFG_CAPABILITY_IS_SRC_SUPPORTED 1
39# ifndef VSF_I2S_CFG_CAPABILITY_IS_DBUFFER_SUPPORTED
40# define VSF_I2S_CFG_CAPABILITY_IS_DBUFFER_SUPPORTED 1
47#if VSF_I2S_CFG_REIMPLEMENT_API_CAPABILITY == DISABLED
52 .is_src_supported = VSF_I2S_CFG_CAPABILITY_IS_SRC_SUPPORTED
53 .is_dbuffer_supported = VSF_I2S_CFG_CAPABILITY_IS_DBUFFER_SUPPORTED
57 return i2s_capability;
63#undef VSF_I2S_CFG_REIMPLEMENT_API_CAPABILITY
64#undef VSF_I2S_CFG_CAPABILITY_IS_SRC_SUPPORTED
65#undef VSF_I2S_CFG_CAPABILITY_IS_DBUFFER_SUPPORTED
68#undef vsf_real_i2s_capability
72#ifdef VSF_I2S_CFG_IMP_REMAP_PREFIX
73# define vsf_imp_i2s_t VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_t)
74# define vsf_imp_i2s_init VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_init)
75# define vsf_imp_i2s_enable VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_enable)
76# define vsf_imp_i2s_disable VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_disable)
77# define vsf_imp_i2s_status VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_status)
78# define vsf_imp_i2s_capability VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_capability)
79# define vsf_imp_i2s_tx_init VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_tx_init)
80# define vsf_imp_i2s_tx_fini VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_tx_fini)
81# define vsf_imp_i2s_tx_start VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_tx_start)
82# define vsf_imp_i2s_rx_init VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_rx_init)
83# define vsf_imp_i2s_rx_fini VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_rx_fini)
84# define vsf_imp_i2s_rx_start VSF_MCONNECT(VSF_I2S_CFG_IMP_PREFIX, _i2s_rx_start)
86# define vsf_remap_i2s_t VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_t)
87# define vsf_remap_i2s_init VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_init)
88# define vsf_remap_i2s_enable VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_enable)
89# define vsf_remap_i2s_disable VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_disable)
90# define vsf_remap_i2s_status VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_status)
91# define vsf_remap_i2s_capability VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_capability)
92# define vsf_remap_i2s_tx_init VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_tx_init)
93# define vsf_remap_i2s_tx_fini VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_tx_fini)
94# define vsf_remap_i2s_tx_start VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_tx_start)
95# define vsf_remap_i2s_rx_init VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_rx_init)
96# define vsf_remap_i2s_rx_fini VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_rx_fini)
97# define vsf_remap_i2s_rx_start VSF_MCONNECT(VSF_I2S_CFG_IMP_REMAP_PREFIX, _i2s_rx_start)
99# define VSF_I2S_CFG_IMP_REMAP_FUNCTIONS \
100 vsf_err_t vsf_imp_i2s_init(vsf_imp_i2s_t *i2s_ptr, vsf_i2s_cfg_t *cfg_ptr) \
102 VSF_HAL_ASSERT(i2s_ptr != NULL); \
103 return vsf_remap_i2s_init(i2s_ptr, cfg_ptr); \
105 vsf_err_t vsf_imp_i2s_tx_init(vsf_imp_i2s_t *i2s_ptr, vsf_i2s_cfg_t *cfg_ptr) \
107 VSF_HAL_ASSERT(i2s_ptr != NULL); \
108 return vsf_remap_i2s_tx_init(i2s_ptr, cfg_ptr); \
110 void vsf_imp_i2s_tx_fini(vsf_imp_i2s_t *i2s_ptr) \
112 VSF_HAL_ASSERT(i2s_ptr != NULL); \
113 vsf_remap_i2s_tx_fini(i2s_ptr); \
115 vsf_err_t vsf_imp_i2s_tx_start(vsf_imp_i2s_t *i2s_ptr) \
117 VSF_HAL_ASSERT(i2s_ptr != NULL); \
118 return vsf_remap_i2s_tx_start(i2s_ptr); \
120 vsf_err_t vsf_imp_i2s_rx_init(vsf_imp_i2s_t *i2s_ptr, vsf_i2s_cfg_t *cfg_ptr) \
122 VSF_HAL_ASSERT(i2s_ptr != NULL); \
123 return vsf_remap_i2s_rx_init(i2s_ptr, cfg_ptr); \
125 void vsf_imp_i2s_rx_fini(vsf_imp_i2s_t *i2s_ptr) \
127 VSF_HAL_ASSERT(i2s_ptr != NULL); \
128 vsf_remap_i2s_rx_fini(i2s_ptr); \
130 vsf_err_t vsf_imp_i2s_rx_start(vsf_imp_i2s_t *i2s_ptr) \
132 VSF_HAL_ASSERT(i2s_ptr != NULL); \
133 return vsf_remap_i2s_rx_start(i2s_ptr); \
135 fsm_rt_t vsf_imp_i2s_enable(vsf_imp_i2s_t *i2s_ptr) \
137 VSF_HAL_ASSERT(i2s_ptr != NULL); \
138 return vsf_remap_i2s_enable(i2s_ptr); \
140 fsm_rt_t vsf_imp_i2s_disable(vsf_imp_i2s_t *i2s_ptr) \
142 VSF_HAL_ASSERT(i2s_ptr != NULL); \
143 return vsf_remap_i2s_disable(i2s_ptr); \
145 vsf_i2s_status_t vsf_imp_i2s_status(vsf_imp_i2s_t *i2s_ptr) \
147 VSF_HAL_ASSERT(i2s_ptr != NULL); \
148 return vsf_remap_i2s_status(i2s_ptr); \
150 vsf_i2s_capability_t vsf_imp_i2s_capability(vsf_imp_i2s_t *i2s_ptr) \
152 VSF_HAL_ASSERT(i2s_ptr != NULL); \
153 return vsf_remap_i2s_capability(i2s_ptr); \
162#define VSF_HAL_TEMPLATE_IMP_NAME _i2s
163#define VSF_HAL_TEMPLATE_IMP_UPCASE_NAME _I2S
165#ifndef VSF_I2S_CFG_IMP_PREFIX
166# error "Please define VSF_I2S_CFG_IMP_PREFIX in i2s driver"
169#ifndef VSF_I2S_CFG_IMP_UPCASE_PREFIX
170# error "Please define VSF_I2S_CFG_IMP_UPCASE_PREFIX in i2s driver"
173#ifndef VSF_I2S_CFG_IMP_COUNT_MASK_PREFIX
174# define VSF_I2S_CFG_IMP_COUNT_MASK_PREFIX VSF_I2S_CFG_IMP_UPCASE_PREFIX
177#ifdef VSF_I2S_CFG_IMP_REMAP_FUNCTIONS
178# define VSF_HAL_CFG_IMP_REMAP_FUNCTIONS VSF_I2S_CFG_IMP_REMAP_FUNCTIONS
183#undef VSF_I2S_CFG_IMP_PREFIX
184#undef VSF_I2S_CFG_IMP_UPCASE_PREFIX
185#undef VSF_I2S_CFG_IMP_COUNT_MASK_PREFIX
186#undef VSF_I2S_CFG_IMP_LV0
187#undef VSF_I2S_CFG_IMP_REMAP_FUNCTIONS
188#undef VSF_I2S_CFG_IMP_HAS_OP
189#undef VSF_I2S_CFG_IMP_EXTERN_OP
192#undef vsf_imp_i2s_init
193#undef vsf_imp_i2s_enable
194#undef vsf_imp_i2s_disable
195#undef vsf_imp_i2s_status
196#undef vsf_imp_i2s_capability
197#undef vsf_imp_i2s_tx_init
198#undef vsf_imp_i2s_tx_fini
199#undef vsf_imp_i2s_tx_start
200#undef vsf_imp_i2s_rx_init
201#undef vsf_imp_i2s_rx_fini
202#undef vsf_imp_i2s_rx_start
204#undef vsf_remap_i2s_t
205#undef vsf_remap_i2s_init
206#undef vsf_remap_i2s_enable
207#undef vsf_remap_i2s_disable
208#undef vsf_remap_i2s_status
209#undef vsf_remap_i2s_capability
210#undef vsf_remap_i2s_tx_init
211#undef vsf_remap_i2s_tx_fini
212#undef vsf_remap_i2s_tx_start
213#undef vsf_remap_i2s_rx_init
214#undef vsf_remap_i2s_rx_fini
215#undef vsf_remap_i2s_rx_start
Definition vsf_template_i2s.h:181
i2s_capability
Definition vsf_template_i2s.h:190