diff --git a/docs/development_guide/build/doctrees/api_reference/peripheral/api_clock.doctree b/docs/development_guide/build/doctrees/api_reference/peripheral/api_clock.doctree index 9e723b73..be5fbf63 100644 Binary files a/docs/development_guide/build/doctrees/api_reference/peripheral/api_clock.doctree and b/docs/development_guide/build/doctrees/api_reference/peripheral/api_clock.doctree differ diff --git a/docs/development_guide/build/doctrees/api_reference/peripheral/api_i2c.doctree b/docs/development_guide/build/doctrees/api_reference/peripheral/api_i2c.doctree index 9659be47..a000cd89 100644 Binary files a/docs/development_guide/build/doctrees/api_reference/peripheral/api_i2c.doctree and b/docs/development_guide/build/doctrees/api_reference/peripheral/api_i2c.doctree differ diff --git a/docs/development_guide/build/doctrees/api_reference/peripheral/api_pwm.doctree b/docs/development_guide/build/doctrees/api_reference/peripheral/api_pwm.doctree index 6cb8cf72..98af7d1b 100644 Binary files a/docs/development_guide/build/doctrees/api_reference/peripheral/api_pwm.doctree and b/docs/development_guide/build/doctrees/api_reference/peripheral/api_pwm.doctree differ diff --git a/docs/development_guide/build/doctrees/api_reference/usb stack/api_usb_stack.doctree b/docs/development_guide/build/doctrees/api_reference/usb stack/api_usb_stack.doctree index 355f2bc0..1a0de7a3 100644 Binary files a/docs/development_guide/build/doctrees/api_reference/usb stack/api_usb_stack.doctree and b/docs/development_guide/build/doctrees/api_reference/usb stack/api_usb_stack.doctree differ diff --git a/docs/development_guide/build/doctrees/environment.pickle b/docs/development_guide/build/doctrees/environment.pickle index b13ec5ea..cf1bdedb 100644 Binary files a/docs/development_guide/build/doctrees/environment.pickle and b/docs/development_guide/build/doctrees/environment.pickle differ diff --git a/docs/development_guide/build/doctrees/get_started/cdk_new_project_quick_start.doctree b/docs/development_guide/build/doctrees/get_started/cdk_new_project_quick_start.doctree new file mode 100644 index 00000000..52dc10e8 Binary files /dev/null and b/docs/development_guide/build/doctrees/get_started/cdk_new_project_quick_start.doctree differ diff --git a/docs/development_guide/build/doctrees/index.doctree b/docs/development_guide/build/doctrees/index.doctree index d3c4531f..086c55e0 100644 Binary files a/docs/development_guide/build/doctrees/index.doctree and b/docs/development_guide/build/doctrees/index.doctree differ diff --git a/docs/development_guide/build/doctrees/samples/advance samples/ble_scan_demo.doctree b/docs/development_guide/build/doctrees/samples/advance samples/ble_scan_demo.doctree index dca6baa1..dfa8f9b3 100644 Binary files a/docs/development_guide/build/doctrees/samples/advance samples/ble_scan_demo.doctree and b/docs/development_guide/build/doctrees/samples/advance samples/ble_scan_demo.doctree differ diff --git a/docs/development_guide/build/doctrees/samples/advance samples/lowpower_demo.doctree b/docs/development_guide/build/doctrees/samples/advance samples/lowpower_demo.doctree index 11509836..80eb7f1e 100644 Binary files a/docs/development_guide/build/doctrees/samples/advance samples/lowpower_demo.doctree and b/docs/development_guide/build/doctrees/samples/advance samples/lowpower_demo.doctree differ diff --git a/docs/development_guide/build/doctrees/samples/basic samples/timer/index.doctree b/docs/development_guide/build/doctrees/samples/basic samples/timer/index.doctree new file mode 100644 index 00000000..0e3a192b Binary files /dev/null and b/docs/development_guide/build/doctrees/samples/basic samples/timer/index.doctree differ diff --git a/docs/development_guide/build/doctrees/samples/basic samples/timer/timer_interrupt_demo.doctree b/docs/development_guide/build/doctrees/samples/basic samples/timer/timer_interrupt_demo.doctree new file mode 100644 index 00000000..efa67be3 Binary files /dev/null and b/docs/development_guide/build/doctrees/samples/basic samples/timer/timer_interrupt_demo.doctree differ diff --git a/docs/development_guide/build/html/_images/cdk_start_1.png b/docs/development_guide/build/html/_images/cdk_start_1.png new file mode 100644 index 00000000..4f2a1549 Binary files /dev/null and b/docs/development_guide/build/html/_images/cdk_start_1.png differ diff --git a/docs/development_guide/build/html/_images/cdk_start_2.png b/docs/development_guide/build/html/_images/cdk_start_2.png new file mode 100644 index 00000000..01c0ef2f Binary files /dev/null and b/docs/development_guide/build/html/_images/cdk_start_2.png differ diff --git a/docs/development_guide/build/html/_images/cdk_start_3.png b/docs/development_guide/build/html/_images/cdk_start_3.png new file mode 100644 index 00000000..1e23de95 Binary files /dev/null and b/docs/development_guide/build/html/_images/cdk_start_3.png differ diff --git a/docs/development_guide/build/html/_images/cdk_start_4.png b/docs/development_guide/build/html/_images/cdk_start_4.png new file mode 100644 index 00000000..d211581a Binary files /dev/null and b/docs/development_guide/build/html/_images/cdk_start_4.png differ diff --git a/docs/development_guide/build/html/_images/cdk_start_5.png b/docs/development_guide/build/html/_images/cdk_start_5.png new file mode 100644 index 00000000..a26426ae Binary files /dev/null and b/docs/development_guide/build/html/_images/cdk_start_5.png differ diff --git a/docs/development_guide/build/html/_sources/api_reference/peripheral/api_clock.rst.txt b/docs/development_guide/build/html/_sources/api_reference/peripheral/api_clock.rst.txt index da42102c..1d373b88 100644 --- a/docs/development_guide/build/html/_sources/api_reference/peripheral/api_clock.rst.txt +++ b/docs/development_guide/build/html/_sources/api_reference/peripheral/api_clock.rst.txt @@ -4,7 +4,7 @@ 简介 ------------------------ -博流系列芯片拥有丰富的时钟源选择,为方便用户配置,提供了时钟树配置表,不需要用户手动调用时钟设置接口,用户只需要关心最终的系统时钟和外设时钟频率即可。时钟配置表位于 ``bsp/board/xxx_board`` 目录下 ``xxx_clock_config.h`` 文件。 +博流系列芯片拥有丰富的时钟源选择,为方便用户配置,提供了时钟树配置表,不需要用户手动调用时钟设置接口,用户只需要关心最终的系统时钟和外设时钟频率即可。时钟配置表位于 ``bsp/board/xxx_board`` 目录下 ``clock_config.h`` 文件。 时钟频率获取接口 @@ -31,6 +31,8 @@ SYSTEM_CLOCK_FCLK, SYSTEM_CLOCK_BCLK, SYSTEM_CLOCK_XCLK, + SYSTEM_CLOCK_32K_CLK, + SYSTEM_CLOCK_AUPLL, }; @@ -57,4 +59,6 @@ PERIPHERAL_CLOCK_ADC, PERIPHERAL_CLOCK_DAC, PERIPHERAL_CLOCK_I2S, + PERIPHERAL_CLOCK_PWM, + PERIPHERAL_CLOCK_CAM, }; \ No newline at end of file diff --git a/docs/development_guide/build/html/_sources/api_reference/peripheral/api_i2c.rst.txt b/docs/development_guide/build/html/_sources/api_reference/peripheral/api_i2c.rst.txt index 84df7e81..21af5bdc 100644 --- a/docs/development_guide/build/html/_sources/api_reference/peripheral/api_i2c.rst.txt +++ b/docs/development_guide/build/html/_sources/api_reference/peripheral/api_i2c.rst.txt @@ -30,7 +30,7 @@ I2C 设备结构体定义 - parent 继承父类属性 - ch i2c id,0 表示 i2c0,1 表示 i2c1 - mode i2c 传输模式,0 为使用硬件 i2c,1 为使用软件 i2c,当前软件 i2c 暂时无效 -- phase +- phase 用来计算 i2c 实际时序时钟 ,公式:i2c_clk = i2c_source_clk/(4*(phase+1)) - 其他待补充 I2C 设备参数配置表 diff --git a/docs/development_guide/build/html/_sources/api_reference/peripheral/api_pwm.rst.txt b/docs/development_guide/build/html/_sources/api_reference/peripheral/api_pwm.rst.txt index 5fd7049b..5087745d 100644 --- a/docs/development_guide/build/html/_sources/api_reference/peripheral/api_pwm.rst.txt +++ b/docs/development_guide/build/html/_sources/api_reference/peripheral/api_pwm.rst.txt @@ -30,13 +30,13 @@ PWM 设备结构体定义 - ch 通道号,使能PWM通道0则ch为0,使能PWM通道0则ch为1,以此类推 - polarity_invert_mode 极性翻转使能 - period PWM 周期值 -- threshold_low PWM 低门限阈值 -- threshold_high PWM 高门限阈值 +- threshold_low PWM 低门限阈值,不能大于period +- threshold_high PWM 高门限阈值,不能大于period - it_pulse_count 触发中断条件的周期计数值 .. note:: PWM 实际频率 = PWM 时钟源/分频/period ,period 非 PWM 实际周期, -.. note:: PWM 占空比 = threshold_low/threshold_high * 100% +.. note:: PWM 占空比 = (threshold_high-threshold_low)/period * 100% PWM 设备参数配置表 ------------------------ @@ -193,11 +193,11 @@ PWM 设备除了标准的控制命令,还具有自己特殊的控制命令。 +------------------------------------------+---------------------------+--------------------------+ |DEVICE_CTRL_SUSPEND |NULL |关闭当前PWM通道 | +------------------------------------------+---------------------------+--------------------------+ -|DEIVCE_CTRL_PWM_FREQUENCE_CONFIG |uint32_t |配置当前PWM通道周期值 | +|DEVICE_CTRL_PWM_FREQUENCE_CONFIG |uint32_t |配置当前PWM通道周期值 | +------------------------------------------+---------------------------+--------------------------+ -|DEIVCE_CTRL_PWM_DUTYCYCLE_CONFIG |pwm_dutycycle_config_t |配置当前PWM通道占空比 | +|DEVICE_CTRL_PWM_DUTYCYCLE_CONFIG |pwm_dutycycle_config_t |配置当前PWM通道占空比 | +------------------------------------------+---------------------------+--------------------------+ -|DEIVCE_CTRL_PWM_IT_PULSE_COUNT_CONFIG |uint32_t |配置触发PWM中断周期值 | +|DEVICE_CTRL_PWM_IT_PULSE_COUNT_CONFIG |uint32_t |配置触发PWM中断周期值 | +------------------------------------------+---------------------------+--------------------------+ **device_set_callback** diff --git a/docs/development_guide/build/html/_sources/api_reference/usb stack/api_usb_stack.rst.txt b/docs/development_guide/build/html/_sources/api_reference/usb stack/api_usb_stack.rst.txt index e03bc967..dafd402b 100644 --- a/docs/development_guide/build/html/_sources/api_reference/usb stack/api_usb_stack.rst.txt +++ b/docs/development_guide/build/html/_sources/api_reference/usb stack/api_usb_stack.rst.txt @@ -1,7 +1,7 @@ USB Stack ======================= -USB Stack 是一个跨平台的、用于嵌入式 MCU 的 USB 协议栈。其中 DEVICE 协议栈对标准设备请求、CLASS 请求、VENDOR 请求规范了一套统一的函数框架,从而对复合设备或者使用自定义设备类时,能够在极短的时间内进行添加和移植,提供了一套标准的 porting 接口,供给不同的 MCU 使用,因此,通用性非常高。此外在代码优美方面,以及内存占用方面也是相当出色。USB DEVICE 协议栈当前具有以下功能: +USB Stack 是一个跨平台的、用于嵌入式 MCU 的 USB 协议栈。其中 DEVICE 协议栈对标准设备请求、CLASS 请求、VENDOR 请求规范了一套统一的函数框架,从而对复合设备或者使用自定义设备类时,能够在极短的时间内进行添加和移植。同时提供了一套标准的 dcd porting 接口,供给不同的 MCU 使用,因此,通用性也非常高。此外在代码优美方面,以及内存占用方面也是相当出色。USB DEVICE 协议栈当前具有以下功能: - 支持 USB2.0 全速和高速设备 - 支持端点中断注册功能,porting 给用户自己处理中断里的数据 diff --git a/docs/development_guide/build/html/_sources/get_started/cdk_new_project_quick_start.rst.txt b/docs/development_guide/build/html/_sources/get_started/cdk_new_project_quick_start.rst.txt new file mode 100644 index 00000000..02c1535e --- /dev/null +++ b/docs/development_guide/build/html/_sources/get_started/cdk_new_project_quick_start.rst.txt @@ -0,0 +1,75 @@ +基于 CDK 新建工程指南 +================================ + +本文档将简单介绍一下如何基于本 SDK 新建一个全新的 CDK 项目工程,按本教程操作前请确保正确安装好了 CDK 集成开发环境 + +examples 的目录结构 +------------------------ + +在 ``bl_mcu_sdk/examples`` 目录下通常存在两层子目录,第一层通常为同一类外设相关的 case 集,一般使用外设名称,第二层通常为该外设具体的某一种测试例程,第二层目录下通常还包含一个以 ``cdk`` 命名的目录,以及该 case 相关的源码, +在 ``cdk`` 目录中通常会包含一个 ``xxx.cdkproj`` 文件,该文件为 CDK 工程文件,在正确安装了 **CDK** 集成开发环境的情况下,双击工程即可打开该项目。新建的项目目录层级应保持与当前 ``examples`` 目录下的 case 层级一致。 + + +.. note:: 该源文件必须包含 c 程序入口,通常为 ``main`` 函数,源文件可以不叫 ``main.c`` + +- 在 ``examples`` 目录下新建一个 ``my_case`` 目录,用于存放你的 case 集 +- 在 ``my_case`` 目录中新建你要测试 case 的名称,比如新建一个 ``gpio_case`` 目录 +- 在 ``gpio_case`` 目录中添加 ``main.c`` 文件和 ``cdk`` 文件夹 + + +目录结构如下: + +.. code-block:: bash + :linenos: + + bl_mcu_sdk + ├── examples + ├── my_case + ├── gpio_case + │ ├── cdk + │ │ ├──gpio_case.cdkproj + │ ├── CMakeLists.txt + │ └── main.c + └── xxxx_case + +添加 cdk 工程相关文件 +------------------------- + +由于 CDK 当前版本暂不支持新建纯 ``Empty`` 工程,所以请按照下面的步骤进行 + +- 将 ``helloworld`` case 中 cdk 目录下 ``helloworld.cdkproj`` 拷贝一份到你自己的 cdk 目录下 +- 修改文件名称为你的 case 名称,例如:``gpio_case.cdkproj`` +- 使用文本编辑器打开 ``gpio_case.cdkproj`` 文件,修改 ``Project Name`` 为你的工程名称,例如:``gpio_case`` + + +.. figure:: img/cdk_start_1.png + :alt: + + +- 编辑好之后,保存文件,接下来双击 ``gpio_case.cdkproj`` 打开工程 +- 打开工程后,即可右击相应的文件夹,添加你所需要的源码文件 + +.. figure:: img/cdk_start_2.png + :alt: + + +- 右击工程,打开 ``Project Settings`` ,选择 Compiler 标签,在 ``Include paths`` 中添加,新文件需要的相应头文件 +- 头文件路径建议使用相对路径 +- 点击 ``OK`` 保存编辑,即可 + + +.. figure:: img/cdk_start_3.png + :alt: + + +- 在有浮点打印输出需求的情况下,需要在 Linker 标签,在 ``Other flags`` 中,添加 ``-u _printf_float`` 的 flag 选项,否则不能正常 printf 浮点数 + +.. figure:: img/cdk_start_4.png + :alt: + + +- 使用不同开发板的情况下,注意选择不同的 board 文件引用,通常情况下,默认配置的是 **bl706_iot** + +.. figure:: img/cdk_start_5.png + :alt: + diff --git a/docs/development_guide/build/html/_sources/index.rst.txt b/docs/development_guide/build/html/_sources/index.rst.txt index a835b312..c7c90126 100644 --- a/docs/development_guide/build/html/_sources/index.rst.txt +++ b/docs/development_guide/build/html/_sources/index.rst.txt @@ -22,6 +22,7 @@ BL MCU SDK 将为您提供博流 BL70X 系列 MCU 开发的全方位支持。 get_started/index get_started/bl_dev_cube get_started/cmake_quick_start + get_started/cdk_new_project_quick_start get_started/connecting_hardware @@ -52,7 +53,7 @@ BL MCU SDK 将为您提供博流 BL70X 系列 MCU 开发的全方位支持。 samples/basic samples/spi/index samples/basic samples/i2c/index samples/basic samples/adc/index - + samples/basic samples/timer/index .. toctree:: diff --git a/docs/development_guide/build/html/_sources/samples/advance samples/ble_scan_demo.rst.txt b/docs/development_guide/build/html/_sources/samples/advance samples/ble_scan_demo.rst.txt index 922974af..2f247122 100644 --- a/docs/development_guide/build/html/_sources/samples/advance samples/ble_scan_demo.rst.txt +++ b/docs/development_guide/build/html/_sources/samples/advance samples/ble_scan_demo.rst.txt @@ -136,7 +136,10 @@ BLE server 软件实现 - **CDK工具编译** - 暂不支持 + 打开项目中提供的工程文件:ble_contral.cdkproj、ble_peripheral.cdkproj + + 参照 :ref:`windows_cdk_quick_start` 的步骤编译下载即可 + - **命令行编译** diff --git a/docs/development_guide/build/html/_sources/samples/advance samples/lowpower_demo.rst.txt b/docs/development_guide/build/html/_sources/samples/advance samples/lowpower_demo.rst.txt index 9833a92d..5db21645 100644 --- a/docs/development_guide/build/html/_sources/samples/advance samples/lowpower_demo.rst.txt +++ b/docs/development_guide/build/html/_sources/samples/advance samples/lowpower_demo.rst.txt @@ -51,6 +51,7 @@ bl_mcu_sdk 提供了一个简单的低功耗参考示例(bl_mcu_sdk examples/pow .. figure:: img/xShell_lowpower.png +.. note::当前 demo 仅仅只是测试三种低功耗模式的使用,如果需要测试达到手册中描述的,需要很多步骤,具体步骤请与我们联系。 **准备低功耗测试所需的硬件环境** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/development_guide/build/html/_sources/samples/basic samples/timer/index.rst.txt b/docs/development_guide/build/html/_sources/samples/basic samples/timer/index.rst.txt new file mode 100644 index 00000000..7cf187b2 --- /dev/null +++ b/docs/development_guide/build/html/_sources/samples/basic samples/timer/index.rst.txt @@ -0,0 +1,9 @@ +======================= +TIMER 示例 +======================= + + +.. toctree:: + :maxdepth: 1 + + TIMER - 定时器中断 \ No newline at end of file diff --git a/docs/development_guide/build/html/_sources/samples/basic samples/timer/timer_interrupt_demo.rst.txt b/docs/development_guide/build/html/_sources/samples/basic samples/timer/timer_interrupt_demo.rst.txt new file mode 100644 index 00000000..20a9ea98 --- /dev/null +++ b/docs/development_guide/build/html/_sources/samples/basic samples/timer/timer_interrupt_demo.rst.txt @@ -0,0 +1,114 @@ +TIMER - 定时器中断 +==================== + +本 demo 基于 TIMER 外设周期性触发中断模式编写。 + +软件实现 +----------------------------- + +- 软件代码见 ``examples/timer/timer_int`` + +.. code-block:: C + :linenos: + + #define TIMER_CLK_SRC (0) + #define TIMER_CLK_DIV (0) + +- 配置 ``TIMER`` 设备时钟源,见 ``drivers\bl702_driver\hal_drv\default_config\timer_config.h``和``drivers\bl702_driver\hal_drv\src\hal_timer.c`` + +.. code-block:: C + :linenos: + + #define CONFIG_GPIO14_FUNC GPIO_FUN_UART0_TX + #define CONFIG_GPIO15_FUNC GPIO_FUN_UART0_RX + +- 配置 ``UART`` 设备复用引脚,见 ``bsp/board/bl706_iot/pinmux_config.h`` + +.. code-block:: C + :linenos: + + #define BSP_USING_TIMER_CH0 + + #if defined(BSP_USING_TIMER_CH0) + #ifndef TIMER_CH0_CONFIG + #define TIMER_CH0_CONFIG \ + { \ + .id = 0, \ + .ch = 0, \ + .cnt_mode = TIMER_CNT_PRELOAD, \ + .pl_trig_src = TIMER_PL_TRIG_COMP0, \ + } + #endif + #endif + +- 使能 ``BSP_USING_TIMER_CH0`` 并配置 ``TIMER`` 设备配置,见 ``bsp/board/bl706_iot/peripheral_config.h`` + +.. code-block:: C + :linenos: + + if (timer_ch0) { + device_open(timer_ch0, DEVICE_OFLAG_INT); + device_set_callback(timer_ch0, timer_ch0_irq_callback); + device_control(timer_ch0, DEVICE_CTRL_SET_INT, NULL); + device_control(timer_ch0, DEVICE_CTRL_TIMER_CH_START, (void *)(&timer_user_cfg)); + } + +- 通过 ``timer_ch0_irq_callback`` 函数,注册用户指定的 ``TIMER0`` 中断服务函数。通过 ``device_control`` 函数使能中断和配置定时周期。 + +.. code-block:: C + :linenos: + + void timer_ch0_irq_callback(struct device *dev, void *args, uint32_t size, uint32_t state) + { + MSG("timer ch0 interrupt! \n"); + + if (state == TIMER_EVENT_COMP0) { + cnt++; + MSG("timer event comp0! cnt=%d\n", cnt); + } else if (state == TIMER_EVENT_COMP1) { + MSG("timer event comp1! \n"); + } else if (state == TIMER_EVENT_COMP2) { + MSG("timer event comp2! \n"); + } + } + + +- 此函数是示例的中断服务函数,作用是判断具体是哪个 COMP 触发的中断和打印 COMP0 触发中断的次数。 + + - ``state`` 会输入 ``TIMER`` 设备的 EVENT 类型 + - ``args`` 包含了返回数据指针 + - ``size`` 包含返回数据的长度 + - ``dev`` 为中断的 ``TIMER`` 设备句柄 + + +编译和烧录 +----------------------------- + +- **CDK 编译** + + 打开项目中提供的工程文件:timer_int.cdkproj + + 参照 :ref:`windows_cdk_quick_start` 的步骤编译下载即可 + +- **命令行编译** + +.. code-block:: bash + :linenos: + + $ cd /bl_mcu_sdk + $ make BOARD=bl706_iot APP=timer_int + +- **烧录** + + 详见 :ref:`bl_dev_cube` + + +实验现象 +----------------------------- + + 每 1 秒触发 1 次 ``timer ch0`` ``COMP0`` 中断,每次触发 ``TIMER`` 中断都会打印一次 ``timer ch0 interrupt!`` ,并且 ``cnt`` 值每次都会加 1 。 + 串口打印: + + ``timer ch0 interrupt! timer event comp0! cnt=1`` + ``timer ch0 interrupt! timer event comp0! cnt=2`` + ``timer ch0 interrupt! timer event comp0! cnt=3`` diff --git a/docs/development_guide/build/html/api_reference/api_overview.html b/docs/development_guide/build/html/api_reference/api_overview.html index 5bec607f..65694af9 100644 --- a/docs/development_guide/build/html/api_reference/api_overview.html +++ b/docs/development_guide/build/html/api_reference/api_overview.html @@ -40,7 +40,7 @@ - + @@ -95,7 +95,8 @@
  • 2. 开发环境搭建指南
  • 3. BLDevCube 烧录工具指南
  • 4. 基于 cmake 框架新建工程指南
  • -
  • 5. 硬件连接指南
  • +
  • 5. 基于 CDK 新建工程指南
  • +
  • 6. 硬件连接指南
  • API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    diff --git a/docs/development_guide/build/html/api_reference/peripheral/api_i2s.html b/docs/development_guide/build/html/api_reference/peripheral/api_i2s.html index da8dface..e0291f7b 100644 --- a/docs/development_guide/build/html/api_reference/peripheral/api_i2s.html +++ b/docs/development_guide/build/html/api_reference/peripheral/api_i2s.html @@ -95,7 +95,8 @@
  • 2. 开发环境搭建指南
  • 3. BLDevCube 烧录工具指南
  • 4. 基于 cmake 框架新建工程指南
  • -
  • 5. 硬件连接指南
  • +
  • 5. 基于 CDK 新建工程指南
  • +
  • 6. 硬件连接指南
  • API 手册

    进阶例程

    API 手册

    进阶例程

    @@ -266,7 +268,7 @@

    注解

    -

    PWM 占空比 = threshold_low/threshold_high * 100%

    +

    PWM 占空比 = (threshold_high-threshold_low)/period * 100%

    @@ -428,15 +430,15 @@

    NULL

    关闭当前PWM通道

    -

    DEIVCE_CTRL_PWM_FREQUENCE_CONFIG

    +

    DEVICE_CTRL_PWM_FREQUENCE_CONFIG

    uint32_t

    配置当前PWM通道周期值

    -

    DEIVCE_CTRL_PWM_DUTYCYCLE_CONFIG

    +

    DEVICE_CTRL_PWM_DUTYCYCLE_CONFIG

    pwm_dutycycle_config_t

    配置当前PWM通道占空比

    -

    DEIVCE_CTRL_PWM_IT_PULSE_COUNT_CONFIG

    +

    DEVICE_CTRL_PWM_IT_PULSE_COUNT_CONFIG

    uint32_t

    配置触发PWM中断周期值

    diff --git a/docs/development_guide/build/html/api_reference/peripheral/api_spi.html b/docs/development_guide/build/html/api_reference/peripheral/api_spi.html index 70c77da5..b583fe95 100644 --- a/docs/development_guide/build/html/api_reference/peripheral/api_spi.html +++ b/docs/development_guide/build/html/api_reference/peripheral/api_spi.html @@ -95,7 +95,8 @@
  • 2. 开发环境搭建指南
  • 3. BLDevCube 烧录工具指南
  • 4. 基于 cmake 框架新建工程指南
  • -
  • 5. 硬件连接指南
  • +
  • 5. 基于 CDK 新建工程指南
  • +
  • 6. 硬件连接指南
  • API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

    API 手册

    进阶例程

      diff --git a/docs/development_guide/build/html/get_started/cdk_new_project_quick_start.html b/docs/development_guide/build/html/get_started/cdk_new_project_quick_start.html new file mode 100644 index 00000000..e5049127 --- /dev/null +++ b/docs/development_guide/build/html/get_started/cdk_new_project_quick_start.html @@ -0,0 +1,327 @@ + + + + + + + + + + 5. 基于 CDK 新建工程指南 — BL_MCU_SDK 开发指南 0.3 文档 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      + + + + + +
      + +
      + + + + + + + + + + + + + + + + + + + +
      + + + + +
      +
      +
      +
      + +
      +

      5. 基于 CDK 新建工程指南

      +

      本文档将简单介绍一下如何基于本 SDK 新建一个全新的 CDK 项目工程,按本教程操作前请确保正确安装好了 CDK 集成开发环境

      +
      +

      5.1. examples 的目录结构

      +

      bl_mcu_sdk/examples 目录下通常存在两层子目录,第一层通常为同一类外设相关的 case 集,一般使用外设名称,第二层通常为该外设具体的某一种测试例程,第二层目录下通常还包含一个以 cdk 命名的目录,以及该 case 相关的源码, +在 cdk 目录中通常会包含一个 xxx.cdkproj 文件,该文件为 CDK 工程文件,在正确安装了 CDK 集成开发环境的情况下,双击工程即可打开该项目。新建的项目目录层级应保持与当前 examples 目录下的 case 层级一致。

      +
      +

      注解

      +

      该源文件必须包含 c 程序入口,通常为 main 函数,源文件可以不叫 main.c

      +
      +
        +
      • examples 目录下新建一个 my_case 目录,用于存放你的 case 集

      • +
      • my_case 目录中新建你要测试 case 的名称,比如新建一个 gpio_case 目录

      • +
      • gpio_case 目录中添加 main.c 文件和 cdk 文件夹

      • +
      +

      目录结构如下:

      +
      1
      +2
      +3
      +4
      +5
      +6
      +7
      +8
      +9
      bl_mcu_sdk
      +├── examples
      +    ├── my_case
      +        ├── gpio_case
      +        │   ├── cdk
      +        │   │   ├──gpio_case.cdkproj
      +        │   ├── CMakeLists.txt
      +        │   └── main.c
      +        └── xxxx_case
      +
      +
      +
      +
      +

      5.2. 添加 cdk 工程相关文件

      +

      由于 CDK 当前版本暂不支持新建纯 Empty 工程,所以请按照下面的步骤进行

      +
        +
      • helloworld case 中 cdk 目录下 helloworld.cdkproj 拷贝一份到你自己的 cdk 目录下

      • +
      • 修改文件名称为你的 case 名称,例如:gpio_case.cdkproj

      • +
      • 使用文本编辑器打开 gpio_case.cdkproj 文件,修改 Project Name 为你的工程名称,例如:gpio_case

      • +
      +
      + +
      +
        +
      • 编辑好之后,保存文件,接下来双击 gpio_case.cdkproj 打开工程

      • +
      • 打开工程后,即可右击相应的文件夹,添加你所需要的源码文件

      • +
      +
      + +
      +
        +
      • 右击工程,打开 Project Settings ,选择 Compiler 标签,在 Include paths 中添加,新文件需要的相应头文件

      • +
      • 头文件路径建议使用相对路径

      • +
      • 点击 OK 保存编辑,即可

      • +
      +
      + +
      +
        +
      • 在有浮点打印输出需求的情况下,需要在 Linker 标签,在 Other flags 中,添加 -u _printf_float 的 flag 选项,否则不能正常 printf 浮点数

      • +
      +
      + +
      +
        +
      • 使用不同开发板的情况下,注意选择不同的 board 文件引用,通常情况下,默认配置的是 bl706_iot

      • +
      +
      + +
      +
      +
      + + +
      + +
      + +
      +
      + +
      + +
      + + + + + + + + + + + \ No newline at end of file diff --git a/docs/development_guide/build/html/get_started/cdk_rv_debugger_plus.html b/docs/development_guide/build/html/get_started/cdk_rv_debugger_plus.html index 8071ffb7..7ca256cf 100644 --- a/docs/development_guide/build/html/get_started/cdk_rv_debugger_plus.html +++ b/docs/development_guide/build/html/get_started/cdk_rv_debugger_plus.html @@ -111,7 +111,8 @@
    • 3. BLDevCube 烧录工具指南
    • 4. 基于 cmake 框架新建工程指南
    • -
    • 5. 硬件连接指南
    • +
    • 5. 基于 CDK 新建工程指南
    • +
    • 6. 硬件连接指南

    API 手册

    进阶例程

      diff --git a/docs/development_guide/build/html/get_started/cmake_quick_start.html b/docs/development_guide/build/html/get_started/cmake_quick_start.html index fde84412..1190f652 100644 --- a/docs/development_guide/build/html/get_started/cmake_quick_start.html +++ b/docs/development_guide/build/html/get_started/cmake_quick_start.html @@ -39,7 +39,7 @@ - + @@ -104,7 +104,8 @@
    • 4.7. 添加新工程并其依赖的源文件和库文件
    -
  • 5. 硬件连接指南
  • +
  • 5. 基于 CDK 新建工程指南
  • +
  • 6. 硬件连接指南
  • API 手册

    进阶例程

      @@ -415,7 +417,7 @@