[doc] update flash,usb,pm,fatfs rst

This commit is contained in:
jzlv 2021-10-14 18:54:16 +08:00
parent d66a28da5c
commit 8b587dbed2
546 changed files with 65199 additions and 460 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 MiB

View file

@ -0,0 +1,89 @@
XIP FLASH 设备
=========================
简介
------------------------
XIPeXecute In Place即芯片内执行指应用程序可以直接在 flash 闪存内运行,不必再把代码读到系统 RAM 中。所谓片内执行并不是说程序在存储器内执行CPU的基本功能是取指、译码、执行存储器访问写回。通常我们使用 Nor FlashNor Flash能在芯片内执行指的是 CPU 能够直接从Nor flash 中取指令,供后面的译码器和执行器来使用。
博流系列芯片拥有 XIP FLASH 控制器并且支持内存映射BL702/BL704/BL706 的逻辑地址为 0x23000000,最大可支持 8M 的 nor flash。不仅如此映射的实际物理 flash 地址是可以修改的,举例来说,假设一个 nor flash 大小为 1M如果应用程序烧录在 flash 物理地址 0那么就可以将逻辑地址映射到 0 地址,如果应用程序烧录在 flash 物理地址 x那么就可以将逻辑地址映射到 x 地址,而逻辑地址可以保持不变,一直是 0x23000000省去了修改 ld 文件的麻烦。
下图演示三块应用程序映射地址分布:
.. figure:: ../img/flash.png
:alt:
XIP FLASH 设备接口
------------------------
**flash_init**
^^^^^^^^^^^^^^^^^^^^^^^^
``flash_init`` 用于初始化 flash 控制器。
.. code-block:: C
BL_Err_Type flash_init(void);
- **return** 错误码0 表示成功,其他表示错误
**flash_read_jedec_id**
^^^^^^^^^^^^^^^^^^^^^^^^
``flash_read_jedec_id`` 用于获取 flash id。
.. code-block:: C
BL_Err_Type flash_read_jedec_id(uint8_t *data);
- **data** 存储 flash id 的指针,大小 4 字节
- **return** 错误码0 表示成功,其他表示错误
**flash_erase**
^^^^^^^^^^^^^^^^^^^^^^^^
``flash_init`` 用于 flash 扇区擦除。
.. code-block:: C
BL_Err_Type flash_erase(uint32_t startaddr, uint32_t len);
- **startaddr** 要擦除的 flash 物理起始地址
- **len** 擦除扇区长度,单位
- **return** 错误码0 表示成功,其他表示错误
**flash_write**
^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: C
BL_Err_Type flash_write(uint32_t addr, uint8_t *data, uint32_t len);
- **addr** 要写入的 flash 物理起始地址
- **data** 写入数据指针
- **len** 写入长度
- **return** 错误码0 表示成功,其他表示错误
**flash_read**
^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: C
BL_Err_Type flash_read(uint32_t addr, uint8_t *data, uint32_t len);
- **addr** 要读取的 flash 物理起始地址
- **data** 读入数据指针
- **len** 读取长度
- **return** 错误码0 表示成功,其他表示错误
**hal_jump2app**
^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: C
void hal_jump2app(uint32_t flash_offset);
- **flash_offset** 要跳转的 flash 物理地址,即烧录新应用程序的物理地址
.. error:: 以上地址均为 flash 物理地址不可以填入内存映射地址比如0x23000000。

View file

@ -0,0 +1,105 @@
PM 设备
=========================
简介
------------------------
PM 设备接口
------------------------
**pm_pds_mode_enter**
^^^^^^^^^^^^^^^^^^^^^^^^
``pm_pds_mode_enter`` 用来进入 pds 模式
.. code-block:: C
void pm_pds_mode_enter(enum pm_pds_sleep_level pds_level, uint32_t sleep_time);
- **pds_level** PDS 等级
- **sleep_time** 睡眠时间,单位 1/32768 hz
其中 ``pds_level`` 提供以下类型:
.. code-block:: C
enum pm_pds_sleep_level {
PM_PDS_LEVEL_0,
PM_PDS_LEVEL_1,
PM_PDS_LEVEL_2,
PM_PDS_LEVEL_3,
PM_PDS_LEVEL_4, /*do not recommend to use*/
PM_PDS_LEVEL_5, /*do not recommend to use*/
PM_PDS_LEVEL_6, /*do not recommend to use*/
PM_PDS_LEVEL_7, /*do not recommend to use*/
PM_PDS_LEVEL_31 = 31,
};
.. warning:: pds level 4~7 不推荐使用
**pm_hbn_mode_enter**
^^^^^^^^^^^^^^^^^^^^^^^^
``pm_hbn_mode_enter`` 用来进入 hbn 模式
.. code-block:: C
void pm_hbn_mode_enter(enum pm_hbn_sleep_level hbn_level, uint8_t sleep_time);
- **hbn_level** HBN 等级
- **sleep_time** 睡眠时间,单位秒
其中 ``hbn_level`` 提供以下类型:
.. code-block:: C
enum pm_hbn_sleep_level {
PM_HBN_LEVEL_0,
PM_HBN_LEVEL_1,
PM_HBN_LEVEL_2,
};
**pm_set_wakeup_callback**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``pm_set_wakeup_callback`` 用来设置从唤醒恢复时跳转的函数地址hbn level1 以上不可用。
.. code-block:: C
void pm_set_wakeup_callback(void (*wakeup_callback)(void));
- **wakeup_callback** 跳转的函数地址
**pm_hbn_out0_irq_register**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``pm_hbn_out0_irq_register`` 用来注册 hbn out0 中断out0下中断有GPIO9~GPIO12,RTC。中断回调函数为 ``pm_irq_callback``。
.. code-block:: C
void pm_hbn_out0_irq_register(void);
**pm_hbn_out1_irq_register**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``pm_hbn_out1_irq_register`` 用来注册 hbn out1 中断out1下中断有ACOMP0、ACOMP1、BOR、PIR。中断回调函数为 ``pm_irq_callback``。
.. code-block:: C
void pm_hbn_out1_irq_register(void);
``pm_irq_callback`` 中 ``event`` 提供以下类型:
.. code-block:: C
enum pm_event_type {
PM_HBN_GPIO9_WAKEUP_EVENT,
PM_HBN_GPIO10_WAKEUP_EVENT,
PM_HBN_GPIO11_WAKEUP_EVENT,
PM_HBN_GPIO12_WAKEUP_EVENT,
PM_HBN_RTC_WAKEUP_EVENT,
PM_HBN_ACOMP0_WAKEUP_EVENT,
PM_HBN_ACOMP1_WAKEUP_EVENT,
};

View file

@ -17,4 +17,6 @@ Peripheral
DAC 设备 <api_dac>
TIMER 设备 <api_timer>
QDEC 设备 <api_qdec>
USB 设备 <api_usb>
USB 设备 <api_usb>
XIP FLASH 设备 <api_flash>
PM 设备 <api_pm>

View file

@ -190,6 +190,44 @@ USB Device CDC 类接口
- **class** 类的句柄
- **intf** 接口句柄
**usbd_cdc_acm_set_line_coding**
""""""""""""""""""""""""""""""""""""
``usbd_cdc_acm_set_line_coding`` 用来对串口进行配置。该接口由用户实现,默认为空。
.. code-block:: C
void usbd_cdc_acm_set_line_coding(uint32_t baudrate, uint8_t databits, uint8_t parity, uint8_t stopbits);
- **baudrate** 波特率
- **databits** 数据位
- **parity** 校验位
- **stopbits** 停止位
**usbd_cdc_acm_set_dtr**
""""""""""""""""""""""""""""""""""""
``usbd_cdc_acm_set_line_coding`` 用来控制串口 DTR。该接口由用户实现默认为空。
.. code-block:: C
void usbd_cdc_acm_set_dtr(bool dtr);
- **dtr** dtr 为1表示拉低电平为0表示拉高电平
**usbd_cdc_acm_set_rts**
""""""""""""""""""""""""""""""""""""
``usbd_cdc_acm_set_line_coding`` 用来控制串口 RTS。该接口由用户实现默认为空。
.. code-block:: C
void usbd_cdc_acm_set_rts(bool rts);
- **rts** rts 为1表示拉低电平为0表示拉高电平
USB Device MSC 类接口
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -204,6 +242,46 @@ USB Device MSC 类接口
- **out_ep** 输出端点的地址
- **in_ep** 输入端点的地址
**usbd_msc_get_cap**
""""""""""""""""""""""""""""""""""""
``usbd_msc_get_cap`` 用来获取存储器的信息。该接口由用户实现,默认为空。
.. code-block:: C
void usbd_msc_get_cap(uint8_t lun, uint32_t *block_num, uint16_t *block_size);
- **lun** 存储逻辑单元,暂时无用
- **block_num** 存储扇区个数的指针
- **block_size** 存储扇区大小的指针
**usbd_msc_sector_read**
""""""""""""""""""""""""""""""""""""
``usbd_msc_sector_read`` 用来对存储器某个扇区开始进行数据读取。该接口由用户实现,默认为空。
.. code-block:: C
int usbd_msc_sector_read(uint32_t sector, uint8_t *buffer, uint32_t length);
- **sector** 扇区偏移
- **buffer** 存储读取的数据的指针
- **length** 读取长度
**usbd_msc_sector_write**
""""""""""""""""""""""""""""""""""""
``usbd_msc_sector_write`` 用来对存储器某个扇区开始写入数据。该接口由用户实现,默认为空。
.. code-block:: C
int usbd_msc_sector_write(uint32_t sector, uint8_t *buffer, uint32_t length);
- **sector** 扇区偏移
- **buffer** 写入数据指针
- **length** 写入长度
USB Device HID 类接口
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -221,6 +299,42 @@ USB Device HID 类接口
- **class** 类的句柄
- **intf** 接口句柄
**usbd_hid_report_descriptor_register**
""""""""""""""""""""""""""""""""""""""""""""
``usbd_hid_report_descriptor_register`` 用来对存储器某个扇区开始写入数据。该接口由用户实现,默认为空。
.. code-block:: C
void usbd_hid_report_descriptor_register(uint8_t intf_num, const uint8_t *desc, uint32_t desc_len);
- **intf_num** 当前 hid 报告描述符所在接口偏移
- **desc** 报告描述符
- **desc_len** 报告描述符长度
**usbd_hid_set_request_callback**
""""""""""""""""""""""""""""""""""""
``usbd_hid_set_request_callback`` 用来对存储器某个扇区开始写入数据。该接口由用户实现,默认为空。
.. code-block:: C
void usbd_hid_set_request_callback( uint8_t intf_num,
uint8_t (*get_report_callback)(uint8_t report_id, uint8_t report_type),
void (*set_report_callback)(uint8_t report_id, uint8_t report_type, uint8_t *report, uint8_t report_len),
uint8_t (*get_idle_callback)(uint8_t report_id),
void (*set_idle_callback)(uint8_t report_id, uint8_t duration),
void (*set_protocol_callback)(uint8_t protocol),
uint8_t (*get_protocol_callback)(void));
- **intf_num** 当前 hid 报告描述符所在接口偏移
- **get_report_callback** get report命令处理回调函数
- **set_report_callback** set report命令处理回调函数
- **get_idle_callback** get idle命令处理回调函数
- **set_idle_callback** set idle命令处理回调函数
- **set_protocol_callback** set protocol命令处理回调函数
- **get_protocol_callback** get protocol命令处理回调函数
USB Device AUDIO 类接口
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View file

@ -54,6 +54,7 @@ BL MCU SDK 将为您提供博流 BL70X 系列 MCU 开发的全方位支持。
samples/basic samples/i2s/index
samples/basic samples/adc/index
samples/basic samples/timer/index
samples/basic samples/flash/index
.. toctree::

View file

@ -147,13 +147,13 @@ BLE server 软件实现
:linenos:
$ cd <sdk_path>/bl_mcu_sdk
$ make BOARD=bl706_iot APP=ble_peripheral SUPPORT_FREERTOS=y SUPPORT_FLOAT=y SUPPORT_BLE=y
$ make BOARD=bl706_iot APP=ble_peripheral SUPPORT_FLOAT=y
.. code-block:: bash
:linenos:
$ cd <sdk_path>/bl_mcu_sdk
$ make BOARD=bl706_iot APP=ble_central SUPPORT_FREERTOS=y SUPPORT_FLOAT=y SUPPORT_BLE=y
$ make BOARD=bl706_iot APP=ble_central SUPPORT_FLOAT=y
- **烧录**

View file

@ -12,13 +12,13 @@ Bouffalo Lab 为 IAP 功能应用提供了相应的 boot2_iap.bin 文件,并
用户可以配合 Dev Cube 图形界面烧写软件,将已有的 boot2_iap.bin 文件烧录进目标板,烧录
一次之后,就可以通过 IAP 功能,在线更新用户代码。
bl_mcu_sdk 开源了 boot2_iap 的软件源码,用户可以到 examples/boot2_iap 查阅代码,并完成编译烧写。编译烧写过程可以参考《快速开发指南》介绍。
bl_mcu_sdk 开源了 boot2_iap 的软件源码,用户可以到 ``examples/boot2_iap`` 查阅代码,并完成编译烧写。编译烧写过程可以参考《快速开发指南》介绍。
准备工具
-----------------------
- 最新版本的 Dev Cube
- Bl706 开发板
- BL706 开发板
- TTL-USB 电平转换芯片

View file

@ -1,2 +1,161 @@
Fatfs 文件系统读写
====================
FatFs 文件系统读写(SD 卡)
===========================
本 demo 主要演示使用 spi 驱动 sd 卡并挂载 fatfs 文件系统的例子。其中 fatfs api 见 `Fatfs 官网 <http://elm-chan.org/fsw/ff/00index_e.html>`_。
准备工具
-----------------------
- 一张 class10 的 sd 卡和 sd 卡转spi 转接板
硬件连接
-----------------------------
本 demo 基于 BL706_AVB 开发板,连接方式如下
::
GPIO function GPIO pin
----------------------------------
SD_CS <--> GPIO10
SPI_SCK <--> GPIO19
SPI_MISO <--> GPIO20
SPI_MOSI <--> GPIO21
软件实现
-----------------------------
- 软件代码见 ``examples/spi/spi_dma_sd``
.. code-block:: C
:linenos:
#define BSP_SPI_CLOCK_SOURCE ROOT_CLOCK_SOURCE_BCLK
#define BSP_SPI_CLOCK_DIV 0
- 配置 ``SPI`` 设备时钟源,见 ``bsp/board/bl706_avb/clock_config.h``
.. code-block:: C
:linenos:
#define CONFIG_GPIO19_FUNC GPIO_FUN_SPI
#define CONFIG_GPIO20_FUNC GPIO_FUN_SPI
#define CONFIG_GPIO21_FUNC GPIO_FUN_SPI
- 配置 ``SPI`` 设备复用引脚,见 ``bsp/board/bl706_avb/pinmux_config.h``,,如有改动,请自行修改
.. note:: 为适配 bl702_avb 硬件, SPI 的 MOSI 和 MISO 默认进行了调换,如果想要恢复默认,修改 ``drivers/bl702_driver/hal_drv/default_config/spi_config.h`` 中 ``SPI_SWAP_ENABLE`` 为 0
.. code-block:: C
:linenos:
#define BSP_USING_SPI0
#if defined(BSP_USING_SPI0)
#ifndef SPI0_CONFIG
#define SPI0_CONFIG \
{ \
.id = 0, \
.clk = 18000000,\
.mode = SPI_MASTER_MODE, \
.direction = SPI_MSB_BYTE0_DIRECTION_FIRST, \
.clk_polaraity = SPI_POLARITY_LOW, \
.clk_phase = SPI_PHASE_1EDGE, \
.datasize = SPI_DATASIZE_8BIT, \
.fifo_threshold = 4, \
}
#endif
#endif
- 使能 ``BSP_USING_SPI0`` 并配置 ``SPI`` 设备配置,见 ``bsp/board/bl706_avb/peripheral_config.h``
.. note:: sd卡的频率不能过高所以设置成 18M 比较合适
.. code-block:: C
:linenos:
#define BSP_USING_DMA0_CH3
#define BSP_USING_DMA0_CH4
#if defined(BSP_USING_DMA0_CH3)
#ifndef DMA0_CH3_CONFIG
#define DMA0_CH3_CONFIG \
{ \
.id = 0, \
.ch = 3, \
.direction = DMA_MEMORY_TO_PERIPH, \
.transfer_mode = DMA_LLI_ONCE_MODE, \
.src_req = DMA_REQUEST_NONE, \
.dst_req = DMA_REQUEST_SPI0_TX, \
.src_width = DMA_TRANSFER_WIDTH_8BIT, \
.dst_width = DMA_TRANSFER_WIDTH_8BIT, \
}
#endif
#endif
#if defined(BSP_USING_DMA0_CH4)
#ifndef DMA0_CH4_CONFIG
#define DMA0_CH4_CONFIG \
{ \
.id = 0, \
.ch = 4, \
.direction = DMA_PERIPH_TO_MEMORY, \
.transfer_mode = DMA_LLI_ONCE_MODE, \
.src_req = DMA_REQUEST_SPI0_RX, \
.dst_req = DMA_REQUEST_NONE, \
.src_width = DMA_TRANSFER_WIDTH_8BIT, \
.dst_width = DMA_TRANSFER_WIDTH_8BIT, \
}
#endif
#endif
- 使能 ``BSP_USING_DMA0_CH3`` ``BSP_USING_DMA0_CH4`` 并配置 ``DMA`` 设备配置,见 ``bsp/board/bl706_avb/peripheral_config.h``
.. code-block:: C
:linenos:
void fatfs_sd_driver_register(void)
{
FATFS_DiskioDriverTypeDef sdDiskioDriver;
memset(&sdDiskioDriver, 0, sizeof(FATFS_DiskioDriverTypeDef));
sdDiskioDriver.MMC_disk_status = sd_disk_status;
sdDiskioDriver.MMC_disk_initialize = sd_disk_initialize;
sdDiskioDriver.MMC_disk_write = sd_disk_write;
sdDiskioDriver.MMC_disk_read = sd_disk_read;
sdDiskioDriver.MMC_disk_ioctl = sd_disk_ioctl;
sdDiskioDriver.Translate_Result_Code = Translate_Result_Code;
disk_driver_callback_init(&sdDiskioDriver);
}
- 实现 fatfs 需要的底层接口
剩余代码见 main.c。
编译和烧录
-----------------------------
- **CDK 编译**
打开项目中提供的工程文件spi_dma_sd.cdkproj
参照 :ref:`windows_cdk_quick_start` 的步骤编译下载即可
- **命令行编译**
.. code-block:: bash
:linenos:
$ cd <sdk_path>/bl_mcu_sdk
$ make BOARD=bl706_avb APP=spi_dma_sd
- **烧录**
详见 :ref:`bl_dev_cube`
实验现象
-----------------------------

