WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
sio_porting.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2023-2023. All rights reserved.
3 * Description: I2S port for project
4 *
5 * Create: 2023-03-10
6 */
7
8#ifndef SIO_PORTING_H
9#define SIO_PORTING_H
10
11#include <stdint.h>
12#include <stdbool.h>
13#include "chip_io.h"
14#include "platform_core.h"
15
16#ifdef __cplusplus
17#if __cplusplus
18extern "C" {
19#endif /* __cplusplus */
20#endif /* __cplusplus */
21
27#define I2S_S_CLK 32000
28#define FREQ_OF_NEED 32
29#define SIO_LOOP 8
30#define I2S_M_CLK 32000
31#define I2S_CR 0x608
32#define I2S_CR_DIV_NUM_BIT 5
33#define I2S_CR_DIV_NUM_LEN 4
34#define I2S_FIFO_SIZE 16
35#define HAL_CFG_I2S_BCLK_DIV_EN 0x1000
36#define HAL_CFG_I2S_CLK_SEL 0x1014
37#define HAL_CFG_I2S_MS_CFG 0x1024
38#define HAL_CFG_I2S_FS_DIV_EN 0x1008
39#define HAL_CFG_I2S_FS_DIV_NUM 0x100c
40#define HAL_CFG_I2S_FS_DIV_RATIO_NUM 0x1010
41#define M_CLKEN0 0x40
42#define I2S_DUTY_CYCLE 2
43#define PCM_DIV_RATIO_NUM 1
44#define CFG_I2S_BCLK_DIV_EN 0
45#define CFG_I2S_BCLK_LOAD_DIV_EN 1
46#define I2S_FS_DIV_NUM_CONFIG_BITS 11
47#define I2S_FS_DIV_RATIO_NUM_BITS 11
48#define I2S_READ_WAIT_TIMES_MAX 8
49#define I2S_PARAM 2
50
51#define SIXTEEN_WIDTH 16
52#define EIGHTTEEN_WIDTH 18
53#define TWENTY_WIDTH 20
54#define TWENTY_FOUR_WIDTH 24
55#define THIRTY_TWO_WIDTH 32
56#define NUM_OF_PIN_REGS 5
57#define CONFIG_I2S_BUS_MAX_NUM 1
58#define CONFIG_I2S_SUPPORT_LOOPBACK 1
59#define CONFIG_DATA_LEN_MAX 128
60
65typedef void (*i2s_irq_func_t)(void);
66
73
79
85
91
97
101void irq_sio0_handler(void);
102
107void sio_porting_clock_enable(bool enable);
108
112void sio_porting_i2s_pinmux(void);
113
117uint32_t sio_porting_get_mclk(void);
118
122uint32_t sio_porting_get_bclk_div_num(uint8_t data_width, uint32_t ch);
124
126
128
130
132
134
135#if defined(CONFIG_I2S_SUPPORT_DMA)
136uint32_t i2s_port_get_dma_trans_src_handshaking(sio_bus_t bus);
137
138uint32_t i2s_port_get_dma_trans_dest_handshaking(sio_bus_t bus);
139#endif
140
145#ifdef __cplusplus
146#if __cplusplus
147}
148#endif /* __cplusplus */
149#endif /* __cplusplus */
150
151#endif
sio_bus_t
SIO(I2S/PCM) Bus.
Definition platform_core.h:254
uint32_t sio_porting_get_bclk_div_num(uint8_t data_width, uint32_t ch)
get bclk.
Definition sio_porting.c:144
uint32_t sio_porting_get_mclk(void)
get mclk.
Definition sio_porting.c:173
void sio_porting_unregister_hal_funcs(sio_bus_t bus)
Unregister hal funcs objects from hal_sio module.
Definition sio_porting.c:63
uintptr_t i2s_porting_tx_left_data_addr_get(sio_bus_t bus)
Definition sio_porting.c:120
void(* i2s_irq_func_t)(void)
Definition of the contorl ID of hal sio.
Definition sio_porting.h:65
uintptr_t i2s_porting_rx_right_data_addr_get(sio_bus_t bus)
Definition sio_porting.c:138
uintptr_t i2s_porting_rx_left_data_addr_get(sio_bus_t bus)
Definition sio_porting.c:132
uintptr_t i2s_porting_tx_right_data_addr_get(sio_bus_t bus)
Definition sio_porting.c:126
void sio_porting_clock_enable(bool enable)
SIO clock.
Definition sio_porting.c:84
void sio_porting_register_hal_funcs(sio_bus_t bus)
Register hal funcs objects into hal_sio module.
Definition sio_porting.c:58
uintptr_t i2s_porting_rx_merge_data_addr_get(sio_bus_t bus)
Definition sio_porting.c:114
void sio_porting_register_irq(sio_bus_t bus)
Register the interrupt of sio.
Definition sio_porting.c:68
void sio_porting_unregister_irq(sio_bus_t bus)
Unregister the interrupt of sio.
Definition sio_porting.c:74
uintptr_t sio_porting_base_addr_get(sio_bus_t bus)
Get the base address of a specified sio.
Definition sio_porting.c:53
void sio_porting_i2s_pinmux(void)
Config the pin mode.
Definition sio_porting.c:97
uintptr_t i2s_porting_tx_merge_data_addr_get(sio_bus_t bus)
Definition sio_porting.c:108
void irq_sio0_handler(void)
The interrupt handler of sio0.
Definition sio_porting.c:79
#define ch(x, y, z)
Definition sha256.c:18
unsigned int uintptr_t
Definition td_type.h:65