WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
i2c_porting.c 文件参考
#include "i2c_porting.h"
#include "hal_i2c.h"
#include "hal_i2c_v150.h"
#include "hal_i2c_v150_comm.h"
#include "pinctrl.h"
#include "osal_interrupt.h"
#include "chip_core_irq.h"
#include "arch_port.h"
i2c_porting.c 的引用(Include)关系图:

结构体

struct  i2c_irq_handler
 

宏定义

#define BUS_CLOCK_TIME_24M   24000000UL
 
#define BUS_CLOCK_TIME_40M   40000000UL
 
#define I2C_CLOCK_DEFAULT   BUS_CLOCK_TIME_40M
 

类型定义

typedef void(* i2c_porting_irq_handler) (void)
 
typedef struct i2c_irq_handler i2c_irq_handler_t
 

函数

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.
 

变量

uintptr_t g_i2c_base_addrs [I2C_BUS_MAX_NUMBER]
 
uint32_t g_i2c_clock [I2C_BUS_MAX_NUMBER]
 

宏定义说明

◆ BUS_CLOCK_TIME_24M

#define BUS_CLOCK_TIME_24M   24000000UL

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

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

◆ BUS_CLOCK_TIME_40M

#define BUS_CLOCK_TIME_40M   40000000UL

◆ I2C_CLOCK_DEFAULT

#define I2C_CLOCK_DEFAULT   BUS_CLOCK_TIME_40M

类型定义说明

◆ i2c_irq_handler_t

◆ i2c_porting_irq_handler

typedef void(* i2c_porting_irq_handler) (void)

函数说明

◆ 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.

变量说明

◆ g_i2c_base_addrs

uintptr_t g_i2c_base_addrs[I2C_BUS_MAX_NUMBER]
初始值:
= {
}
#define I2C_BUS_0_BASE_ADDR
Definition platform_core.h:59
#define I2C_BUS_1_BASE_ADDR
Definition platform_core.h:60
unsigned int uintptr_t
Definition td_type.h:65

◆ g_i2c_clock

uint32_t g_i2c_clock[I2C_BUS_MAX_NUMBER]
初始值:
= {
(uint32_t) 40000000UL ,
(uint32_t) 40000000UL ,
}