View file

@ -1,95 +1,258 @@
LowPower 低功耗评估
Power Management
=========================
简介
------------------------
本 demo 主要演示 bl 系列 mcu 低功耗性能。具体低功耗介绍请参考 `BL702/704/706 参考手册 <https://dev.bouffalolab.com/media/upload/doc/BL702_BL704_706_RM_zh_CN_1.1.pdf>`_。
博流系列芯片拥有丰富的低功耗特性,以适配不同的低功耗应用场合。为了方便用户快速的评测使用 bl 系列 MCU 低功耗性能 bl_mcu_sdk 提供了一套抽象的低功耗接口,将低功耗等级分为四个等级,分别为
低功耗模式:
1. Running : Running 为 CPU 正常运行时的功耗,由客户应用代码执行的功能决定功耗。
- Running : Running 为 CPU 正常运行时的功耗,由客户应用代码执行的功能决定功耗。
2. WFI WFI 模式,CPU 的 clock 处于被 Gating 状态CPU 停止运行当用户退出WFI模式的时候程序将会继续运行。
- WFI 模式:CPU 的 clock 处于被 Gating 状态CPU 停止运行当用户退出WFI模式的时候程序将会继续运行。
3. PDS : PDS 模式,关闭了芯片上大多数电源域,同时关闭了 CPU和 CPU 处于同一个电源域的 ITCMDTCM 等 RAM 不可使用,只有 64K 的 OCTAM 可以保存数据,可以通过内部 RTC 进行唤醒,或者使用 GPIO 引脚(在 GPIO 电源域没有关闭的情况下)唤醒
- PDS 模式: 根据不同的模式关闭不同的电源域,当关闭了 CPU 电源域时ITCMDTCM RAM 不可使用,只有 64K 的 OCRAM 可以使用
4. HBN : HBN 模式,关闭了芯片上绝大多数电源域,关闭了 CPU 以及 64K OCRAM只有位于 AON 域的 4K RAM 可以保存数据,可以通过内部 RTC 进行唤醒,或者使用特定的唤醒引脚(位于 AON 域的引脚)唤醒
- HBN 模式: 根据不同的模式关闭不同的电源域ITCMDTCM OCRAM RAM 无法使用,在 hbn0 下位于 AON 域的 4K RAM 可以使用,其他 hbn 模式下 4K RAM 也不可使用
bl_mcu_sdk 提供了一个简单的低功耗参考示例(bl_mcu_sdk examples/power/lowpower_test/),旨在帮助用户快速评估低功耗功能,如果需要进一步适配自身的低功耗场景,采取不同的低功耗策略,请查阅相关 datasheet 或者寻找 Boufflao Lab 的技术支持。
在该示例中,外设及 CPU 的时钟选择均是晶振 32M。基于该示例的功耗测量结果如下表所示:
演示内容:
+------------+------------+------------+---------------------+---------------------------+
|模式 |参考电流 |对应基础模式|唤醒源 |备注 |
+============+============+============+=====================+===========================+
|Running |5.68 mA |Run | |所有外设时钟都打开 |
+------------+------------+------------+---------------------+---------------------------+
|WFI |3.14 mA |WFI |任意中断 |除串口外,其它外设时钟关闭 |
+------------+------------+------------+---------------------+---------------------------+
|PDS |10 uA |PDS 31 |内部RTC/引脚中断 |64K OCRAM保存数据 |
+------------+------------+------------+---------------------+---------------------------+
|HBN |1 uA |HBN 1 |内部RTC/引脚中断 |4K AON RAM保存数据 |
+------------+------------+------------+---------------------+---------------------------+
- pds3 使用 gpio10 外部中断下降沿唤醒
- pds31 使用 pds 唤醒脚 (gpio6) 唤醒
- pds31 使用 pds timer 唤醒
- hbn0 使用 acomp (gpio11) 唤醒
- hbn1 使用 rtc 唤醒
- hbn2 使用 hbn 唤醒脚 (gpio12) 唤醒
.. note:: 高级别的唤醒源可以唤醒低级别的功耗模式,比如 hbn 唤醒脚可以唤醒所有的低功耗模式。
上表中的参考电流是通过示例固件测试得出的。符合 bl70x 系列 MCU 的 spec 的描述run wfi pds hbn 四种等级的定义简化了原先的 hbn level 以及 pds level 的设定。
准备工具
-----------------------
见 bl702_bl704_bl706_DS_EN_Combo_1.9.pdf page 28
.. figure:: img/powerTable.png
**低功耗示例测试方法**
------------------------
**编译低功耗示例代码**
^^^^^^^^^^^^^^^^^^^^^^^^
在工程目录下键入 ``make APP=lowpower_test SUPPORT_SHELL=y BOARD=bl706_lp`` 完成低功耗示例 bl706 的编译。或者直接使用 CDK 工程,完成编译下载
您可以参考本文档《快速开发指南》来获取更多编译烧写的信息。
当编译并烧写成功后连接串口到电脑端并复位芯片Xshell 会出现如下图所示的页面。
.. figure:: img/xShell_lowpower.png
.. note::当前 demo 仅仅只是测试三种低功耗模式的使用,如果需要测试达到手册中描述的,需要很多步骤,具体步骤请与我们联系。
**准备低功耗测试所需的硬件环境**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- 可以串联电流表到电源端的电路板
- 电流表
- 一台 PC 主机(运行 Windows 或者 Linux 系统)
- TTL 转 USB
如下图所示,将电流表串联进入 bl706 模组的供电线路,通过 PC 端的串口调试助手软件,下发不同的低功耗指令,使得 bl706 进入对应的低功耗模式
观察电流表示值,完成评估。
- pc控制端使用串口终端软件xshell 或者 mobaxterm
- 可以串联电流表到电源端的电路板
- 电流表
- TTL 转 USB
- 滑动变阻器
.. figure:: img/lowpower_arch.png
**使用 Xshell 开始评估低功耗性能**
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
用户可以通过在 Xshell 输入下述指令,进入对应的低功耗模式。
``run``
硬件连接
-----------------------------
- 复位芯片之后,默认进入 run 模式,没有进入任何低功耗模式,芯片实际在运行 while(1); 语句。
本 demo 基于 BL706_LP 开发板,连接方式如下
``wfi``
::
GPIO function GPIO pin
----------------------------------
PDS_WAKEUP <--> GPIO6
EXTI <--> GPIO10
ADC <--> GPIO11
HBN_WAKEUP <--> GPIO12
UART0_TX <--> GPIO14
UART0_RX <--> GPIO15
软件实现
-------------------------
软件基于 shell 进行调试,如何注册 shell 命令这里不再说明。
PDS 模式
^^^^^^^^^^^^^^^^
- 软件代码见 ``examples/pm/pds_mode_wakeup``
.. code-block:: C
:linenos:
#define CONFIG_GPIO6_FUNC GPIO_FUN_WAKEUP
- pds 唤醒脚配置pds3 和 pds31 使用,见 ``bsp/board/bl706_lp/pinmux_config.h``
.. code-block:: C
:linenos:
#define CONFIG_GPIO10_FUNC GPIO_FUN_GPIO_EXTI_FALLING_EDGE
- 外部中断引脚配置pds3 使用,见 ``bsp/board/bl706_lp/pinmux_config.h``
.. code-block:: C
:linenos:
#define CONFIG_GPIO12_FUNC GPIO_FUN_WAKEUP
- hbn 唤醒脚配置pds3 和 pds31 使用,见 ``bsp/board/bl706_lp/pinmux_config.h``
- 进入 wfi 模式后面不加任何参数进入之后CPU 处于 clock gating 状态,降低功耗
- 进入 wfi 模式后,任何中断会唤醒,例如 uart 中断。在 Xshell 中敲击回车会触发 BL706 UART RX 中断,因此可以通过此方法唤醒 wfi 低功耗模式。
.. code-block:: C
:linenos:
``pds sleeptime``
gpio_attach_irq(GPIO_PIN_10, gpio_int_callback);
gpio_irq_enable(GPIO_PIN_10, ENABLE); //only used for level3
- 注册 gpio10 外部中断回调函数并使能
.. code-block:: C
:linenos:
int pds3_enter(int argc, char *argv[])
{
MSG("gpio wake up case,enter pds3 mode\r\n");
bflb_platform_delay_ms(50);
pm_pds_mode_enter(PM_PDS_LEVEL_3, 0); /*hbn、pds、exti gpio can wakeup*/
BL_CASE_SUCCESS; /*level 3 can run here*/
return 0;
}
int pds31_enter(int argc, char *argv[])
{
int second = 0;
if (argc == 2) {
second = atoi(argv[1]);
} else {
second = 0;
}
MSG("gpio wake up case,enter pds31 mode\r\n");
bflb_platform_delay_ms(50);
pm_pds_mode_enter(PM_PDS_LEVEL_31, second); /*hbn、pds gpio can wakeup*/
return 0;
}
SHELL_CMD_EXPORT(pds3_enter, pds3 gpio wakeup test)
SHELL_CMD_EXPORT(pds31_enter, pds31 gpio wakeup test)
- 注册进入 pds3 和 pds31 的命令
HBN 模式
^^^^^^^^^^^^^^^^
- 软件代码见 ``examples/pm/hbn_mode_wakeup``
.. code-block:: C
:linenos:
#define CONFIG_GPIO11_FUNC GPIO_FUN_ADC
- adc 引脚配置hbn0 下 acomp 使用,见 ``bsp/board/bl706_lp/pinmux_config.h``
.. code-block:: C
:linenos:
#define CONFIG_GPIO12_FUNC GPIO_FUN_WAKEUP
- hbn 唤醒脚配置hbn0、hbn1、hbn2 使用,见 ``bsp/board/bl706_lp/pinmux_config.h``
.. code-block:: C
:linenos:
int hbn0_enter(int argc, char *argv[])
{
acomp_device_t acomp_device;
acomp_device.id = 0;
acomp_device.pos_ch = ACOMP_CHANNEL_ADC_CHANNEL3; /*from gpio11 adc func*/
acomp_device.neg_ch = ACOMP_CHANNEL_0P375VBAT;
acomp_device.pos_hysteresis_vol = ACOMP_HYSTERESIS_VOLT_50MV;
acomp_device.neg_hysteresis_vol = ACOMP_HYSTERESIS_VOLT_50MV;
acomp_init(&acomp_device);
bflb_platform_delay_ms(50); /*delay for acomp*/
for (uint32_t i = 0; i < 30; i++) {
MSG("status:%d\r\n", acomp_get_result(&acomp_device));
bflb_platform_delay_ms(100);
}
MSG("acomp wake up case,enter hbn0 mode\r\n");
bflb_platform_delay_ms(50);
/** cpu will wakeup when acomp status change
* please note that if you set gpio9-gpio12 with GPIO_FUN_WAKEUP,it will also wakeup this level
* rtc can wakeup this level when sleep time do not equal 0
**/
pm_hbn_mode_enter(PM_HBN_LEVEL_0, 0);
return 0;
}
int hbn1_enter(int argc, char *argv[])
{
int second = 0;
if (argc == 2) {
second = atoi(argv[1]);
} else {
second = 1;
}
MSG("rtc wake up case,enter hbn1 mode\r\n");
bflb_platform_delay_ms(50);
/** cpu will wakeup when rtc sleep time timeout
* please note that if you set gpio9-gpio12 with GPIO_FUN_WAKEUP,it will also wakeup this level
**/
pm_hbn_mode_enter(PM_HBN_LEVEL_1, second);
return 0;
}
int hbn2_enter(int argc, char *argv[])
{
MSG("gpio wake up case,enter hbn2 mode\r\n");
bflb_platform_delay_ms(50);
/*cpu will wakeup when you set gpio9-gpio12 with GPIO_FUN_WAKEUP
* rtc can not wakeup level2
**/
pm_hbn_mode_enter(PM_HBN_LEVEL_2, 0);
return 0;
}
- 注册进入 hbn0、hbn1、hbn2 的命令
- pds 可以选择带一个 sleeptime 的参数,决定其内部 RTC 唤醒时间。如果指令不带此参数,那么默认不使用 RTC 内部唤醒,目前的固件仅支持上电复位唤醒。
- 如果指令包含 sleeptime 参数pds 将会在``sleeptime * clock_period`` 的时刻被唤醒,表现为复位芯片,重新打印起始报文。
- 进入低功耗模式后RTC 的时钟是 32K因此 sleeptime 为 32768 时,表现为睡眠 1S 后唤醒。
编译和烧录
-----------------------------
``hbn sleeptime``
- **CDK 编译**
暂无,用户可以自己添加
- **命令行编译**
.. code-block:: bash
:linenos:
$ cd <sdk_path>/bl_mcu_sdk
$ make BOARD=bl706_lp APP=pds_mode_wakeup
$ make BOARD=bl706_lp APP=hbn_mode_wakeup
- **烧录**
详见 :ref:`bl_dev_cube`
- hbn 可以选择带一个 sleeptime 的参数,决定其内部 RTC 唤醒时间。如果指令不带此参数,那么默认不使用 RTC 内部唤醒,目前的固件仅支持上电复位唤醒。
- 如果指令包含 sleeptime 参数hbn 将会在``sleeptime * clock_period`` 的时刻被唤醒,表现为复位芯片,重新打印起始报文。
- 进入低功耗模式后RTC 的时钟是 32K因此 sleeptime 为 32768 时,表现为睡眠 1S 后唤醒。
实验现象
-----------------------------
- 首先唤醒脚唤醒方式默认均为下降沿唤醒,所以需要将 GPIO6、GPIO10、GPIO12 引脚外接电阻到 3.3V。
- acomp 变化电压阈值在 1.2375V,所以需要使用滑动电阻器,调整到 1.2375V0.375VBAT)后再使用。
- 打开终端,并按下 TAB 键可以列出命令。
- 输入需要执行命令回车即可运行。
**PDS 模式**
.. figure:: img/lowpower_pds.gif
:alt:
**HBN 模式**
.. figure:: img/lowpower_hbn.gif
:alt:
详细测试结果见 `BL702/704/706 数据手册 page 28 <https://dev.bouffalolab.com/media/upload/doc/BL702_BL704_BL706_DS_zh_CN_Combo_1.9.pdf>`_。
.. figure:: img/powerTable.png

View file

@ -190,7 +190,7 @@ SHELL 命令注册
:linenos:
$ cd <sdk_path>/bl_mcu_sdk
$ make BOARD=bl706_iot APP=shell SUPPORT_SHELL=y
$ make BOARD=bl706_iot APP=shell
- **烧录**

View file

@ -6,7 +6,7 @@ USB Device 应用
:maxdepth: 1
CDC - 虚拟串口<usbd_cdc>
MSC - U 盘<usbd_msc>
MSC - U 盘升级<usbd_msc>
HID - 键盘&鼠标<usbd_hid>
VIDEO - 摄像头<usbd_video>
AUDIO - 麦克风<usbd_audio>

View file

