Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Function

This section provides high level APIs to upper layer. More...

Overview

This section provides high level APIs to upper layer.

Functions

int mtk_os_hal_config_i2s (i2s_no i2s_port, audio_parameter *parameter)
 Set the I2S configuration. More...
 
int mtk_os_hal_enable_i2s (i2s_no i2s_port)
 Enable I2S. More...
 
int mtk_os_hal_disable_i2s (i2s_no i2s_port)
 Disable I2S. More...
 
int mtk_os_hal_request_i2s (i2s_no i2s_port)
 request I2S use. More...
 
int mtk_os_hal_free_i2s (i2s_no i2s_port)
 Free I2S request. More...
 

Function Documentation

int mtk_os_hal_config_i2s ( i2s_no  i2s_port,
audio_parameter parameter 
)

Set the I2S configuration.

Usage: User can call this function to configure I2S.
The mtk_os_hal_config_i2s() function configures the I2S and DMA for I2S settings and start up DMA for I2S.

Parameters
[in]i2s_port: enum i2s_no.
[in]parameter: struct audio_parameter.
Returns
Return "0" if configure I2S and DMA for I2S are sucessfully.
Return -I2S_EPTR if the i2s_port is over MTK_I2S_MAX_PORT_NUMBER or parameter is invalid.
int mtk_os_hal_enable_i2s ( i2s_no  i2s_port)

Enable I2S.

Usage: User can call this function to start I2S TX and RX

Parameters
[in]i2s_port: enum i2s_no.
Returns
Return "0" if start I2S TX and RX are sucessfully.
Return -I2S_EPTR if the i2s_port is over MTK_I2S_MAX_PORT_NUMBER or enable I2S TX and RX are fail.
int mtk_os_hal_disable_i2s ( i2s_no  i2s_port)

Disable I2S.

Usage: User can call this function to start I2S TX, RX and DMA

Parameters
[in]i2s_port: enum i2s_no.
Returns
Return "0" if stop I2S TX, RX and DMA are sucessfully.
Return -I2S_EPTR if the i2s_port is over MTK_I2S_MAX_PORT_NUMBER or stop I2S TX, RX and DMA are fail.
int mtk_os_hal_request_i2s ( i2s_no  i2s_port)

request I2S use.

Usage: User can call this function to request the DMA channels.

Parameters
[in]i2s_port: enum i2s_no.
Returns
Return "0" if request I2S PINMUX and DMA channels are sucessfully.
Return -I2S_EPTR if the i2s_port is over MTK_I2S_MAX_PORT_NUMBER or DMA channel request fail
int mtk_os_hal_free_i2s ( i2s_no  i2s_port)

Free I2S request.

Usage: User can call this function to release the DMA channels and I2S PINMUX request.

Parameters
[in]i2s_port: enum i2s_no.
Returns
Return "0" if free PINMUX and DMA channel are sucessfully.
Return -I2S_EPTR if the i2s_port is over MTK_I2S_MAX_PORT_NUMBER or DMA channel release is fail