WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
i2c_porting.h 文件参考
#include <stdint.h>
#include <stdbool.h>
#include "platform_core.h"
i2c_porting.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define I2C_BUS_MAX_NUM   I2C_BUS_MAX_NUMBER
 
#define I2C_0_SCL_PIN_CTRL_REG   0x4400D048
 
#define I2C_0_SDA_PIN_CTRL_REG   0x4400D044
 
#define I2C_1_SCL_PIN_CTRL_REG   0x4400D040
 
#define I2C_1_SDA_PIN_CTRL_REG   0x4400D03C
 
#define PIN_CTRL_MODE_2   0x2
 

函数

uintptr_t i2c_porting_base_addr_get (i2c_bus_t bus)
 Get the base address of a specified I2C.
 
void i2c_port_set_clock_value (i2c_bus_t bus, uint32_t clock)
 Set the bus clock of specified i2c.
 
uint32_t i2c_port_get_clock_value (i2c_bus_t bus)
 Get the bus clock of specified i2c.
 
void i2c_port_register_irq (i2c_bus_t bus)
 Register the interrupt of I2C.
 
void i2c_port_unregister_irq (i2c_bus_t bus)
 Unregister the interrupt of I2C.
 
uint32_t i2c_porting_lock (i2c_bus_t bus)
 I2C lock.
 
void i2c_porting_unlock (i2c_bus_t bus, uint32_t irq_sts)
 I2C unlock.
 

宏定义说明

◆ I2C_0_SCL_PIN_CTRL_REG

#define I2C_0_SCL_PIN_CTRL_REG   0x4400D048

◆ I2C_0_SDA_PIN_CTRL_REG

#define I2C_0_SDA_PIN_CTRL_REG   0x4400D044

◆ I2C_1_SCL_PIN_CTRL_REG

#define I2C_1_SCL_PIN_CTRL_REG   0x4400D040

◆ I2C_1_SDA_PIN_CTRL_REG

#define I2C_1_SDA_PIN_CTRL_REG   0x4400D03C

◆ I2C_BUS_MAX_NUM

#define I2C_BUS_MAX_NUM   I2C_BUS_MAX_NUMBER

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2022. All rights reserved.

Description: Provides i2c port template
History:
2022-08-15, Create file.

◆ PIN_CTRL_MODE_2

#define PIN_CTRL_MODE_2   0x2

函数说明

◆ i2c_port_get_clock_value()

uint32_t i2c_port_get_clock_value ( i2c_bus_t  bus)

Get the bus clock of specified i2c.

参数
[in]busThe I2C bus. see i2c_bus_t
返回
The bus clock of specified I2C.

◆ i2c_port_register_irq()

void i2c_port_register_irq ( i2c_bus_t  bus)

Register the interrupt of I2C.

◆ i2c_port_set_clock_value()

void i2c_port_set_clock_value ( i2c_bus_t  bus,
uint32_t  clock 
)

Set the bus clock of specified i2c.

参数
[in]busThe I2C bus. see i2c_bus_t
[in]clockThe bus clock of specified I2C.

◆ i2c_port_unregister_irq()

void i2c_port_unregister_irq ( i2c_bus_t  bus)

Unregister the interrupt of I2C.

◆ i2c_porting_base_addr_get()

uintptr_t i2c_porting_base_addr_get ( i2c_bus_t  bus)

Get the base address of a specified I2C.

参数
[in]busThe bus index of I2C.
返回
The base address of specified I2C.

◆ i2c_porting_lock()

uint32_t i2c_porting_lock ( i2c_bus_t  bus)

I2C lock.

参数
[in]busThe bus index of I2C.
返回
The irq lock number of I2C.

◆ i2c_porting_unlock()

void i2c_porting_unlock ( i2c_bus_t  bus,
uint32_t  irq_sts 
)

I2C unlock.

参数
[in]busThe bus index of I2C.
[in]irq_stsThe irq lock number of I2C.