Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
os_hal_i2s.h
1 /*
2  * (C) 2005-2020 MediaTek Inc. All rights reserved.
3  *
4  * Copyright Statement:
5  *
6  * This MT3620 driver software/firmware and related documentation
7  * ("MediaTek Software") are protected under relevant copyright laws.
8  * The information contained herein is confidential and proprietary to
9  * MediaTek Inc. ("MediaTek"). You may only use, reproduce, modify, or
10  * distribute (as applicable) MediaTek Software if you have agreed to and been
11  * bound by this Statement and the applicable license agreement with MediaTek
12  * ("License Agreement") and been granted explicit permission to do so within
13  * the License Agreement ("Permitted User"). If you are not a Permitted User,
14  * please cease any access or use of MediaTek Software immediately.
15  *
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
18  * PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS
19  * ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
21  * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
22  * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
23  * INCORPORATED IN, OR SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO
24  * LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
25  * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
26  * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
27  * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
28  * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
29  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
30  * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED
31  * HEREUNDER WILL BE ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
32  * RECEIVER TO MEDIATEK DURING THE PRECEDING TWELVE (12) MONTHS FOR SUCH
33  * MEDIATEK SOFTWARE AT ISSUE.
34  */
35 
36 #ifndef __OS_HAL_I2S_H__
37 #define __OS_HAL_I2S_H__
38 
39 #include "mhal_i2s.h"
40 
112 typedef struct {
124  unsigned int msb_offset;
134  unsigned int *tx_buffer_addr;
136  unsigned int tx_buffer_len;
138  unsigned int tx_period_len;
140  unsigned int *rx_buffer_addr;
142  unsigned int rx_buffer_len;
144  unsigned int rx_period_len;
163 #ifdef __cplusplus
164 extern "C" {
165 #endif
166 
179 int mtk_os_hal_config_i2s(i2s_no i2s_port, audio_parameter *parameter);
180 
190 int mtk_os_hal_enable_i2s(i2s_no i2s_port);
191 
201 int mtk_os_hal_disable_i2s(i2s_no i2s_port);
202 
212 int mtk_os_hal_request_i2s(i2s_no i2s_port);
213 
224 int mtk_os_hal_free_i2s(i2s_no i2s_port);
225 
226 #ifdef __cplusplus
227 }
228 #endif
229 
239 #endif /*__OS_HAL_I2S_H__*/
hal_i2s_channel_number channel_number
I2S channel number.
Definition: os_hal_i2s.h:120
hal_i2s_link_bits_sample
I2S bits per sample.
Definition: mhal_i2s.h:258
void * tx_callback_data
TX callback data.
Definition: os_hal_i2s.h:148
int mtk_os_hal_request_i2s(i2s_no i2s_port)
request I2S use.
hal_i2s_link_channel_per_sample
I2S link channel per sample.
Definition: mhal_i2s.h:245
void * rx_callback_data
RX callback data.
Definition: os_hal_i2s.h:152
hal_i2s_tx_mode
Enable or disable the right channel of I2S Tx sending the same data as the left channel of I2S Tx...
Definition: mhal_i2s.h:274
unsigned int tx_buffer_len
TX buffer length (unit:BYTE)
Definition: os_hal_i2s.h:136
i2s_fnen
Function enable/disable.
Definition: mhal_i2s.h:328
i2s_fnen word_select_inverse
LRCK inverse.
Definition: os_hal_i2s.h:126
i2s_no
I2S port number.
Definition: mhal_i2s.h:316
unsigned int * tx_buffer_addr
TX buffer point.
Definition: os_hal_i2s.h:134
unsigned int rx_period_len
RX period length (unit:BYTE)
Definition: os_hal_i2s.h:144
int mtk_os_hal_enable_i2s(i2s_no i2s_port)
Enable I2S.
hal_i2s_channel_number
I2S channel number define.
Definition: mhal_i2s.h:305
int mtk_os_hal_free_i2s(i2s_no i2s_port)
Free I2S request.
void(* i2s_dma_callback_func)(void *user_data)
This defines the callback function prototype.
Definition: mhal_i2s.h:213
hal_i2s_sample_rate
I2S sample rate define.
Definition: mhal_i2s.h:353
int mtk_os_hal_disable_i2s(i2s_no i2s_port)
Disable I2S.
hal_i2s_sample_rate sample_rate
Sample rate.
Definition: os_hal_i2s.h:116
Definition: os_hal_i2s.h:112
unsigned int msb_offset
TDM MSB offset.
Definition: os_hal_i2s.h:124
hal_i2s_link_bits_sample bits_per_sample
Word length.
Definition: os_hal_i2s.h:118
unsigned int rx_buffer_len
RX buffer length (unit:BYTE)
Definition: os_hal_i2s.h:142
i2s_dma_callback_func tx_callback_func
TX DMA callback function.
Definition: os_hal_i2s.h:146
unsigned int tx_period_len
TX period length (unit:BYTE)
Definition: os_hal_i2s.h:138
hal_i2s_link_channel_per_sample channels_per_sample
TDM channel number.
Definition: os_hal_i2s.h:122
i2s_fnen lr_swap
LR swap.
Definition: os_hal_i2s.h:128
hal_i2s_initial_type i2s_initial_type
Protocol mode.
Definition: os_hal_i2s.h:114
hal_i2s_rx_down_rate
Enable or disable 2x down sample rate mode in the I2S Rx link.
Definition: mhal_i2s.h:292
hal_i2s_initial_type
This enum defines the initial type of I2S.
Definition: mhal_i2s.h:339
hal_i2s_rx_down_rate rx_down_rate
RX down rate.
Definition: os_hal_i2s.h:132
int mtk_os_hal_config_i2s(i2s_no i2s_port, audio_parameter *parameter)
Set the I2S configuration.
unsigned int * rx_buffer_addr
RX buffer point.
Definition: os_hal_i2s.h:140
i2s_dma_callback_func rx_callback_func
TX DMA callback function.
Definition: os_hal_i2s.h:150
hal_i2s_tx_mode tx_mode
Right channel data as the left channel of I2S Tx.
Definition: os_hal_i2s.h:130