@ -1,2 +1,136 @@
MSC - U 盘
MSC - U 盘升级
====================
本 demo 主要演示使用 usb 将 xip flash 模拟成 u 盘设备,将其作为一个 BootLoader 使用,用来升级固件。
USB大容量存储设备类The USB mass storage device class是一种计算机和移动设备之间的传输协议它允许一个通用串行总线USB设备来访问主机的计算设备使两者之间进行文件传输。
MSC 协议介绍参考 `USB 官方文档 <https://www.usb.org/documents>`_。
bootloader 我们将其编译后烧录在 flash 0x2000 开始的物理地址,工具默认也是这个地址。
.. figure:: img/usb_msc.png
我们使用 flash 物理地址 0x0000c000 (48K) 开始的地方,用来模拟 u 盘u 盘大小为 256K64 个扇区,每个扇区 4KB ),根据文件系统格式,可以知道,数据的地址在 u 盘的第 10 个扇区0x16000也即 APP 的入口地址。BootLoader 与 APP 分区表如下:
.. figure:: img/usb_msc2.png
准备工具
-----------------------
- 一根 usb 数据线
硬件连接
-----------------------------
- 内部 flash 不需要额外电路
- 外部 flash 需要连接 flash 控制器接口
::
GPIO function GPIO pin
----------------------------------
USB_DP <--> GPIO7
USB_DM <--> GPIO8
UART0_TX <--> GPIO14
BOOTLOADER_PIN <--> GPIO15
软件实现
-------------------------
- 软件代码见 ``examples/usb/usb_msc_flash_boot``
.. code-block:: C
:linenos:
#define BLOCK_SIZE 4096
#define BLOCK_COUNT 64
#define FLASH_ADDR 0x0000c000 /*addr start from 48k */
void usbd_msc_get_cap(uint8_t lun, uint32_t *block_num, uint16_t *block_size)
{
*block_num = BLOCK_COUNT;
*block_size = BLOCK_SIZE;
}
int usbd_msc_sector_read(uint32_t sector, uint8_t *buffer, uint32_t length)
{
flash_read(FLASH_ADDR + sector * BLOCK_SIZE, buffer, length);
return 0;
}
int usbd_msc_sector_write(uint32_t sector, uint8_t *buffer, uint32_t length)
{
flash_erase(FLASH_ADDR + sector * BLOCK_SIZE, BLOCK_SIZE);
flash_write(FLASH_ADDR + sector * BLOCK_SIZE, buffer, length);
return 0;
}
- 实现 usb msc 需要的底层接口u 盘大小 256Kflash 物理地址从 0x0000c000 开始。
.. code-block:: C
:linenos:
gpio_set_mode(GPIO_PIN_15, GPIO_INPUT_PD_MODE);
if (gpio_read(GPIO_PIN_15)) {
MSG("*************Welcome to usb msc boot,update your app bin*************\r\n");
usbd_desc_register(msc_ram_descriptor);
usbd_msc_class_init(MSC_OUT_EP, MSC_IN_EP);
usb_fs = usb_dc_init();
if (usb_fs) {
device_control(usb_fs, DEVICE_CTRL_SET_INT, (void *)(USB_EP4_DATA_OUT_IT | USB_EP5_DATA_IN_IT));
}
while (!usb_device_is_configured()) {
}
} else {
uint8_t bin_header;
flash_read(FLASH_ADDR + 10 * BLOCK_SIZE, &bin_header, 1);
if ((bin_header == 0x00) && (bin_header == 0xff)) {
MSG("*************Illegal bin!! Please update your bin*************\r\n");
while (1) {
}
}
MSG("*************Let's go to application*************\r\n");
bflb_platform_delay_ms(20);
bflb_platform_deinit();
hal_jump2app(FLASH_ADDR + 10 * BLOCK_SIZE);
}
- 配置 GPIO15 作为输入模式,默认拉低,拉高进入 u 盘升级。
- 如果 GPIO15 为高,则进入 u 盘 升级程序。
- 如果 GPIO15 为低,则表示不需要升级直接进入 app此时需要修改内存映射地址将逻辑地址映射的物理地址flash offset )从 0x2000 改成实际 app 存储在 flash 的地址为FLASH_ADDR + 10 * BLOCK_SIZE。
- ``hal_jump2app`` 中对物理地址进行了判断bootloader 程序预留 48K物理地址小于 4M。
编译和烧录
-----------------------------
- **CDK 编译**
暂无,用户可以自己添加
- **命令行编译**
.. code-block:: bash
:linenos:
$ cd <sdk_path>/bl_mcu_sdk
$ make BOARD=bl706_iot APP=usb_msc_flash_boot
- **烧录**
详见 :ref:`bl_dev_cube`
实验现象
-----------------------------
- 将 GPIO15 拉高,然后使用 USB 数据线插到电脑上,识别出一个 U 盘。
- 将编译的 APP bin 文件拖入 U 盘。
- 拔下 USB ,拉低 GPIO15供电以后进入 APP 。
.. figure:: img/usb_msc3.gif

View file

@ -85,9 +85,7 @@ BL706 AVB + GC0308摄像头模块 + windows 相机
#define CONFIG_GPIO30_FUNC GPIO_FUN_CAM
#define CONFIG_GPIO31_FUNC GPIO_FUN_CAM
- 使用到的 GPIO 配置见 ``bsp/board/bl706_avb/pinmux_config.h``,默认提供了该 demo 的引脚配置
.. note:: ``bsp/board/bl706_avb/pinmux_config.h`` 当前给所有的示例 demo 使用,所以,需要先选定 ``PINMUX_SELECT`` 为 ``PINMUX_UVC``,开启 UVC demo
- 使用到的 GPIO 配置见 ``bsp/board/bl706_avb/pinmux_config.h``
.. code-block:: C
:linenos:

View file

@ -0,0 +1,59 @@
XIP FLASH - 数据读写
======================
本 demo 主要演示 xip flash 基本的数据读写功能。
硬件连接
-----------------------------
- 内部 flash 不需要额外电路
- 外部 flash 需要连接 flash 控制器接口
软件实现
-----------------------------
- 软件代码见 ``examples/flash/flash_rw``
.. code-block:: C
:linenos:
/* erase 0x00010000 16k flash */
flash_erase(0x00010000, 16 * 1024);
/* write 0x00010000 flash data */
flash_write(0x00010000, writeTestData, sizeof(writeTestData));
memset(readTestData, 0, 256);
/* read 0x00010000 flash data */
flash_read(0x00010000, readTestData, sizeof(readTestData));
- 擦除 flash 物理地址 0x00010000 开始的 16K 内容
- 从flash 物理地址 0x00010000 开始写入用户数据
- 从flash 物理地址 0x00010000 开始读取用户数据
编译和烧录
-----------------------------
- **CDK 编译**
打开项目中提供的工程文件flash_rw.cdkproj
参照 :ref:`windows_cdk_quick_start` 的步骤编译下载即可
- **命令行编译**
.. code-block:: bash
:linenos:
$ cd <sdk_path>/bl_mcu_sdk
$ make BOARD=bl706_iot APP=flash_rw
- **烧录**
详见 :ref:`bl_dev_cube`
实验现象
-----------------------------
打开串口,如果显示 case success 表示读写成功,否则读写错误

View file

@ -0,0 +1,9 @@
=======================
XIP FLASH 示例
=======================
.. toctree::
:maxdepth: 1
XIP FLASH - 数据读写 <flash_demo>

View file

@ -136,13 +136,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -161,13 +161,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -130,6 +130,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -148,13 +150,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -124,6 +124,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -142,13 +144,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -122,6 +122,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -140,13 +142,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -139,6 +139,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -157,13 +159,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -0,0 +1,365 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>2.14. XIP FLASH 设备 &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/translations.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="2.15. PM 设备" href="api_pm.html" />
<link rel="prev" title="2.13. USB 设备" href="api_usb.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home"> BL_MCU_SDK 开发指南
</a>
<div class="version">
0.3
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">快速开发指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/get_started.html">1. 开发前的准备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/connecting_hardware.html">2. 硬件连接指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/index.html">3. 开发环境搭建指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/cmake_quick_start.html">4. 基于 cmake 框架新建工程指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/cdk_new_project_quick_start.html">5. 基于 CDK 新建工程指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/bl_dev_cube.html">6. BLDevCube 烧录工具指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/board.html">7. Board 配置系统使用指南</a></li>
</ul>
<p class="caption"><span class="caption-text">API 手册</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../api_overview.html">1. API 概述</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">2. Peripheral</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="api_clock.html">2.1. 时钟树</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_gpio.html">2.2. GPIO 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_uart.html">2.3. UART 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pwm.html">2.4. PWM 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_dma.html">2.5. DMA 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_i2c.html">2.6. I2C 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_i2s.html">2.7. I2S 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_spi.html">2.8. SPI 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_adc.html">2.9. ADC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_dac.html">2.10. DAC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">2.14. XIP FLASH 设备</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">2.14.1. 简介</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id2">2.14.2. XIP FLASH 设备接口</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#flash-init">2.14.2.1. <strong>flash_init</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#flash-read-jedec-id">2.14.2.2. <strong>flash_read_jedec_id</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#flash-erase">2.14.2.3. <strong>flash_erase</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#flash-write">2.14.2.4. <strong>flash_write</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#flash-read">2.14.2.5. <strong>flash_read</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#hal-jump2app">2.14.2.6. <strong>hal_jump2app</strong></a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb%20stack/api_usb_stack.html">4. USB Stack</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bluetooth/api_ble.html">5. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">基础外设例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/gpio/index.html">1. GPIO 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/uart/index.html">2. UART 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/pwm/index.html">3. PWM 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/mtimer/index.html">4. MTIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/dma/index.html">5. DMA 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/spi/index.html">6. SPI 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2c/index.html">7. I2C 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL_MCU_SDK 开发指南</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><a href="index.html"><span class="section-number">2. </span>Peripheral</a> &raquo;</li>
<li><span class="section-number">2.14. </span>XIP FLASH 设备</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/api_reference/peripheral/api_flash.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="xip-flash">
<h1><span class="section-number">2.14. </span>XIP FLASH 设备<a class="headerlink" href="#xip-flash" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2><span class="section-number">2.14.1. </span>简介<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>XIPeXecute In Place即芯片内执行指应用程序可以直接在 flash 闪存内运行,不必再把代码读到系统 RAM 中。所谓片内执行并不是说程序在存储器内执行CPU的基本功能是取指、译码、执行存储器访问写回。通常我们使用 Nor FlashNor Flash能在芯片内执行指的是 CPU 能够直接从Nor flash 中取指令,供后面的译码器和执行器来使用。</p>
<p>博流系列芯片拥有 XIP FLASH 控制器并且支持内存映射BL702/BL704/BL706 的逻辑地址为 0x23000000,最大可支持 8M 的 nor flash。不仅如此映射的实际物理 flash 地址是可以修改的,举例来说,假设一个 nor flash 大小为 1M如果应用程序烧录在 flash 物理地址 0那么就可以将逻辑地址映射到 0 地址,如果应用程序烧录在 flash 物理地址 x那么就可以将逻辑地址映射到 x 地址,而逻辑地址可以保持不变,一直是 0x23000000省去了修改 ld 文件的麻烦。</p>
<p>下图演示三块应用程序映射地址分布:</p>
<div class="figure align-default">
<img alt="" src="../../_images/flash.png" />
</div>
</div>
<div class="section" id="id2">
<h2><span class="section-number">2.14.2. </span>XIP FLASH 设备接口<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<div class="section" id="flash-init">
<h3><span class="section-number">2.14.2.1. </span><strong>flash_init</strong><a class="headerlink" href="#flash-init" title="永久链接至标题"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">flash_init</span></code> 用于初始化 flash 控制器。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="n">BL_Err_Type</span> <span class="nf">flash_init</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>return</strong> 错误码0 表示成功,其他表示错误</p></li>
</ul>
</div>
<div class="section" id="flash-read-jedec-id">
<h3><span class="section-number">2.14.2.2. </span><strong>flash_read_jedec_id</strong><a class="headerlink" href="#flash-read-jedec-id" title="永久链接至标题"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">flash_read_jedec_id</span></code> 用于获取 flash id。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="n">BL_Err_Type</span> <span class="nf">flash_read_jedec_id</span><span class="p">(</span><span class="kt">uint8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>data</strong> 存储 flash id 的指针,大小 4 字节</p></li>
<li><p><strong>return</strong> 错误码0 表示成功,其他表示错误</p></li>
</ul>
</div>
<div class="section" id="flash-erase">
<h3><span class="section-number">2.14.2.3. </span><strong>flash_erase</strong><a class="headerlink" href="#flash-erase" title="永久链接至标题"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">flash_init</span></code> 用于 flash 扇区擦除。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="n">BL_Err_Type</span> <span class="nf">flash_erase</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">startaddr</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">len</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>startaddr</strong> 要擦除的 flash 物理起始地址</p></li>
<li><p><strong>len</strong> 擦除扇区长度,单位</p></li>
<li><p><strong>return</strong> 错误码0 表示成功,其他表示错误</p></li>
</ul>
</div>
<div class="section" id="flash-write">
<h3><span class="section-number">2.14.2.4. </span><strong>flash_write</strong><a class="headerlink" href="#flash-write" title="永久链接至标题"></a></h3>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="n">BL_Err_Type</span> <span class="nf">flash_write</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">addr</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">len</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>addr</strong> 要写入的 flash 物理起始地址</p></li>
<li><p><strong>data</strong> 写入数据指针</p></li>
<li><p><strong>len</strong> 写入长度</p></li>
<li><p><strong>return</strong> 错误码0 表示成功,其他表示错误</p></li>
</ul>
</div>
<div class="section" id="flash-read">
<h3><span class="section-number">2.14.2.5. </span><strong>flash_read</strong><a class="headerlink" href="#flash-read" title="永久链接至标题"></a></h3>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="n">BL_Err_Type</span> <span class="nf">flash_read</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">addr</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">data</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">len</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>addr</strong> 要读取的 flash 物理起始地址</p></li>
<li><p><strong>data</strong> 读入数据指针</p></li>
<li><p><strong>len</strong> 读取长度</p></li>
<li><p><strong>return</strong> 错误码0 表示成功,其他表示错误</p></li>
</ul>
</div>
<div class="section" id="hal-jump2app">
<h3><span class="section-number">2.14.2.6. </span><strong>hal_jump2app</strong><a class="headerlink" href="#hal-jump2app" title="永久链接至标题"></a></h3>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">hal_jump2app</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">flash_offset</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>flash_offset</strong> 要跳转的 flash 物理地址,即烧录新应用程序的物理地址</p></li>
</ul>
<div class="admonition error">
<p class="admonition-title">错误</p>
<p>以上地址均为 flash 物理地址不可以填入内存映射地址比如0x23000000。</p>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="api_pm.html" class="btn btn-neutral float-right" title="2.15. PM 设备" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="api_usb.html" class="btn btn-neutral float-left" title="2.13. USB 设备" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; 版权所有 2021, BouffaloLab Co., Ltd.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View file

