2022-11-10 22:22:48 +08:00
|
|
|
|
/*
|
|
|
|
|
* Copyright : (C) 2022 Phytium Information Technology, Inc.
|
|
|
|
|
* All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* This program is OPEN SOURCE software: you can redistribute it and/or modify it
|
|
|
|
|
* under the terms of the Phytium Public License as published by the Phytium Technology Co.,Ltd,
|
|
|
|
|
* either version 1.0 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY;
|
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
* See the Phytium Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* FilePath: fi2c_g.c
|
|
|
|
|
* Date: 2022-02-10 14:53:42
|
|
|
|
|
* LastEditTime: 2022-02-18 08:36:14
|
2023-05-11 10:25:21 +08:00
|
|
|
|
* Description: This file is for I2C static configuration
|
2022-11-10 22:22:48 +08:00
|
|
|
|
*
|
|
|
|
|
* Modify History:
|
|
|
|
|
* Ver Who Date Changes
|
|
|
|
|
* ----- ------ -------- --------------------------------------
|
2023-05-11 10:25:21 +08:00
|
|
|
|
* 1.0 zhugengyu 2021/11/1 first commit
|
|
|
|
|
* 1.1 liushengming 2022/02/18 add e2000 configs
|
2022-11-10 22:22:48 +08:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* - This file contains a configuration table that specifies the configuration
|
|
|
|
|
- 驱动全局变量定义,包括静态配置参数 */
|
|
|
|
|
|
|
|
|
|
/***************************** Include Files *********************************/
|
|
|
|
|
|
|
|
|
|
#include "ftypes.h"
|
|
|
|
|
#include "fparameters.h"
|
|
|
|
|
#include "fi2c.h"
|
|
|
|
|
#include "sdkconfig.h"
|
|
|
|
|
/************************** Constant Definitions *****************************/
|
|
|
|
|
|
|
|
|
|
/**************************** Type Definitions *******************************/
|
|
|
|
|
|
|
|
|
|
/***************** Macros (Inline Functions) Definitions *********************/
|
|
|
|
|
|
|
|
|
|
/************************** Function Prototypes ******************************/
|
|
|
|
|
|
|
|
|
|
/************************** Variable Definitions *****************************/
|
|
|
|
|
/**
|
|
|
|
|
* @name: FI2C_CONFIG_TBL
|
|
|
|
|
* @msg: I2C驱动的默认配置参数
|
|
|
|
|
*/
|
2023-05-11 10:25:21 +08:00
|
|
|
|
const FI2cConfig FI2C_CONFIG_TBL[FI2C_NUM] =
|
2022-11-10 22:22:48 +08:00
|
|
|
|
{
|
2023-05-11 10:25:21 +08:00
|
|
|
|
[FI2C0_ID] =
|
2022-11-10 22:22:48 +08:00
|
|
|
|
{
|
2023-05-11 10:25:21 +08:00
|
|
|
|
.instance_id = FI2C0_ID,
|
|
|
|
|
.base_addr = FI2C0_BASE_ADDR,
|
|
|
|
|
.irq_num = FI2C0_IRQ_NUM,
|
2022-11-10 22:22:48 +08:00
|
|
|
|
.irq_prority = 0,
|
2023-05-11 10:25:21 +08:00
|
|
|
|
.ref_clk_hz = FI2C_CLK_FREQ_HZ,
|
2022-11-10 22:22:48 +08:00
|
|
|
|
.work_mode = FI2C_MASTER,
|
|
|
|
|
.slave_addr = 0,
|
|
|
|
|
.use_7bit_addr = TRUE,
|
|
|
|
|
.speed_rate = FI2C_SPEED_STANDARD_RATE
|
|
|
|
|
},
|
2023-05-11 10:25:21 +08:00
|
|
|
|
#if defined(CONFIG_TARGET_E2000) || defined(CONFIG_TARGET_D2000) || defined(CONFIG_TARGET_F2000_4)
|
|
|
|
|
[FI2C1_ID] =
|
2022-11-10 22:22:48 +08:00
|
|
|
|
{
|
2023-05-11 10:25:21 +08:00
|
|
|
|
.instance_id = FI2C1_ID,
|
|
|
|
|
.base_addr = FI2C1_BASE_ADDR,
|
|
|
|
|
.irq_num = FI2C1_IRQ_NUM,
|
2022-11-10 22:22:48 +08:00
|
|
|
|
.irq_prority = 0,
|
2023-05-11 10:25:21 +08:00
|
|
|
|
.ref_clk_hz = FI2C_CLK_FREQ_HZ,
|
2022-11-10 22:22:48 +08:00
|
|
|
|
.work_mode = FI2C_MASTER,
|
|
|
|
|
.slave_addr = 0,
|
|
|
|
|
.use_7bit_addr = TRUE,
|
|
|
|
|
.speed_rate = FI2C_SPEED_STANDARD_RATE
|
|
|
|
|
},
|
|
|
|
|
|
2023-05-11 10:25:21 +08:00
|
|
|
|
[FI2C2_ID] =
|
2022-11-10 22:22:48 +08:00
|
|
|
|
{
|
2023-05-11 10:25:21 +08:00
|
|
|
|
.instance_id = FI2C2_ID,
|
|
|
|
|
.base_addr = FI2C2_BASE_ADDR,
|
|
|
|
|
.irq_num = FI2C2_IRQ_NUM,
|
2022-11-10 22:22:48 +08:00
|
|
|
|
.irq_prority = 0,
|
2023-05-11 10:25:21 +08:00
|
|
|
|
.ref_clk_hz = FI2C_CLK_FREQ_HZ,
|
2022-11-10 22:22:48 +08:00
|
|
|
|
.work_mode = FI2C_MASTER,
|
|
|
|
|
.slave_addr = 0,
|
|
|
|
|
.use_7bit_addr = TRUE,
|
|
|
|
|
.speed_rate = FI2C_SPEED_STANDARD_RATE
|
|
|
|
|
},
|
2023-05-11 10:25:21 +08:00
|
|
|
|
#endif
|
|
|
|
|
#if defined(CONFIG_TARGET_D2000) || defined(CONFIG_TARGET_F2000_4)
|
|
|
|
|
[FI2C3_ID] =
|
2022-11-10 22:22:48 +08:00
|
|
|
|
{
|
2023-05-11 10:25:21 +08:00
|
|
|
|
.instance_id = FI2C3_ID,
|
|
|
|
|
.base_addr = FI2C3_BASE_ADDR,
|
|
|
|
|
.irq_num = FI2C3_IRQ_NUM,
|
2022-11-10 22:22:48 +08:00
|
|
|
|
.irq_prority = 0,
|
2023-05-11 10:25:21 +08:00
|
|
|
|
.ref_clk_hz = FI2C_CLK_FREQ_HZ,
|
2022-11-10 22:22:48 +08:00
|
|
|
|
.work_mode = FI2C_MASTER,
|
|
|
|
|
.slave_addr = 0,
|
|
|
|
|
.use_7bit_addr = TRUE,
|
|
|
|
|
.speed_rate = FI2C_SPEED_STANDARD_RATE
|
|
|
|
|
}
|
2023-05-11 10:25:21 +08:00
|
|
|
|
#endif
|
2022-11-10 22:22:48 +08:00
|
|
|
|
};
|