blob: 8ea6a12dec0b34e329ff96dc37677ef4ae69e650 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
/*
* 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_sinit.c
* Date: 2022-02-10 14:53:42
* LastEditTime: 2022-02-18 08:36:52
* Description: This files is for
*
* Modify History:
* Ver Who Date Changes
* ----- ------ -------- --------------------------------------
*/
/* - This file contains the implementation of driver's static initialization functionality.
- 驱动静态初始化 */
/***************************** Include Files *********************************/
#include "ftypes.h"
#include "fparameters.h"
#include "fi2c.h"
#include "sdkconfig.h"
/************************** Constant Definitions *****************************/
/**************************** Type Definitions *******************************/
/***************** Macros (Inline Functions) Definitions *********************/
/************************** Variable Definitions *****************************/
extern const FI2cConfig FI2C_CONFIG_TBL[I2C_INSTANCE_NUM];
/************************** Function Prototypes ******************************/
/**
* @name: FI2cLookupConfig
* @msg: 获取I2C驱动的默认配置参数
* @return {const FI2cConfig*} 驱动默认参数
* @param {u32} instance_id, 当前控制的I2C控制器实例号
*/
const FI2cConfig *FI2cLookupConfig(u32 instance_id)
{
const FI2cConfig *ptr = NULL;
u32 index;
for (index = 0; index < (u32)I2C_INSTANCE_NUM; index++)
{
if (FI2C_CONFIG_TBL[index].instance_id == instance_id)
{
ptr = &FI2C_CONFIG_TBL[index];
break;
}
}
return (const FI2cConfig *)ptr;
}
|