@ -128,6 +128,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -146,13 +148,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -127,6 +127,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -145,13 +147,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -130,6 +130,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -148,13 +150,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -0,0 +1,372 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>2.15. PM 设备 &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
<link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/doctools.js"></script>
<script src="../../_static/translations.js"></script>
<script type="text/javascript" src="../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="3. Shell" href="../shell/api_shell.html" />
<link rel="prev" title="2.14. XIP FLASH 设备" href="api_flash.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../index.html" class="icon icon-home"> BL_MCU_SDK 开发指南
</a>
<div class="version">
0.3
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">快速开发指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/get_started.html">1. 开发前的准备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/connecting_hardware.html">2. 硬件连接指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/index.html">3. 开发环境搭建指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/cmake_quick_start.html">4. 基于 cmake 框架新建工程指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/cdk_new_project_quick_start.html">5. 基于 CDK 新建工程指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/bl_dev_cube.html">6. BLDevCube 烧录工具指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../get_started/board.html">7. Board 配置系统使用指南</a></li>
</ul>
<p class="caption"><span class="caption-text">API 手册</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../api_overview.html">1. API 概述</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">2. Peripheral</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="api_clock.html">2.1. 时钟树</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_gpio.html">2.2. GPIO 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_uart.html">2.3. UART 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pwm.html">2.4. PWM 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_dma.html">2.5. DMA 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_i2c.html">2.6. I2C 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_i2s.html">2.7. I2S 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_spi.html">2.8. SPI 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_adc.html">2.9. ADC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_dac.html">2.10. DAC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">2.15. PM 设备</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">2.15.1. 简介</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id2">2.15.2. PM 设备接口</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#pm-pds-mode-enter">2.15.2.1. <strong>pm_pds_mode_enter</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#pm-hbn-mode-enter">2.15.2.2. <strong>pm_hbn_mode_enter</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#pm-set-wakeup-callback">2.15.2.3. <strong>pm_set_wakeup_callback</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#pm-hbn-out0-irq-register">2.15.2.4. <strong>pm_hbn_out0_irq_register</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#pm-hbn-out1-irq-register">2.15.2.5. <strong>pm_hbn_out1_irq_register</strong></a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb%20stack/api_usb_stack.html">4. USB Stack</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bluetooth/api_ble.html">5. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">基础外设例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/gpio/index.html">1. GPIO 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/uart/index.html">2. UART 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/pwm/index.html">3. PWM 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/mtimer/index.html">4. MTIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/dma/index.html">5. DMA 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/spi/index.html">6. SPI 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2c/index.html">7. I2C 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../index.html">BL_MCU_SDK 开发指南</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><a href="index.html"><span class="section-number">2. </span>Peripheral</a> &raquo;</li>
<li><span class="section-number">2.15. </span>PM 设备</li>
<li class="wy-breadcrumbs-aside">
<a href="../../_sources/api_reference/peripheral/api_pm.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="pm">
<h1><span class="section-number">2.15. </span>PM 设备<a class="headerlink" href="#pm" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2><span class="section-number">2.15.1. </span>简介<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
</div>
<div class="section" id="id2">
<h2><span class="section-number">2.15.2. </span>PM 设备接口<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<div class="section" id="pm-pds-mode-enter">
<h3><span class="section-number">2.15.2.1. </span><strong>pm_pds_mode_enter</strong><a class="headerlink" href="#pm-pds-mode-enter" title="永久链接至标题"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">pm_pds_mode_enter</span></code> 用来进入 pds 模式</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">pm_pds_mode_enter</span><span class="p">(</span><span class="k">enum</span> <span class="n">pm_pds_sleep_level</span> <span class="n">pds_level</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">sleep_time</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>pds_level</strong> PDS 等级</p></li>
<li><p><strong>sleep_time</strong> 睡眠时间,单位 1/32768 hz</p></li>
</ul>
<p>其中 <code class="docutils literal notranslate"><span class="pre">pds_level</span></code> 提供以下类型:</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="k">enum</span> <span class="n">pm_pds_sleep_level</span> <span class="p">{</span>
<span class="n">PM_PDS_LEVEL_0</span><span class="p">,</span>
<span class="n">PM_PDS_LEVEL_1</span><span class="p">,</span>
<span class="n">PM_PDS_LEVEL_2</span><span class="p">,</span>
<span class="n">PM_PDS_LEVEL_3</span><span class="p">,</span>
<span class="n">PM_PDS_LEVEL_4</span><span class="p">,</span> <span class="cm">/*do not recommend to use*/</span>
<span class="n">PM_PDS_LEVEL_5</span><span class="p">,</span> <span class="cm">/*do not recommend to use*/</span>
<span class="n">PM_PDS_LEVEL_6</span><span class="p">,</span> <span class="cm">/*do not recommend to use*/</span>
<span class="n">PM_PDS_LEVEL_7</span><span class="p">,</span> <span class="cm">/*do not recommend to use*/</span>
<span class="n">PM_PDS_LEVEL_31</span> <span class="o">=</span> <span class="mi">31</span><span class="p">,</span>
<span class="p">};</span>
</pre></div>
</div>
<div class="admonition warning">
<p class="admonition-title">警告</p>
<p>pds level 4~7 不推荐使用</p>
</div>
</div>
<div class="section" id="pm-hbn-mode-enter">
<h3><span class="section-number">2.15.2.2. </span><strong>pm_hbn_mode_enter</strong><a class="headerlink" href="#pm-hbn-mode-enter" title="永久链接至标题"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">pm_hbn_mode_enter</span></code> 用来进入 hbn 模式</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">pm_hbn_mode_enter</span><span class="p">(</span><span class="k">enum</span> <span class="n">pm_hbn_sleep_level</span> <span class="n">hbn_level</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">sleep_time</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>hbn_level</strong> HBN 等级</p></li>
<li><p><strong>sleep_time</strong> 睡眠时间,单位秒</p></li>
</ul>
<p>其中 <code class="docutils literal notranslate"><span class="pre">hbn_level</span></code> 提供以下类型:</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="k">enum</span> <span class="n">pm_hbn_sleep_level</span> <span class="p">{</span>
<span class="n">PM_HBN_LEVEL_0</span><span class="p">,</span>
<span class="n">PM_HBN_LEVEL_1</span><span class="p">,</span>
<span class="n">PM_HBN_LEVEL_2</span><span class="p">,</span>
<span class="p">};</span>
</pre></div>
</div>
</div>
<div class="section" id="pm-set-wakeup-callback">
<h3><span class="section-number">2.15.2.3. </span><strong>pm_set_wakeup_callback</strong><a class="headerlink" href="#pm-set-wakeup-callback" title="永久链接至标题"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">pm_set_wakeup_callback</span></code> 用来设置从唤醒恢复时跳转的函数地址hbn level1 以上不可用。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">pm_set_wakeup_callback</span><span class="p">(</span><span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">wakeup_callback</span><span class="p">)(</span><span class="kt">void</span><span class="p">));</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>wakeup_callback</strong> 跳转的函数地址</p></li>
</ul>
</div>
<div class="section" id="pm-hbn-out0-irq-register">
<h3><span class="section-number">2.15.2.4. </span><strong>pm_hbn_out0_irq_register</strong><a class="headerlink" href="#pm-hbn-out0-irq-register" title="永久链接至标题"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">pm_hbn_out0_irq_register</span></code> 用来注册 hbn out0 中断out0下中断有GPIO9~GPIO12,RTC。中断回调函数为 <code class="docutils literal notranslate"><span class="pre">pm_irq_callback</span></code></p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">pm_hbn_out0_irq_register</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
</pre></div>
</div>
</div>
<div class="section" id="pm-hbn-out1-irq-register">
<h3><span class="section-number">2.15.2.5. </span><strong>pm_hbn_out1_irq_register</strong><a class="headerlink" href="#pm-hbn-out1-irq-register" title="永久链接至标题"></a></h3>
<p><code class="docutils literal notranslate"><span class="pre">pm_hbn_out1_irq_register</span></code> 用来注册 hbn out1 中断out1下中断有ACOMP0、ACOMP1、BOR、PIR。中断回调函数为 <code class="docutils literal notranslate"><span class="pre">pm_irq_callback</span></code></p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">pm_hbn_out1_irq_register</span><span class="p">(</span><span class="kt">void</span><span class="p">);</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">pm_irq_callback</span></code><code class="docutils literal notranslate"><span class="pre">event</span></code> 提供以下类型:</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="k">enum</span> <span class="n">pm_event_type</span> <span class="p">{</span>
<span class="n">PM_HBN_GPIO9_WAKEUP_EVENT</span><span class="p">,</span>
<span class="n">PM_HBN_GPIO10_WAKEUP_EVENT</span><span class="p">,</span>
<span class="n">PM_HBN_GPIO11_WAKEUP_EVENT</span><span class="p">,</span>
<span class="n">PM_HBN_GPIO12_WAKEUP_EVENT</span><span class="p">,</span>
<span class="n">PM_HBN_RTC_WAKEUP_EVENT</span><span class="p">,</span>
<span class="n">PM_HBN_ACOMP0_WAKEUP_EVENT</span><span class="p">,</span>
<span class="n">PM_HBN_ACOMP1_WAKEUP_EVENT</span><span class="p">,</span>
<span class="p">};</span>
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../shell/api_shell.html" class="btn btn-neutral float-right" title="3. Shell" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="api_flash.html" class="btn btn-neutral float-left" title="2.14. XIP FLASH 设备" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; 版权所有 2021, BouffaloLab Co., Ltd.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View file

@ -134,6 +134,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -152,13 +154,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -129,6 +129,8 @@
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -147,13 +149,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -134,6 +134,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -152,13 +154,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -130,6 +130,8 @@
</li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -148,13 +150,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -131,6 +131,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -149,13 +151,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -39,7 +39,7 @@
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="3. Shell" href="../shell/api_shell.html" />
<link rel="next" title="2.14. XIP FLASH 设备" href="api_flash.html" />
<link rel="prev" title="2.12. QDEC 设备" href="api_qdec.html" />
</head>
@ -140,6 +140,8 @@
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -158,13 +160,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>
@ -629,7 +632,7 @@
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../shell/api_shell.html" class="btn btn-neutral float-right" title="3. Shell" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="api_flash.html" class="btn btn-neutral float-right" title="2.14. XIP FLASH 设备" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="api_qdec.html" class="btn btn-neutral float-left" title="2.12. QDEC 设备" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>

View file

@ -116,6 +116,8 @@
<li class="toctree-l2"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l2"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../shell/api_shell.html">3. Shell</a></li>
@ -134,13 +136,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>
@ -228,6 +231,8 @@
<li class="toctree-l1"><a class="reference internal" href="api_timer.html">2.11. TIMER 设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="api_qdec.html">2.12. QDEC 设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="api_usb.html">2.13. USB 设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="api_flash.html">2.14. XIP FLASH 设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="api_pm.html">2.15. PM 设备</a></li>
</ul>
</div>
</div>

View file

@ -40,7 +40,7 @@
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="4. USB Stack" href="../usb%20stack/api_usb_stack.html" />
<link rel="prev" title="2.13. USB 设备" href="../peripheral/api_usb.html" />
<link rel="prev" title="2.15. PM 设备" href="../peripheral/api_pm.html" />
</head>
<body class="wy-body-for-nav">
@ -129,13 +129,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>
@ -281,7 +282,7 @@
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../usb%20stack/api_usb_stack.html" class="btn btn-neutral float-right" title="4. USB Stack" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="../peripheral/api_usb.html" class="btn btn-neutral float-left" title="2.13. USB 设备" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="../peripheral/api_pm.html" class="btn btn-neutral float-left" title="2.15. PM 设备" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>

View file

@ -121,14 +121,22 @@
</li>
<li class="toctree-l3"><a class="reference internal" href="#usb-device-cdc">4.3.2. USB Device CDC 类接口</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#usbd-cdc-add-acm-interface">4.3.2.1. <strong>usbd_cdc_add_acm_interface</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#usbd-cdc-acm-set-line-coding">4.3.2.2. <strong>usbd_cdc_acm_set_line_coding</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#usbd-cdc-acm-set-dtr">4.3.2.3. <strong>usbd_cdc_acm_set_dtr</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#usbd-cdc-acm-set-rts">4.3.2.4. <strong>usbd_cdc_acm_set_rts</strong></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#usb-device-msc">4.3.3. USB Device MSC 类接口</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#usbd-msc-class-init">4.3.3.1. <strong>usbd_msc_class_init</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#usbd-msc-get-cap">4.3.3.2. <strong>usbd_msc_get_cap</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#usbd-msc-sector-read">4.3.3.3. <strong>usbd_msc_sector_read</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#usbd-msc-sector-write">4.3.3.4. <strong>usbd_msc_sector_write</strong></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#usb-device-hid">4.3.4. USB Device HID 类接口</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#usbd-hid-add-interface">4.3.4.1. <strong>usbd_hid_add_interface</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#usbd-hid-report-descriptor-register">4.3.4.2. <strong>usbd_hid_report_descriptor_register</strong></a></li>
<li class="toctree-l4"><a class="reference internal" href="#usbd-hid-set-request-callback">4.3.4.3. <strong>usbd_hid_set_request_callback</strong></a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#usb-device-audio">4.3.5. USB Device AUDIO 类接口</a><ul>
@ -157,13 +165,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>
@ -412,6 +421,39 @@
<li><p><strong>intf</strong> 接口句柄</p></li>
</ul>
</div>
<div class="section" id="usbd-cdc-acm-set-line-coding">
<h4><span class="section-number">4.3.2.2. </span><strong>usbd_cdc_acm_set_line_coding</strong><a class="headerlink" href="#usbd-cdc-acm-set-line-coding" title="永久链接至标题"></a></h4>
<p><code class="docutils literal notranslate"><span class="pre">usbd_cdc_acm_set_line_coding</span></code> 用来对串口进行配置。该接口由用户实现,默认为空。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">usbd_cdc_acm_set_line_coding</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">baudrate</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">databits</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">parity</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">stopbits</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>baudrate</strong> 波特率</p></li>
<li><p><strong>databits</strong> 数据位</p></li>
<li><p><strong>parity</strong> 校验位</p></li>
<li><p><strong>stopbits</strong> 停止位</p></li>
</ul>
</div>
<div class="section" id="usbd-cdc-acm-set-dtr">
<h4><span class="section-number">4.3.2.3. </span><strong>usbd_cdc_acm_set_dtr</strong><a class="headerlink" href="#usbd-cdc-acm-set-dtr" title="永久链接至标题"></a></h4>
<p><code class="docutils literal notranslate"><span class="pre">usbd_cdc_acm_set_line_coding</span></code> 用来控制串口 DTR。该接口由用户实现默认为空。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">usbd_cdc_acm_set_dtr</span><span class="p">(</span><span class="kt">bool</span> <span class="n">dtr</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>dtr</strong> dtr 为1表示拉低电平为0表示拉高电平</p></li>
</ul>
</div>
<div class="section" id="usbd-cdc-acm-set-rts">
<h4><span class="section-number">4.3.2.4. </span><strong>usbd_cdc_acm_set_rts</strong><a class="headerlink" href="#usbd-cdc-acm-set-rts" title="永久链接至标题"></a></h4>
<p><code class="docutils literal notranslate"><span class="pre">usbd_cdc_acm_set_line_coding</span></code> 用来控制串口 RTS。该接口由用户实现默认为空。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">usbd_cdc_acm_set_rts</span><span class="p">(</span><span class="kt">bool</span> <span class="n">rts</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>rts</strong> rts 为1表示拉低电平为0表示拉高电平</p></li>
</ul>
</div>
</div>
<div class="section" id="usb-device-msc">
<h3><span class="section-number">4.3.3. </span>USB Device MSC 类接口<a class="headerlink" href="#usb-device-msc" title="永久链接至标题"></a></h3>
@ -426,6 +468,42 @@
<li><p><strong>in_ep</strong> 输入端点的地址</p></li>
</ul>
</div>
<div class="section" id="usbd-msc-get-cap">
<h4><span class="section-number">4.3.3.2. </span><strong>usbd_msc_get_cap</strong><a class="headerlink" href="#usbd-msc-get-cap" title="永久链接至标题"></a></h4>
<p><code class="docutils literal notranslate"><span class="pre">usbd_msc_get_cap</span></code> 用来获取存储器的信息。该接口由用户实现,默认为空。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">usbd_msc_get_cap</span><span class="p">(</span><span class="kt">uint8_t</span> <span class="n">lun</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="o">*</span><span class="n">block_num</span><span class="p">,</span> <span class="kt">uint16_t</span> <span class="o">*</span><span class="n">block_size</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>lun</strong> 存储逻辑单元,暂时无用</p></li>
<li><p><strong>block_num</strong> 存储扇区个数的指针</p></li>
<li><p><strong>block_size</strong> 存储扇区大小的指针</p></li>
</ul>
</div>
<div class="section" id="usbd-msc-sector-read">
<h4><span class="section-number">4.3.3.3. </span><strong>usbd_msc_sector_read</strong><a class="headerlink" href="#usbd-msc-sector-read" title="永久链接至标题"></a></h4>
<p><code class="docutils literal notranslate"><span class="pre">usbd_msc_sector_read</span></code> 用来对存储器某个扇区开始进行数据读取。该接口由用户实现,默认为空。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="nf">usbd_msc_sector_read</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">sector</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">buffer</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">length</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>sector</strong> 扇区偏移</p></li>
<li><p><strong>buffer</strong> 存储读取的数据的指针</p></li>
<li><p><strong>length</strong> 读取长度</p></li>
</ul>
</div>
<div class="section" id="usbd-msc-sector-write">
<h4><span class="section-number">4.3.3.4. </span><strong>usbd_msc_sector_write</strong><a class="headerlink" href="#usbd-msc-sector-write" title="永久链接至标题"></a></h4>
<p><code class="docutils literal notranslate"><span class="pre">usbd_msc_sector_write</span></code> 用来对存储器某个扇区开始写入数据。该接口由用户实现,默认为空。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="nf">usbd_msc_sector_write</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">sector</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">buffer</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">length</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>sector</strong> 扇区偏移</p></li>
<li><p><strong>buffer</strong> 写入数据指针</p></li>
<li><p><strong>length</strong> 写入长度</p></li>
</ul>
</div>
</div>
<div class="section" id="usb-device-hid">
<h3><span class="section-number">4.3.4. </span>USB Device HID 类接口<a class="headerlink" href="#usb-device-hid" title="永久链接至标题"></a></h3>
@ -442,6 +520,40 @@
<li><p><strong>intf</strong> 接口句柄</p></li>
</ul>
</div>
<div class="section" id="usbd-hid-report-descriptor-register">
<h4><span class="section-number">4.3.4.2. </span><strong>usbd_hid_report_descriptor_register</strong><a class="headerlink" href="#usbd-hid-report-descriptor-register" title="永久链接至标题"></a></h4>
<p><code class="docutils literal notranslate"><span class="pre">usbd_hid_report_descriptor_register</span></code> 用来对存储器某个扇区开始写入数据。该接口由用户实现,默认为空。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">usbd_hid_report_descriptor_register</span><span class="p">(</span><span class="kt">uint8_t</span> <span class="n">intf_num</span><span class="p">,</span> <span class="k">const</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">desc</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">desc_len</span><span class="p">);</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>intf_num</strong> 当前 hid 报告描述符所在接口偏移</p></li>
<li><p><strong>desc</strong> 报告描述符</p></li>
<li><p><strong>desc_len</strong> 报告描述符长度</p></li>
</ul>
</div>
<div class="section" id="usbd-hid-set-request-callback">
<h4><span class="section-number">4.3.4.3. </span><strong>usbd_hid_set_request_callback</strong><a class="headerlink" href="#usbd-hid-set-request-callback" title="永久链接至标题"></a></h4>
<p><code class="docutils literal notranslate"><span class="pre">usbd_hid_set_request_callback</span></code> 用来对存储器某个扇区开始写入数据。该接口由用户实现,默认为空。</p>
<div class="highlight-C notranslate"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">usbd_hid_set_request_callback</span><span class="p">(</span> <span class="kt">uint8_t</span> <span class="n">intf_num</span><span class="p">,</span>
<span class="kt">uint8_t</span> <span class="p">(</span><span class="o">*</span><span class="n">get_report_callback</span><span class="p">)(</span><span class="kt">uint8_t</span> <span class="n">report_id</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">report_type</span><span class="p">),</span>
<span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">set_report_callback</span><span class="p">)(</span><span class="kt">uint8_t</span> <span class="n">report_id</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">report_type</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">report</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">report_len</span><span class="p">),</span>
<span class="kt">uint8_t</span> <span class="p">(</span><span class="o">*</span><span class="n">get_idle_callback</span><span class="p">)(</span><span class="kt">uint8_t</span> <span class="n">report_id</span><span class="p">),</span>
<span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">set_idle_callback</span><span class="p">)(</span><span class="kt">uint8_t</span> <span class="n">report_id</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="n">duration</span><span class="p">),</span>
<span class="kt">void</span> <span class="p">(</span><span class="o">*</span><span class="n">set_protocol_callback</span><span class="p">)(</span><span class="kt">uint8_t</span> <span class="n">protocol</span><span class="p">),</span>
<span class="kt">uint8_t</span> <span class="p">(</span><span class="o">*</span><span class="n">get_protocol_callback</span><span class="p">)(</span><span class="kt">void</span><span class="p">));</span>
</pre></div>
</div>
<ul class="simple">
<li><p><strong>intf_num</strong> 当前 hid 报告描述符所在接口偏移</p></li>
<li><p><strong>get_report_callback</strong> get report命令处理回调函数</p></li>
<li><p><strong>set_report_callback</strong> set report命令处理回调函数</p></li>
<li><p><strong>get_idle_callback</strong> get idle命令处理回调函数</p></li>
<li><p><strong>set_idle_callback</strong> set idle命令处理回调函数</p></li>
<li><p><strong>set_protocol_callback</strong> set protocol命令处理回调函数</p></li>
<li><p><strong>get_protocol_callback</strong> get protocol命令处理回调函数</p></li>
</ul>
</div>
</div>
<div class="section" id="usb-device-audio">
<h3><span class="section-number">4.3.5. </span>USB Device AUDIO 类接口<a class="headerlink" href="#usb-device-audio" title="永久链接至标题"></a></h3>

View file

@ -117,13 +117,14 @@
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -139,13 +139,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -135,13 +135,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -141,13 +141,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -128,13 +128,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -140,13 +140,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -135,13 +135,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -123,13 +123,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -135,13 +135,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -128,13 +128,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -134,13 +134,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -128,13 +128,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -124,13 +124,14 @@
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -118,13 +118,14 @@
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>
@ -236,15 +237,16 @@
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
</div>
<div class="toctree-wrapper compound">
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="samples/advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -119,13 +119,14 @@
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">6. BLE 客户端和服务端互连</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">6.1. 准备工具</a></li>
@ -405,12 +406,12 @@
</ul>
<div class="highlight-bash notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span> $ <span class="nb">cd</span> &lt;sdk_path&gt;/bl_mcu_sdk
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_iot <span class="nv">APP</span><span class="o">=</span>ble_peripheral <span class="nv">SUPPORT_FREERTOS</span><span class="o">=</span>y <span class="nv">SUPPORT_FLOAT</span><span class="o">=</span>y <span class="nv">SUPPORT_BLE</span><span class="o">=</span>y
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_iot <span class="nv">APP</span><span class="o">=</span>ble_peripheral <span class="nv">SUPPORT_FLOAT</span><span class="o">=</span>y
</pre></div>
</td></tr></table></div>
<div class="highlight-bash notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span> $ <span class="nb">cd</span> &lt;sdk_path&gt;/bl_mcu_sdk
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_iot <span class="nv">APP</span><span class="o">=</span>ble_central <span class="nv">SUPPORT_FREERTOS</span><span class="o">=</span>y <span class="nv">SUPPORT_FLOAT</span><span class="o">=</span>y <span class="nv">SUPPORT_BLE</span><span class="o">=</span>y
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_iot <span class="nv">APP</span><span class="o">=</span>ble_central <span class="nv">SUPPORT_FLOAT</span><span class="o">=</span>y
</pre></div>
</td></tr></table></div>
<ul>

View file

@ -40,7 +40,7 @@
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="6. BLE 客户端和服务端互连" href="ble_scan_demo.html" />
<link rel="prev" title="4. LowPower 低功耗评估" href="lowpower_demo.html" />
<link rel="prev" title="4. Power Management" href="lowpower_demo.html" />
</head>
<body class="wy-body-for-nav">
@ -119,13 +119,14 @@
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">5. BOOT2 IAP</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">5.1. 准备工具</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">5.2. 实验现象</a></li>
@ -210,12 +211,12 @@
<p>Bouffalo Lab 为 IAP 功能应用提供了相应的 boot2_iap.bin 文件,并将其与 Dev Cube 软件包同步发布。
用户可以配合 Dev Cube 图形界面烧写软件,将已有的 boot2_iap.bin 文件烧录进目标板,烧录
一次之后,就可以通过 IAP 功能,在线更新用户代码。</p>
<p>bl_mcu_sdk 开源了 boot2_iap 的软件源码,用户可以到 examples/boot2_iap 查阅代码,并完成编译烧写。编译烧写过程可以参考《快速开发指南》介绍。</p>
<p>bl_mcu_sdk 开源了 boot2_iap 的软件源码,用户可以到 <code class="docutils literal notranslate"><span class="pre">examples/boot2_iap</span></code> 查阅代码,并完成编译烧写。编译烧写过程可以参考《快速开发指南》介绍。</p>
<div class="section" id="id1">
<h2><span class="section-number">5.1. </span>准备工具<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>最新版本的 Dev Cube</p></li>
<li><p>Bl706 开发板</p></li>
<li><p>BL706 开发板</p></li>
<li><p>TTL-USB 电平转换芯片</p></li>
</ul>
</div>
@ -232,7 +233,7 @@
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="ble_scan_demo.html" class="btn btn-neutral float-right" title="6. BLE 客户端和服务端互连" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="lowpower_demo.html" class="btn btn-neutral float-left" title="4. LowPower 低功耗评估" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="lowpower_demo.html" class="btn btn-neutral float-left" title="4. Power Management" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>

View file

@ -119,13 +119,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">7. EMAC 以太网应用</a><ul class="current">

View file

@ -119,13 +119,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">7. EMAC 以太网应用</a><ul class="current">

View file

@ -118,13 +118,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">7. EMAC 以太网应用</a><ul class="current">

View file

@ -119,13 +119,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">7. EMAC 以太网应用</a><ul class="current">

View file

@ -119,13 +119,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">7. EMAC 以太网应用</a><ul class="current">

View file

@ -119,13 +119,14 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">7. EMAC 以太网应用</a><ul>

View file

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>2. Fatfs 文件系统读写 &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
<title>2. FatFs 文件系统读写(SD 卡) &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
@ -119,13 +119,21 @@
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">2. FatFs 文件系统读写(SD 卡)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">2.1. 准备工具</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">2.2. 硬件连接</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">2.3. 软件实现</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id4">2.4. 编译和烧录</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id5">2.5. 实验现象</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="emac/index.html">7. EMAC 以太网应用</a></li>
@ -177,7 +185,7 @@
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">2. </span>Fatfs 文件系统读写</li>
<li><span class="section-number">2. </span>FatFs 文件系统读写(SD 卡)</li>
<li class="wy-breadcrumbs-aside">
@ -196,8 +204,225 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="fatfs">
<h1><span class="section-number">2. </span>Fatfs 文件系统读写<a class="headerlink" href="#fatfs" title="永久链接至标题"></a></h1>
<div class="section" id="fatfs-sd">
<h1><span class="section-number">2. </span>FatFs 文件系统读写(SD 卡)<a class="headerlink" href="#fatfs-sd" title="永久链接至标题"></a></h1>
<p>本 demo 主要演示使用 spi 驱动 sd 卡并挂载 fatfs 文件系统的例子。其中 fatfs api 见 <a class="reference external" href="http://elm-chan.org/fsw/ff/00index_e.html">Fatfs 官网</a></p>
<div class="section" id="id1">
<h2><span class="section-number">2.1. </span>准备工具<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>一张 class10 的 sd 卡和 sd 卡转spi 转接板</p></li>
</ul>
</div>
<div class="section" id="id2">
<h2><span class="section-number">2.2. </span>硬件连接<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>本 demo 基于 BL706_AVB 开发板,连接方式如下</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="n">GPIO</span> <span class="n">function</span> <span class="n">GPIO</span> <span class="n">pin</span>
<span class="o">----------------------------------</span>
<span class="n">SD_CS</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO10</span>
<span class="n">SPI_SCK</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO19</span>
<span class="n">SPI_MISO</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO20</span>
<span class="n">SPI_MOSI</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO21</span>
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h2><span class="section-number">2.3. </span>软件实现<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>软件代码见 <code class="docutils literal notranslate"><span class="pre">examples/spi/spi_dma_sd</span></code></p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define BSP_SPI_CLOCK_SOURCE ROOT_CLOCK_SOURCE_BCLK</span>
<span class="cp">#define BSP_SPI_CLOCK_DIV 0</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>配置 <code class="docutils literal notranslate"><span class="pre">SPI</span></code> 设备时钟源,见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_avb/clock_config.h</span></code></p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define CONFIG_GPIO19_FUNC GPIO_FUN_SPI</span>
<span class="cp">#define CONFIG_GPIO20_FUNC GPIO_FUN_SPI</span>
<span class="cp">#define CONFIG_GPIO21_FUNC GPIO_FUN_SPI</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>配置 <code class="docutils literal notranslate"><span class="pre">SPI</span></code> 设备复用引脚,见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_avb/pinmux_config.h</span></code>,,如有改动,请自行修改</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>为适配 bl702_avb 硬件, SPI 的 MOSI 和 MISO 默认进行了调换,如果想要恢复默认,修改 <code class="docutils literal notranslate"><span class="pre">drivers/bl702_driver/hal_drv/default_config/spi_config.h</span></code><code class="docutils literal notranslate"><span class="pre">SPI_SWAP_ENABLE</span></code> 为 0</p>
</div>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define BSP_USING_SPI0</span>
<span class="cp">#if defined(BSP_USING_SPI0)</span>
<span class="cp">#ifndef SPI0_CONFIG</span>
<span class="cp">#define SPI0_CONFIG \</span>
<span class="cp">{ \</span>
<span class="cp">.id = 0, \</span>
<span class="cp">.clk = 18000000,\</span>
<span class="cp">.mode = SPI_MASTER_MODE, \</span>
<span class="cp">.direction = SPI_MSB_BYTE0_DIRECTION_FIRST, \</span>
<span class="cp">.clk_polaraity = SPI_POLARITY_LOW, \</span>
<span class="cp">.clk_phase = SPI_PHASE_1EDGE, \</span>
<span class="cp">.datasize = SPI_DATASIZE_8BIT, \</span>
<span class="cp">.fifo_threshold = 4, \</span>
<span class="cp">}</span>
<span class="cp">#endif</span>
<span class="cp">#endif</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>使能 <code class="docutils literal notranslate"><span class="pre">BSP_USING_SPI0</span></code> 并配置 <code class="docutils literal notranslate"><span class="pre">SPI</span></code> 设备配置,见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_avb/peripheral_config.h</span></code></p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>sd卡的频率不能过高所以设置成 18M 比较合适</p>
</div>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span>
<span class="normal">21</span>
<span class="normal">22</span>
<span class="normal">23</span>
<span class="normal">24</span>
<span class="normal">25</span>
<span class="normal">26</span>
<span class="normal">27</span>
<span class="normal">28</span>
<span class="normal">29</span>
<span class="normal">30</span>
<span class="normal">31</span>
<span class="normal">32</span>
<span class="normal">33</span>
<span class="normal">34</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define BSP_USING_DMA0_CH3</span>
<span class="cp">#define BSP_USING_DMA0_CH4</span>
<span class="cp">#if defined(BSP_USING_DMA0_CH3)</span>
<span class="cp">#ifndef DMA0_CH3_CONFIG</span>
<span class="cp">#define DMA0_CH3_CONFIG \</span>
<span class="cp"> { \</span>
<span class="cp"> .id = 0, \</span>
<span class="cp"> .ch = 3, \</span>
<span class="cp"> .direction = DMA_MEMORY_TO_PERIPH, \</span>
<span class="cp"> .transfer_mode = DMA_LLI_ONCE_MODE, \</span>
<span class="cp"> .src_req = DMA_REQUEST_NONE, \</span>
<span class="cp"> .dst_req = DMA_REQUEST_SPI0_TX, \</span>
<span class="cp"> .src_width = DMA_TRANSFER_WIDTH_8BIT, \</span>
<span class="cp"> .dst_width = DMA_TRANSFER_WIDTH_8BIT, \</span>
<span class="cp"> }</span>
<span class="cp">#endif</span>
<span class="cp">#endif</span>
<span class="cp">#if defined(BSP_USING_DMA0_CH4)</span>
<span class="cp">#ifndef DMA0_CH4_CONFIG</span>
<span class="cp">#define DMA0_CH4_CONFIG \</span>
<span class="cp"> { \</span>
<span class="cp"> .id = 0, \</span>
<span class="cp"> .ch = 4, \</span>
<span class="cp"> .direction = DMA_PERIPH_TO_MEMORY, \</span>
<span class="cp"> .transfer_mode = DMA_LLI_ONCE_MODE, \</span>
<span class="cp"> .src_req = DMA_REQUEST_SPI0_RX, \</span>
<span class="cp"> .dst_req = DMA_REQUEST_NONE, \</span>
<span class="cp"> .src_width = DMA_TRANSFER_WIDTH_8BIT, \</span>
<span class="cp"> .dst_width = DMA_TRANSFER_WIDTH_8BIT, \</span>
<span class="cp"> }</span>
<span class="cp">#endif</span>
<span class="cp">#endif</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>使能 <code class="docutils literal notranslate"><span class="pre">BSP_USING_DMA0_CH3</span></code> <code class="docutils literal notranslate"><span class="pre">BSP_USING_DMA0_CH4</span></code> 并配置 <code class="docutils literal notranslate"><span class="pre">DMA</span></code> 设备配置,见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_avb/peripheral_config.h</span></code></p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kt">void</span> <span class="nf">fatfs_sd_driver_register</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">FATFS_DiskioDriverTypeDef</span> <span class="n">sdDiskioDriver</span><span class="p">;</span>
<span class="n">memset</span><span class="p">(</span><span class="o">&amp;</span><span class="n">sdDiskioDriver</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">FATFS_DiskioDriverTypeDef</span><span class="p">));</span>
<span class="n">sdDiskioDriver</span><span class="p">.</span><span class="n">MMC_disk_status</span> <span class="o">=</span> <span class="n">sd_disk_status</span><span class="p">;</span>
<span class="n">sdDiskioDriver</span><span class="p">.</span><span class="n">MMC_disk_initialize</span> <span class="o">=</span> <span class="n">sd_disk_initialize</span><span class="p">;</span>
<span class="n">sdDiskioDriver</span><span class="p">.</span><span class="n">MMC_disk_write</span> <span class="o">=</span> <span class="n">sd_disk_write</span><span class="p">;</span>
<span class="n">sdDiskioDriver</span><span class="p">.</span><span class="n">MMC_disk_read</span> <span class="o">=</span> <span class="n">sd_disk_read</span><span class="p">;</span>
<span class="n">sdDiskioDriver</span><span class="p">.</span><span class="n">MMC_disk_ioctl</span> <span class="o">=</span> <span class="n">sd_disk_ioctl</span><span class="p">;</span>
<span class="n">sdDiskioDriver</span><span class="p">.</span><span class="n">Translate_Result_Code</span> <span class="o">=</span> <span class="n">Translate_Result_Code</span><span class="p">;</span>
<span class="n">disk_driver_callback_init</span><span class="p">(</span><span class="o">&amp;</span><span class="n">sdDiskioDriver</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>实现 fatfs 需要的底层接口</p></li>
</ul>
<p>剩余代码见 main.c。</p>
</div>
<div class="section" id="id4">
<h2><span class="section-number">2.4. </span>编译和烧录<a class="headerlink" href="#id4" title="永久链接至标题"></a></h2>
<ul>
<li><p><strong>CDK 编译</strong></p>
<p>打开项目中提供的工程文件spi_dma_sd.cdkproj</p>
<p>参照 <a class="reference internal" href="../../get_started/Windows_quick_start_cdk.html#windows-cdk-quick-start"><span class="std std-ref">Windows 下使用 CDK (类 MDK Keil)开发指南</span></a> 的步骤编译下载即可</p>
</li>
<li><p><strong>命令行编译</strong></p></li>
</ul>
<div class="highlight-bash notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span> $ <span class="nb">cd</span> &lt;sdk_path&gt;/bl_mcu_sdk
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_avb <span class="nv">APP</span><span class="o">=</span>spi_dma_sd
</pre></div>
</td></tr></table></div>
<ul>
<li><p><strong>烧录</strong></p>
<p>详见 <a class="reference internal" href="../../get_started/bl_dev_cube.html#bl-dev-cube"><span class="std std-ref">BLDevCube 烧录工具指南</span></a></p>
</li>
</ul>
</div>
<div class="section" id="id5">
<h2><span class="section-number">2.5. </span>实验现象<a class="headerlink" href="#id5" title="永久链接至标题"></a></h2>
</div>
</div>

View file

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>4. LowPower 低功耗评估 &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
<title>4. Power Management &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
@ -119,20 +119,23 @@
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">4. LowPower 低功耗评估</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">4.1. 简介</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">4.2. <strong>低功耗示例测试方法</strong></a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id3">4.2.1. <strong>编译低功耗示例代码</strong></a></li>
<li class="toctree-l3"><a class="reference internal" href="#id4">4.2.2. <strong>准备低功耗测试所需的硬件环境</strong></a></li>
<li class="toctree-l3"><a class="reference internal" href="#xshell">4.2.3. <strong>使用 Xshell 开始评估低功耗性能</strong></a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">4. Power Management</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#id1">4.1. 准备工具</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id2">4.2. 硬件连接</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id3">4.3. 软件实现</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#pds">4.3.1. PDS 模式</a></li>
<li class="toctree-l3"><a class="reference internal" href="#hbn">4.3.2. HBN 模式</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#id4">4.4. 编译和烧录</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id5">4.5. 实验现象</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="boot2_iap_info.html">5. BOOT2 IAP</a></li>
@ -186,7 +189,7 @@
<li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">4. </span>LowPower 低功耗评估</li>
<li><span class="section-number">4. </span>Power Management</li>
<li class="wy-breadcrumbs-aside">
@ -205,119 +208,334 @@
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="lowpower">
<h1><span class="section-number">4. </span>LowPower 低功耗评估<a class="headerlink" href="#lowpower" title="永久链接至标题"></a></h1>
<div class="section" id="id1">
<h2><span class="section-number">4.1. </span>简介<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<p>博流系列芯片拥有丰富的低功耗特性,以适配不同的低功耗应用场合。为了方便用户快速的评测使用 bl 系列 MCU 低功耗性能 bl_mcu_sdk 提供了一套抽象的低功耗接口,将低功耗等级分为四个等级,分别为</p>
<ol class="arabic simple">
<li><p>Running : Running 为 CPU 正常运行时的功耗,由客户应用代码执行的功能决定功耗。</p></li>
<li><p>WFI WFI 模式CPU 的 clock 处于被 Gating 状态CPU 停止运行当用户退出WFI模式的时候程序将会继续运行。</p></li>
<li><p>PDS : PDS 模式,关闭了芯片上大多数电源域,同时关闭了 CPU和 CPU 处于同一个电源域的 ITCMDTCM 等 RAM 不可使用,只有 64K 的 OCTAM 可以保存数据,可以通过内部 RTC 进行唤醒,或者使用 GPIO 引脚(在 GPIO 电源域没有关闭的情况下)唤醒。</p></li>
<li><p>HBN : HBN 模式,关闭了芯片上绝大多数电源域,关闭了 CPU 以及 64K OCRAM只有位于 AON 域的 4K RAM 可以保存数据,可以通过内部 RTC 进行唤醒,或者使用特定的唤醒引脚(位于 AON 域的引脚)唤醒。</p></li>
</ol>
<p>bl_mcu_sdk 提供了一个简单的低功耗参考示例(bl_mcu_sdk examples/power/lowpower_test/),旨在帮助用户快速评估低功耗功能,如果需要进一步适配自身的低功耗场景,采取不同的低功耗策略,请查阅相关 datasheet 或者寻找 Boufflao Lab 的技术支持。
在该示例中,外设及 CPU 的时钟选择均是晶振 32M。基于该示例的功耗测量结果如下表所示:</p>
<blockquote>
<div><table class="docutils align-default">
<colgroup>
<col style="width: 14%" />
<col style="width: 14%" />
<col style="width: 14%" />
<col style="width: 25%" />
<col style="width: 32%" />
</colgroup>
<thead>
<tr class="row-odd"><th class="head"><p>模式</p></th>
<th class="head"><p>参考电流</p></th>
<th class="head"><p>对应基础模式</p></th>
<th class="head"><p>唤醒源</p></th>
<th class="head"><p>备注</p></th>
</tr>
</thead>
<tbody>
<tr class="row-even"><td><p>Running</p></td>
<td><p>5.68 mA</p></td>
<td><p>Run</p></td>
<td></td>
<td><p>所有外设时钟都打开</p></td>
</tr>
<tr class="row-odd"><td><p>WFI</p></td>
<td><p>3.14 mA</p></td>
<td><p>WFI</p></td>
<td><p>任意中断</p></td>
<td><p>除串口外,其它外设时钟关闭</p></td>
</tr>
<tr class="row-even"><td><p>PDS</p></td>
<td><p>10 uA</p></td>
<td><p>PDS 31</p></td>
<td><p>内部RTC/引脚中断</p></td>
<td><p>64K OCRAM保存数据</p></td>
</tr>
<tr class="row-odd"><td><p>HBN</p></td>
<td><p>1 uA</p></td>
<td><p>HBN 1</p></td>
<td><p>内部RTC/引脚中断</p></td>
<td><p>4K AON RAM保存数据</p></td>
</tr>
</tbody>
</table>
</div></blockquote>
<p>上表中的参考电流是通过示例固件测试得出的。符合 bl70x 系列 MCU 的 spec 的描述run wfi pds hbn 四种等级的定义简化了原先的 hbn level 以及 pds level 的设定。</p>
<p>见 bl702_bl704_bl706_DS_EN_Combo_1.9.pdf page 28</p>
<div class="figure align-default">
<img alt="../../_images/powerTable.png" src="../../_images/powerTable.png" />
</div>
</div>
<div class="section" id="id2">
<h2><span class="section-number">4.2. </span><strong>低功耗示例测试方法</strong><a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<div class="section" id="id3">
<h3><span class="section-number">4.2.1. </span><strong>编译低功耗示例代码</strong><a class="headerlink" href="#id3" title="永久链接至标题"></a></h3>
<p>在工程目录下键入 <code class="docutils literal notranslate"><span class="pre">make</span> <span class="pre">APP=lowpower_test</span>&#160; <span class="pre">SUPPORT_SHELL=y</span> <span class="pre">BOARD=bl706_lp</span></code> 完成低功耗示例 bl706 的编译。或者直接使用 CDK 工程,完成编译下载
您可以参考本文档《快速开发指南》来获取更多编译烧写的信息。</p>
<p>当编译并烧写成功后连接串口到电脑端并复位芯片Xshell 会出现如下图所示的页面。</p>
<div class="figure align-default">
<img alt="../../_images/xShell_lowpower.png" src="../../_images/xShell_lowpower.png" />
</div>
</div>
<div class="section" id="id4">
<h3><span class="section-number">4.2.2. </span><strong>准备低功耗测试所需的硬件环境</strong><a class="headerlink" href="#id4" title="永久链接至标题"></a></h3>
<div class="section" id="power-management">
<h1><span class="section-number">4. </span>Power Management<a class="headerlink" href="#power-management" title="永久链接至标题"></a></h1>
<p>本 demo 主要演示 bl 系列 mcu 低功耗性能。具体低功耗介绍请参考 <a class="reference external" href="https://dev.bouffalolab.com/media/upload/doc/BL702_BL704_706_RM_zh_CN_1.1.pdf">BL702/704/706 参考手册</a></p>
<p>低功耗模式:</p>
<ul class="simple">
<li><p>Running : Running 为 CPU 正常运行时的功耗,由客户应用代码执行的功能决定功耗。</p></li>
<li><p>WFI 模式CPU 的 clock 处于被 Gating 状态CPU 停止运行当用户退出WFI模式的时候程序将会继续运行。</p></li>
<li><p>PDS 模式: 根据不同的模式关闭不同的电源域,当关闭了 CPU 电源域时ITCMDTCM RAM 不可使用,只有 64K 的 OCRAM 可以使用。</p></li>
<li><p>HBN 模式: 根据不同的模式关闭不同的电源域ITCMDTCM OCRAM RAM 无法使用,在 hbn0 下位于 AON 域的 4K RAM 可以使用,其他 hbn 模式下 4K RAM 也不可使用。</p></li>
</ul>
<p>演示内容:</p>
<ul class="simple">
<li><p>pds3 使用 gpio10 外部中断下降沿唤醒</p></li>
<li><p>pds31 使用 pds 唤醒脚 (gpio6) 唤醒</p></li>
<li><p>pds31 使用 pds timer 唤醒</p></li>
<li><p>hbn0 使用 acomp (gpio11) 唤醒</p></li>
<li><p>hbn1 使用 rtc 唤醒</p></li>
<li><p>hbn2 使用 hbn 唤醒脚 (gpio12) 唤醒</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p>高级别的唤醒源可以唤醒低级别的功耗模式,比如 hbn 唤醒脚可以唤醒所有的低功耗模式。</p>
</div>
<div class="section" id="id1">
<h2><span class="section-number">4.1. </span>准备工具<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>pc控制端使用串口终端软件xshell 或者 mobaxterm</p></li>
<li><p>可以串联电流表到电源端的电路板</p></li>
<li><p>电流表</p></li>
<li><p>一台 PC 主机(运行 Windows 或者 Linux 系统)</p></li>
<li><p>TTL 转 USB</p></li>
<li><p>滑动变阻器</p></li>
</ul>
<p>如下图所示,将电流表串联进入 bl706 模组的供电线路,通过 PC 端的串口调试助手软件,下发不同的低功耗指令,使得 bl706 进入对应的低功耗模式
观察电流表示值,完成评估。</p>
<div class="figure align-default">
<img alt="../../_images/lowpower_arch.png" src="../../_images/lowpower_arch.png" />
</div>
</div>
<div class="section" id="xshell">
<h3><span class="section-number">4.2.3. </span><strong>使用 Xshell 开始评估低功耗性能</strong><a class="headerlink" href="#xshell" title="永久链接至标题"></a></h3>
<p>用户可以通过在 Xshell 输入下述指令,进入对应的低功耗模式。</p>
<p><code class="docutils literal notranslate"><span class="pre">run</span></code></p>
<div class="section" id="id2">
<h2><span class="section-number">4.2. </span>硬件连接<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<p>本 demo 基于 BL706_LP 开发板,连接方式如下</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="n">GPIO</span> <span class="n">function</span> <span class="n">GPIO</span> <span class="n">pin</span>
<span class="o">----------------------------------</span>
<span class="n">PDS_WAKEUP</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO6</span>
<span class="n">EXTI</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO10</span>
<span class="n">ADC</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO11</span>
<span class="n">HBN_WAKEUP</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO12</span>
<span class="n">UART0_TX</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO14</span>
<span class="n">UART0_RX</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO15</span>
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h2><span class="section-number">4.3. </span>软件实现<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<p>软件基于 shell 进行调试,如何注册 shell 命令这里不再说明。</p>
<div class="section" id="pds">
<h3><span class="section-number">4.3.1. </span>PDS 模式<a class="headerlink" href="#pds" title="永久链接至标题"></a></h3>
<ul class="simple">
<li><p>复位芯片之后,默认进入 run 模式,没有进入任何低功耗模式,芯片实际在运行 while(1); 语句。</p></li>
<li><p>软件代码见 <code class="docutils literal notranslate"><span class="pre">examples/pm/pds_mode_wakeup</span></code></p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">wfi</span></code></p>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define CONFIG_GPIO6_FUNC GPIO_FUN_WAKEUP</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>进入 wfi 模式后面不加任何参数进入之后CPU 处于 clock gating 状态,降低功耗</p></li>
<li><p>进入 wfi 模式后,任何中断会唤醒,例如 uart 中断。在 Xshell 中敲击回车会触发 BL706 UART RX 中断,因此可以通过此方法唤醒 wfi 低功耗模式。</p></li>
<li><p>pds 唤醒脚配置pds3 和 pds31 使用,见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_lp/pinmux_config.h</span></code></p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">pds</span> <span class="pre">sleeptime</span></code></p>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define CONFIG_GPIO10_FUNC GPIO_FUN_GPIO_EXTI_FALLING_EDGE</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>pds 可以选择带一个 sleeptime 的参数,决定其内部 RTC 唤醒时间。如果指令不带此参数,那么默认不使用 RTC 内部唤醒,目前的固件仅支持上电复位唤醒。</p></li>
<li><p>如果指令包含 sleeptime 参数pds 将会在``sleeptime * clock_period`` 的时刻被唤醒,表现为复位芯片,重新打印起始报文。</p></li>
<li><p>进入低功耗模式后RTC 的时钟是 32K因此 sleeptime 为 32768 时,表现为睡眠 1S 后唤醒。</p></li>
<li><p>外部中断引脚配置pds3 使用,见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_lp/pinmux_config.h</span></code></p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">hbn</span> <span class="pre">sleeptime</span></code></p>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define CONFIG_GPIO12_FUNC GPIO_FUN_WAKEUP</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>hbn 可以选择带一个 sleeptime 的参数,决定其内部 RTC 唤醒时间。如果指令不带此参数,那么默认不使用 RTC 内部唤醒,目前的固件仅支持上电复位唤醒。</p></li>
<li><p>如果指令包含 sleeptime 参数hbn 将会在``sleeptime * clock_period`` 的时刻被唤醒,表现为复位芯片,重新打印起始报文。</p></li>
<li><p>进入低功耗模式后RTC 的时钟是 32K因此 sleeptime 为 32768 时,表现为睡眠 1S 后唤醒。</p></li>
<li><p>hbn 唤醒脚配置pds3 和 pds31 使用,见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_lp/pinmux_config.h</span></code></p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="n">gpio_attach_irq</span><span class="p">(</span><span class="n">GPIO_PIN_10</span><span class="p">,</span> <span class="n">gpio_int_callback</span><span class="p">);</span>
<span class="n">gpio_irq_enable</span><span class="p">(</span><span class="n">GPIO_PIN_10</span><span class="p">,</span> <span class="n">ENABLE</span><span class="p">);</span> <span class="c1">//only used for level3</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>注册 gpio10 外部中断回调函数并使能</p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span>
<span class="normal">21</span>
<span class="normal">22</span>
<span class="normal">23</span>
<span class="normal">24</span>
<span class="normal">25</span>
<span class="normal">26</span>
<span class="normal">27</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="nf">pds3_enter</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span>
<span class="p">{</span>
<span class="n">MSG</span><span class="p">(</span><span class="s">&quot;gpio wake up case,enter pds3 mode</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">bflb_platform_delay_ms</span><span class="p">(</span><span class="mi">50</span><span class="p">);</span>
<span class="n">pm_pds_mode_enter</span><span class="p">(</span><span class="n">PM_PDS_LEVEL_3</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span> <span class="cm">/*hbn、pds、exti gpio can wakeup*/</span>
<span class="n">BL_CASE_SUCCESS</span><span class="p">;</span> <span class="cm">/*level 3 can run here*/</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
<span class="kt">int</span> <span class="nf">pds31_enter</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span>
<span class="p">{</span>
<span class="kt">int</span> <span class="n">second</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="n">argc</span> <span class="o">==</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
<span class="n">second</span> <span class="o">=</span> <span class="n">atoi</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">]);</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="n">second</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">MSG</span><span class="p">(</span><span class="s">&quot;gpio wake up case,enter pds31 mode</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">bflb_platform_delay_ms</span><span class="p">(</span><span class="mi">50</span><span class="p">);</span>
<span class="n">pm_pds_mode_enter</span><span class="p">(</span><span class="n">PM_PDS_LEVEL_31</span><span class="p">,</span> <span class="n">second</span><span class="p">);</span> <span class="cm">/*hbn、pds gpio can wakeup*/</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">SHELL_CMD_EXPORT</span><span class="p">(</span><span class="n">pds3_enter</span><span class="p">,</span> <span class="n">pds3</span> <span class="n">gpio</span> <span class="n">wakeup</span> <span class="n">test</span><span class="p">)</span>
<span class="n">SHELL_CMD_EXPORT</span><span class="p">(</span><span class="n">pds31_enter</span><span class="p">,</span> <span class="n">pds31</span> <span class="n">gpio</span> <span class="n">wakeup</span> <span class="n">test</span><span class="p">)</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>注册进入 pds3 和 pds31 的命令</p></li>
</ul>
</div>
<div class="section" id="hbn">
<h3><span class="section-number">4.3.2. </span>HBN 模式<a class="headerlink" href="#hbn" title="永久链接至标题"></a></h3>
<ul class="simple">
<li><p>软件代码见 <code class="docutils literal notranslate"><span class="pre">examples/pm/hbn_mode_wakeup</span></code></p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define CONFIG_GPIO11_FUNC GPIO_FUN_ADC</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>adc 引脚配置hbn0 下 acomp 使用,见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_lp/pinmux_config.h</span></code></p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define CONFIG_GPIO12_FUNC GPIO_FUN_WAKEUP</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>hbn 唤醒脚配置hbn0、hbn1、hbn2 使用,见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_lp/pinmux_config.h</span></code></p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span>
<span class="normal">21</span>
<span class="normal">22</span>
<span class="normal">23</span>
<span class="normal">24</span>
<span class="normal">25</span>
<span class="normal">26</span>
<span class="normal">27</span>
<span class="normal">28</span>
<span class="normal">29</span>
<span class="normal">30</span>
<span class="normal">31</span>
<span class="normal">32</span>
<span class="normal">33</span>
<span class="normal">34</span>
<span class="normal">35</span>
<span class="normal">36</span>
<span class="normal">37</span>
<span class="normal">38</span>
<span class="normal">39</span>
<span class="normal">40</span>
<span class="normal">41</span>
<span class="normal">42</span>
<span class="normal">43</span>
<span class="normal">44</span>
<span class="normal">45</span>
<span class="normal">46</span>
<span class="normal">47</span>
<span class="normal">48</span>
<span class="normal">49</span>
<span class="normal">50</span>
<span class="normal">51</span>
<span class="normal">52</span>
<span class="normal">53</span>
<span class="normal">54</span>
<span class="normal">55</span>
<span class="normal">56</span>
<span class="normal">57</span>
<span class="normal">58</span>
<span class="normal">59</span>
<span class="normal">60</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="kt">int</span> <span class="nf">hbn0_enter</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span>
<span class="p">{</span>
<span class="n">acomp_device_t</span> <span class="n">acomp_device</span><span class="p">;</span>
<span class="n">acomp_device</span><span class="p">.</span><span class="n">id</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="n">acomp_device</span><span class="p">.</span><span class="n">pos_ch</span> <span class="o">=</span> <span class="n">ACOMP_CHANNEL_ADC_CHANNEL3</span><span class="p">;</span> <span class="cm">/*from gpio11 adc func*/</span>
<span class="n">acomp_device</span><span class="p">.</span><span class="n">neg_ch</span> <span class="o">=</span> <span class="n">ACOMP_CHANNEL_0P375VBAT</span><span class="p">;</span>
<span class="n">acomp_device</span><span class="p">.</span><span class="n">pos_hysteresis_vol</span> <span class="o">=</span> <span class="n">ACOMP_HYSTERESIS_VOLT_50MV</span><span class="p">;</span>
<span class="n">acomp_device</span><span class="p">.</span><span class="n">neg_hysteresis_vol</span> <span class="o">=</span> <span class="n">ACOMP_HYSTERESIS_VOLT_50MV</span><span class="p">;</span>
<span class="n">acomp_init</span><span class="p">(</span><span class="o">&amp;</span><span class="n">acomp_device</span><span class="p">);</span>
<span class="n">bflb_platform_delay_ms</span><span class="p">(</span><span class="mi">50</span><span class="p">);</span> <span class="cm">/*delay for acomp*/</span>
<span class="k">for</span> <span class="p">(</span><span class="kt">uint32_t</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="mi">30</span><span class="p">;</span> <span class="n">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
<span class="n">MSG</span><span class="p">(</span><span class="s">&quot;status:%d</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">,</span> <span class="n">acomp_get_result</span><span class="p">(</span><span class="o">&amp;</span><span class="n">acomp_device</span><span class="p">));</span>
<span class="n">bflb_platform_delay_ms</span><span class="p">(</span><span class="mi">100</span><span class="p">);</span>
<span class="p">}</span>
<span class="n">MSG</span><span class="p">(</span><span class="s">&quot;acomp wake up case,enter hbn0 mode</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">bflb_platform_delay_ms</span><span class="p">(</span><span class="mi">50</span><span class="p">);</span>
<span class="cm">/** cpu will wakeup when acomp status change</span>
<span class="cm"> * please note that if you set gpio9-gpio12 with GPIO_FUN_WAKEUP,it will also wakeup this level</span>
<span class="cm"> * rtc can wakeup this level when sleep time do not equal 0</span>
<span class="cm"> **/</span>
<span class="n">pm_hbn_mode_enter</span><span class="p">(</span><span class="n">PM_HBN_LEVEL_0</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
<span class="kt">int</span> <span class="nf">hbn1_enter</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span>
<span class="p">{</span>
<span class="kt">int</span> <span class="n">second</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="k">if</span> <span class="p">(</span><span class="n">argc</span> <span class="o">==</span> <span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
<span class="n">second</span> <span class="o">=</span> <span class="n">atoi</span><span class="p">(</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">]);</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="n">second</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
<span class="p">}</span>
<span class="n">MSG</span><span class="p">(</span><span class="s">&quot;rtc wake up case,enter hbn1 mode</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">bflb_platform_delay_ms</span><span class="p">(</span><span class="mi">50</span><span class="p">);</span>
<span class="cm">/** cpu will wakeup when rtc sleep time timeout</span>
<span class="cm"> * please note that if you set gpio9-gpio12 with GPIO_FUN_WAKEUP,it will also wakeup this level</span>
<span class="cm"> **/</span>
<span class="n">pm_hbn_mode_enter</span><span class="p">(</span><span class="n">PM_HBN_LEVEL_1</span><span class="p">,</span> <span class="n">second</span><span class="p">);</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
<span class="kt">int</span> <span class="nf">hbn2_enter</span><span class="p">(</span><span class="kt">int</span> <span class="n">argc</span><span class="p">,</span> <span class="kt">char</span> <span class="o">*</span><span class="n">argv</span><span class="p">[])</span>
<span class="p">{</span>
<span class="n">MSG</span><span class="p">(</span><span class="s">&quot;gpio wake up case,enter hbn2 mode</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">bflb_platform_delay_ms</span><span class="p">(</span><span class="mi">50</span><span class="p">);</span>
<span class="cm">/*cpu will wakeup when you set gpio9-gpio12 with GPIO_FUN_WAKEUP</span>
<span class="cm"> * rtc can not wakeup level2</span>
<span class="cm"> **/</span>
<span class="n">pm_hbn_mode_enter</span><span class="p">(</span><span class="n">PM_HBN_LEVEL_2</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>注册进入 hbn0、hbn1、hbn2 的命令</p></li>
</ul>
</div>
</div>
<div class="section" id="id4">
<h2><span class="section-number">4.4. </span>编译和烧录<a class="headerlink" href="#id4" title="永久链接至标题"></a></h2>
<ul>
<li><p><strong>CDK 编译</strong></p>
<blockquote>
<div><p>暂无,用户可以自己添加</p>
</div></blockquote>
</li>
<li><p><strong>命令行编译</strong></p></li>
</ul>
<div class="highlight-bash notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span> $ <span class="nb">cd</span> &lt;sdk_path&gt;/bl_mcu_sdk
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_lp <span class="nv">APP</span><span class="o">=</span>pds_mode_wakeup
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_lp <span class="nv">APP</span><span class="o">=</span>hbn_mode_wakeup
</pre></div>
</td></tr></table></div>
<ul>
<li><p><strong>烧录</strong></p>
<p>详见 <a class="reference internal" href="../../get_started/bl_dev_cube.html#bl-dev-cube"><span class="std std-ref">BLDevCube 烧录工具指南</span></a></p>
</li>
</ul>
</div>
<div class="section" id="id5">
<h2><span class="section-number">4.5. </span>实验现象<a class="headerlink" href="#id5" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>首先唤醒脚唤醒方式默认均为下降沿唤醒,所以需要将 GPIO6、GPIO10、GPIO12 引脚外接电阻到 3.3V。</p></li>
<li><p>acomp 变化电压阈值在 1.2375V,所以需要使用滑动电阻器,调整到 1.2375V0.375VBAT)后再使用。</p></li>
<li><p>打开终端,并按下 TAB 键可以列出命令。</p></li>
<li><p>输入需要执行命令回车即可运行。</p></li>
</ul>
<p><strong>PDS 模式</strong></p>
<div class="figure align-default">
<img alt="" src="../../_images/lowpower_pds.gif" />
</div>
<p><strong>HBN 模式</strong></p>
<div class="figure align-default">
<img alt="" src="../../_images/lowpower_hbn.gif" />
</div>
<p>详细测试结果见 <a class="reference external" href="https://dev.bouffalolab.com/media/upload/doc/BL702_BL704_BL706_DS_zh_CN_Combo_1.9.pdf">BL702/704/706 数据手册 page 28</a></p>
<div class="figure align-default">
<img alt="../../_images/powerTable.png" src="../../_images/powerTable.png" />
</div>
</div>
</div>

View file

@ -39,8 +39,8 @@
<link rel="index" title="索引" href="../../genindex.html" />
<link rel="search" title="搜索" href="../../search.html" />
<link rel="next" title="2. Fatfs 文件系统读写" href="fatfs_demo.html" />
<link rel="prev" title="10.1. TIMER - 秒中断定时" href="../basic%20samples/timer/timer_interrupt_demo.html" />
<link rel="next" title="2. FatFs 文件系统读写(SD 卡)" href="fatfs_demo.html" />
<link rel="prev" title="11.1. XIP FLASH - 数据读写" href="../basic%20samples/flash/flash_demo.html" />
</head>
<body class="wy-body-for-nav">
@ -119,6 +119,7 @@
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
@ -134,9 +135,9 @@
<li class="toctree-l2"><a class="reference internal" href="#id7">1.5. 实验现象</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="emac/index.html">7. EMAC 以太网应用</a></li>
@ -445,7 +446,7 @@
</ul>
<div class="highlight-bash notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span> $ <span class="nb">cd</span> &lt;sdk_path&gt;/bl_mcu_sdk
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_iot <span class="nv">APP</span><span class="o">=</span>shell <span class="nv">SUPPORT_SHELL</span><span class="o">=</span>y
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_iot <span class="nv">APP</span><span class="o">=</span>shell
</pre></div>
</td></tr></table></div>
<ul>
@ -469,8 +470,8 @@
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="fatfs_demo.html" class="btn btn-neutral float-right" title="2. Fatfs 文件系统读写" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="../basic%20samples/timer/timer_interrupt_demo.html" class="btn btn-neutral float-left" title="10.1. TIMER - 秒中断定时" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="fatfs_demo.html" class="btn btn-neutral float-right" title="2. FatFs 文件系统读写(SD 卡)" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="../basic%20samples/flash/flash_demo.html" class="btn btn-neutral float-left" title="11.1. XIP FLASH - 数据读写" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>

View file

@ -40,7 +40,7 @@
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="3.1. CDC - 虚拟串口" href="usbd_cdc.html" />
<link rel="prev" title="2. Fatfs 文件系统读写" href="../fatfs_demo.html" />
<link rel="prev" title="2. FatFs 文件系统读写(SD 卡)" href="../fatfs_demo.html" />
</head>
<body class="wy-body-for-nav">
@ -119,20 +119,21 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">3. USB Device 应用</a><ul>
<li class="toctree-l2"><a class="reference internal" href="usbd_cdc.html">3.1. CDC - 虚拟串口</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_hid.html">3.3. HID - 键盘&amp;鼠标</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_video.html">3.4. VIDEO - 摄像头</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_audio.html">3.5. AUDIO - 麦克风</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../emac/index.html">7. EMAC 以太网应用</a></li>
@ -208,7 +209,7 @@
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="usbd_cdc.html">3.1. CDC - 虚拟串口</a></li>
<li class="toctree-l1"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘升级</a></li>
<li class="toctree-l1"><a class="reference internal" href="usbd_hid.html">3.3. HID - 键盘&amp;鼠标</a></li>
<li class="toctree-l1"><a class="reference internal" href="usbd_video.html">3.4. VIDEO - 摄像头</a></li>
<li class="toctree-l1"><a class="reference internal" href="usbd_audio.html">3.5. AUDIO - 麦克风</a></li>
@ -223,7 +224,7 @@
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="usbd_cdc.html" class="btn btn-neutral float-right" title="3.1. CDC - 虚拟串口" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="../fatfs_demo.html" class="btn btn-neutral float-left" title="2. Fatfs 文件系统读写" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="../fatfs_demo.html" class="btn btn-neutral float-left" title="2. FatFs 文件系统读写(SD 卡)" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>

View file

@ -39,7 +39,7 @@
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="4. LowPower 低功耗评估" href="../lowpower_demo.html" />
<link rel="next" title="4. Power Management" href="../lowpower_demo.html" />
<link rel="prev" title="3.4. VIDEO - 摄像头" href="usbd_video.html" />
</head>
@ -119,14 +119,15 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">3. USB Device 应用</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="usbd_cdc.html">3.1. CDC - 虚拟串口</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_hid.html">3.3. HID - 键盘&amp;鼠标</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_video.html">3.4. VIDEO - 摄像头</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">3.5. AUDIO - 麦克风</a><ul>
@ -139,7 +140,7 @@
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../emac/index.html">7. EMAC 以太网应用</a></li>
@ -587,7 +588,7 @@ USB 协议栈可以参考 API 手册下的 USB Stack 章节的说明。</p>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../lowpower_demo.html" class="btn btn-neutral float-right" title="4. LowPower 低功耗评估" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="../lowpower_demo.html" class="btn btn-neutral float-right" title="4. Power Management" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="usbd_video.html" class="btn btn-neutral float-left" title="3.4. VIDEO - 摄像头" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>

View file

@ -39,7 +39,7 @@
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="3.2. MSC - U 盘" href="usbd_msc.html" />
<link rel="next" title="3.2. MSC - U 盘升级" href="usbd_msc.html" />
<link rel="prev" title="3. USB Device 应用" href="index.html" />
</head>
@ -119,20 +119,21 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">3. USB Device 应用</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">3.1. CDC - 虚拟串口</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_hid.html">3.3. HID - 键盘&amp;鼠标</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_video.html">3.4. VIDEO - 摄像头</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_audio.html">3.5. AUDIO - 麦克风</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../emac/index.html">7. EMAC 以太网应用</a></li>
@ -215,7 +216,7 @@
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="usbd_msc.html" class="btn btn-neutral float-right" title="3.2. MSC - U 盘" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="usbd_msc.html" class="btn btn-neutral float-right" title="3.2. MSC - U 盘升级" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="index.html" class="btn btn-neutral float-left" title="3. USB Device 应用" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>

View file

@ -40,7 +40,7 @@
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="3.4. VIDEO - 摄像头" href="usbd_video.html" />
<link rel="prev" title="3.2. MSC - U 盘" href="usbd_msc.html" />
<link rel="prev" title="3.2. MSC - U 盘升级" href="usbd_msc.html" />
</head>
<body class="wy-body-for-nav">
@ -119,20 +119,21 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">3. USB Device 应用</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="usbd_cdc.html">3.1. CDC - 虚拟串口</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘升级</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">3.3. HID - 键盘&amp;鼠标</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_video.html">3.4. VIDEO - 摄像头</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_audio.html">3.5. AUDIO - 麦克风</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../emac/index.html">7. EMAC 以太网应用</a></li>
@ -216,7 +217,7 @@
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="usbd_video.html" class="btn btn-neutral float-right" title="3.4. VIDEO - 摄像头" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="usbd_msc.html" class="btn btn-neutral float-left" title="3.2. MSC - U 盘" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<a href="usbd_msc.html" class="btn btn-neutral float-left" title="3.2. MSC - U 盘升级" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>

View file

@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>3.2. MSC - U 盘 &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
<title>3.2. MSC - U 盘升级 &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
@ -119,20 +119,28 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">3. USB Device 应用</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="usbd_cdc.html">3.1. CDC - 虚拟串口</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">3.2. MSC - U 盘</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">3.2. MSC - U 盘升级</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">3.2.1. 准备工具</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id2">3.2.2. 硬件连接</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id3">3.2.3. 软件实现</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id4">3.2.4. 编译和烧录</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id5">3.2.5. 实验现象</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="usbd_hid.html">3.3. HID - 键盘&amp;鼠标</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_video.html">3.4. VIDEO - 摄像头</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_audio.html">3.5. AUDIO - 麦克风</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../emac/index.html">7. EMAC 以太网应用</a></li>
@ -186,7 +194,7 @@
<li><a href="index.html"><span class="section-number">3. </span>USB Device 应用</a> &raquo;</li>
<li><span class="section-number">3.2. </span>MSC - U 盘</li>
<li><span class="section-number">3.2. </span>MSC - U 盘升级</li>
<li class="wy-breadcrumbs-aside">
@ -206,7 +214,186 @@
<div itemprop="articleBody">
<div class="section" id="msc-u">
<h1><span class="section-number">3.2. </span>MSC - U 盘<a class="headerlink" href="#msc-u" title="永久链接至标题"></a></h1>
<h1><span class="section-number">3.2. </span>MSC - U 盘升级<a class="headerlink" href="#msc-u" title="永久链接至标题"></a></h1>
<p>本 demo 主要演示使用 usb 将 xip flash 模拟成 u 盘设备,将其作为一个 BootLoader 使用,用来升级固件。</p>
<p>USB大容量存储设备类The USB mass storage device class是一种计算机和移动设备之间的传输协议它允许一个通用串行总线USB设备来访问主机的计算设备使两者之间进行文件传输。</p>
<p>MSC 协议介绍参考 <a class="reference external" href="https://www.usb.org/documents">USB 官方文档</a></p>
<p>bootloader 我们将其编译后烧录在 flash 0x2000 开始的物理地址,工具默认也是这个地址。</p>
<div class="figure align-default">
<img alt="../../../_images/usb_msc.png" src="../../../_images/usb_msc.png" />
</div>
<p>我们使用 flash 物理地址 0x0000c000 (48K) 开始的地方,用来模拟 u 盘u 盘大小为 256K64 个扇区,每个扇区 4KB ),根据文件系统格式,可以知道,数据的地址在 u 盘的第 10 个扇区0x16000也即 APP 的入口地址。BootLoader 与 APP 分区表如下:</p>
<div class="figure align-default">
<img alt="../../../_images/usb_msc2.png" src="../../../_images/usb_msc2.png" />
</div>
<div class="section" id="id1">
<h2><span class="section-number">3.2.1. </span>准备工具<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>一根 usb 数据线</p></li>
</ul>
</div>
<div class="section" id="id2">
<h2><span class="section-number">3.2.2. </span>硬件连接<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>内部 flash 不需要额外电路</p></li>
<li><p>外部 flash 需要连接 flash 控制器接口</p></li>
</ul>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span> <span class="n">GPIO</span> <span class="n">function</span> <span class="n">GPIO</span> <span class="n">pin</span>
<span class="o">----------------------------------</span>
<span class="n">USB_DP</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO7</span>
<span class="n">USB_DM</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO8</span>
<span class="n">UART0_TX</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO14</span>
<span class="n">BOOTLOADER_PIN</span> <span class="o">&lt;--&gt;</span> <span class="n">GPIO15</span>
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h2><span class="section-number">3.2.3. </span>软件实现<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>软件代码见 <code class="docutils literal notranslate"><span class="pre">examples/usb/usb_msc_flash_boot</span></code></p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cp">#define BLOCK_SIZE 4096</span>
<span class="cp">#define BLOCK_COUNT 64</span>
<span class="cp">#define FLASH_ADDR 0x0000c000 </span><span class="cm">/*addr start from 48k */</span><span class="cp"></span>
<span class="kt">void</span> <span class="nf">usbd_msc_get_cap</span><span class="p">(</span><span class="kt">uint8_t</span> <span class="n">lun</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="o">*</span><span class="n">block_num</span><span class="p">,</span> <span class="kt">uint16_t</span> <span class="o">*</span><span class="n">block_size</span><span class="p">)</span>
<span class="p">{</span>
<span class="o">*</span><span class="n">block_num</span> <span class="o">=</span> <span class="n">BLOCK_COUNT</span><span class="p">;</span>
<span class="o">*</span><span class="n">block_size</span> <span class="o">=</span> <span class="n">BLOCK_SIZE</span><span class="p">;</span>
<span class="p">}</span>
<span class="kt">int</span> <span class="nf">usbd_msc_sector_read</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">sector</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">buffer</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">length</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">flash_read</span><span class="p">(</span><span class="n">FLASH_ADDR</span> <span class="o">+</span> <span class="n">sector</span> <span class="o">*</span> <span class="n">BLOCK_SIZE</span><span class="p">,</span> <span class="n">buffer</span><span class="p">,</span> <span class="n">length</span><span class="p">);</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
<span class="kt">int</span> <span class="nf">usbd_msc_sector_write</span><span class="p">(</span><span class="kt">uint32_t</span> <span class="n">sector</span><span class="p">,</span> <span class="kt">uint8_t</span> <span class="o">*</span><span class="n">buffer</span><span class="p">,</span> <span class="kt">uint32_t</span> <span class="n">length</span><span class="p">)</span>
<span class="p">{</span>
<span class="n">flash_erase</span><span class="p">(</span><span class="n">FLASH_ADDR</span> <span class="o">+</span> <span class="n">sector</span> <span class="o">*</span> <span class="n">BLOCK_SIZE</span><span class="p">,</span> <span class="n">BLOCK_SIZE</span><span class="p">);</span>
<span class="n">flash_write</span><span class="p">(</span><span class="n">FLASH_ADDR</span> <span class="o">+</span> <span class="n">sector</span> <span class="o">*</span> <span class="n">BLOCK_SIZE</span><span class="p">,</span> <span class="n">buffer</span><span class="p">,</span> <span class="n">length</span><span class="p">);</span>
<span class="k">return</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>实现 usb msc 需要的底层接口u 盘大小 256Kflash 物理地址从 0x0000c000 开始。</p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span>
<span class="normal">11</span>
<span class="normal">12</span>
<span class="normal">13</span>
<span class="normal">14</span>
<span class="normal">15</span>
<span class="normal">16</span>
<span class="normal">17</span>
<span class="normal">18</span>
<span class="normal">19</span>
<span class="normal">20</span>
<span class="normal">21</span>
<span class="normal">22</span>
<span class="normal">23</span>
<span class="normal">24</span>
<span class="normal">25</span>
<span class="normal">26</span>
<span class="normal">27</span>
<span class="normal">28</span>
<span class="normal">29</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="n">gpio_set_mode</span><span class="p">(</span><span class="n">GPIO_PIN_15</span><span class="p">,</span> <span class="n">GPIO_INPUT_PD_MODE</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">gpio_read</span><span class="p">(</span><span class="n">GPIO_PIN_15</span><span class="p">))</span> <span class="p">{</span>
<span class="n">MSG</span><span class="p">(</span><span class="s">&quot;*************Welcome to usb msc boot,update your app bin*************</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">usbd_desc_register</span><span class="p">(</span><span class="n">msc_ram_descriptor</span><span class="p">);</span>
<span class="n">usbd_msc_class_init</span><span class="p">(</span><span class="n">MSC_OUT_EP</span><span class="p">,</span> <span class="n">MSC_IN_EP</span><span class="p">);</span>
<span class="n">usb_fs</span> <span class="o">=</span> <span class="n">usb_dc_init</span><span class="p">();</span>
<span class="k">if</span> <span class="p">(</span><span class="n">usb_fs</span><span class="p">)</span> <span class="p">{</span>
<span class="n">device_control</span><span class="p">(</span><span class="n">usb_fs</span><span class="p">,</span> <span class="n">DEVICE_CTRL_SET_INT</span><span class="p">,</span> <span class="p">(</span><span class="kt">void</span> <span class="o">*</span><span class="p">)(</span><span class="n">USB_EP4_DATA_OUT_IT</span> <span class="o">|</span> <span class="n">USB_EP5_DATA_IN_IT</span><span class="p">));</span>
<span class="p">}</span>
<span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">usb_device_is_configured</span><span class="p">())</span> <span class="p">{</span>
<span class="p">}</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="kt">uint8_t</span> <span class="n">bin_header</span><span class="p">;</span>
<span class="n">flash_read</span><span class="p">(</span><span class="n">FLASH_ADDR</span> <span class="o">+</span> <span class="mi">10</span> <span class="o">*</span> <span class="n">BLOCK_SIZE</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">bin_header</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
<span class="k">if</span> <span class="p">((</span><span class="n">bin_header</span> <span class="o">==</span> <span class="mh">0x00</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="n">bin_header</span> <span class="o">==</span> <span class="mh">0xff</span><span class="p">))</span> <span class="p">{</span>
<span class="n">MSG</span><span class="p">(</span><span class="s">&quot;*************Illegal bin!! Please update your bin*************</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="k">while</span> <span class="p">(</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
<span class="p">}</span>
<span class="p">}</span>
<span class="n">MSG</span><span class="p">(</span><span class="s">&quot;*************Let&#39;s go to application*************</span><span class="se">\r\n</span><span class="s">&quot;</span><span class="p">);</span>
<span class="n">bflb_platform_delay_ms</span><span class="p">(</span><span class="mi">20</span><span class="p">);</span>
<span class="n">bflb_platform_deinit</span><span class="p">();</span>
<span class="n">hal_jump2app</span><span class="p">(</span><span class="n">FLASH_ADDR</span> <span class="o">+</span> <span class="mi">10</span> <span class="o">*</span> <span class="n">BLOCK_SIZE</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>配置 GPIO15 作为输入模式,默认拉低,拉高进入 u 盘升级。</p></li>
<li><p>如果 GPIO15 为高,则进入 u 盘 升级程序。</p></li>
<li><p>如果 GPIO15 为低,则表示不需要升级直接进入 app此时需要修改内存映射地址将逻辑地址映射的物理地址flash offset )从 0x2000 改成实际 app 存储在 flash 的地址为FLASH_ADDR + 10 * BLOCK_SIZE。</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">hal_jump2app</span></code> 中对物理地址进行了判断bootloader 程序预留 48K物理地址小于 4M。</p></li>
</ul>
</div>
<div class="section" id="id4">
<h2><span class="section-number">3.2.4. </span>编译和烧录<a class="headerlink" href="#id4" title="永久链接至标题"></a></h2>
<ul>
<li><p><strong>CDK 编译</strong></p>
<blockquote>
<div><p>暂无,用户可以自己添加</p>
</div></blockquote>
</li>
<li><p><strong>命令行编译</strong></p></li>
</ul>
<div class="highlight-bash notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span> $ <span class="nb">cd</span> &lt;sdk_path&gt;/bl_mcu_sdk
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_iot <span class="nv">APP</span><span class="o">=</span>usb_msc_flash_boot
</pre></div>
</td></tr></table></div>
<ul>
<li><p><strong>烧录</strong></p>
<p>详见 <a class="reference internal" href="../../../get_started/bl_dev_cube.html#bl-dev-cube"><span class="std std-ref">BLDevCube 烧录工具指南</span></a></p>
</li>
</ul>
</div>
<div class="section" id="id5">
<h2><span class="section-number">3.2.5. </span>实验现象<a class="headerlink" href="#id5" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>将 GPIO15 拉高,然后使用 USB 数据线插到电脑上,识别出一个 U 盘。</p></li>
<li><p>将编译的 APP bin 文件拖入 U 盘。</p></li>
<li><p>拔下 USB ,拉低 GPIO15供电以后进入 APP 。</p></li>
</ul>
<div class="figure align-default">
<img alt="../../../_images/usb_msc3.gif" src="../../../_images/usb_msc3.gif" />
</div>
</div>
</div>

View file

@ -119,14 +119,15 @@
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../basic%20samples/flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">3. USB Device 应用</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="usbd_cdc.html">3.1. CDC - 虚拟串口</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_msc.html">3.2. MSC - U 盘升级</a></li>
<li class="toctree-l2"><a class="reference internal" href="usbd_hid.html">3.3. HID - 键盘&amp;鼠标</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#">3.4. VIDEO - 摄像头</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">3.4.1. 准备工具</a></li>
@ -139,7 +140,7 @@
<li class="toctree-l2"><a class="reference internal" href="usbd_audio.html">3.5. AUDIO - 麦克风</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../emac/index.html">7. EMAC 以太网应用</a></li>
@ -309,12 +310,8 @@
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>使用到的 GPIO 配置见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_avb/pinmux_config.h</span></code>,默认提供了该 demo 的引脚配置</p></li>
<li><p>使用到的 GPIO 配置见 <code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_avb/pinmux_config.h</span></code></p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">注解</p>
<p><code class="docutils literal notranslate"><span class="pre">bsp/board/bl706_avb/pinmux_config.h</span></code> 当前给所有的示例 demo 使用,所以,需要先选定 <code class="docutils literal notranslate"><span class="pre">PINMUX_SELECT</span></code><code class="docutils literal notranslate"><span class="pre">PINMUX_UVC</span></code>,开启 UVC demo</p>
</div>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>

View file

@ -128,13 +128,14 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -122,13 +122,14 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -128,13 +128,14 @@
<li class="toctree-l1"><a class="reference internal" href="../i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -122,13 +122,14 @@
<li class="toctree-l1"><a class="reference internal" href="../i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -0,0 +1,327 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>11.1. XIP FLASH - 数据读写 &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/translations.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="1. Shell 命令行调试" href="../../advance%20samples/shell_demo.html" />
<link rel="prev" title="11. XIP FLASH 示例" href="index.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home"> BL_MCU_SDK 开发指南
</a>
<div class="version">
0.3
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">快速开发指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/get_started.html">1. 开发前的准备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/connecting_hardware.html">2. 硬件连接指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/index.html">3. 开发环境搭建指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/cmake_quick_start.html">4. 基于 cmake 框架新建工程指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/cdk_new_project_quick_start.html">5. 基于 CDK 新建工程指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/bl_dev_cube.html">6. BLDevCube 烧录工具指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/board.html">7. Board 配置系统使用指南</a></li>
</ul>
<p class="caption"><span class="caption-text">API 手册</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/api_overview.html">1. API 概述</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/peripheral/index.html">2. Peripheral</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/shell/api_shell.html">3. Shell</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/usb%20stack/api_usb_stack.html">4. USB Stack</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/bluetooth/api_ble.html">5. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">基础外设例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../gpio/index.html">1. GPIO 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../uart/index.html">2. UART 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../pwm/index.html">3. PWM 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mtimer/index.html">4. MTIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dma/index.html">5. DMA 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../spi/index.html">6. SPI 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../i2c/index.html">7. I2C 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">11. XIP FLASH 示例</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">11.1. XIP FLASH - 数据读写</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#id1">11.1.1. 硬件连接</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id2">11.1.2. 软件实现</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id3">11.1.3. 编译和烧录</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id4">11.1.4. 实验现象</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL_MCU_SDK 开发指南</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><a href="index.html"><span class="section-number">11. </span>XIP FLASH 示例</a> &raquo;</li>
<li><span class="section-number">11.1. </span>XIP FLASH - 数据读写</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/samples/basic samples/flash/flash_demo.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="xip-flash">
<h1><span class="section-number">11.1. </span>XIP FLASH - 数据读写<a class="headerlink" href="#xip-flash" title="永久链接至标题"></a></h1>
<p>本 demo 主要演示 xip flash 基本的数据读写功能。</p>
<div class="section" id="id1">
<h2><span class="section-number">11.1.1. </span>硬件连接<a class="headerlink" href="#id1" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>内部 flash 不需要额外电路</p></li>
<li><p>外部 flash 需要连接 flash 控制器接口</p></li>
</ul>
</div>
<div class="section" id="id2">
<h2><span class="section-number">11.1.2. </span>软件实现<a class="headerlink" href="#id2" title="永久链接至标题"></a></h2>
<ul class="simple">
<li><p>软件代码见 <code class="docutils literal notranslate"><span class="pre">examples/flash/flash_rw</span></code></p></li>
</ul>
<div class="highlight-C notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
<span class="normal"> 2</span>
<span class="normal"> 3</span>
<span class="normal"> 4</span>
<span class="normal"> 5</span>
<span class="normal"> 6</span>
<span class="normal"> 7</span>
<span class="normal"> 8</span>
<span class="normal"> 9</span>
<span class="normal">10</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="cm">/* erase 0x00010000 16k flash */</span>
<span class="n">flash_erase</span><span class="p">(</span><span class="mh">0x00010000</span><span class="p">,</span> <span class="mi">16</span> <span class="o">*</span> <span class="mi">1024</span><span class="p">);</span>
<span class="cm">/* write 0x00010000 flash data */</span>
<span class="n">flash_write</span><span class="p">(</span><span class="mh">0x00010000</span><span class="p">,</span> <span class="n">writeTestData</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">writeTestData</span><span class="p">));</span>
<span class="n">memset</span><span class="p">(</span><span class="n">readTestData</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">256</span><span class="p">);</span>
<span class="cm">/* read 0x00010000 flash data */</span>
<span class="n">flash_read</span><span class="p">(</span><span class="mh">0x00010000</span><span class="p">,</span> <span class="n">readTestData</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="n">readTestData</span><span class="p">));</span>
</pre></div>
</td></tr></table></div>
<ul class="simple">
<li><p>擦除 flash 物理地址 0x00010000 开始的 16K 内容</p></li>
<li><p>从flash 物理地址 0x00010000 开始写入用户数据</p></li>
<li><p>从flash 物理地址 0x00010000 开始读取用户数据</p></li>
</ul>
</div>
<div class="section" id="id3">
<h2><span class="section-number">11.1.3. </span>编译和烧录<a class="headerlink" href="#id3" title="永久链接至标题"></a></h2>
<ul>
<li><p><strong>CDK 编译</strong></p>
<p>打开项目中提供的工程文件flash_rw.cdkproj</p>
<p>参照 <a class="reference internal" href="../../../get_started/Windows_quick_start_cdk.html#windows-cdk-quick-start"><span class="std std-ref">Windows 下使用 CDK (类 MDK Keil)开发指南</span></a> 的步骤编译下载即可</p>
</li>
<li><p><strong>命令行编译</strong></p></li>
</ul>
<div class="highlight-bash notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span> $ <span class="nb">cd</span> &lt;sdk_path&gt;/bl_mcu_sdk
$ make <span class="nv">BOARD</span><span class="o">=</span>bl706_iot <span class="nv">APP</span><span class="o">=</span>flash_rw
</pre></div>
</td></tr></table></div>
<ul>
<li><p><strong>烧录</strong></p>
<p>详见 <a class="reference internal" href="../../../get_started/bl_dev_cube.html#bl-dev-cube"><span class="std std-ref">BLDevCube 烧录工具指南</span></a></p>
</li>
</ul>
</div>
<div class="section" id="id4">
<h2><span class="section-number">11.1.4. </span>实验现象<a class="headerlink" href="#id4" title="永久链接至标题"></a></h2>
<p>打开串口,如果显示 case success 表示读写成功,否则读写错误</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="../../advance%20samples/shell_demo.html" class="btn btn-neutral float-right" title="1. Shell 命令行调试" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="index.html" class="btn btn-neutral float-left" title="11. XIP FLASH 示例" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; 版权所有 2021, BouffaloLab Co., Ltd.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View file

@ -0,0 +1,260 @@
<!DOCTYPE html>
<html class="writer-html5" lang="zh-CN" >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>11. XIP FLASH 示例 &mdash; BL_MCU_SDK 开发指南 0.3 文档</title>
<link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
<!--[if lt IE 9]>
<script src="../../../_static/js/html5shiv.min.js"></script>
<![endif]-->
<script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
<script src="../../../_static/jquery.js"></script>
<script src="../../../_static/underscore.js"></script>
<script src="../../../_static/doctools.js"></script>
<script src="../../../_static/translations.js"></script>
<script type="text/javascript" src="../../../_static/js/theme.js"></script>
<link rel="index" title="索引" href="../../../genindex.html" />
<link rel="search" title="搜索" href="../../../search.html" />
<link rel="next" title="11.1. XIP FLASH - 数据读写" href="flash_demo.html" />
<link rel="prev" title="10.1. TIMER - 秒中断定时" href="../timer/timer_interrupt_demo.html" />
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search" >
<a href="../../../index.html" class="icon icon-home"> BL_MCU_SDK 开发指南
</a>
<div class="version">
0.3
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<p class="caption"><span class="caption-text">快速开发指南</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/get_started.html">1. 开发前的准备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/connecting_hardware.html">2. 硬件连接指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/index.html">3. 开发环境搭建指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/cmake_quick_start.html">4. 基于 cmake 框架新建工程指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/cdk_new_project_quick_start.html">5. 基于 CDK 新建工程指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/bl_dev_cube.html">6. BLDevCube 烧录工具指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../get_started/board.html">7. Board 配置系统使用指南</a></li>
</ul>
<p class="caption"><span class="caption-text">API 手册</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/api_overview.html">1. API 概述</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/peripheral/index.html">2. Peripheral</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/shell/api_shell.html">3. Shell</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/usb%20stack/api_usb_stack.html">4. USB Stack</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api_reference/bluetooth/api_ble.html">5. BLE</a></li>
</ul>
<p class="caption"><span class="caption-text">基础外设例程</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../gpio/index.html">1. GPIO 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../uart/index.html">2. UART 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../pwm/index.html">3. PWM 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mtimer/index.html">4. MTIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dma/index.html">5. DMA 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../spi/index.html">6. SPI 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../i2c/index.html">7. I2C 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">11. XIP FLASH 示例</a><ul>
<li class="toctree-l2"><a class="reference internal" href="flash_demo.html">11.1. XIP FLASH - 数据读写</a></li>
</ul>
</li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="../../../index.html">BL_MCU_SDK 开发指南</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="../../../index.html" class="icon icon-home"></a> &raquo;</li>
<li><span class="section-number">11. </span>XIP FLASH 示例</li>
<li class="wy-breadcrumbs-aside">
<a href="../../../_sources/samples/basic samples/flash/index.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="xip-flash">
<h1><span class="section-number">11. </span>XIP FLASH 示例<a class="headerlink" href="#xip-flash" title="永久链接至标题"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="flash_demo.html">11.1. XIP FLASH - 数据读写</a></li>
</ul>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="flash_demo.html" class="btn btn-neutral float-right" title="11.1. XIP FLASH - 数据读写" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
<a href="../timer/timer_interrupt_demo.html" class="btn btn-neutral float-left" title="10.1. TIMER - 秒中断定时" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&#169; 版权所有 2021, BouffaloLab Co., Ltd.
</p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View file

@ -129,13 +129,14 @@
<li class="toctree-l1"><a class="reference internal" href="../i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -129,13 +129,14 @@
<li class="toctree-l1"><a class="reference internal" href="../i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -123,13 +123,14 @@
<li class="toctree-l1"><a class="reference internal" href="../i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

View file

@ -128,13 +128,14 @@
<li class="toctree-l1"><a class="reference internal" href="../i2s/index.html">8. I2S 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../adc/index.html">9. ADC 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timer/index.html">10. TIMER 示例</a></li>
<li class="toctree-l1"><a class="reference internal" href="../flash/index.html">11. XIP FLASH 示例</a></li>
</ul>
<p class="caption"><span class="caption-text">进阶例程</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/shell_demo.html">1. Shell 命令行调试</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. Fatfs 文件系统读写</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/fatfs_demo.html">2. FatFs 文件系统读写(SD 卡)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/usb/index.html">3. USB Device 应用</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. LowPower 低功耗评估</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/lowpower_demo.html">4. Power Management</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/boot2_iap_info.html">5. BOOT2 IAP</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/ble_scan_demo.html">6. BLE 客户端和服务端互连</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../advance%20samples/emac/index.html">7. EMAC 以太网应用</a></li>

Some files were not shown because too many files have changed in this diff Show more