Skip to content

How to use board level configuration


1. Overview

This document is a CI130X SDK board level adaptation document. It aims to introduce how developers can modify the SDK to adapt to a new board when using a non SDK standard board.


2. Instructions

Board level configuration code path: SDK driver boards

2.1. Code Structure

Source file Description
board_ default. C
Weak definition interface of board level configuration
board.c
board. H
Board level configuration interface
board_ port_ template. C
Example of board level configuration
CI-D06GT01D_ REV. c
CI standard board D06GT01D configuration source file

2.2. Steps to add a new board

When developers need to use a new board with no corresponding configuration source file in the SDK, they need to follow the steps below to add it. If there is already a configuration source file in the SDK, they just need to follow step 2 to associate the current board.

2.2.1. Step 1: Add Source File

Add a new board source file, such as CI-D06GT01D_ REV. c, adding method: copy board_ port_ template. C In SDK driver boards, rename it, and modify the content of the corresponding interface in the source file. If you need to add an interface, see step 3.

2.2.2. Step 2: Associate the new board source file

After adding the source file of a new board under SDK driver boards, you need to associate the source file of the new board with the current SDK by opening the project code and modifying the user_ BOORD in config. h_ PORT_ FILE macro definition enables new board level configuration source files to be associated.

#define BOARD_ PORT_ FILE "CI-D06GT01D_REV_V1.0. c"//The board level configuration source file is associated with CI-D06GT01D_ REV_ V1.0.c

2.2.3. Step 3: Add interface description

(1) Add an interface to the newly added configuration source file. The example source file is taken as an example in the figure.

板级配置使用方法

Figure 2-1 Step 1 of Adding a Board Level Configuration Interface

(2) Add a function declaration to the boards. h file, as shown in the following figure.

板级配置使用方法

Figure 2-2 Step 2 of Adding a Board Level Configuration Interface

(3) In borads_ Add virtual functions with the same name in default. c, as shown in the following figure.

板级配置使用方法

Figure 2-3 Step 3 of Adding a Board Level Configuration Interface