蜂鸟W方案开发指导手册: ReleaseNote

蜂鸟W方案开发指导手册 v1.0.1
ReleaseNote

版本历史记录

版本：V1.0.1，发布时间：2021/09/06

适配环境：

  • 硬件：蜂鸟W US615 V1_0 开发板
  • 软件：hb_w v1.1.0

修改记录：

  1. 二次开发章节中增加常用CLI指令说明

版本：V1.0.0，发布时间：2021/08/05

适配环境：

  • 硬件：蜂鸟W US615 V1_0 开发板
  • 软件：hb_w v1.0.0

修改记录：

  1. 第一版发布


蜂鸟W方案开发指导手册: 1、简介

1、简介

1. 引言

云知声总部位于北京，在上海、深圳、厦门设有全资子公司。是一家专注物联网人工智能服务、拥有完全自主知识产权的世界顶尖的智能语音识别和语义理解技术的高新技术企业。自2012年由智能语音技术起家，云知声多年来不断拓展技术边界，技术能力不仅涵盖了感知、认知、交互等方面的人工智能语音语义技术，更是在突破了 AI 芯片设计技术后，一举打造出了自主研发、自主知识产权、自主可控的全栈式人工智能技术链条（深度学习算法+大数据+超级计算+芯片能力）。

以强大的计算平台为基础，云知声构建了“云端芯”生态体系，提供跨硬件平台、跨应用场景的软硬件一体化云端+本地智能的芯片终端解决方案。目前云知声是迄今为止行业内唯一实现芯片落地应用的公司、国内白色家电领域领先AI芯片供应商、国内首家推出医疗云服务并完成数百家医院系统测试的语音服务商、我国后装车机市场占有量行业第一、教育云社会化口语评测服务市场占有量第一。还在智慧生活（家居、车载、机器人等）和智慧服务（医疗、教育、司法等）等多个垂直场景均有落地应用。

2. 产品简介

云知声提供标准化软硬件一体离线语音解决方案，支持单麦拾音、前端降噪、语音唤醒、离线识别等。用户使用方案中的标准化硬件模组配合云知声设备平台与相关工具，快速定制语音产品，为空调、冰箱、灯具、开关等家居设备赋能，无需联网即可使其具备智能语音交互能力。

- 硬件：基于云知声蜂鸟W芯片为核心的标准硬件板，集成离线识别算法

- 开放平台：可进行语音相关配置并生成软件版本的云知声智能设备平台

- 软件与源码：可直接使用，也可修改代码进行二次编译的软件版本

- 文档与工具：使用指南与技术开发文档，配套测试工具


蜂鸟W方案开发指导手册: 2、产品说明

2、产品说明

1. 硬件说明

蜂鸟W芯片是一款Wi-Fi/BT双模智能语音IoT芯片。支持2.4G IEEE802.11b/g/n Wi-Fi通讯协议；支持BLE配网。芯片集成32位CPU处理器，内置UART、GPIO、SPI、SDIO、I2C、I2S、ADC、TouchSensor等外围接口；支持TEE安全引擎，支持多种硬件加解密算法，内置DSP、浮点运算单元与安全引擎，支持代码安全权限设置，支持固件加密存储、固件签名、安全调试、安全升级等多项安全措施，保证产品安全特性。依托于云知声在语音识别技术上的积累和算法的不断优化和创新，将本地识别算法与芯片架构深度融合，为客户提供Turnkey语音识别方案。

蜂鸟W芯片通用开发板

蜂鸟W芯片通用开发板板

蜂鸟W芯片主要特性：

配置 | 规格
蜂鸟W芯片 | 高速SRAM 288KB
 | FLASH 2MB
mic数量 | 1
UART通信接口 | 5
音频接口 | I2S
控制接口 | UART, GPIO, I2C, SPI, PWM 等
Wi-Fi | IEEE802.11 b/g/n 支持WMM/WMM-PS/WPA/WPA2/WPS 支持Station、Soft-AP功能 传输速率最高到150Mbps
BT | 支持BLE配网

2. 软件功能

序号 | 功能 | 功能描述
1 | 单麦拾音 | · 单麦克风方案 · 支持家居场景3~5m远讲
2 | 语音唤醒 | · 高性能唤醒引擎 · 支持带口音的普通话 · 低误唤醒率 (< 1 false in 24 hours)
3 | 离线识别 | · 支持本地100条控制指令识别
4 | 多轮对话 | · 一次唤醒连续对话，语音操作更加便捷自然。
5 | 多种发音人音色 | · 提供标准女声、甜美女声、可爱女声、台湾女声、标准男声、女童声、男童声七种音色可选
6 | UART主板对接 | · 云知声提供标准UART协议，也支持对接用户自有协议
7 | IoT对接 | · 支持主流IoT服务商对接
7 | 智能设备平台 | · 云知声设备平台提供：唤醒词自定义，命令词自定义，回复播报语自定义，发音人音色选择等产品自定义配置


蜂鸟W方案开发指导手册: 3、获取源码

3、获取源码

1. 前期准备

1.1 账号创建

• 进入云知声开放平台：http://udp.hivoice.cn/

• 点击右上角的 登陆/注册，弹出如下窗口：

• 如无账号，请点击 去注册；

• 注册方式有“手机账号注册”、“邮箱账号注册”两种方式

• 如已有云知声开发账号请忽略本步骤；

• 选择邮箱账号注册需点击激活邮件后才能正常登陆

1.2 完善资料

注册成功后，为确保账号可用，请登陆云知声账号；

登陆后，点击右上角的 完善资料，输入相关必填信息。

1.3 开通权限

1. 联系云知声商务，申请开通云知声智能设备平台权限，获取离线标准开发板；

2. 开通权限后，产品控制台入口可见，在控制台-产品接入下。

2. 配置并生成产品版本

2.1 创建产品

（1）用户登陆云知声开放平台（http://udp.hivoice.cn/），点击导航栏中的 控制台，点击 产品接入 进入产品接入控制台。

（2）进入产品控制台后，点击 创建产品。

（3）云知声智能设备平台提供不同场景，用以定制不同语音产品形态，此处选择智能家居中文版（离在线）

（4）选择系统与芯片平台，选择 蜂鸟W芯片

该页面点击芯片旁的？按钮，可以获取蜂鸟W芯片产品手册。

（5）填写产品信息，包括名称与描述

（6）确认所选项无问题，点击 保存且下一步，即初步创建产品成功

2.2 产品版本开发

2.2.1 创建产品版本

（1）创建产品版本，填写版本号及版本信息，点击下一步

• 产品创建成功后，系统会自动为该产品分配Appkey与AppSecret，此为该产品唯一识别ID和密匙

• 一个产品可维护多个版本，可通过版本号与版本描述来区分

2.2.2 配置终端能力

（1） 选择前端信号处理方案

蜂鸟W芯片通用板支持单麦克风收音，开发者针对不同的使用场景，选择识别距离，实现对声音信号的处理方式，提升识别结果的准确率。

（2）PIN脚配置

蜂鸟W支持零代码实现芯片引脚配置，通过参数配置自定义GPIO、PWM、UART等端口的输出信号，直接控制外围电路。

（3）自定义产品唤醒词，以及唤醒回复语

• 支持3-6个字的唤醒词自定义配置，最多支持5组唤醒词的添加；

• 为保证语音产品有最佳唤醒体验，平台针对唤醒词的发音提供打分功能，并会提供具体指导信息；

• 涉及黄赌毒、政治敏感、低俗辱骂等不合规内容的唤醒词不可使用；

• 完整唤醒词定义规则可点击界面上《唤醒词自定义规则》；

• 支持按照产品使用场景自定义唤醒灵敏度；

• 自定义设置唤醒回复语，唤醒回复最多支持3条，设置后将随机播报。

（4）按照规则填写命令词与应答语（使能IoT服务时，请参考相关IoT对接章节进行配置）

如下图所示，点击“如何自定义”为语法格式说明与规则介绍；

点击“点这里添加”则弹出输入框，可以在页面内直接输入命令词与应答语的定义；

如不满足语法格式要求平台则会进行实时提示。输入完成后选择命令词识别灵敏度，点击“确定”即可提交。

提交后仍可对词表基础信息进行编辑；

点击“控制详情”切换TAB，将控制行为与引脚输出信号进行对应，实现对控制指令的信号输出的配置。

语法格式说明与规则介绍

为方便产品构建，平台定义了一套语法格式，语法格式组成为：

action=命令词1|命令词2...@回复语

举例：TempSet15=设置十五度|十五度@已设为十五度

action 为一个控制指令的唯一标识，用户对着设备说出“设置十五度”“十五度”并被语义理解时，如已对接设备，语义理解模块会将TempSet15传给设备。

命令词 为想要定义的语音话术，用户必须按照定义的话术说出才有效。如用户可以使用“设置十五度”“十五度”来实现同一个设置温度15度的控制。

回复语 为针对该条控制指令的设备回复播报。

action、命令词、回复语均由用户定义。等号前的action为唯一值；等号后的命令词可输入多个，以 | 符号分割；@后为回复语，每个控制指令可以定义对应的回复。

点击语法格式后的 问号，可看到语法格式要求：

Ø action由英文、下划线“_”和数字组成，必须英文开头，不区分大小写，15个字符内

Ø 命令词最多支持100条，每条限 2 - 10 个字符，仅支持中文

Ø 一个action仅支持一条回复语，回复语总字数不得超过500个字符，支持中文、数字、逗号、句号、问号

点击语法句式后的 问号，可以看到针对回复播报特殊读音的标签使用说明：

Ø <py>：需要对单个汉字的发音进行纠正的场合。

注：拼音声调范围为 1 - 5，1 - 4 对应一声到四声，5对应轻声。

例：已调<py>tiao2</py>至中<py>zhong1</py>风档

播报为：已调(tiao2)至中(zhong1)风档

Ø <value>：需要将数字按照数值读法播报

例：已设为<value>15</value>度

播报为：已设为十五度

Ø <code>：需要将数字按照数字串逐位播报

例：已设为<code>15</code>度

播报为：已设为一五度

开发者注意：

1. 产品默认支持音量大小调节，音量调节控制默认句式如下：

 volumeUpUni=增大音量

 volumeDownUni=减小音量

如需自定义音量与主动退出的控制话术与应答播报，可在语法文件内添加以上控制句式，只需保持=号前的action不变，修改=后的内容即可。

举例如下：

volumeUpUni=大声一点|调大声点@已为您调高音量

exitUni=拜拜|再见@好的，那我先退下了

2. 产品内置音量等级三档控制逻辑，默认不开启。如需使用该逻辑，可在定义离线命令词与播报语处，添加词条后生效：

 最大音量 volumeMaxUni

 中等音量 volumeMidUni

 最小音量 volumeMinUni

如希望添加最大音量调节，可参考下方举例添加句式：

volumeMaxUni=最大音量|音量调到最大@已调至最大音量

3. 用户可以在离线命令词自定义部分，指定特定的action，定义非语音交互的应答语播报，用于非正常语音交互的情景。

开发者需从指定文件夹获取此部分定制的语音音频文件，并根据产品定义修改源码。可参见文内 5.3 播报逻辑开发。

格式如下：

Special_Replies@回复语1|回复语2|回复语3

如警报播报：以智能烧水壶为例，产品内传感器检测到缺水状态，自动语音警报；

如极限播报：空调指令“升高温度”，正常播报为“温度已升高”；当温度到上限时，播报“温度已调至最高”。

举例如下：

Special_Replies@内丹干烧|水壶缺水|没水啦|主人请加水

4. 用户可以在离线命令词自定义部分，指定特定的竞争词（可理解为无效命令词），防止一定概率的误识别。

格式如下：

Special_Gabages=命令词1|命令词2|命令词3|...

以空调产品为例，并没有高于32度的温控指令，用户说出“三十六度”时，不希望空调识别到“十六度”；
以空调产品为例，没有自动风的指令，当用户说说出“自动风”时，不希望空调识别到“自然风”（如果阈值设置较低）。

举例如下：

举例：Special_Gabages=三十六度|四十六度|五十六度|六十六度

（5）选择语音识别模型

蜂鸟W芯片方案支持对声学模型进行选择，默认为云知声针对蜂鸟W芯片定制的经过算法优化的通用声学模型。

如当前系统默认的声学模型性能无法满足用户需求时（注：此处用户需求，指经过语音性能量化测试的明确指标），可以使用云知声模型训练平台，采集特定离线命令词的语音训练数据并进行模型定制。

（6）针对产品定位，选择适合产品形态的发音人

• 活泼可爱的萱萱和KiYo，童真童趣的糖糖和天天，温柔可亲的玲玲，庄重严肃的小雯与小峰，七种音色可供选择；

• 可调节音量、语速与声音亮度；

• 提供在线试听，方便用户进行决策；

（7）其它配置

1) 开机音配置

系统自带默认开机铃声，可在页面点击试听。

如需进行开机欢迎语的自定义，也可以选择自定义内容，产品则会在开机后自动进行播报，欢迎语播报自定义限中文，可输入30个字符；也可选择不使用开机音。

2) 识别状态退出相关配置

语音产品为保证用户体验，唤醒后一段时间内无语音输入产品会主动退出识别状态，如需输入命令词，则需再次唤醒。

此段等待用户输入语音命令的有效时间，即为“唤醒超时退出时间”。

• 为确保产品有较好的用户体验，支持5s – 60s的超时退出时间设置，默认为10秒

• 超时退出回复最多可设置2条

当用户想要结束对话时，也可以主动要求退出识别状态。

• 默认退出命令为“退下”“再见”，可根据产品定义修改，最多可设置3条

• 主动退出回复最多可设置2条

如配置完成，则可点击下一步，进入版本发布页面。

2.2.3 下载版本

（1）产品配置开发完成，进入发布页面后，可点击 立即发布

（2）产品发布需要一定时间，可以有两种方法获取到发布成功的产品

• 发布界面下，版本发布成功后，会有下载提示

• 也可以直接返回产品详情，或关闭页面一段时间再进入智能设备平台的产品详情，页面中的版本列表处点击下载

2.3 产品版本维护

产品详情页面可以查看已创建的产品，可以查看每个版本的配置信息，也可以对已发布成功的版本进行下载操作

2.3.1 新版本迭代

同一个产品如有新需求的修改或迭代，可在产品详情页面点击产品方案的“编辑” +开发新版本，后续的操作步骤同创建产品版本时的流程一致。

提供选择任一历史版本进行迭代开发的选项，默认为基于最新修改的版本，也可根据需求进行其它版本的选择。


蜂鸟W方案开发指导手册: 4、烧录固件

4、烧录固件

1. 文件介绍

• 产品的软件烧录包下载成功后，解压文件，可以看到如下方文件目录

• 如想直接使用，体验语音功能，请打开“image_demo/Hummingbird-W-Production-Tool”文件夹，双击“UnisoundDownloader”，运行烧录工具

• 烧录工具配置界面如下图所示：

2. 烧录指南

详见#1所示说明文档《W_Download_Tool_User_Guide.pdf》


蜂鸟W方案开发指导手册: 5、搭建开发环境

5、搭建开发环境

1 环境准备

(1) 下载编译工具

推荐使用Ubuntu 16.04 / centos7以上版本作为开发环境。

交叉编译工具下载地址：

链接：https://pan.baidu.com/s/1oEDxL3r875l9bist51R4jg

提取码：aruy

下载交叉编译工具并解压到开发环境“/opt”路径中，或其他路径：

再将路径配置到系统环境变量中：

(2) 已下载的版本里除了可直接烧录使用的image_demo外，文件夹内包含产品方案源码，如下图所示：

(3) 安装python环境：sudo apt-get install python

(4) 安装lame音频处理工具：sudo apt-get install lame

(5) 安装编译开发工具集：sudo pip install yoctools -i https://mirrors.aliyun.com/pypi/simple

(6) 安装32位兼容库（如果系统未安装过）：sudo apt-get install lib32stdc++6 lib32z1 lib32ncurses5 lib32bz2-1.0（仅适用于Ubuntu 16.04版本，其他版本请根据系统说明解决兼容性问题)

2 编译

(1) 执行编译

进入solution/unisound目录，执行make：

编译成功会看到如下信息：

(2) out/unisound目录下可以看到编译生成的完整固件，使用章节3中的下载工具即可进行烧录使用：


蜂鸟W方案开发指导手册: 6、软件架构

6、软件架构

1.软件架构

蜂鸟W芯片源码框架采用分层设计，各个层次完成特定的功能封装，基本框架结构如下图所示：

各个层次功能描述如下：

ü 硬件规范层：定义了uart、spi、i2c、gpio等芯片外设驱动的统一接口；

ü 核心服务层：包含了操作系统内核、设备管理框架、网络协议、蓝牙协议、网络管理器等核心服务模块；

ü 应用组件层：提供了大量的应用组件，满足不同产品需求的选择；

ü 业务框架层：提供IoT、语音识别、人机交互等多种应用领域软件框架，简化了应用软件的编写难度。

2.源码目录结构

源码各个文件功能如下所示：

一般情况下，开发者仅需改动solution/unisound目录即可实现大部分的需求。

根目录：

本方案常用的组件如下：


蜂鸟W方案开发指导手册: 7、二次开发

7、二次开发

1. 运行一个Demo

平台下载源码的solution/unisound目录下执行make即可生成可使用的demo固件，烧录入开发板后即可体验完整功能

2.串口调试

调试串口默认使用uart0，连接PC后使用常见串口工具（如putty、xshell、secureCRT等），配置波特率 (115200bps)、数据位 (8)、停止位 (1)、校验 (None)即可。

TX连接串口调试器RX，RX连接串口调试器TX，GND连接GND接口，设备上电后，可在串口工具中观察到如下启动信息：

蜂鸟W使能log调试功能后默认支持CLI，可在串口工具中输入命令行进行调试，如查看剩余内存信息：

支持的CLI命令行如下：

也可参考如下示例添加自己的命令：

3.常用CLI指令

 | 功能 | 指令 | 备注
系统 | 重启设备 | sys reboot |
 | 查看版本号 | sys app |
 | 查看任务信息 | ps |
 | 查看内存使用 | free |
KV存储 | 写入字符数据 | kv set <key_str> <value_str> | 实际使用时不需要输入尖括号（下同），示例： kv set wifi_ssid test_ap
 | 写入数值数据 | kv setint <key_str> <value_int> | 例：kv setint wifi_en 1
 | 读取字符数据 | kv get <key_str> | 例：kv get wifi_ssid
 | 读取数值数据 | kv getint <key_str> | 例：kv getint wifi_en
 | 删除键值对 | kv del <key_str> | 例：kv del wifi_en
 | 列出键值对 | kv list |
网络 | 获取mac | app wifi mac |
 | 开始进行配网 | app wifi_prov ble | 设备重启并进入配网模式
 | 扫频检测可用热点 | iwpriv wifi_scan |
 | 查看网络状态 | ifconfig |

4.调整指令阈值

蜂鸟W芯片支持离线语音识别阈值的配置，一般情况使用平台自动计算获得的值即可，也可以根据项目的要求进行微调。


蜂鸟W方案开发指导手册: 8、IOT使用说明

8、IOT使用说明

概述

本文主要介绍了基于蜂鸟W芯片与阿里生活物联网平台的IoT方案开发流程。

一、 创建阿里物联网产品

1. 参照https://help.aliyun.com/document_detail/142147.html中的指引完成阿里云账号的注册，并在生活物联网平台创建IoT产品（选择自有品牌项目）

2. 创建产品时选择数据格式为【ICA标准数据格式】：

3. 完成功能定义后，点击右上角的【查看物模型】，选择【完整物模型】，即可导出云知声设备平台所需的IoT物模型数据

A.

B.

C.

二、 创建云知声蜂鸟W产品

1. 参照https://doc.hivoice.cn/udp/快速开始.html中的指引在云知声开放平台创建蜂鸟W IoT产品

2. 打开【IoT服务】并选择【阿里】，点击添加物模型数据（见章节一）

3. 平台会将支持的IoT控制指令解析为如下表格，可根据需要添加语音控制指令及回复语（无需语音控制或回复的直接留空即可）

4. 切换到【控制详情】标签，可进行控制功能的配置

5. [可选] 点击右上角的【添加功能】，可添加仅需语音控制的指令（即与IoT控制无关的离线语音功能）

三、 IoT功能调试

1. 完成章节一、二的平台端配置后，使用云知声平台生成的方案包

2. 在阿里生活物联网平台上添加测试设备，模组信息暂时可选择“模组”-“未认证”，DeviceName使用设备的mac地址（参考二次开发章节，可使用console指令app wifi mac获取，无需冒号连接）

3. 添加完测试设备后，即可获得对应设备的授权码

4. 将上述设备授权信息写入到测试设备中（可通过console使用如下指令，尖括号无需输入）

kv set hal_devinfo_dn <DeviceName>

kv set hal_devinfo_ds <DeviceSecret>

kv set hal_devinfo_pk <ProductKey>

kv set hal_devinfo_ps <Product Secret>

kv setint hal_devinfo_pid <Product Id>

5. 重启设备后生效，测试设备即可接入阿里IoT，可在云端或手机app端进行联调，阿里IoT的调试方法可参考https://help.aliyun.com/document_detail/142147.html中相关章节

四、 其他说明

1. 量产阶段可使用专用工具进行设备批量授权


蜂鸟W方案开发指导手册: 模块

模块
这里列出了所有模块:
[详情级别 12]
▼ Driver APIs | Driver APIs
7816 Driver APIs | 7816 driver APIs
ADC Driver APIs | ADC driver APIs
CPU CLOCK Driver APIs | CPU CLOCK driver APIs
DMA Driver APIs | DMA driver APIs
EFUSE Driver APIs | EFUSE driver APIs
SPI FLASH Driver APIs | SPI FLASH driver APIs
GPIO Driver APIs | GPIO driver APIs
IOMUX Driver APIs | IO Multiplex driver APIs
MASTER SPI Driver APIs | MASTERSPI driver APIs
HSPI Driver APIs | HSPI driver APIs
I2C Driver APIs | I2C driver APIs
I2S Driver APIs | I2S driver APIs
INNER FLASH Driver APIs | INNER FLASH driver APIs
IRQ Driver APIs | IRQ driver APIs
LCD Driver APIs | LCD driver APIs
PMU Driver APIs | PMU driver APIs
PSRAM Driver APIs | PSRAM driver APIs
PWM Driver APIs | PWM driver APIs
RTC Driver APIs | RTC driver APIs
SASC Driver APIs | SASC driver APIs
SDIO HOST Driver APIs | SDIO HOST driver APIs
TIMER Driver APIs | TIMER driver APIs
TIPC Driver APIs | TIPC driver APIs
UART Driver APIs | UART driver APIs
WDG Driver APIs | WDG driver APIs


蜂鸟W方案开发指导手册: Driver APIs

模块 | 函数
Driver APIs

Driver APIs 更多...

模块

7816 Driver APIs
7816 driver APIs
ADC Driver APIs
ADC driver APIs
CPU CLOCK Driver APIs
CPU CLOCK driver APIs
DMA Driver APIs
DMA driver APIs
EFUSE Driver APIs
EFUSE driver APIs
SPI FLASH Driver APIs
SPI FLASH driver APIs
GPIO Driver APIs
GPIO driver APIs
IOMUX Driver APIs
IO Multiplex driver APIs
MASTER SPI Driver APIs
MASTERSPI driver APIs
HSPI Driver APIs
HSPI driver APIs
I2C Driver APIs
I2C driver APIs
I2S Driver APIs
I2S driver APIs
INNER FLASH Driver APIs
INNER FLASH driver APIs
IRQ Driver APIs
IRQ driver APIs
LCD Driver APIs
LCD driver APIs
PMU Driver APIs
PMU driver APIs
PSRAM Driver APIs
PSRAM driver APIs
PWM Driver APIs
PWM driver APIs
RTC Driver APIs
RTC driver APIs
SASC Driver APIs
SASC driver APIs
SDIO HOST Driver APIs
SDIO HOST driver APIs
TIMER Driver APIs
TIMER driver APIs
TIPC Driver APIs
TIPC driver APIs
UART Driver APIs
UART driver APIs
WDG Driver APIs
WDG driver APIs

函数

void spi_start_transfer (u32 transfer_bytes)

详细描述


蜂鸟W方案开发指导手册: 7816 Driver APIs

函数
7816 Driver APIs
Driver APIs

7816 driver APIs 更多...

函数

void | uni_sc_io_clk_config (uint8_t mode)
This function is used to config the pin in gpio or 7816 mode for the 7816 power on timing 更多...
void | uni_sc_powerInit (void)
close af to use as gpio 更多...
void | uni_sc_poweron (void)
power on the 7816 device if power is controled by GPIO 更多...
void | uni_sc_poweroff (void)
power off the 7816 device if power is controled by GPIO 更多...
void | uni_sc_rst_low (void)
driver the reset gpio in low level 更多...
void | uni_sc_rst_high (void)
driver the reset gpio in high level 更多...
void | uni_sc_hotreset (void)
hotrest the 7816 device obey the 7816-3 timing 更多...
void | uni_sc_colreset (void)
colreset the 7816 device obey the 7816-3 timing 更多...
void | uni_sc_deactive (void)
deactive the 7816 device obey the 7816-3 timing 更多...
void | uni_sc_set_bgt (uint8_t bgt)
This function is used to config the block guard time param in 7816 mode 更多...
void | uni_sc_tx_retry_times (uint8_t count)
This function is used to config the tx retry count when detect err signal 更多...
void | uni_sc_rx_retry_times (uint8_t count)
This function is used to config the rx retry count when detect parity error 更多...
void | uni_sc_set_etu (uint16_t etu)
This function is used to config the etu param 更多...
void | uni_sc_set_frequency (uint32_t freq)
This function config the module clock freq 更多...

详细描述

函数说明

◆ uni_sc_colreset()

void uni_sc_colreset ( void )
返回值

◆ uni_sc_deactive()

void uni_sc_deactive ( void )
返回值

◆ uni_sc_hotreset()

void uni_sc_hotreset ( void )
返回值

◆ uni_sc_io_clk_config()

void uni_sc_io_clk_config ( uint8_t mode )
参数
[in] mode : 1–gpio mode ; 0–7816 mode
返回值

◆ uni_sc_powerInit()

void uni_sc_powerInit ( void )
返回值

◆ uni_sc_poweroff()

void uni_sc_poweroff ( void )
返回值

◆ uni_sc_poweron()

void uni_sc_poweron ( void )
返回值

◆ uni_sc_rst_high()

void uni_sc_rst_high ( void )
返回值

◆ uni_sc_rst_low()

void uni_sc_rst_low ( void )
返回值

◆ uni_sc_rx_retry_times()

void uni_sc_rx_retry_times ( uint8_t count )
参数
[in] count : the value of retry time will be set 7 for max
返回值

◆ uni_sc_set_bgt()

void uni_sc_set_bgt ( uint8_t bgt )
参数
[in] bgt : the value of blcok guard time will be set
返回值

◆ uni_sc_set_etu()

void uni_sc_set_etu ( uint16_t etu )
参数
[in] etu : the value of etu will be set
返回值

◆ uni_sc_set_frequency()

void uni_sc_set_frequency ( uint32_t freq )
参数
[in] freq : the value of clock freq
返回值

◆ uni_sc_tx_retry_times()

void uni_sc_tx_retry_times ( uint8_t count )
参数
[in] count : the value of retry time will be set 7 for max
返回值


蜂鸟W方案开发指导手册: ADC Driver APIs

函数
ADC Driver APIs
Driver APIs

ADC driver APIs 更多...

函数

void | tls_adc_init (u8 ifusedma, u8 dmachannel)
This function is used to init adc. 更多...
void | tls_adc_irq_register (int inttype, void(*callback)(u32 *buf, u16 len))
This function is used to register interrupt callback function. 更多...
void | tls_adc_clear_irq (int inttype)
This function is used to clear the interrupt source. 更多...
void | tls_adc_start_with_dma (int Channel, int Length)
This function is used to register interrupt callback function. 更多...
void | tls_adc_start_with_cpu (int Channel)
This function is used to start adc. 更多...
u32 | tls_read_adc_result (void)
This function is used to read adc result. 更多...
void | tls_adc_stop (int ifusedma)
This function is used to stop the adc. 更多...
void | tls_adc_config_cmp_reg (int cmp_data, int cmp_pol)
This function is used to config adc bigger register. 更多...
void | tls_adc_reference_sel (int ref)
This function is used to set adc reference source. 更多...
int | adc_get_interTemp (void)
This function is used to read internal temperature. 更多...
u16 | adc_get_inputVolt (u8 channel)
This function is used to read input voltage. 更多...
u16 | adc_get_interVolt (void)
This function is used to read internal voltage. 更多...
int | adc_temp (void)
This function is used to read temperature. 更多...

详细描述

函数说明

◆ adc_get_inputVolt()

u16 adc_get_inputVolt ( u8 channel )
参数
[in] channel adc channel,from 0 to 3 is single input;4 and 5 is differential input.
返回值
voltage
注解
None

◆ adc_get_interTemp()

int adc_get_interTemp ( void )
参数
[in] None
返回值
temperature
注解
None

◆ adc_get_interVolt()

u16 adc_get_interVolt ( void )
参数
[in] None
返回值
voltage
注解
None

◆ adc_temp()

int adc_temp ( void )
参数
[in] None
返回值
temperature
注解
None

◆ tls_adc_clear_irq()

void tls_adc_clear_irq ( int inttype )
参数
[in] inttype interrupt type: ADC_INT_TYPE_ADC adc interrupt,user get adc result from the callback function. ADC_INT_TYPE_DMA dma interrupt,dma transfer the adc result to the user's buffer.
返回
None
注解
None

◆ tls_adc_config_cmp_reg()

void tls_adc_config_cmp_reg | ( | int | cmp_data,
 |  | int | cmp_pol
 | ) |  |
参数
[in] | cmp_data | compare data
[in] | cmp_pol | compare pol
返回
None
注解
None

◆ tls_adc_init()

void tls_adc_init | ( | u8 | ifusedma,
 |  | u8 | dmachannel
 | ) |  |
参数
[in] | ifusedma | if use dma
[in] | dmachannel | dma channel
返回
None
注解
None

◆ tls_adc_irq_register()

void tls_adc_irq_register | ( | int | inttype,
 |  | void(*)(u32 *buf, u16 len) | callback
 | ) |  |
参数
[in] | inttype | interrupt type: ADC_INT_TYPE_ADC adc interrupt,user get adc result from the callback function. ADC_INT_TYPE_DMA dma interrupt,dma transfer the adc result to the user's buffer.
[in] | callback | interrupt callback function.
返回
None
注解
None

◆ tls_adc_reference_sel()

void tls_adc_reference_sel ( int ref )
参数
[in] ref ADC_REFERENCE_EXTERNAL,ADC_REFERENCE_INTERNAL
返回
None
注解
None

◆ tls_adc_start_with_cpu()

void tls_adc_start_with_cpu ( int Channel )
参数
[in] Channel adc channel,from 0 to 3 is single input;4 and 5 is differential input.
返回
None
注解
None

◆ tls_adc_start_with_dma()

void tls_adc_start_with_dma | ( | int | Channel,
 |  | int | Length
 | ) |  |
参数
[in] | Channel | adc channel,from 0 to 3 is single input;4 and 5 is differential input.
[in] | Length | byte data length,is an integer multiple of half word,need <= 0x500
返回
None
注解
None

◆ tls_adc_stop()

void tls_adc_stop ( int ifusedma )
参数
[in] ifusedma if use dma
返回
None
注解
None

◆ tls_read_adc_result()

u32 tls_read_adc_result ( void )
参数
[in] None
返回值
adc result
注解
None


蜂鸟W方案开发指导手册: CPU CLOCK Driver APIs

函数
CPU CLOCK Driver APIs
Driver APIs

CPU CLOCK driver APIs 更多...

函数

void | tls_sys_clk_set (u32 clk)
This function is used to set cpu clock 更多...
void | tls_sys_clk_get (tls_sys_clk *sysclk)
This function is used to get cpu clock 更多...

详细描述

函数说明

◆ tls_sys_clk_get()

void tls_sys_clk_get ( tls_sys_clk * sysclk )
参数
[out] *sysclk point to the addr for system clk output
返回
None
注解
None

◆ tls_sys_clk_set()

void tls_sys_clk_set ( u32 clk )
参数
[in] clk select cpu clock clk == CPU_CLK_80M 80M clk == CPU_CLK_40M 40M
返回
None
注解
None


蜂鸟W方案开发指导手册: DMA Driver APIs

函数
DMA Driver APIs
Driver APIs

DMA driver APIs 更多...

函数

void | tls_dma_irq_clr (unsigned char ch, unsigned char flags)
This function is used to clear dma interrupt flag. 更多...
void | tls_dma_irq_register (unsigned char ch, void(*callback)(void *p), void *arg, unsigned char flags)
This function is used to register dma interrupt callback function. 更多...
int | tls_dma_wait_complt (unsigned char ch)
This function is used to register dma interrupt 更多...
unsigned char | tls_dma_start_by_wrap (unsigned char ch, struct tls_dma_descriptor *dma_desc, unsigned char auto_reload, unsigned short src_zize, unsigned short dest_zize)
This function is used to Start the DMA controller by Wrap 更多...
unsigned char | tls_dma_start (unsigned char ch, struct tls_dma_descriptor *dma_desc, unsigned char auto_reload)
This function is used to Wait until DMA operation completes 更多...
unsigned char | tls_dma_stop (unsigned char ch)
This function is used to To stop current DMA channel transfer 更多...
unsigned char | tls_dma_request (unsigned char ch, unsigned char flags)
This function is used to Request a free dma channel. If ch is 0, the function will select a random free channel, else return the selected channel no. if free. 更多...
void | tls_dma_free (unsigned char ch)
This function is used to Free the DMA channel when not use 更多...
void | tls_dma_init (void)
This function is used to Initialize DMA Control 更多...

详细描述

函数说明

◆ tls_dma_free()

void tls_dma_free ( unsigned char ch )
参数
[in] ch channel no. that is ready to free
返回
None
注解
None

◆ tls_dma_init()

void tls_dma_init ( void )
参数
[in] None
返回
None
注解
None

◆ tls_dma_irq_clr()

void tls_dma_irq_clr | ( | unsigned char | ch,
 |  | unsigned char | flags
 | ) |  |
参数
[in] | ch | Channel no.[0~7]
[in] | flags | Flags setted to TLS_DMA_IRQ_BURST_DONE, TLS_DMA_IRQ_TRANSFER_DONE, TLS_DMA_IRQ_BOTH_DONE.
返回
None
注解
None

◆ tls_dma_irq_register()

void tls_dma_irq_register | ( | unsigned char | ch,
 |  | void(*)(void *p) | callback,
 |  | void * | arg,
 |  | unsigned char | flags
 | ) |  |
参数
[in] | ch | Channel no.[0~7]
[in] | callback | is the dma interrupt call back function.
[in] | arg | the param of the callback function.
[in] | flags | Flags setted to TLS_DMA_IRQ_BURST_DONE, TLS_DMA_IRQ_TRANSFER_DONE, TLS_DMA_IRQ_BOTH_DONE.
返回
None
注解
None

◆ tls_dma_request()

unsigned char tls_dma_request | ( | unsigned char | ch,
 |  | unsigned char | flags
 | ) |  |
参数
[in] | ch | channel no.
[in] | flags | flags setted to selected channel
返回
Channel no. that is free now
注解
Channel no. that is free now

◆ tls_dma_start()

unsigned char tls_dma_start | ( | unsigned char | ch,
 |  | struct tls_dma_descriptor * | dma_desc,
 |  | unsigned char | auto_reload
 | ) |  |
参数
[in] autoReload Does restart when current transfer complete?
[in] | ch | Channel no.[0~7]
[in] | pDmaDesc | Pointer to DMA channel descriptor structure.
返回值
Always STATUS_SUCCESS.
注解
DMA Descriptor: +-----------------------------------------------------------—+ |Vld[31] | RSV | +-----------------------------------------------------------—+ | RSV | Dma_Ctrl[16:0] | +-----------------------------------------------------------—+ | Src_Addr[31:0] | +-----------------------------------------------------------—+ | Dest_Addr[31:0] | +-----------------------------------------------------------—+ | Next_Desc_Add[31:0] | +-----------------------------------------------------------—+

◆ tls_dma_start_by_wrap()

unsigned char tls_dma_start_by_wrap | ( | unsigned char | ch,
 |  | struct tls_dma_descriptor * | dma_desc,
 |  | unsigned char | auto_reload,
 |  | unsigned short | src_zize,
 |  | unsigned short | dest_zize
 | ) |  |
参数
[in] autoReload Does restart when current transfer complete?
[in] | ch | Channel no.[0~7]
[in] | pDmaDesc | Pointer to DMA channel descriptor structure.
返回值
Always STATUS_SUCCESS.
注解
DMA Descriptor: +-----------------------------------------------------------—+ |Vld[31] | RSV | +-----------------------------------------------------------—+ | RSV | Dma_Ctrl[16:0] | +-----------------------------------------------------------—+ | Src_Addr[31:0] | +-----------------------------------------------------------—+ | Dest_Addr[31:0] | +-----------------------------------------------------------—+ | Next_Desc_Add[31:0] | +-----------------------------------------------------------—+

◆ tls_dma_stop()

unsigned char tls_dma_stop ( unsigned char ch )
参数
[in] ch channel no. to be stopped
返回值
Always STATUS_SUCCESS
注解
If channel stop, DMA_CHNL_CTRL_CHNL_ON bit in DMA_CHNLCTRL_REG is cleared.

◆ tls_dma_wait_complt()

int tls_dma_wait_complt ( unsigned char ch )
参数
[in] ch DMA channel no.[0~7]
返回
None
注解
None


蜂鸟W方案开发指导手册: EFUSE Driver APIs

函数
EFUSE Driver APIs
Driver APIs

EFUSE driver APIs 更多...

函数

int | tls_ft_param_init (void)
This function is used to init ft param. 更多...
int | tls_ft_param_set (unsigned int opnum, void *data, unsigned int len)
This function is used to write ft_param. 更多...
int | tls_ft_param_get (unsigned int opnum, void *data, unsigned int rdlen)
This function is used to read ft_param. 更多...
int | tls_get_mac_addr (u8 *mac)
This function is used to get mac addr 更多...
int | tls_set_mac_addr (u8 *mac)
This function is used to set mac addr 更多...
int | tls_get_bt_mac_addr (u8 *mac)
This function is used to get bluetooth mac addr 更多...
int | tls_set_bt_mac_addr (u8 *mac)
This function is used to set bluetooth mac addr 更多...
int | tls_get_tx_gain (u8 *txgain)
This function is used to get tx gain 更多...
int | tls_set_tx_gain (u8 *txgain)
This function is used to set tx gain 更多...
int | tls_get_tx_lo (u8 *txlo)
This function is used to get tx lod 更多...
int | tls_set_tx_lo (u8 *txlo)
This function is used to set tx lod 更多...
int | tls_get_tx_iq_gain (u8 *txGain)
This function is used to get tx iq gain 更多...
int | tls_set_tx_iq_gain (u8 *txGain)
This function is used to set tx iq gain 更多...
int | tls_get_rx_iq_gain (u8 *rxGain)
This function is used to get rx iq gain 更多...
int | tls_set_rx_iq_gain (u8 *rxGain)
This function is used to get rx iq gain 更多...
int | tls_get_tx_iq_phase (u8 *txPhase)
This function is used to get tx iq phase 更多...
int | tls_set_tx_iq_phase (u8 *txPhase)
This function is used to set tx iq phase 更多...
int | tls_get_rx_iq_phase (u8 *rxPhase)
This function is used to get rx iq phase 更多...
int | tls_set_rx_iq_phase (u8 *rxPhase)
This function is used to set rx iq phase 更多...
int | tls_freq_err_op (u8 *freqerr, u8 flag)
This function is used to set/get freq err 更多...
int | tls_rf_vcg_ctrl_op (u8 *vcg, u8 flag)
This function is used to set/get vcg ctrl 更多...

详细描述

函数说明

◆ tls_freq_err_op()

int tls_freq_err_op | ( | u8 * | freqerr,
 |  | u8 | flag
 | ) |  |
参数
[in] | freqerr
[in] | flag | 1-set 0-get
返回值
TLS_EFUSE_STATUS_OK | set/get success
TLS_EFUSE_STATUS_EIO | set/get failed

◆ tls_ft_param_get()

int tls_ft_param_get | ( | unsigned int | opnum,
 |  | void * | data,
 |  | unsigned int | rdlen
 | ) |  |
参数
[in] | opnum | ft cmd
[in] | data | data pointer
[in] | len | len to read data
返回值
TLS_EFUSE_STATUS_OK | get success
TLS_EFUSE_STATUS_EIO | get failed

◆ tls_ft_param_init()

int tls_ft_param_init ( void )
参数
[in] None
返回值
TRUE | init success
FALSE | init failed

◆ tls_ft_param_set()

int tls_ft_param_set | ( | unsigned int | opnum,
 |  | void * | data,
 |  | unsigned int | len
 | ) |  |
参数
[in] | opnum | ft cmd
[in] | data | data pointer
[in] | len | len to write data
返回值
TLS_EFUSE_STATUS_OK | set success
TLS_EFUSE_STATUS_EIO | set failed

◆ tls_get_bt_mac_addr()

int tls_get_bt_mac_addr ( u8 * mac )
参数
[in] mac mac addr,6 byte
返回值
TLS_EFUSE_STATUS_OK | get success
TLS_EFUSE_STATUS_EIO | get failed

◆ tls_get_mac_addr()

int tls_get_mac_addr ( u8 * mac )
参数
[in] mac mac addr,6 byte
返回值
TLS_EFUSE_STATUS_OK | get success
TLS_EFUSE_STATUS_EIO | get failed

◆ tls_get_rx_iq_gain()

int tls_get_rx_iq_gain ( u8 * rxGain )
参数
[in] rxGain
返回值
TLS_EFUSE_STATUS_OK | get success
TLS_EFUSE_STATUS_EIO | get failed

◆ tls_get_rx_iq_phase()

int tls_get_rx_iq_phase ( u8 * rxPhase )
参数
[in] rxPhase
返回值
TLS_EFUSE_STATUS_OK | get success
TLS_EFUSE_STATUS_EIO | get failed

◆ tls_get_tx_gain()

int tls_get_tx_gain ( u8 * txgain )
参数
[in] txgain tx gain,12 byte
返回值
TLS_EFUSE_STATUS_OK | get success
TLS_EFUSE_STATUS_EIO | get failed

◆ tls_get_tx_iq_gain()

int tls_get_tx_iq_gain ( u8 * txGain )
参数
[in] txGain
返回值
TLS_EFUSE_STATUS_OK | get success
TLS_EFUSE_STATUS_EIO | get failed

◆ tls_get_tx_iq_phase()

int tls_get_tx_iq_phase ( u8 * txPhase )
参数
[in] txPhase
返回值
TLS_EFUSE_STATUS_OK | get success
TLS_EFUSE_STATUS_EIO | get failed

◆ tls_get_tx_lo()

int tls_get_tx_lo ( u8 * txlo )
参数
[in] txlo tx lod
返回值
TLS_EFUSE_STATUS_OK | get success
TLS_EFUSE_STATUS_EIO | get failed

◆ tls_rf_vcg_ctrl_op()

int tls_rf_vcg_ctrl_op | ( | u8 * | vcg,
 |  | u8 | flag
 | ) |  |
参数
[in] | vcg
[in] | flag | 1-set 0-get
返回值
TLS_EFUSE_STATUS_OK | set/get success
TLS_EFUSE_STATUS_EIO | set/get failed

◆ tls_set_bt_mac_addr()

int tls_set_bt_mac_addr ( u8 * mac )
参数
[in] mac mac addr,6 byte
返回值
TLS_EFUSE_STATUS_OK | set success
TLS_EFUSE_STATUS_EIO | set failed

◆ tls_set_mac_addr()

int tls_set_mac_addr ( u8 * mac )
参数
[in] mac mac addr,6 byte
返回值
TLS_EFUSE_STATUS_OK | set success
TLS_EFUSE_STATUS_EIO | set failed

◆ tls_set_rx_iq_gain()

int tls_set_rx_iq_gain ( u8 * rxGain )
参数
[in] rxGain
返回值
TLS_EFUSE_STATUS_OK | set success
TLS_EFUSE_STATUS_EIO | set failed

◆ tls_set_rx_iq_phase()

int tls_set_rx_iq_phase ( u8 * rxPhase )
参数
[in] rxPhase
返回值
TLS_EFUSE_STATUS_OK | set success
TLS_EFUSE_STATUS_EIO | set failed

◆ tls_set_tx_gain()

int tls_set_tx_gain ( u8 * txgain )
参数
[in] txgain tx gain,12 byte
返回值
TLS_EFUSE_STATUS_OK | set success
TLS_EFUSE_STATUS_EIO | set failed

◆ tls_set_tx_iq_gain()

int tls_set_tx_iq_gain ( u8 * txGain )
参数
[in] txGain
返回值
TLS_EFUSE_STATUS_OK | set success
TLS_EFUSE_STATUS_EIO | set failed

◆ tls_set_tx_iq_phase()

int tls_set_tx_iq_phase ( u8 * txPhase )
参数
[in] txPhase
返回值
TLS_EFUSE_STATUS_OK | set success
TLS_EFUSE_STATUS_EIO | set failed

◆ tls_set_tx_lo()

int tls_set_tx_lo ( u8 * txlo )
参数
[in] txlo tx lod
返回值
TLS_EFUSE_STATUS_OK | set success
TLS_EFUSE_STATUS_EIO | set failed


蜂鸟W方案开发指导手册: SPI FLASH Driver APIs

函数
SPI FLASH Driver APIs
Driver APIs

SPI FLASH driver APIs 更多...

函数

int | tls_spifls_init (void)
This function is used to initial flash module structer. 更多...
int | tls_spifls_read (u32 addr, u8 *buf, u32 len)
This function is used to read data from the flash. 更多...
int | tls_spifls_write (u32 addr, u8 *buf, u32 len)
This function is used to write data into the flash. 更多...
int | tls_spifls_erase (u32 sector)
int | tls_spifls_exit (void)

详细描述

函数说明

◆ tls_spifls_init()

int tls_spifls_init ( void )
参数
[in] None
返回值
TLS_FLS_STATUS_OK | if init sucsess
TLS_FLS_STATUS_EBUSY | already inited
TLS_FLS_STATUS_ENOMEM | memory error
注解
None

◆ tls_spifls_read()

int tls_spifls_read | ( | u32 | addr,
 |  | u8 * | buf,
 |  | u32 | len
 | ) |  |
参数
[in] | addr | Specifies the starting address to read from
[in] | buf | Pointer to a byte array that is to be written.
[in] | len | length to read.
返回值
TLS_FLS_STATUS_OK | if read sucsess
TLS_FLS_STATUS_EIO | if read fail
注解
None

◆ tls_spifls_write()

int tls_spifls_write | ( | u32 | addr,
 |  | u8 * | buf,
 |  | u32 | len
 | ) |  |
参数
[in] | addr | Specifies the starting address to write to.
[in] | buf | Pointer to a byte array that holds the data to be written.
[in] | len | length to write.
返回值
TLS_FLS_STATUS_OK | if write flash success
TLS_FLS_STATUS_EPERM | if flash struct point is null
TLS_FLS_STATUS_ENODRV | if flash driver is not installed
TLS_FLS_STATUS_EINVAL | if argument is invalid
TLS_FLS_STATUS_EIO | if io error
注解
None


蜂鸟W方案开发指导手册: GPIO Driver APIs

函数
GPIO Driver APIs
Driver APIs

GPIO driver APIs 更多...

函数

void | tls_gpio_cfg (enum tls_io_name gpio_pin, enum tls_gpio_dir dir, enum tls_gpio_attr attr)
This function is used to config gpio function 更多...
void | tls_gpio_cfg_attr (enum tls_io_name gpio_pin, enum tls_gpio_attr attr)
void | tls_gpio_cfg_dir (enum tls_io_name gpio_pin, enum tls_gpio_dir dir)
u8 | tls_gpio_read (enum tls_io_name gpio_pin)
This function is used to read gpio status 更多...
void | tls_gpio_write (enum tls_io_name gpio_pin, u8 value)
This function is used to modify gpio status 更多...
void | tls_gpio_irq_enable (enum tls_io_name gpio_pin, enum tls_gpio_irq_trig mode)
This function is used to config gpio interrupt 更多...
void | tls_gpio_irq_disable (enum tls_io_name gpio_pin)
This function is used to disable gpio interrupt 更多...
u8 | tls_get_gpio_irq_status (enum tls_io_name gpio_pin)
This function is used to get gpio interrupt status 更多...
u8 | tls_get_gpio_irq_status2 (enum tls_io_name gpio_pin)
void | tls_clr_gpio_irq_status (enum tls_io_name gpio_pin)
This function is used to clear gpio interrupt flag 更多...
void | tls_gpio_isr_register (enum tls_io_name gpio_pin, tls_gpio_irq_callback callback, void *arg)
This function is used to register gpio interrupt 更多...

详细描述

函数说明

◆ tls_clr_gpio_irq_status()

void tls_clr_gpio_irq_status ( enum tls_io_name gpio_pin )
参数
[in] gpio_pin gpio pin num
返回
None
注解
None

◆ tls_get_gpio_irq_status()

u8 tls_get_gpio_irq_status ( enum tls_io_name gpio_pin )
参数
[in] gpio_pin gpio pin num
返回值
0 | no interrupt happened
1 | interrupt happened
注解
None

◆ tls_gpio_cfg()

void tls_gpio_cfg | ( | enum tls_io_name | gpio_pin,
 |  | enum tls_gpio_dir | dir,
 |  | enum tls_gpio_attr | attr
 | ) |  |
参数
[in] | gpio_pin | gpio pin num
[in] | dir | gpio direction
[in] | attr | gpio attribute
返回
None
注解
None

◆ tls_gpio_irq_disable()

void tls_gpio_irq_disable ( enum tls_io_name gpio_pin )
参数
[in] gpio_pin gpio pin num
返回
None
注解
None

◆ tls_gpio_irq_enable()

void tls_gpio_irq_enable | ( | enum tls_io_name | gpio_pin,
 |  | enum tls_gpio_irq_trig | mode
 | ) |  |
参数
[in] | gpio_pin | gpio pin num
[in] | mode | interrupt trigger type
返回
None
注解
None

◆ tls_gpio_isr_register()

void tls_gpio_isr_register | ( | enum tls_io_name | gpio_pin,
 |  | tls_gpio_irq_callback | callback,
 |  | void * | arg
 | ) |  |
参数
[in] | gpio_pin | gpio pin num
[in] | callback | the gpio interrupt call back function
[in] | arg | parammeter for the callback
返回
None
注解
gpio callback function is called in interrupt, so can not operate the critical data in the callback fuuction, recommendation to send messages to other tasks to operate it.

◆ tls_gpio_read()

u8 tls_gpio_read ( enum tls_io_name gpio_pin )
参数
[in] gpio_pin gpio pin num
返回值
0 | power level is low
1 | power level is high
注解
None

◆ tls_gpio_write()

void tls_gpio_write | ( | enum tls_io_name | gpio_pin,
 |  | u8 | value
 | ) |  |
参数
[in] | gpio_pin | gpio pin num
[in] | value | power level 0: low power level 1: high power level
返回
None
注解
None


蜂鸟W方案开发指导手册: IOMUX Driver APIs

函数
IOMUX Driver APIs
Driver APIs

IO Multiplex driver APIs 更多...

函数

void | uni_spi_ck_config (enum tls_io_name io_name)
config the pins used for spi ck 更多...
void | uni_spi_cs_config (enum tls_io_name io_name)
config the pins used for spi cs 更多...
void | uni_spi_di_config (enum tls_io_name io_name)
config the pins used for spi di 更多...
void | uni_spi_do_config (enum tls_io_name io_name)
config the pins used for spi do 更多...
void | uni_uart0_tx_config (enum tls_io_name io_name)
config the pins used for uart0 tx 更多...
void | uni_uart0_rx_config (enum tls_io_name io_name)
config the pins used for uart0 rx 更多...
void | uni_uart1_tx_config (enum tls_io_name io_name)
config the pins used for uart1 tx 更多...
void | uni_uart1_rx_config (enum tls_io_name io_name)
config the pins used for uart1 rx 更多...
void | uni_uart1_rts_config (enum tls_io_name io_name)
config the pins used for uart1 rts 更多...
void | uni_uart1_cts_config (enum tls_io_name io_name)
config the pins used for uart1 cts 更多...
void | uni_uart2_tx_scio_config (enum tls_io_name io_name)
config the pins used for uart2 tx or 7816-io 更多...
void | uni_uart2_rx_config (enum tls_io_name io_name)
config the pins used for uart2 rx 更多...
void | uni_uart2_rts_scclk_config (enum tls_io_name io_name)
config the pins used for uart2 rts or 7816-clk 更多...
void | uni_uart2_cts_config (enum tls_io_name io_name)
config the pins used for uart2 cts 更多...
void | uni_uart3_tx_config (enum tls_io_name io_name)
config the pins used for uart3 tx 更多...
void | uni_uart3_rx_config (enum tls_io_name io_name)
config the pins used for uart3 rx 更多...
void | uni_uart4_tx_config (enum tls_io_name io_name)
config the pins used for uart4 tx 更多...
void | uni_uart4_rx_config (enum tls_io_name io_name)
config the pins used for uart4 rx 更多...
void | uni_i2s_ck_config (enum tls_io_name io_name)
config the pins used for i2s ck 更多...
void | uni_i2s_ws_config (enum tls_io_name io_name)
config the pins used for i2s ws 更多...
void | uni_i2s_do_config (enum tls_io_name io_name)
config the pins used for i2s do 更多...
void | uni_i2s_di_config (enum tls_io_name io_name)
config the pins used for i2s di 更多...
void | uni_i2s_mclk_config (enum tls_io_name io_name)
config the pins used for i2s mclk 更多...
void | uni_i2s_extclk_config (enum tls_io_name io_name)
config the pins used for i2s extclk 更多...
void | uni_i2c_scl_config (enum tls_io_name io_name)
config the pins used for i2c scl 更多...
void | uni_i2c_sda_config (enum tls_io_name io_name)
config the pins used for i2c sda 更多...
void | uni_pwm1_config (enum tls_io_name io_name)
config the pins used for pwm1 更多...
void | uni_pwm2_config (enum tls_io_name io_name)
config the pins used for pwm1 更多...
void | uni_pwm3_config (enum tls_io_name io_name)
config the pins used for pwm3 更多...
void | uni_pwm4_config (enum tls_io_name io_name)
config the pins used for pwm4 更多...
void | uni_pwm5_config (enum tls_io_name io_name)
config the pins used for pwm5 更多...
void | uni_pwmbrk_config (enum tls_io_name io_name)
config the pins used for pwm break 更多...
void | uni_swd_config (bool enable)
config the pins used for swd 更多...
void | uni_adc_config (u8 Channel)
config the pins used for adc 更多...
void | uni_gpio_af_disable (void)
disable all the gpio af 更多...

详细描述

函数说明

◆ uni_adc_config()

void uni_adc_config ( u8 Channel )
参数
Channel the channel that shall be used 0~1: single-ended input 0~1: differential input
返回
None

◆ uni_gpio_af_disable()

void uni_gpio_af_disable ( void )
返回
None
注解
This function must call before anyothers for configure gpio Alternate functions

◆ uni_i2c_scl_config()

void uni_i2c_scl_config ( enum tls_io_name io_name )
参数
io_name config i2c scl pins name UNI_IO_PA_01 UNI_IO_PB_19
返回
None

◆ uni_i2c_sda_config()

void uni_i2c_sda_config ( enum tls_io_name io_name )
参数
io_name config i2c sda pins name UNI_IO_PA_04 UNI_IO_PB_20
返回
None

◆ uni_i2s_ck_config()

void uni_i2s_ck_config ( enum tls_io_name io_name )
参数
io_name config i2s master ck pins name UNI_IO_PA_04
UNI_IO_PB_08
返回
None

◆ uni_i2s_di_config()

void uni_i2s_di_config ( enum tls_io_name io_name )
参数
io_name config i2s slave di pins name UNI_IO_PA_07 UNI_IO_PB_10
返回
None

◆ uni_i2s_do_config()

void uni_i2s_do_config ( enum tls_io_name io_name )
参数
io_name config i2s master do pins name UNI_IO_PA_00 UNI_IO_PB_11
返回
None

◆ uni_i2s_extclk_config()

void uni_i2s_extclk_config ( enum tls_io_name io_name )
参数
io_name config i2s extclk pins name UNI_IO_PA_07
返回
None

◆ uni_i2s_mclk_config()

void uni_i2s_mclk_config ( enum tls_io_name io_name )
参数
io_name config i2s mclk pins name UNI_IO_PA_00
返回
None

◆ uni_i2s_ws_config()

void uni_i2s_ws_config ( enum tls_io_name io_name )
参数
io_name config i2s master ws pins name UNI_IO_PA_01 UNI_IO_PB_09
返回
None

◆ uni_pwm1_config()

void uni_pwm1_config ( enum tls_io_name io_name )
参数
io_name config pwm1 pins name UNI_IO_PA_00 UNI_IO_PB_00 UNI_IO_PB_19
返回
None

◆ uni_pwm2_config()

void uni_pwm2_config ( enum tls_io_name io_name )
参数
io_name config pwm1 pins name UNI_IO_PA_01 UNI_IO_PB_01 UNI_IO_PB_20
返回
None

◆ uni_pwm3_config()

void uni_pwm3_config ( enum tls_io_name io_name )
参数
io_name config pwm3 pins name UNI_IO_PB_02
返回
None

◆ uni_pwm4_config()

void uni_pwm4_config ( enum tls_io_name io_name )
参数
io_name config pwm4 pins name UNI_IO_PB_03
返回
None

◆ uni_pwm5_config()

void uni_pwm5_config ( enum tls_io_name io_name )
参数
io_name config pwm5 pins name UNI_IO_PA_04
返回
None

◆ uni_pwmbrk_config()

void uni_pwmbrk_config ( enum tls_io_name io_name )
参数
io_name config pwm break pins name UNI_IO_PB_08
返回
None

◆ uni_spi_ck_config()

void uni_spi_ck_config ( enum tls_io_name io_name )
参数
io_name config spi ck pins name UNI_IO_PB_01 UNI_IO_PB_02
返回
None

◆ uni_spi_cs_config()

void uni_spi_cs_config ( enum tls_io_name io_name )
参数
io_name config spi cs pins name UNI_IO_PA_00 UNI_IO_PB_04
返回
None

◆ uni_spi_di_config()

void uni_spi_di_config ( enum tls_io_name io_name )
参数
io_name config spi di pins name UNI_IO_PB_00 UNI_IO_PB_03
返回
None

◆ uni_spi_do_config()

void uni_spi_do_config ( enum tls_io_name io_name )
参数
io_name config spi do pins name UNI_IO_PA_07 UNI_IO_PB_05
返回
None

◆ uni_swd_config()

void uni_swd_config ( bool enable )
参数
enable enable or disable chip swd function 1: enable 0: disable
返回
None

◆ uni_uart0_rx_config()

void uni_uart0_rx_config ( enum tls_io_name io_name )
参数
io_name config uart0 rx pins name UNI_IO_PB_20
返回
None

◆ uni_uart0_tx_config()

void uni_uart0_tx_config ( enum tls_io_name io_name )
参数
io_name config uart0 tx pins name UNI_IO_PB_19
返回
None

◆ uni_uart1_cts_config()

void uni_uart1_cts_config ( enum tls_io_name io_name )
参数
io_name config uart1 cts pins name UNI_IO_PB_20
返回
None

◆ uni_uart1_rts_config()

void uni_uart1_rts_config ( enum tls_io_name io_name )
参数
io_name config uart1 rts pins name UNI_IO_PB_19
返回
None

◆ uni_uart1_rx_config()

void uni_uart1_rx_config ( enum tls_io_name io_name )
参数
io_name config uart1 rx pins name UNI_IO_PB_07
返回
None

◆ uni_uart1_tx_config()

void uni_uart1_tx_config ( enum tls_io_name io_name )
参数
io_name config uart1 tx pins name UNI_IO_PB_06
返回
None

◆ uni_uart2_cts_config()

void uni_uart2_cts_config ( enum tls_io_name io_name )
参数
io_name config uart2 cts pins name UNI_IO_PB_05
返回
None

◆ uni_uart2_rts_scclk_config()

void uni_uart2_rts_scclk_config ( enum tls_io_name io_name )
参数
io_name config uart2 rts or 7816-clk pins name UNI_IO_PB_04
返回
None

◆ uni_uart2_rx_config()

void uni_uart2_rx_config ( enum tls_io_name io_name )
参数
io_name config uart2 rx pins name UNI_IO_PB_03
返回
None

◆ uni_uart2_tx_scio_config()

void uni_uart2_tx_scio_config ( enum tls_io_name io_name )
参数
io_name config uart2 tx or 7816-io pins name UNI_IO_PB_02
返回
None

◆ uni_uart3_rx_config()

void uni_uart3_rx_config ( enum tls_io_name io_name )
参数
io_name config uart1 rx pins name UNI_IO_PB_01
返回
None

◆ uni_uart3_tx_config()

void uni_uart3_tx_config ( enum tls_io_name io_name )
参数
io_name config uart1 tx pins name UNI_IO_PB_00
返回
None

◆ uni_uart4_rx_config()

void uni_uart4_rx_config ( enum tls_io_name io_name )
参数
io_name config uart1 rx pins name UNI_IO_PB_05
返回
None

◆ uni_uart4_tx_config()

void uni_uart4_tx_config ( enum tls_io_name io_name )
参数
io_name config uart1 tx pins name UNI_IO_PB_04
返回
None


蜂鸟W方案开发指导手册: MASTER SPI Driver APIs

函数
MASTER SPI Driver APIs
Driver APIs

MASTERSPI driver APIs 更多...

函数

int | tls_spi_init (void)
This function is used to initialize the SPI master driver. 更多...
int | tls_spi_setup (u8 mode, u8 cs_active, u32 fclk)
This function is used to setup the spi controller. 更多...
int | tls_spi_write (const u8 *buf, u32 len)
This function is used to synchronous write data by SPI. 更多...
int | tls_spi_read (u8 *buf, u32 len)
This function is used to synchronously read data from SPI. 更多...
int | tls_spi_read_with_cmd (const u8 *txbuf, u32 n_tx, u8 *rxbuf, u32 n_rx)
This function is used to synchronously write command and then read data from SPI. 更多...
int | tls_spi_write_with_cmd (const u8 *cmd, u32 n_cmd, const u8 *txbuf, u32 n_tx)
This function is used to synchronous write 32bit command then write data from SPI. 更多...
void | tls_spi_trans_type (u8 type)
This function is used to set SPI transfer mode. 更多...

详细描述

函数说明

◆ tls_spi_init()

int tls_spi_init ( void )
参数
[in] None
返回值
TLS_SPI_STATUS_OK | if initialize success
TLS_SPI_STATUS_EBUSY | if SPI is already initialized
TLS_SPI_STATUS_ENOMEM | if malloc SPI memory fail
注解
None

◆ tls_spi_read()

int tls_spi_read | ( | u8 * | buf,
 |  | u32 | len
 | ) |  |
参数
[in] | buf | is the buffer for saving SPI data.
[in] | len | is the data length.
返回值
TLS_SPI_STATUS_OK | if write success.
TLS_SPI_STATUS_EINVAL | if argument is invalid.
TLS_SPI_STATUS_ENOMEM | if there is no enough memory.
TLS_SPI_STATUS_ESHUTDOWN | if SPI driver does not installed.
注解
None

◆ tls_spi_read_with_cmd()

int tls_spi_read_with_cmd | ( | const u8 * | txbuf,
 |  | u32 | n_tx,
 |  | u8 * | rxbuf,
 |  | u32 | n_rx
 | ) |  |
参数
[in] | txbuf | is the write data buffer.
[in] | n_tx | is the write data length.
[in] | rxbuf | is the read data buffer.
[in] | n_rx | is the read data length.
返回值
TLS_SPI_STATUS_OK | if write success.
TLS_SPI_STATUS_EINVAL | if argument is invalid.
TLS_SPI_STATUS_ENOMEM | if there is no enough memory.
TLS_SPI_STATUS_ESHUTDOWN | if SPI driver has not been installed.
注解
None

◆ tls_spi_setup()

int tls_spi_setup | ( | u8 | mode,
 |  | u8 | cs_active,
 |  | u32 | fclk
 | ) |  |
参数
[in] | mode | is CPOL and CPHA type defined in TLS_SPI_MODE_0 to TLS_SPI_MODE_3
[in] | cs_active | is cs mode, defined as TLS_SPI_CS_LOW or TLS_SPI_CS_HIGH
[in] | fclk | is spi clock,the unit is HZ.
返回值
TLS_SPI_STATUS_OK | if setup success
TLS_SPI_STATUS_EMODENOSUPPORT | if mode is not support
TLS_SPI_STATUS_EINVAL | if cs_active is not support
TLS_SPI_STATUS_ECLKNOSUPPORT | if fclk is not support
注解
None

◆ tls_spi_trans_type()

void tls_spi_trans_type ( u8 type )
参数
[in] type is the transfer type. SPI_BYTE_TRANSFER ->byte transfer; SPI_WORD_TRANSFER ->word transfer; SPI_DMA_TRANSFER ->DMA transfer;
返回
None
注解
None

◆ tls_spi_write()

int tls_spi_write | ( | const u8 * | buf,
 |  | u32 | len
 | ) |  |
参数
[in] | buf | data to be sent.
[in] | len | data length.
返回值
TLS_SPI_STATUS_OK | if write success.
TLS_SPI_STATUS_EINVAL | if argument is invalid.
TLS_SPI_STATUS_ENOMEM | if there is no enough memory.
TLS_SPI_STATUS_ESHUTDOWN | if SPI driver does not installed.
注解
None

◆ tls_spi_write_with_cmd()

int tls_spi_write_with_cmd | ( | const u8 * | cmd,
 |  | u32 | n_cmd,
 |  | const u8 * | txbuf,
 |  | u32 | n_tx
 | ) |  |
参数
[in] | cmd | is the command data.
[in] | n_cmd | is the command len,can not bigger than four
[in] | txbuf | is the write data buffer.
[in] | n_tx | is the write data length.
返回值
TLS_SPI_STATUS_OK | if write success.
TLS_SPI_STATUS_EINVAL | if argument is invalid.
TLS_SPI_STATUS_ENOMEM | if there is no enough memory.
TLS_SPI_STATUS_ESHUTDOWN | if SPI driver does not installed.
注解
None


蜂鸟W方案开发指导手册: HSPI Driver APIs

函数
HSPI Driver APIs
Driver APIs

HSPI driver APIs 更多...

函数

int | tls_slave_spi_init (void)
This function is used to initial HSPI register. 更多...
void | tls_set_hspi_user_mode (u8 ifenable)
This function is used to enable or disable user mode. 更多...
void | tls_set_high_speed_interface_type (int type)
This function is used to set high speed interface type. 更多...
void | tls_hspi_rx_cmd_callback_register (s16(*rx_cmd_callback)(char *buf))
This function is used to register hspi rx command interrupt. 更多...
void | tls_hspi_rx_data_callback_register (s16(*rx_data_callback)(char *buf))
This function is used to register hspi rx data interrupt. 更多...
void | tls_hspi_tx_data_callback_register (s16(*tx_data_callback)(char *buf))
This function is used to register hspi tx data interrupt. 更多...
int | tls_hspi_tx_data (char *txbuf, int len)
This function is used to transfer data. 更多...

详细描述

函数说明

◆ tls_hspi_rx_cmd_callback_register()

void tls_hspi_rx_cmd_callback_register ( s16(*)(char *buf) rx_cmd_callback )
参数
[in] rx_cmd_callback is the hspi rx interrupt call back function.
返回
None
注解
None

◆ tls_hspi_rx_data_callback_register()

void tls_hspi_rx_data_callback_register ( s16(*)(char *buf) rx_data_callback )
参数
[in] rx_data_callback is the hspi rx interrupt call back function.
返回
None
注解
None

◆ tls_hspi_tx_data()

int tls_hspi_tx_data | ( | char * | txbuf,
 |  | int | len
 | ) |  |
参数
[in] | txbuf | is a buf for saving user data.
[in] | len | is the data length.
返回值
transfer | data len success
0 | failed
注解
None

◆ tls_hspi_tx_data_callback_register()

void tls_hspi_tx_data_callback_register ( s16(*)(char *buf) tx_data_callback )
参数
[in] tx_data_callback is the hspi tx interrupt call back function.
返回
None
注解
None

◆ tls_set_high_speed_interface_type()

void tls_set_high_speed_interface_type ( int type )
参数
[in] type is the interface type. HSPI_INTERFACE_SPI or HSPI_INTERFACE_SDIO
返回
None
注解
None

◆ tls_set_hspi_user_mode()

void tls_set_hspi_user_mode ( u8 ifenable )
参数
[in] ifenable TRUE or FALSE
返回
None
注解
If the user enables the user mode, RICM instruction in the system will not be used by SPI. If the user wants to use the SPI interface as other use, need to enable the user mode. This function must be called before the register function.

◆ tls_slave_spi_init()

int tls_slave_spi_init ( void )
参数
[in] None
返回值
0 | success
other | failed
注解
When the system is initialized, the function has been called, so users can not call this function.


蜂鸟W方案开发指导手册: I2C Driver APIs

宏定义 | 函数
I2C Driver APIs
Driver APIs

I2C driver APIs 更多...

宏定义

#define uni_i2c_int_mask(bl) do { tls_bitband_write(HR_I2C_CTRL, 6, bl);}while(0);

函数

void | tls_i2c_init (u32 freq)
Init the I2C module 更多...
void | tls_i2c_stop (void)
send stop signal 更多...
int | tls_i2c_wait_ack (void)
Waiting for ack signal 更多...
void | tls_i2c_write_byte (u8 data, u8 ifstart)
Writes the data to data register of I2C module when ifstart one the start signal will be sent followed by the data when ifstart zero only the data will be send 更多...
u8 | tls_i2c_read_byte (u8 ifack, u8 ifstop)
Get the data stored in data register of I2C module 更多...
void | uni_i2c_transfer_done_register (void(*done)(void))
This function is used to register i2c transfer done callback function. 更多...
int | uni_i2c_start_write_it (uint8_t devaddr, uint8_t wordaddr, uint8_t *buf, uint16_t len)
Start writing through int mode 更多...
int | uni_i2c_start_read_it (uint8_t devaddr, uint8_t wordaddr, uint8_t *buf, uint16_t len)
Get the data stored in data register of I2C module 更多...

详细描述

宏定义说明

◆ uni_i2c_int_mask

#define uni_i2c_int_mask ( bl ) do { tls_bitband_write(HR_I2C_CTRL, 6, bl);}while(0);

I2C initialization mask

函数说明

◆ tls_i2c_init()

void tls_i2c_init ( u32 freq )
参数
freq I2C reference clock frequency in Hz that will be used
注解
the value must be between 100k and 400k

◆ tls_i2c_read_byte()

u8 tls_i2c_read_byte | ( | u8 | ifack,
 |  | u8 | ifstop
 | ) |  |
参数
[in] | ifack | when one send ack after reading the data register,when zero don't
[in] | ifstop | when one send stop signal after read, when zero do not send stop
返回值
the received data

◆ tls_i2c_stop()

void tls_i2c_stop ( void )

◆ tls_i2c_wait_ack()

int tls_i2c_wait_ack ( void )
返回值
- UNI_FAILED
  • UNI_SUCCESS

◆ tls_i2c_write_byte()

void tls_i2c_write_byte | ( | u8 | data,
 |  | u8 | ifstart
 | ) |  |
参数
[in] | data | the data will be write to the data register of I2C module
[in] | ifstart | when one send start signal, when zero don't
返回值

◆ uni_i2c_start_read_it()

int uni_i2c_start_read_it | ( | uint8_t | devaddr,
 |  | uint8_t | wordaddr,
 |  | uint8_t * | buf,
 |  | uint16_t | len
 | ) |  |
参数
[in] | ifack | when one send ack after reading the data register,when zero don't
[in] | ifstop | when one send stop signal after read, when zero do not send stop
返回值
the received data

◆ uni_i2c_start_write_it()

int uni_i2c_start_write_it | ( | uint8_t | devaddr,
 |  | uint8_t | wordaddr,
 |  | uint8_t * | buf,
 |  | uint16_t | len
 | ) |  |
参数
[in] | devaddr | the device address
[in] | wordaddr | when one send stop signal after read, when zero do not send stop
[in] | buf | the address point where data shoule be stored
[in] | len | the length of data will be received
返回值
- UNI_FAILED
  • UNI_SUCCESS

◆ uni_i2c_transfer_done_register()

void uni_i2c_transfer_done_register ( void(*)(void) done )
参数
[in] done is the i2c transfer done callback function.
返回值
None
注解
None


蜂鸟W方案开发指导手册: I2S Driver APIs

函数
I2S Driver APIs
Driver APIs

I2S driver APIs 更多...

函数

void | uni_i2s_register_callback (tls_i2s_callback callback)
Register a callback function 更多...
int | uni_i2s_port_init (I2S_InitDef *opts)
Initializes the I2S according to the specified parameters in the I2S_InitDef. 更多...
void | uni_i2s_tx_rx_stop (void)
stop i2s module 更多...
int | uni_i2s_tx_int (int16_t *data, uint16_t len, int16_t *next_data)
Transmit an amount of data in blocking mode with Interrupt 更多...
int | uni_i2s_tx_dma (int16_t *data, uint16_t len, int16_t *next_data)
Transmit an amount of data in blocking mode with DMA's normal mode 更多...
int | uni_i2s_tx_dma_link (int16_t *data, uint16_t len, int16_t *next_data)
Transmit an amount of data in blocking mode with DMA's link mode 更多...
int | uni_i2s_rx_int (int16_t *data, uint16_t len)
Receive an amount of data in blocking mode with Interrupt 更多...
int | uni_i2s_rx_dma (int16_t *data, uint16_t len)
Receive an amount of data in blocking mode with DMA 更多...
int | uni_i2s_tx_rx_int (I2S_InitDef *opts, int16_t *data_tx, int16_t *data_rx, uint16_t len)
Full-Duplex Transmit/Receive data in blocking mode using Interrupt 更多...
int | uni_i2s_tx_rx_dma (I2S_InitDef *opts, int16_t *data_tx, int16_t *data_rx, uint16_t len)
Full-Duplex Transmit/Receive data in blocking mode using DMA 更多...
int | uni_i2s_transmit_dma (uni_dma_handler_type *hdma, uint16_t *data, uint16_t len)
int | uni_i2s_receive_dma (uni_dma_handler_type *hdma, uint16_t *data, uint16_t len)
void | uni_i2s_set_format (uint32_t format)
void | uni_i2s_set_word_len (uint8_t len)
void | uni_i2s_set_freq (uint32_t lr_freq, uint32_t mclk)
void | uni_i2s_left_channel_sel (bool bl)
void | uni_i2s_mono_select (bool bl)
void | uni_i2s_enable (bool bl)
void | uni_i2s_set_mode (bool bl)
void | uni_i2s_tx_enable (bool bl)
void | uni_i2s_tx_dma_enable (bool bl)
void | uni_i2s_rx_enable (bool bl)
void | uni_i2s_rx_dma_enable (bool bl)
void | uni_i2s_module_reset (void)
void | uni_i2s_int_clear_all (void)
void | uni_i2s_int_mask_all (void)
void | uni_i2s_set_txth (uint8_t th)
void | uni_i2s_set_rxth (uint8_t th)
void | uni_i2s_rx_fifo_clear ()
void | uni_i2s_tx_fifo_clear ()

详细描述

函数说明

◆ uni_i2s_port_init()

int uni_i2s_port_init ( I2S_InitDef * opts )
参数
opts pointer to a I2S_InitDef structure that contains the configuration information for I2S module
返回值
status

◆ uni_i2s_register_callback()

void uni_i2s_register_callback ( tls_i2s_callback callback )
参数
callback | pointer to a callback function in which you can prepare the next buffer
callback->data | pointer to data buffer to be prepared
callback->len | size of the data buffer to be prepared in 32-bit
注解
The registerred callback function will be called as long as the transmission begins
返回值
none

◆ uni_i2s_rx_dma()

int uni_i2s_rx_dma | ( | int16_t * | data,
 |  | uint16_t | len
 | ) |  |
参数
data | a 16-bit pointer to the Receive data buffer.
len | number of data sample to be received:
注解
the len parameter means the number of 16-bit data length.
The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).
This function will block its task until the transmission is over,so perpare the next data buffer at another task during this interval.
返回值
status

◆ uni_i2s_rx_int()

int uni_i2s_rx_int | ( | int16_t * | data,
 |  | uint16_t | len
 | ) |  |
参数
data | a 16-bit pointer to the Receive data buffer.
len | number of data sample to be received:
注解
the len parameter means the number of 16-bit data length.
The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).
This function will block its task until the transmission is over,so perpare the next data buffer at another task during this interval.
返回值
status

◆ uni_i2s_tx_dma()

int uni_i2s_tx_dma | ( | int16_t * | data,
 |  | uint16_t | len,
 |  | int16_t * | next_data
 | ) |  |
参数
data | a 16-bit pointer to data buffer.
len | number of data sample to be sent:
next_data | a 16-bit pointer to the next data buffer, same size with data; set to NULL if it's not needed
注解
the len parameter means the number of 32-bit data length.
The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).
This function will block its task until the transmission is over,so perpare the next data buffer at another task during this interval.
This function will call the registerred callback function as long as the transmission begins
返回值
status

◆ uni_i2s_tx_dma_link()

int uni_i2s_tx_dma_link | ( | int16_t * | data,
 |  | uint16_t | len,
 |  | int16_t * | next_data
 | ) |  |
参数
data | a 16-bit pointer to data buffer.
len | number of data sample to be sent:
next_data | a 16-bit pointer to the next data buffer, same size with data:
注解
the len parameter means the number of 32-bit data length.
The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).
This function will block its task until the transmission is over,so perpare the next data buffer at another task during this interval.Set len to 0xffff will exit this rountine.
This function will call the registerred callback function as long as the data or next_data is sent out.So prepare it in the callback.
See the demo for detail use.
返回值
status

◆ uni_i2s_tx_int()

int uni_i2s_tx_int | ( | int16_t * | data,
 |  | uint16_t | len,
 |  | int16_t * | next_data
 | ) |  |
参数
data | a 16-bit pointer to data buffer.
len | number of data sample to be sent:
next_data | a 16-bit pointer to the next data buffer, same size with data; set to NULL if it's not needed
注解
the len parameter means the number of 16-bit data length.
The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).
This function will block its task until the transmission is over,so perpare the next data buffer at another task during this interval.
This function will call the registerred callback function as long as the transmission begins
返回值
status

◆ uni_i2s_tx_rx_dma()

int uni_i2s_tx_rx_dma | ( | I2S_InitDef * | opts,
 |  | int16_t * | data_tx,
 |  | int16_t * | data_rx,
 |  | uint16_t | len
 | ) |  |
参数
opts | pointer to a I2S_InitDef structure that contains the configuration information for I2S module
data_tx | a 16-bit pointer to the Transmit data buffer.
data_rx | a 16-bit pointer to the Receive data buffer.
len | number of data sample to be sent:
注解
the len parameter means the number of 16-bit data length.
The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).
This function will block its task until the transmission is over,so perpare the next data buffer at another task during this interval.
返回值
status

◆ uni_i2s_tx_rx_int()

int uni_i2s_tx_rx_int | ( | I2S_InitDef * | opts,
 |  | int16_t * | data_tx,
 |  | int16_t * | data_rx,
 |  | uint16_t | len
 | ) |  |
参数
opts | pointer to a I2S_InitDef structure that contains the configuration information for I2S module
data_tx | a 16-bit pointer to the Transmit data buffer.
data_rx | a 16-bit pointer to the Receive data buffer.
len | number of data sample to be sent:
注解
the len parameter means the number of 16-bit data length.
The I2S is kept enabled at the end of transaction to avoid the clock de-synchronization between Master and Slave(example: audio streaming).
This function will block its task until the transmission is over,so perpare the next data buffer at another task during this interval.
返回值
status

◆ uni_i2s_tx_rx_stop()

void uni_i2s_tx_rx_stop ( void )
返回值
none


蜂鸟W方案开发指导手册: INNER FLASH Driver APIs

枚举值 | 函数 | 变量
INNER FLASH Driver APIs
Driver APIs

INNER FLASH driver APIs 更多...

函数

int | tls_flash_unlock (void)
This function is used to unlock flash protect area [0x0~0x2000]. 更多...
int | tls_flash_lock (void)
This function is used to lock flash protect area [0x0~0x2000]. 更多...
void | tls_fls_sem_lock (void)
This function is used to get the flash semaphore. 更多...
void | tls_fls_sem_unlock (void)
This function is used to release the flash semaphore. 更多...
int | tls_fls_init (void)
This function is used to initial flash module structer. 更多...
int | tls_fls_read (u32 addr, u8 *buf, u32 len)
This function is used to read data from the flash. 更多...
int | tls_fls_write (u32 addr, u8 *buf, u32 len)
This function is used to write data into the flash. 更多...
int | tls_fls_write_without_erase (u32 addr, u8 *buf, u32 len)
int | tls_fls_erase (u32 sector)
This function is used to erase the appointed sector 更多...
void | tls_fls_sys_param_postion_init (void)
This function is used to initialize system parameter postion by flash density 更多...

变量

uint32_t FLASH_ENCRYPT_CTRL_Type::encrypt_en: 1
uint32_t FLASH_ENCRYPT_CTRL_Type::code_decrypt:1
uint32_t FLASH_ENCRYPT_CTRL_Type::key_ready: 1
uint32_t FLASH_ENCRYPT_CTRL_Type::data_decrypt:1
uint32_t FLASH_ENCRYPT_CTRL_Type::key_sel: 1
uint32_t FLASH_ENCRYPT_CTRL_Type::_reserved0: 27
struct {
uint32_t FLASH_ENCRYPT_CTRL_Type::encrypt_en: 1
uint32_t FLASH_ENCRYPT_CTRL_Type::code_decrypt:1
uint32_t FLASH_ENCRYPT_CTRL_Type::key_ready: 1
uint32_t FLASH_ENCRYPT_CTRL_Type::data_decrypt:1
uint32_t FLASH_ENCRYPT_CTRL_Type::key_sel: 1
uint32_t FLASH_ENCRYPT_CTRL_Type::_reserved0: 27
} FLASH_ENCRYPT_CTRL_Type::b
uint32_t | FLASH_ENCRYPT_CTRL_Type::w
vu32 | FLASH_TypeDef::ACR
vu32 | FLASH_TypeDef::KEYR
vu32 | FLASH_TypeDef::SR
vu32 | FLASH_TypeDef::CR
vu32 | FLASH_TypeDef::AR
tls_os_sem_t * | tls_inside_fls::fls_lock

详细描述

函数说明

◆ tls_flash_lock()

int tls_flash_lock ( void )
参数
None
返回
None
注解
None

◆ tls_flash_unlock()

int tls_flash_unlock ( void )
参数
None
返回
None
注解
None

◆ tls_fls_erase()

int tls_fls_erase ( u32 sector )
参数
[in] sector sector num of the flash, 4K bytes every sector
返回值
TLS_FLS_STATUS_OK | if read sucsess
other | if read fail
注解
None

◆ tls_fls_init()

int tls_fls_init ( void )
参数
[in] None
返回值
TLS_FLS_STATUS_OK | if init sucsess
TLS_FLS_STATUS_EBUSY | already inited
TLS_FLS_STATUS_ENOMEM | memory error
注解
None

◆ tls_fls_read()

int tls_fls_read | ( | u32 | addr,
 |  | u8 * | buf,
 |  | u32 | len
 | ) |  |
参数
[in] | addr | Specifies the starting address to read from.
[in] | buf | Specified the address to save the readback data.
[in] | len | Specifies the length of the data to read.
返回值
TLS_FLS_STATUS_OK | if read sucsess
TLS_FLS_STATUS_EIO | if read fail
注解
None

◆ tls_fls_sem_lock()

void tls_fls_sem_lock ( void )
参数
None
返回
None
注解
None

◆ tls_fls_sem_unlock()

void tls_fls_sem_unlock ( void )
参数
None
返回
None
注解
None

◆ tls_fls_sys_param_postion_init()

void tls_fls_sys_param_postion_init ( void )
参数
None
返回值
None
注解
must be called before tls_param_init

◆ tls_fls_write()

int tls_fls_write | ( | u32 | addr,
 |  | u8 * | buf,
 |  | u32 | len
 | ) |  |
参数
[in] | addr | Specifies the starting address to write to
[in] | buf | Pointer to a byte array that is to be written
[in] | len | Specifies the length of the data to be written
返回值
TLS_FLS_STATUS_OK | if write flash success
TLS_FLS_STATUS_EPERM | if flash struct point is null
TLS_FLS_STATUS_ENODRV | if flash driver is not installed
TLS_FLS_STATUS_EINVAL | if argument is invalid
TLS_FLS_STATUS_EIO | if io error
注解
None

变量说明

◆ _reserved0 [1/2]

uint32_t FLASH_ENCRYPT_CTRL_Type::_reserved0

bit: 5.. 31 Reserved

◆ _reserved0 [2/2]

uint32_t { ... } ::_reserved0

bit: 5.. 31 Reserved

◆ ACR

vu32 FLASH_TypeDef::ACR

offset 0x000

◆ AR

vu32 FLASH_TypeDef::AR

offset 0x010

◆ b

struct { ... } FLASH_ENCRYPT_CTRL_Type::b

Structure Access by bit

◆ code_decrypt [1/2]

uint32_t FLASH_ENCRYPT_CTRL_Type::code_decrypt

bit: 1 read code from AHB decrypt flag

◆ code_decrypt [2/2]

uint32_t { ... } ::code_decrypt

bit: 1 read code from AHB decrypt flag

◆ CR

vu32 FLASH_TypeDef::CR

offset 0x00C

◆ data_decrypt [1/2]

uint32_t { ... } ::data_decrypt

bit: 3 read data from AHB or flash controller decrypt flag

◆ data_decrypt [2/2]

uint32_t FLASH_ENCRYPT_CTRL_Type::data_decrypt

bit: 3 read data from AHB or flash controller decrypt flag

◆ encrypt_en [1/2]

uint32_t { ... } ::encrypt_en

bit: 0 write encrypt flag

◆ encrypt_en [2/2]

uint32_t FLASH_ENCRYPT_CTRL_Type::encrypt_en

bit: 0 write encrypt flag

◆ key_ready [1/2]

uint32_t FLASH_ENCRYPT_CTRL_Type::key_ready

bit: 2 RO key ready flag

◆ key_ready [2/2]

uint32_t { ... } ::key_ready

bit: 2 RO key ready flag

◆ key_sel [1/2]

uint32_t { ... } ::key_sel

bit: 4 key sel flag

◆ key_sel [2/2]

uint32_t FLASH_ENCRYPT_CTRL_Type::key_sel

bit: 4 key sel flag

◆ KEYR

vu32 FLASH_TypeDef::KEYR

offset 0x004

◆ SR

vu32 FLASH_TypeDef::SR

offset 0x008

◆ w

uint32_t FLASH_ENCRYPT_CTRL_Type::w

Type Access by whole register


蜂鸟W方案开发指导手册: IRQ Driver APIs

函数
IRQ Driver APIs
Driver APIs

IRQ driver APIs 更多...

函数

void | tls_irq_init (void)
This function is used to initial system interrupt. 更多...
void | tls_irq_register_handler (u8 vec_no, intr_handler_func handler, void *data)
This function is used to register interrupt handler function. 更多...
void | tls_irq_unregister_handler (u8 vec_no)
void | tls_irq_enable (u8 vec_no)
This function is used to enable interrupt. 更多...
void | tls_irq_disable (u8 vec_no)
This function is used to disable interrupt. 更多...
u8 | tls_get_isr_count (void)
This function is used to get the isr count. 更多...

详细描述

函数说明

◆ tls_get_isr_count()

u8 tls_get_isr_count ( void )
参数
[in] None
返回值
count
注解
None

◆ tls_irq_disable()

void tls_irq_disable ( u8 vec_no )
参数
[in] vec_no interrupt NO
返回
None
注解
None

◆ tls_irq_enable()

void tls_irq_enable ( u8 vec_no )
参数
[in] vec_no interrupt NO
返回
None
注解
None

◆ tls_irq_init()

void tls_irq_init ( void )
参数
[in] None
返回
None
注解
None

◆ tls_irq_register_handler()

void tls_irq_register_handler | ( | u8 | vec_no,
 |  | intr_handler_func | handler,
 |  | void * | data
 | ) |  |
参数
[in] | vec_no | interrupt NO
[in] | handler
[in] | *data
返回
None
注解
None


蜂鸟W方案开发指导手册: LCD Driver APIs

宏定义 | 函数
LCD Driver APIs
Driver APIs

LCD driver APIs 更多...

宏定义

#define | TLS_LCD_CLK_ENABLE(enable)
Enable or disable clock of LCD module 更多...
#define | TLS_LCD_ENABLE(enable)
Enable or disable the LCD module 更多...
#define | TLS_LCD_POWERDOWM(enable)
Enable or disable the LCD module 更多...

函数

void | tls_lcd_fresh_ratio (uint8_t com_num, uint16_t freq)
Initialize LCD Frame Counter 更多...
void | tls_lcd_init (tls_lcd_options_t *opts)
initialize the LCD module 更多...
void | tls_lcd_fresh_rate (uint16_t freq)
Initialize LCD Frame Counter 更多...
void | tls_lcd_seg_set (int com, int bit, int on_off)
Turn on or clear a segment 更多...
void | tls_lcd_vlcd_sel (LCD_VlcdDef vlcd)
Select the voltage of LCD module 更多...
void | tls_lcd_duty_set (LCD_DutyDef duty)
Set the duty of LCD module 更多...
void | tls_lcd_bias_set (LCD_BiasDef bias)
Set the bias of LCD module 更多...

详细描述

宏定义说明

◆ TLS_LCD_CLK_ENABLE

#define TLS_LCD_CLK_ENABLE ( enable )
值:
do { \
tls_bitband_write(HR_CLK_BASE_ADDR, HR_CLK_LCD_GATE_Pos, enable); \
} while(0)
参数
[in] enable When one enable the clock of LCD module, when zero disable

◆ TLS_LCD_ENABLE

#define TLS_LCD_ENABLE ( enable )
值:
do { \
tls_bitband_write(HR_LCD_CR, LCD_CR_EN_Pos, enable); \
} while(0)
参数
[in] enable When one enable the LCD module, when zero disable

◆ TLS_LCD_POWERDOWM

#define TLS_LCD_POWERDOWM ( enable )
值:
do { \
tls_bitband_write(HR_LCD_CR, LCD_CR_PD_Pos, enable); \
} while(0)
参数
[in] enable When one close LCD module, when zero open the LCD module

函数说明

◆ tls_lcd_bias_set()

void tls_lcd_bias_set ( LCD_BiasDef bias )
参数
[in] duty This parameter can be one of the following values:
  • BIAS_STATIC
  • BIAS_ONEHALF
  • BIAS_ONETHIRD
  • BIAS_ONEFOURTH

◆ tls_lcd_duty_set()

void tls_lcd_duty_set ( LCD_DutyDef duty )
参数
[in] duty This parameter can be one of the following values:
  • DUTY_STATIC
  • DUTY_ONEHALF
  • DUTY_ONETHIRD
  • DUTY_ONEFOURTH
  • DUTY_ONEFIFTH
  • DUTY_ONESIXTH
  • DUTY_ONESEVENTH
  • DUTY_ONEEIGHTH

◆ tls_lcd_fresh_rate()

void tls_lcd_fresh_rate ( uint16_t freq )
参数
[in] freq LCD reference refresh frequency in Hz that will be used

◆ tls_lcd_fresh_ratio()

void tls_lcd_fresh_ratio | ( | uint8_t | com_num,
 |  | uint16_t | freq
 | ) |  |
参数
[in] | com_num | Number of the com
[in] | freq | LCD reference refresh frequency in Hz that will be used

◆ tls_lcd_init()

void tls_lcd_init ( tls_lcd_options_t * opts )

◆ tls_lcd_seg_set()

void tls_lcd_seg_set | ( | int | com,
 |  | int | bit,
 |  | int | on_off
 | ) |  |
参数
[in] | com | Which COM line to update
[in] | bit | Bit index of which field to change
[in] | enable | When one will set segment, when zero will clear segment
注解
Before this function be called, the module must have been intialized

◆ tls_lcd_vlcd_sel()

void tls_lcd_vlcd_sel ( LCD_VlcdDef vlcd )
参数
[in] vlcd This parameter can be one of the following values:
  • VLCD27
  • VLCD29
  • VLCD31
  • VLCD33


蜂鸟W方案开发指导手册: PMU Driver APIs

函数
PMU Driver APIs
Driver APIs

PMU driver APIs 更多...

函数

void | tls_pmu_timer1_isr_register (tls_pmu_irq_callback callback, void *arg)
This function is used to register pmu timer1 interrupt 更多...
void | tls_pmu_timer0_isr_register (tls_pmu_irq_callback callback, void *arg)
This function is used to register pmu timer0 interrupt 更多...
void | tls_pmu_gpio_isr_register (tls_pmu_irq_callback callback, void *arg)
This function is used to register pmu gpio interrupt 更多...
void | tls_pmu_sdio_isr_register (tls_pmu_irq_callback callback, void *arg)
This function is used to register pmu sdio interrupt 更多...
void | tls_pmu_clk_select (u8 bypass)
This function is used to select pmu clk 更多...
void | tls_pmu_timer0_start (u16 second)
This function is used to start pmu timer0 更多...
void | tls_pmu_timer0_stop (void)
This function is used to stop pmu timer0 更多...
void | tls_pmu_timer1_start (u16 msec)
This function is used to start pmu timer1 更多...
void | tls_pmu_timer1_stop (void)
This function is used to stop pmu timer1 更多...
void | tls_pmu_standby_start (void)
This function is used to start pmu goto standby 更多...
void | tls_pmu_sleep_start (void)
This function is used to start pmu goto sleep 更多...
void | tls_close_peripheral_clock (tls_peripheral_type_s devices)
This function is used to close peripheral's clock 更多...
void | tls_open_peripheral_clock (tls_peripheral_type_s devices)
This function is used to open peripheral's clock 更多...

详细描述

函数说明

◆ tls_close_peripheral_clock()

void tls_close_peripheral_clock ( tls_peripheral_type_s devices )
参数
[in] devices peripherals
返回
None
注解
None

◆ tls_open_peripheral_clock()

void tls_open_peripheral_clock ( tls_peripheral_type_s devices )
参数
[in] devices peripherals
返回
None
注解
None

◆ tls_pmu_clk_select()

void tls_pmu_clk_select ( u8 bypass )
参数
[in] bypass pmu clk whether or not use bypass mode 1 pmu clk use 32K by 40MHZ other pmu clk 32K by calibration circuit
返回
None
注解
None

◆ tls_pmu_gpio_isr_register()

void tls_pmu_gpio_isr_register | ( | tls_pmu_irq_callback | callback,
 |  | void * | arg
 | ) |  |
参数
[in] | callback | the pmu gpio interrupt call back function
[in] | arg | parameter of call back function
返回
None
注解
user not need clear interrupt flag. pmu gpio callback function is called in interrupt, so can not operate the critical data in the callback fuuction, recommendation to send messages to other tasks to operate it.

◆ tls_pmu_sdio_isr_register()

void tls_pmu_sdio_isr_register | ( | tls_pmu_irq_callback | callback,
 |  | void * | arg
 | ) |  |
参数
[in] | callback | the pmu sdio interrupt call back function
[in] | arg | parameter of call back function
返回
None
注解
user not need clear interrupt flag. pmu sdio callback function is called in interrupt, so can not operate the critical data in the callback fuuction, recommendation to send messages to other tasks to operate it.

◆ tls_pmu_sleep_start()

void tls_pmu_sleep_start ( void )
参数
None
返回
None
注解
None

◆ tls_pmu_standby_start()

void tls_pmu_standby_start ( void )
参数
None
返回
None
注解
None

◆ tls_pmu_timer0_isr_register()

void tls_pmu_timer0_isr_register | ( | tls_pmu_irq_callback | callback,
 |  | void * | arg
 | ) |  |
参数
[in] | callback | the pmu timer0 interrupt call back function
[in] | arg | parameter of call back function
返回
None
注解
user not need clear interrupt flag. pmu timer0 callback function is called in interrupt, so can not operate the critical data in the callback fuuction, recommendation to send messages to other tasks to operate it.

◆ tls_pmu_timer0_start()

void tls_pmu_timer0_start ( u16 second )
参数
[in] second vlaue of timer0 count[s]
返回
None
注解
None

◆ tls_pmu_timer0_stop()

void tls_pmu_timer0_stop ( void )
参数
None
返回
None
注解
None

◆ tls_pmu_timer1_isr_register()

void tls_pmu_timer1_isr_register | ( | tls_pmu_irq_callback | callback,
 |  | void * | arg
 | ) |  |
参数
[in] | callback | the pmu timer1 interrupt call back function
[in] | arg | parameter of call back function
返回
None
注解
user not need clear interrupt flag. pmu timer1 callback function is called in interrupt, so can not operate the critical data in the callback fuuction, recommendation to send messages to other tasks to operate it.

◆ tls_pmu_timer1_start()

void tls_pmu_timer1_start ( u16 msec )
参数
[in] second vlaue of timer1 count[ms]
返回
None
注解
None

◆ tls_pmu_timer1_stop()

void tls_pmu_timer1_stop ( void )
参数
None
返回
None
注解
None


蜂鸟W方案开发指导手册: PSRAM Driver APIs

函数
PSRAM Driver APIs
Driver APIs

PSRAM driver APIs 更多...

函数

void | psram_init (psram_mode_t mode)
This function is used to init the psram . 更多...
int | memcpy_dma (unsigned char *dst, unsigned char *src, int num)
This function is used to Copy block of memory in dma mode . 更多...

详细描述

函数说明

◆ memcpy_dma()

int memcpy_dma | ( | unsigned char * | dst,
 |  | unsigned char * | src,
 |  | int | num
 | ) |  |
参数
[in] | src | Pointer to the source of data to be copied
[in] | dst | Pointer to the destination array where the content is to be copied
[in] | num | Number of bytes to copy
返回值
num Number of bytes that's been copied
注解
None

◆ psram_init()

void psram_init ( psram_mode_t mode )
参数
[in] mode is work mode, PSRAM_SPI or PSRAM_QPI
返回值
none
注解
None


蜂鸟W方案开发指导手册: PWM Driver APIs

函数
PWM Driver APIs
Driver APIs

PWM driver APIs 更多...

函数

void | tls_pwm_isr_register (u8 channel, pwm_irq_callback callback, void *arg)
This function is used to register the pwm interrupt callback function 更多...
int | tls_pwm_duty_config (u8 channel, u8 duty)
This function is used to set duty radio 更多...
int | tls_pwm_freq_config (u8 channel, u16 clkdiv, u8 period)
This function is used to set frequency 更多...
int | tls_pwm_out_mode_config (u8 channel, enum tls_pwm_out_mode mode)
This function is used to set the output mode 更多...
int | tls_pwm_cnt_type_config (u8 channel, enum tls_pwm_cnt_type cnt_type)
This function is used to set the counting mode 更多...
int | tls_pwm_loop_mode_config (u8 channel, enum tls_pwm_loop_type loop_mode)
This function is used to set whether to loop 更多...
int | tls_pwm_out_inverse_cmd (u8 channel, bool en)
This function is used to set whether to inverse the output 更多...
int | tls_pwm_stoptime_by_period_config (u8 channel, u8 pnum)
This function is used to set the number of period to be generated 更多...
int | tls_pwm_output_en_cmd (u8 channel, bool en)
This function is used to set output enable 更多...
int | tls_pwm_deadzone_config (u8 channel, bool dten, u8 dtclkdiv, u8 dtcnt)
This function is used to set the dead time 更多...
int | tls_pwm_capture_inverse_cmd (u8 channel, bool en)
This function is used to set whether to inverse the capture input 更多...
int | tls_pwm_brake_mode_config (u8 channel, bool en, enum tls_pwm_brake_out_level brok)
This function is used to set break mode 更多...
int | tls_pwm_capture_mode_config (u8 channel)
This function is used to enable the capture mode 更多...
int | tls_pwm_stoptime_irq_cmd (u8 channel, bool en)
This function is used to set the interrupt about the number of period 更多...
int | tls_pwm_capture_irq_type_config (u8 channel, enum tls_pwm_cap_int_type int_type)
This function is used to set the interrupt about the capture 更多...
int | tls_pwm_out_init (pwm_init_param *pwm_param)
This function is used to initial pwm(out mode) 更多...
int | tls_pwm_cap_init (u8 channel, u16 clkdiv, bool inverse_en, enum tls_pwm_cap_int_type int_type)
This function is used to initial pwm(capture mode) 更多...
int | tls_pwm_start (u8 channel)
This function is used to start pwm 更多...
void | tls_pwm_freq_set (u8 channel, u32 freq)
This function is used to stop pwm 更多...
void | tls_pwm_duty_set (u8 channel, u8 duty)
This function is used to set duty radio 更多...
int | tls_pwm_init (u8 channel, u32 freq, u8 duty, u8 pnum)
This function is used to initial pwm 更多...
int | tls_pwm_stop (u8 channel)
This function is used to stop pwm 更多...
u16 | tls_pwm_get_clkdiv (u8 channel)

详细描述

函数说明

◆ tls_pwm_brake_mode_config()

int tls_pwm_brake_mode_config | ( | u8 | channel,
 |  | bool | en,
 |  | enum tls_pwm_brake_out_level | brok
 | ) |  |
参数
[in] | channel | pwm channel NO.,channel 0 or channel 4
[in] | en | whether enable the break mode,ENABLE or DISABLE
[in] | brok | when break
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_cap_init()

int tls_pwm_cap_init | ( | u8 | channel,
 |  | u16 | clkdiv,
 |  | bool | inverse_en,
 |  | enum tls_pwm_cap_int_type | int_type
 | ) |  |
参数
[in] | channel | pwm channel, channel 0 or channel 4
[in] | clkdiv | clock divider, range 0 to 65535
[in] | inverse_en | whether the input signal is reversed
[in] | int_type | interrupt type
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_capture_inverse_cmd()

int tls_pwm_capture_inverse_cmd | ( | u8 | channel,
 |  | bool | en
 | ) |  |
参数
[in] | channel | pwm channel NO.,channel 0 or channel 4
[in] | en | ENABLE or DISABLE
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_capture_irq_type_config()

int tls_pwm_capture_irq_type_config | ( | u8 | channel,
 |  | enum tls_pwm_cap_int_type | int_type
 | ) |  |
参数
[in] | channel | pwm channel,channel 0 or channel 4
[in] | int_type | interrupt type
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_capture_mode_config()

int tls_pwm_capture_mode_config ( u8 channel )
参数
[in] channel pwm channel NO.,channel 0 or channel 4
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_cnt_type_config()

int tls_pwm_cnt_type_config | ( | u8 | channel,
 |  | enum tls_pwm_cnt_type | cnt_type
 | ) |  |
参数
[in] | channel | pwm channel NO.,range form 0 to 4
[in] | cnt_type | counting mode
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_deadzone_config()

int tls_pwm_deadzone_config | ( | u8 | channel,
 |  | bool | dten,
 |  | u8 | dtclkdiv,
 |  | u8 | dtcnt
 | ) |  |
参数
[in] | channel | pwm channel NO.,channel 0 or channel 2
[in] | dten | whether enalbe the deat time, ENABLE or DISABLE
[in] | dtclkdiv | dead zone clock divider, range 0 to 3
[in] | dtcnt | the number of the counting clock cycle, range 0 to 255
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_duty_config()

int tls_pwm_duty_config | ( | u8 | channel,
 |  | u8 | duty
 | ) |  |
参数
[in] | channel | pwm channel NO.,range form 0 to 4
[in] | duty | Number of active levels
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_duty_set()

void tls_pwm_duty_set | ( | u8 | channel,
 |  | u8 | duty
 | ) |  |
参数
[in] | channel | pwm channel NO., range form 0 to 4
[in] | duty | duty radio, range from 0 to 255
返回
None
注解
None

◆ tls_pwm_freq_config()

int tls_pwm_freq_config | ( | u8 | channel,
 |  | u16 | clkdiv,
 |  | u8 | period
 | ) |  |
参数
[in] | channel | pwm channel NO., range form 0 to 4
[in] | clkdiv | clock divider, range 0 to 65535
[in] | period | the number of the counting clock cycle
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_freq_set()

void tls_pwm_freq_set | ( | u8 | channel,
 |  | u32 | freq
 | ) |  |
参数
[in] | channel | pwm channel no, range form 0 to 4
[in] | freq | frequency, range from 1 to 156250
返回
None
注解
None

◆ tls_pwm_init()

int tls_pwm_init | ( | u8 | channel,
 |  | u32 | freq,
 |  | u8 | duty,
 |  | u8 | pnum
 | ) |  |
参数
[in] | channel | pwm channel, range from 0 to 4
[in] | freq | is a pointer to frequency, freq range from 1 to 156250
[in] | duty | is a pointer to duty radio, duty range from 0 to 255
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_isr_register()

void tls_pwm_isr_register | ( | u8 | channel,
 |  | pwm_irq_callback | callback,
 |  | void * | arg
 | ) |  |
参数
[in] callback the pwm interrupt callback function
返回
None
注解
None

◆ tls_pwm_loop_mode_config()

int tls_pwm_loop_mode_config | ( | u8 | channel,
 |  | enum tls_pwm_loop_type | loop_mode
 | ) |  |
参数
[in] | channel | pwm channel NO.,range form 0 to 4
[in] | loop_mode | whether to loop
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_out_init()

int tls_pwm_out_init ( pwm_init_param * pwm_param )
参数
[in] pwm_param structure containing the initialization parameters
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_out_inverse_cmd()

int tls_pwm_out_inverse_cmd | ( | u8 | channel,
 |  | bool | en
 | ) |  |
参数
[in] | channel | pwm channel NO.,range form 0 to 4
[in] | en | ENABLE or DISABLE
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_out_mode_config()

int tls_pwm_out_mode_config | ( | u8 | channel,
 |  | enum tls_pwm_out_mode | mode
 | ) |  |
参数
[in] | channel | pwm channel NO., range form 0 to 4
[in] | mode | pwm work mode for signal generate
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_output_en_cmd()

int tls_pwm_output_en_cmd | ( | u8 | channel,
 |  | bool | en
 | ) |  |
参数
[in] | channel | pwm channel NO.,channel 0 or channel 4
[in] | en | ENABLE or DISABLE
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_start()

int tls_pwm_start ( u8 channel )
参数
[in] channel pwm channel, range from 0 to 4
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_stop()

int tls_pwm_stop ( u8 channel )
参数
[in] channel pwm channel, range from 0 to 4
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_stoptime_by_period_config()

int tls_pwm_stoptime_by_period_config | ( | u8 | channel,
 |  | u8 | pnum
 | ) |  |
参数
[in] | channel | pwm channel NO.,range form 0 to 4
[in] | pnum | the number of period to be generated,range from 0 to 255
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None

◆ tls_pwm_stoptime_irq_cmd()

int tls_pwm_stoptime_irq_cmd | ( | u8 | channel,
 |  | bool | en
 | ) |  |
参数
[in] | channel | pwm channel,range from 0 to 4
[in] | en | enble or disable
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
None


蜂鸟W方案开发指导手册: RTC Driver APIs

函数
RTC Driver APIs
Driver APIs

RTC driver APIs 更多...

函数

void | tls_set_rtc (struct tm *tblock)
This function is used to set pmu rtc time 更多...
void | tls_get_rtc (struct tm *tblock)
This function is used to get pmu rtc time 更多...
void | tls_rtc_isr_register (tls_rtc_irq_callback callback, void *arg)
This function is used to register pmu rtc interrupt 更多...
void | tls_rtc_timer_start (struct tm *tblock)
This function is used to start pmu rtc timer 更多...
void | tls_rtc_timer_stop (void)
This function is used to stop pmu rtc timer 更多...

详细描述

函数说明

◆ tls_get_rtc()

void tls_get_rtc ( struct tm * tblock )
参数
[out] tblock time value
返回
None
注解
None

◆ tls_rtc_isr_register()

void tls_rtc_isr_register | ( | tls_rtc_irq_callback | callback,
 |  | void * | arg
 | ) |  |
参数
[in] | callback | the rtc interrupt call back function
[in] | arg | parameter of call back function
返回
None
注解
User does not need to clear the interrupt flag. Rtc callback function is called in interrupt, so do not operate the critical data in the callback fuuction. Sending messages to other tasks to handle is recommended.

◆ tls_rtc_timer_start()

void tls_rtc_timer_start ( struct tm * tblock )
参数
[in] tblock timer value
返回
None
注解
None

◆ tls_rtc_timer_stop()

void tls_rtc_timer_stop ( void )
参数
None
返回
None
注解
This function also is used to clear rtc timer interrupt

◆ tls_set_rtc()

void tls_set_rtc ( struct tm * tblock )
参数
[in] tblock time value
返回
None
注解
None


蜂鸟W方案开发指导手册: SASC Driver APIs

函数
SASC Driver APIs
Driver APIs

SASC driver APIs 更多...

函数

void | uni_sasc_enable_region (SASC_Type *block, uint32_t idx)
This function is used enable region. 更多...
void | uni_sasc_disable_region (SASC_Type *block, uint32_t idx)
This function is used disable region. 更多...
void | set_region_protect (uint32_t base_addr, uint32_t idx, sasc_region_size_e size, sasc_region_attr_t *attr)
This function is used set region protect. 更多...

详细描述

函数说明

◆ set_region_protect()

void set_region_protect | ( | uint32_t | base_addr,
 |  | uint32_t | idx,
 |  | sasc_region_size_e | size,
 |  | sasc_region_attr_t * | attr
 | ) |  |
参数
[in] | base_addr | base address
[in] | idx | index
[in] | size | size
[in] | attr | attribute
返回
None
注解
None

◆ uni_sasc_disable_region()

void uni_sasc_disable_region | ( | SASC_Type * | block,
 |  | uint32_t | idx
 | ) |  |
参数
[in] | block | sasc type
[in] | idx | index
返回
None
注解
None

◆ uni_sasc_enable_region()

void uni_sasc_enable_region | ( | SASC_Type * | block,
 |  | uint32_t | idx
 | ) |  |
参数
[in] | block | sasc type
[in] | idx | index
返回
None
注解
None


蜂鸟W方案开发指导手册: SDIO HOST Driver APIs

函数
SDIO HOST Driver APIs
Driver APIs

SDIO HOST driver APIs 更多...

函数

int | sdh_card_init (uint32_t *rca_ref)
This function is used to initial the sd host module . 更多...
int | uni_sd_card_set_bus_width (uint32_t rca, uint8_t bus_width)
This function is used to set the width of bus . 更多...
int | uni_sd_card_block_read (uint32_t sd_addr, char *buf)
This function is used to read one block data from the sd card with irq mode . 更多...
int | uni_sd_card_block_write (uint32_t rca, uint32_t sd_addr, char *buf)
This function is used to write one block data into the sd card with irq mode . 更多...
int | uni_sd_card_blocks_read (uint32_t sd_addr, char *buf, uint32_t buflen)
This function is used to read blocks of data from the sd card with dma mode . 更多...
int | uni_sd_card_blocks_write (uint32_t rca, uint32_t sd_addr, char *buf, uint32_t buflen)
This function is used to write blocks of data into the sd card with dma mode . 更多...

详细描述

函数说明

◆ sdh_card_init()

int sdh_card_init ( uint32_t * rca_ref )
参数
[out] rca_ref Pointer to the rca reference
返回值
status 0 if succeed, otherwise fail
注解
None

◆ uni_sd_card_block_read()

int uni_sd_card_block_read | ( | uint32_t | sd_addr,
 |  | char * | buf
 | ) |  |
参数
[in] | sd_addr | address that to be read from
[in] | buf | Pointer to the buffer that the data shall be read into
返回值
status 0 if succeed, otherwise fail
注解
None

◆ uni_sd_card_block_write()

int uni_sd_card_block_write | ( | uint32_t | rca,
 |  | uint32_t | sd_addr,
 |  | char * | buf
 | ) |  |
参数
[in] | sd_addr | address that to be written to
[in] | buf | Pointer to the buffer that holding the data to be written
返回值
status 0 if succeed, otherwise fail
注解
None

◆ uni_sd_card_blocks_read()

int uni_sd_card_blocks_read | ( | uint32_t | sd_addr,
 |  | char * | buf,
 |  | uint32_t | buflen
 | ) |  |
参数
[in] | sd_addr | address that to be read from
[in] | buf | Pointer to the buffer that the data shall be read into
[in] | buflen | buffer size, should be integer multiple of 512
返回值
status 0 if succeed, otherwise fail
注解
None

◆ uni_sd_card_blocks_write()

int uni_sd_card_blocks_write | ( | uint32_t | rca,
 |  | uint32_t | sd_addr,
 |  | char * | buf,
 |  | uint32_t | buflen
 | ) |  |
参数
[in] | sd_addr | address that to be written to
[in] | buf | Pointer to the buffer that holding the data to be written
[in] | buflen | buffer size, should be integer multiple of 512
返回值
status 0 if succeed, otherwise fail
注解
None

◆ uni_sd_card_set_bus_width()

int uni_sd_card_set_bus_width | ( | uint32_t | rca,
 |  | uint8_t | bus_width
 | ) |  |
参数
[in] | rca | the rca reference
[in] | bus_width | 0:1bit; 2:4bits
返回值
status 0 if succeed, otherwise fail
注解
None


蜂鸟W方案开发指导手册: TIMER Driver APIs

函数
TIMER Driver APIs
Driver APIs

TIMER driver APIs 更多...

函数

u8 | tls_timer_create (struct tls_timer_cfg *cfg)
This function is used to create a timer 更多...
void | tls_timer_start (u8 timer_id)
This function is used to start a timer 更多...
void | tls_timer_stop (u8 timer_id)
This function is used to stop a timer 更多...
void | tls_timer_change (u8 timer_id, u32 newtime)
This function is used to change a timer wait time 更多...
u32 | tls_timer_read (u8 timer_id)
This function is used to read a timer's current value 更多...
void | tls_timer_destroy (u8 timer_id)
This function is used to delete a timer 更多...

详细描述

函数说明

◆ tls_timer_change()

void tls_timer_change | ( | u8 | timer_id,
 |  | u32 | newtime
 | ) |  |
参数
[in] | timer_id | timer id[0~5]
[in] | newtime | new wait time
返回值
None
注解
If the timer does not start, this function will start the timer

◆ tls_timer_create()

u8 tls_timer_create ( struct tls_timer_cfg * cfg )
参数
[in] cfg timer configuration
返回值
UNI_TIMER_ID_INVALID | failed
other | timer id
注解
User does not need to clear the interrupt flag. Rtc callback function is called in interrupt, so do not operate the critical data in the callback fuuction. Sending messages to other tasks to handle is recommended.

◆ tls_timer_destroy()

void tls_timer_destroy ( u8 timer_id )
参数
[in] timer_id timer id
返回
None
注解
None

◆ tls_timer_read()

u32 tls_timer_read ( u8 timer_id )
参数
[in] timer_id timer id[0~5]
返回值
timer's current value
注解
none

◆ tls_timer_start()

void tls_timer_start ( u8 timer_id )
参数
[in] timer_id timer id
返回
None
注解
None

◆ tls_timer_stop()

void tls_timer_stop ( u8 timer_id )
参数
[in] timer_id timer id
返回
None
注解
None


蜂鸟W方案开发指导手册: TIPC Driver APIs

函数
TIPC Driver APIs
Driver APIs

TIPC driver APIs 更多...

函数

__STATIC_INLINE void | uni_tipc_enable_i2c (void)
This function is used enable i2c. 更多...
__STATIC_INLINE void | uni_tipc_disable_i2c (void)
This function is used disable i2c. 更多...
__STATIC_INLINE void | uni_tipc_enable_uart0 (void)
This function is used enable uart0. 更多...
__STATIC_INLINE void | uni_tipc_disable_uart0 (void)
This function is used disable uart0. 更多...
__STATIC_INLINE void | uni_tipc_enable_sar_adc (void)
This function is used enable sar adc. 更多...
__STATIC_INLINE void | uni_tipc_disable_sar_adc (void)
This function is used disable sar adc. 更多...
__STATIC_INLINE void | uni_tipc_enable_lspi (void)
This function is used enable low speed spi. 更多...
__STATIC_INLINE void | uni_tipc_disable_lspi (void)
This function is used disable low speed spi. 更多...
__STATIC_INLINE void | uni_tipc_enable_uart1 (void)
This function is used enable uart1. 更多...
__STATIC_INLINE void | uni_tipc_disable_uart1 (void)
This function is used disable uart1. 更多...
__STATIC_INLINE void | uni_tipc_enable_uart2 (void)
This function is used enable uart2. 更多...
__STATIC_INLINE void | uni_tipc_disable_uart2 (void)
This function is used disable uart2. 更多...
__STATIC_INLINE void | uni_tipc_enable_uart3 (void)
This function is used enable uart3. 更多...
__STATIC_INLINE void | uni_tipc_disable_uart3 (void)
This function is used disable uart3. 更多...
__STATIC_INLINE void | uni_tipc_enable_uart4 (void)
This function is used enable uart4. 更多...
__STATIC_INLINE void | uni_tipc_disable_uart4 (void)
This function is used disable uart4. 更多...
__STATIC_INLINE void | uni_tipc_enable_uart5 (void)
This function is used enable uart5. 更多...
__STATIC_INLINE void | uni_tipc_disable_uart5 (void)
This function is used disable uart5. 更多...
__STATIC_INLINE void | uni_tipc_enable_porta (void)
This function is used enable porta. 更多...
__STATIC_INLINE void | uni_tipc_disable_porta (void)
This function is used disable porta. 更多...
__STATIC_INLINE void | uni_tipc_enable_portb (void)
This function is used enable portb. 更多...
__STATIC_INLINE void | uni_tipc_disable_portb (void)
This function is used disable portb. 更多...
__STATIC_INLINE void | uni_tipc_enable_watch_dog (void)
This function is used enable watch dog. 更多...
__STATIC_INLINE void | uni_tipc_disable_watch_dog (void)
This function is used disable watch dog. 更多...
__STATIC_INLINE void | uni_tipc_enable_timer (void)
This function is used enable timer. 更多...
__STATIC_INLINE void | uni_tipc_disable_timer (void)
This function is used disable timer. 更多...
__STATIC_INLINE void | uni_tipc_enable_rf_controler (void)
This function is used enable rf controler. 更多...
__STATIC_INLINE void | uni_tipc_disable_rf_controler (void)
This function is used disable rf controler. 更多...
__STATIC_INLINE void | uni_tipc_enable_lcd (void)
This function is used enable lcd. 更多...
__STATIC_INLINE void | uni_tipc_disable_lcd (void)
This function is used disable lcd. 更多...
__STATIC_INLINE void | uni_tipc_enable_pwm (void)
This function is used enable pwm. 更多...
__STATIC_INLINE void | uni_tipc_disable_pwm (void)
This function is used disable pwm. 更多...
__STATIC_INLINE void | uni_tipc_enable_i2s (void)
This function is used enable i2s. 更多...
__STATIC_INLINE void | uni_tipc_disable_i2s (void)
This function is used disable i2s. 更多...
__STATIC_INLINE void | uni_tipc_enable_bt_modem (void)
This function is used enable bt modem. 更多...
__STATIC_INLINE void | uni_tipc_disable_bt_modem (void)
This function is used disable bt modem. 更多...
__STATIC_INLINE void | uni_tipc_enable_sdio_host (void)
This function is used enable sdio host. 更多...
__STATIC_INLINE void | uni_tipc_disable_sdio_host (void)
This function is used disable sdio host. 更多...
__STATIC_INLINE void | uni_tipc_enable_flash (void)
This function is used enable flash. 更多...
__STATIC_INLINE void | uni_tipc_disable_flash (void)
This function is used disable flash. 更多...
__STATIC_INLINE void | uni_tipc_enable_psram (void)
This function is used enable psram. 更多...
__STATIC_INLINE void | uni_tipc_disable_psram (void)
This function is used disable psram. 更多...
__STATIC_INLINE void | uni_tipc_enable_rsa (void)
This function is used enable rsa. 更多...
__STATIC_INLINE void | uni_tipc_disable_rsa (void)
This function is used disable rsa. 更多...
__STATIC_INLINE void | uni_tipc_enable_dma (void)
This function is used enable dma. 更多...
__STATIC_INLINE void | uni_tipc_disable_dma (void)
This function is used disable dma. 更多...
__STATIC_INLINE void | uni_tipc_enable_gpsec (void)
This function is used enable gpsec. 更多...
__STATIC_INLINE void | uni_tipc_disable_gpsec (void)
This function is used disable gpsec. 更多...
__STATIC_INLINE void | uni_tipc_enable_bt (void)
This function is used enable bt. 更多...
__STATIC_INLINE void | uni_tipc_disable_bt (void)
This function is used disable bt. 更多...
__STATIC_INLINE void | uni_tipc_enable_pmu (void)
This function is used enable pmu. 更多...
__STATIC_INLINE void | uni_tipc_disable_pmu (void)
This function is used disable pmu. 更多...
__STATIC_INLINE void | uni_tipc_enable_clk_rst (void)
This function is used enable clock reset. 更多...
__STATIC_INLINE void | uni_tipc_disable_clk_rst (void)
This function is used disable clock reset. 更多...
__STATIC_INLINE void | uni_tipc_enable_mmu (void)
This function is used enable mmu. 更多...
__STATIC_INLINE void | uni_tipc_disable_mmu (void)
This function is used disable mmu. 更多...
__STATIC_INLINE void | uni_tipc_enable_bbp (void)
This function is used enable bbp. 更多...
__STATIC_INLINE void | uni_tipc_disable_bbp (void)
This function is used disable bbp. 更多...
__STATIC_INLINE void | uni_tipc_enable_mac (void)
This function is used enable mac. 更多...
__STATIC_INLINE void | uni_tipc_disable_mac (void)
This function is used disable mac. 更多...
__STATIC_INLINE void | uni_tipc_enable_sec (void)
This function is used enable sec. 更多...
__STATIC_INLINE void | uni_tipc_disable_sec (void)
This function is used disable sec. 更多...
__STATIC_INLINE void | uni_tipc_enable_sdio_slave (void)
This function is used enable sdio slave. 更多...
__STATIC_INLINE void | uni_tipc_disable_sdio_slave (void)
This function is used disable sdio slave. 更多...
__STATIC_INLINE void | uni_tipc_enable_hspi (void)
This function is used enable high speed spi. 更多...
__STATIC_INLINE void | uni_tipc_disable_hspi (void)
This function is used disable high speed spi. 更多...
__STATIC_INLINE void | uni_tipc_enable_sdio_wrapper (void)
This function is used enable sdio wrapper. 更多...
__STATIC_INLINE void | uni_tipc_disable_sdio_wrapper (void)
This function is used disable sdio wrapper. 更多...
__STATIC_INLINE void | uni_tipc_enable_rf_bist (void)
This function is used enable rf bist. 更多...
__STATIC_INLINE void | uni_tipc_disable_rf_bist (void)
This function is used disable rf bist. 更多...

详细描述

函数说明

◆ uni_tipc_disable_bbp()

__STATIC_INLINE void uni_tipc_disable_bbp ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_bt()

__STATIC_INLINE void uni_tipc_disable_bt ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_bt_modem()

__STATIC_INLINE void uni_tipc_disable_bt_modem ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_clk_rst()

__STATIC_INLINE void uni_tipc_disable_clk_rst ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_dma()

__STATIC_INLINE void uni_tipc_disable_dma ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_flash()

__STATIC_INLINE void uni_tipc_disable_flash ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_gpsec()

__STATIC_INLINE void uni_tipc_disable_gpsec ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_hspi()

__STATIC_INLINE void uni_tipc_disable_hspi ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_i2c()

__STATIC_INLINE void uni_tipc_disable_i2c ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_i2s()

__STATIC_INLINE void uni_tipc_disable_i2s ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_lcd()

__STATIC_INLINE void uni_tipc_disable_lcd ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_lspi()

__STATIC_INLINE void uni_tipc_disable_lspi ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_mac()

__STATIC_INLINE void uni_tipc_disable_mac ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_mmu()

__STATIC_INLINE void uni_tipc_disable_mmu ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_pmu()

__STATIC_INLINE void uni_tipc_disable_pmu ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_porta()

__STATIC_INLINE void uni_tipc_disable_porta ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_portb()

__STATIC_INLINE void uni_tipc_disable_portb ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_psram()

__STATIC_INLINE void uni_tipc_disable_psram ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_pwm()

__STATIC_INLINE void uni_tipc_disable_pwm ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_rf_bist()

__STATIC_INLINE void uni_tipc_disable_rf_bist ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_rf_controler()

__STATIC_INLINE void uni_tipc_disable_rf_controler ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_rsa()

__STATIC_INLINE void uni_tipc_disable_rsa ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_sar_adc()

__STATIC_INLINE void uni_tipc_disable_sar_adc ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_sdio_host()

__STATIC_INLINE void uni_tipc_disable_sdio_host ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_sdio_slave()

__STATIC_INLINE void uni_tipc_disable_sdio_slave ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_sdio_wrapper()

__STATIC_INLINE void uni_tipc_disable_sdio_wrapper ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_sec()

__STATIC_INLINE void uni_tipc_disable_sec ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_timer()

__STATIC_INLINE void uni_tipc_disable_timer ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_uart0()

__STATIC_INLINE void uni_tipc_disable_uart0 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_uart1()

__STATIC_INLINE void uni_tipc_disable_uart1 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_uart2()

__STATIC_INLINE void uni_tipc_disable_uart2 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_uart3()

__STATIC_INLINE void uni_tipc_disable_uart3 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_uart4()

__STATIC_INLINE void uni_tipc_disable_uart4 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_uart5()

__STATIC_INLINE void uni_tipc_disable_uart5 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_disable_watch_dog()

__STATIC_INLINE void uni_tipc_disable_watch_dog ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_bbp()

__STATIC_INLINE void uni_tipc_enable_bbp ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_bt()

__STATIC_INLINE void uni_tipc_enable_bt ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_bt_modem()

__STATIC_INLINE void uni_tipc_enable_bt_modem ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_clk_rst()

__STATIC_INLINE void uni_tipc_enable_clk_rst ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_dma()

__STATIC_INLINE void uni_tipc_enable_dma ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_flash()

__STATIC_INLINE void uni_tipc_enable_flash ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_gpsec()

__STATIC_INLINE void uni_tipc_enable_gpsec ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_hspi()

__STATIC_INLINE void uni_tipc_enable_hspi ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_i2c()

__STATIC_INLINE void uni_tipc_enable_i2c ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_i2s()

__STATIC_INLINE void uni_tipc_enable_i2s ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_lcd()

__STATIC_INLINE void uni_tipc_enable_lcd ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_lspi()

__STATIC_INLINE void uni_tipc_enable_lspi ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_mac()

__STATIC_INLINE void uni_tipc_enable_mac ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_mmu()

__STATIC_INLINE void uni_tipc_enable_mmu ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_pmu()

__STATIC_INLINE void uni_tipc_enable_pmu ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_porta()

__STATIC_INLINE void uni_tipc_enable_porta ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_portb()

__STATIC_INLINE void uni_tipc_enable_portb ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_psram()

__STATIC_INLINE void uni_tipc_enable_psram ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_pwm()

__STATIC_INLINE void uni_tipc_enable_pwm ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_rf_bist()

__STATIC_INLINE void uni_tipc_enable_rf_bist ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_rf_controler()

__STATIC_INLINE void uni_tipc_enable_rf_controler ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_rsa()

__STATIC_INLINE void uni_tipc_enable_rsa ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_sar_adc()

__STATIC_INLINE void uni_tipc_enable_sar_adc ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_sdio_host()

__STATIC_INLINE void uni_tipc_enable_sdio_host ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_sdio_slave()

__STATIC_INLINE void uni_tipc_enable_sdio_slave ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_sdio_wrapper()

__STATIC_INLINE void uni_tipc_enable_sdio_wrapper ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_sec()

__STATIC_INLINE void uni_tipc_enable_sec ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_timer()

__STATIC_INLINE void uni_tipc_enable_timer ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_uart0()

__STATIC_INLINE void uni_tipc_enable_uart0 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_uart1()

__STATIC_INLINE void uni_tipc_enable_uart1 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_uart2()

__STATIC_INLINE void uni_tipc_enable_uart2 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_uart3()

__STATIC_INLINE void uni_tipc_enable_uart3 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_uart4()

__STATIC_INLINE void uni_tipc_enable_uart4 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_uart5()

__STATIC_INLINE void uni_tipc_enable_uart5 ( void )
参数
[in] None
返回
None
注解
None

◆ uni_tipc_enable_watch_dog()

__STATIC_INLINE void uni_tipc_enable_watch_dog ( void )
参数
[in] None
返回
None
注解
None


蜂鸟W方案开发指导手册: UART Driver APIs

函数
UART Driver APIs
Driver APIs

UART driver APIs 更多...

函数

int | tls_uart_port_init (u16 uart_no, tls_uart_options_t *opts, u8 modeChoose)
This function is used to initial uart port. 更多...
void | tls_uart_rx_callback_register (u16 uart_no, s16(*rx_callback)(u16 len, void *user_data), void *user_data)
This function is used to register uart rx interrupt. 更多...
void | tls_uart_tx_callback_register (u16 uart_no, s16(*tx_callback)(struct tls_uart_port *port))
This function is used to register uart tx interrupt. 更多...
int | tls_uart_read (u16 uart_no, u8 *buf, u16 readsize)
This function is used to copy circular buffer data to user buffer. 更多...
int | tls_uart_write (u16 uart_no, char *buf, u16 writesize)
This function is used to transfer data synchronously. 更多...
int | tls_uart_dma_write (char *buf, u16 writesize, void(*cmpl_callback)(void *p), u16 uart_no)
This function is used to transfer data with DMA. 更多...
int | tls_uart_set_parity (u16 uart_no, TLS_UART_PMODE_T paritytype)
This function is used to set uart parity. 更多...
int | tls_uart_set_baud_rate (u16 uart_no, u32 baudrate)
This function is used to set uart baudrate. 更多...
int | tls_uart_set_stop_bits (u16 uart_no, TLS_UART_STOPBITS_T stopbits)
This function is used to set uart stop bits. 更多...

详细描述

函数说明

◆ tls_uart_dma_write()

int tls_uart_dma_write | ( | char * | buf,
 |  | u16 | writesize,
 |  | void(*)(void *p) | cmpl_callback,
 |  | u16 | uart_no
 | ) |  |
参数
[in] | buf | is a buf for saving user data
[in] | writesize | is the user data length
[in] | cmpl_callback | function point,when the transfer is completed, the function will be called.
返回值
UNI_SUCCESS | success
UNI_FAILED | failed
注解
Only uart1 support DMA transfer.

◆ tls_uart_port_init()

int tls_uart_port_init | ( | u16 | uart_no,
 |  | tls_uart_options_t * | opts,
 |  | u8 | modeChoose
 | ) |  |
参数
[in] uart_no is the uart number.
  • TLS_UART_0 TLS_UART_1 TLS_UART_2 TLS_UART_3 TLS_UART_4
[in] | opts | is the uart setting options,if this param is NULL,this function will use the default options.
[in] | modeChoose:; | choose uart2 mode or 7816 mode when uart_no is TLS_UART_2, 0 for uart2 mode and 1 for 7816 mode.
返回值
- UNI_SUCCESS
  • UNI_FAILED
注解
When the system is initialized, the function has been called, so users can not call the function.

◆ tls_uart_read()

int tls_uart_read | ( | u16 | uart_no,
 |  | u8 * | buf,
 |  | u16 | readsize
 | ) |  |
参数
[in] | uart_no | is the uart numer
[in] | buf | is the user buffer
[in] | readsize | is the user read size
返回值
copy data size
注解
None

◆ tls_uart_rx_callback_register()

void tls_uart_rx_callback_register | ( | u16 | uart_no,
 |  | s16(*)(u16 len, void *user_data) | rx_callback,
 |  | void * | user_data
 | ) |  |
参数
[in] | uart_no | TLS_UART_0 or TLS_UART_1
[in] | rx_callback | is the uart rx interrupt call back function.
返回
None
注解
None

◆ tls_uart_set_baud_rate()

int tls_uart_set_baud_rate | ( | u16 | uart_no,
 |  | u32 | baudrate
 | ) |  |
参数
[in] | uart_no | is the uart number
[in] | baudrate | is the baudrate user want used,the unit is HZ.
返回值
UNI_SUCCESS | if setting success
UNI_FAILED | if setting fail
注解
None

◆ tls_uart_set_parity()

int tls_uart_set_parity | ( | u16 | uart_no,
 |  | TLS_UART_PMODE_T | paritytype
 | ) |  |
参数
[in] | uart_no | is the uart number
[in] | paritytype | is a parity type defined in TLS_UART_PMODE_T
返回值
UNI_SUCCESS | if setting success
UNI_FAILED | if setting fail
注解
None

◆ tls_uart_set_stop_bits()

int tls_uart_set_stop_bits | ( | u16 | uart_no,
 |  | TLS_UART_STOPBITS_T | stopbits
 | ) |  |
参数
[in] | uart_no | is the uart number
[in] | stopbits | is a stop bit type defined in TLS_UART_STOPBITS_T
返回值
UNI_SUCCESS | if setting success
UNI_FAILED | if setting fail
注解
None

◆ tls_uart_tx_callback_register()

void tls_uart_tx_callback_register | ( | u16 | uart_no,
 |  | s16(*)(struct tls_uart_port *port) | tx_callback
 | ) |  |
参数
[in] | uart_no | is the uart numer.
[in] | callback | is the uart tx interrupt call back function.
返回值

◆ tls_uart_write()

int tls_uart_write | ( | u16 | uart_no,
 |  | char * | buf,
 |  | u16 | writesize
 | ) |  |
参数
[in] | uart_no | is the uart number
[in] | buf | is a buf for saving user data
[in] | writesize | is the user data length
返回值
UNI_SUCCESS | tx success
UNI_FAILED | tx failed
注解
None


蜂鸟W方案开发指导手册: WDG Driver APIs

函数
WDG Driver APIs
Driver APIs

WDG driver APIs 更多...

函数

void | tls_watchdog_clr (void)
This function is used to feed the dog. 更多...
void | tls_watchdog_init (u32 usec)
This function is used to init and start the watchdog. 更多...
void | tls_sys_reset (void)
This function is used to reset the system. 更多...

详细描述

函数说明

◆ tls_sys_reset()

void tls_sys_reset ( void )
参数
None
返回
None
注解
None

◆ tls_watchdog_clr()

void tls_watchdog_clr ( void )
参数
None
返回
None
注解
None

◆ tls_watchdog_init()

void tls_watchdog_init ( u32 usec )
参数
[in] usec microseconds
返回
None
注解
None


蜂鸟W方案开发指导手册: 结构体

结构体
这里列出了所有结构体，并附带简要说明:
C _pwm_init_param |
C fls_list |
C LCD_T | LCD Register Declaration
C tls_fls |
C tls_hspi_rx_desc |
C tls_hspi_tx_desc |
C tls_slave_hspi |
C tls_spi_message |
C tls_spi_port |
C tls_spi_transfer |
C tls_timer_cfg |


蜂鸟W方案开发指导手册: 结构体索引

结构体索引
_ | f | l | t
_
l
tls_hspi_rx_desc tls_spi_port
tls_hspi_tx_desc tls_spi_transfer
_pwm_init_param LCD_T tls_slave_hspi tls_timer_cfg
f
t
tls_spi_message


蜂鸟W方案开发指导手册: Z: 目录参考

  • Z:
Z: 目录参考


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components 目录参考

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
components 目录参考


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w 目录参考

  • Z:
  • w800
  • unione_lite_app_hb_w
unione_lite_app_hb_w 目录参考


蜂鸟W方案开发指导手册: C:/Users/YZS/Desktop/doxygen/src/HummingbirdW 目录参考

  • src
  • HummingbirdW
HummingbirdW 目录参考


蜂鸟W方案开发指导手册: C:/Users/YZS/Desktop/doxygen/src/HummingbirdW/input 目录参考

  • src
  • HummingbirdW
  • input
input 目录参考


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver 目录参考

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
driver 目录参考

文件

文件 | uni_7816.h [代码]
文件 | uni_cpu.h [代码]
cpu driver module
文件 | uni_dma.h [代码]
DMA Driver Module
文件 | uni_efuse.h [代码]
virtual efuse Driver Module
文件 | uni_flash.h [代码]
flash Driver module
文件 | uni_flash_map.h [代码]
flash zone map
文件 | uni_fls_gd25qxx.h [代码]
wm gd25qxx flash driver
文件 | uni_gpio.h [代码]
GPIO Driver Module
文件 | uni_gpio_afsel.h [代码]
GPIO Driver Module
文件 | uni_hostspi.h [代码]
host spi Driver Module
文件 | uni_hspi.h [代码]
High speed spi slave Module
文件 | uni_i2c.h [代码]
文件 | uni_internal_flash.h [代码]
inter flash driver
文件 | uni_io.h [代码]
IO Driver Module
文件 | uni_irq.h [代码]
interupt driver module
文件 | uni_lcd.h [代码]
LCD Driver Module
文件 | uni_pmu.h [代码]
pmu driver module
文件 | uni_pwm.h [代码]
pwm driver module
文件 | uni_rtc.h [代码]
rtc Driver Module
文件 | uni_timer.h [代码]
Timer Driver Module
文件 | uni_uart.h [代码]
uart Driver Module
文件 | uni_watchdog.h [代码]
watchdog Driver Module


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include 目录参考

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
include 目录参考

目录


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk 目录参考

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
unisdk 目录参考


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615 目录参考

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
chip_us615 目录参考


蜂鸟W方案开发指导手册: Z:/w800 目录参考

  • Z:
  • w800
w800 目录参考


蜂鸟W方案开发指导手册: 成员变量

这里列出了所有文档化的结构体和联合体的成员变量，并附带结构或联合所属的文件:

- a -

  • arg : tls_timer_cfg

- c -

  • callback : tls_timer_cfg
  • channel : _pwm_init_param
  • clkdiv : _pwm_init_param
  • cnt_type : _pwm_init_param
  • COM_EN : LCD_T
  • complete : tls_spi_message
  • context : tls_spi_message
  • cs_active : tls_spi_port
  • CTRL : LCD_T
  • curr_rx_desc : tls_slave_hspi
  • curr_tx_desc : tls_slave_hspi
  • current_message : tls_spi_port
  • current_remaining_bytes : tls_spi_port
  • current_remaining_transfer : tls_spi_port
  • current_transfer : tls_spi_port

- d -

  • delay_usecs : tls_spi_transfer
  • dtclkdiv : _pwm_init_param
  • dtcnt : _pwm_init_param
  • dten : _pwm_init_param
  • duty : _pwm_init_param

- f -

  • FRAMECNT : LCD_T

- i -

  • inverse_en : _pwm_init_param
  • is_repeat : tls_timer_cfg

- l -

  • len : tls_spi_transfer
  • loop_type : _pwm_init_param

- m -

  • mode : _pwm_init_param , tls_spi_port
  • msg_queue : tls_spi_port

- p -

  • period : _pwm_init_param
  • pnum : _pwm_init_param
  • pnum_int : _pwm_init_param

- q -

  • queue : tls_spi_message

- r -

  • rx_buf : tls_spi_transfer
  • rx_len : tls_spi_transfer

- s -

  • SEG_EN : LCD_T
  • speed_hz : tls_spi_port
  • status : tls_spi_message

- t -

  • timeout : tls_timer_cfg
  • transfer_list : tls_spi_transfer
  • transfers : tls_spi_message
  • transtype : tls_spi_port
  • tx_buf : tls_spi_transfer

- u -

  • unit : tls_timer_cfg

- w -

  • wait_queue : tls_spi_port


蜂鸟W方案开发指导手册: 成员变量 - 变量

- a -

  • arg : tls_timer_cfg

- c -

  • callback : tls_timer_cfg
  • channel : _pwm_init_param
  • clkdiv : _pwm_init_param
  • cnt_type : _pwm_init_param
  • COM_EN : LCD_T
  • complete : tls_spi_message
  • context : tls_spi_message
  • cs_active : tls_spi_port
  • CTRL : LCD_T
  • curr_rx_desc : tls_slave_hspi
  • curr_tx_desc : tls_slave_hspi
  • current_message : tls_spi_port
  • current_remaining_bytes : tls_spi_port
  • current_remaining_transfer : tls_spi_port
  • current_transfer : tls_spi_port

- d -

  • delay_usecs : tls_spi_transfer
  • dtclkdiv : _pwm_init_param
  • dtcnt : _pwm_init_param
  • dten : _pwm_init_param
  • duty : _pwm_init_param

- f -

  • FRAMECNT : LCD_T

- i -

  • inverse_en : _pwm_init_param
  • is_repeat : tls_timer_cfg

- l -

  • len : tls_spi_transfer
  • loop_type : _pwm_init_param

- m -

  • mode : _pwm_init_param , tls_spi_port
  • msg_queue : tls_spi_port

- p -

  • period : _pwm_init_param
  • pnum : _pwm_init_param
  • pnum_int : _pwm_init_param

- q -

  • queue : tls_spi_message

- r -

  • rx_buf : tls_spi_transfer
  • rx_len : tls_spi_transfer

- s -

  • SEG_EN : LCD_T
  • speed_hz : tls_spi_port
  • status : tls_spi_message

- t -

  • timeout : tls_timer_cfg
  • transfer_list : tls_spi_transfer
  • transfers : tls_spi_message
  • transtype : tls_spi_port
  • tx_buf : tls_spi_transfer

- u -

  • unit : tls_timer_cfg

- w -

  • wait_queue : tls_spi_port


蜂鸟W方案开发指导手册: 相关页面

相关页面
这里列出了所有相关页面:
1、简介
2、产品说明
3、获取源码
4、烧录固件
5、搭建开发环境
6、软件架构
7、二次开发
8、IOT使用说明


蜂鸟W方案开发指导手册: _pwm_init_param结构体 参考

成员变量
_pwm_init_param结构体 参考

#include <uni_pwm.h>

成员变量

enum tls_pwm_out_mode | mode
u8 | channel
u16 | clkdiv
u8 | period
u8 | duty
bool | dten
u8 | dtclkdiv
u8 | dtcnt
enum tls_pwm_cnt_type | cnt_type
enum tls_pwm_loop_type | loop_type
bool | inverse_en
u8 | pnum
bool | pnum_int

详细描述

pwm initial parameters

结构体成员变量说明

◆ channel

u8 _pwm_init_param::channel

channel id 0~4

◆ clkdiv

u16 _pwm_init_param::clkdiv

clock divided value

◆ cnt_type

enum tls_pwm_cnt_type _pwm_init_param::cnt_type

count type

◆ dtclkdiv

u8 _pwm_init_param::dtclkdiv

dead zone clock divided value (0~3)

◆ dtcnt

u8 _pwm_init_param::dtcnt

period number of dead zone time (0~255)

◆ dten

bool _pwm_init_param::dten

enable dead zone time (ENABLE or DISABLE)

◆ duty

u8 _pwm_init_param::duty

duty radio (range 0~255, high level or low level by out_inversion decided

◆ inverse_en

bool _pwm_init_param::inverse_en

output is inverse

◆ loop_type

enum tls_pwm_loop_type _pwm_init_param::loop_type

cycle type

◆ mode

enum tls_pwm_out_mode _pwm_init_param::mode

work mode

◆ period

u8 _pwm_init_param::period

period value(output frequency F = CLK/CLK_DIV/PERIOD)

◆ pnum

u8 _pwm_init_param::pnum

generate interrupt after pnum period

◆ pnum_int

bool _pwm_init_param::pnum_int

period interrupt is enable


蜂鸟W方案开发指导手册: fls_list结构体 参考

成员变量
fls_list结构体 参考

成员变量

struct fls_list * | next
struct fls_list * | prev

详细描述


蜂鸟W方案开发指导手册: LCD_T结构体 参考

成员变量
LCD_T结构体 参考

LCD Register Declaration 更多...

#include <uni_lcd.h>

成员变量

__IO uint32_t | CTRL
__IO uint32_t | FRAMECNT
__IO uint32_t | COM0
__IO uint32_t | COM1
__IO uint32_t | COM2
__IO uint32_t | COM3
__IO uint32_t | COM4
__IO uint32_t | COM5
__IO uint32_t | COM6
__IO uint32_t | COM7
__IO uint32_t | COM_EN
__IO uint32_t | SEG_EN

详细描述

结构体成员变量说明

◆ COM_EN

__IO uint32_t LCD_T::COM_EN

LCD COM Control Register

◆ CTRL

__IO uint32_t LCD_T::CTRL

Control Register

◆ FRAMECNT

__IO uint32_t LCD_T::FRAMECNT

Refresh Rate Prescaler Register

◆ SEG_EN

__IO uint32_t LCD_T::SEG_EN

LCD SEG Control Register


蜂鸟W方案开发指导手册: tls_fls结构体 参考

成员变量
tls_fls结构体 参考

成员变量

struct fls_list | fls_drvs
struct tls_fls_drv * | current_drv
tls_os_sem_t * | fls_lock

详细描述


蜂鸟W方案开发指导手册: tls_hspi_rx_desc结构体 参考

成员变量
tls_hspi_rx_desc结构体 参考

#include <uni_hspi.h>

成员变量

u32 | valid_ctrl
u32 | buf_addr
u32 | next_desc_addr

详细描述

Definition of receive data descriptor structure


蜂鸟W方案开发指导手册: tls_hspi_tx_desc结构体 参考

成员变量
tls_hspi_tx_desc结构体 参考

#include <uni_hspi.h>

成员变量

volatile u32 | valid_ctrl
u32 | buf_info
u32 | buf_addr [3]
u32 | next_desc_addr

详细描述

Definition of send data descriptor structure


蜂鸟W方案开发指导手册: tls_slave_hspi结构体 参考

成员变量
tls_slave_hspi结构体 参考

#include <uni_hspi.h>

成员变量

u8 | ifusermode
s16(* | rx_cmd_callback )(char *buf)
s16(* | rx_data_callback )(char *buf)
s16(* | tx_data_callback )(char *buf)
struct tls_hspi_tx_desc * | curr_tx_desc
struct tls_hspi_rx_desc * | curr_rx_desc

详细描述

struct tls_slave_hspi

结构体成员变量说明

◆ curr_rx_desc

struct tls_hspi_rx_desc* tls_slave_hspi::curr_rx_desc

Downlink data management

◆ curr_tx_desc

struct tls_hspi_tx_desc* tls_slave_hspi::curr_tx_desc

Upstream data management


蜂鸟W方案开发指导手册: tls_spi_message结构体 参考

成员变量
tls_spi_message结构体 参考

#include <uni_hostspi.h>

成员变量

struct dl_list | queue
struct dl_list | transfers
void(* | complete )(void *)
void * | context
u32 | status

详细描述

one multi-segment SPI transaction

A struct tls_spi_message is used to execute an atomic sequence of data transfers, each represented by a struct tls_spi_transfer. The sequence is "atomic" in the sense that no other spi_message may use that SPI bus until that sequence completes.

结构体成员变量说明

◆ complete

void(* tls_spi_message::complete) (void *)

called to report transaction completions.

◆ context

void* tls_spi_message::context

the argument to complete() when it's called.

◆ queue

struct dl_list tls_spi_message::queue

transaction messages are sequenced through tls_spi_port.wait_queue.

◆ status

u32 tls_spi_message::status

transaction message status.

◆ transfers

struct dl_list tls_spi_message::transfers

list of transfer segments in this transaction.


蜂鸟W方案开发指导手册: tls_spi_port结构体 参考

成员变量
tls_spi_port结构体 参考

#include <uni_hostspi.h>

成员变量

u32 | speed_hz
u8 | cs_active
u8 | mode
u8 | reconfig
struct dl_list | wait_queue
tls_os_queue_t * | lock
tls_os_queue_t * | msg_queue
struct tls_spi_message * | current_message
u32 | current_remaining_transfer
struct tls_spi_transfer * | current_transfer
u32 | current_remaining_bytes
u8 | transtype

详细描述

driver structure to SPI master controller

This data structure presents the SPI master controller's configuration data. The device attached to this SPI master controller share the same transfer mode, chipselect mode and clock rate. And this structure maintains a queue of tls_spi_message transactions and uses this tls_spi_message transaction to access to the SPI device. For each such message it queues, it calls the message's completion function when the transaction completes.

结构体成员变量说明

◆ cs_active

u8 tls_spi_port::cs_active

chipselect mode, maybe active low or active high.

◆ current_message

struct tls_spi_message* tls_spi_port::current_message

current transaction message in-progressing.

◆ current_remaining_bytes

u32 tls_spi_port::current_remaining_bytes

remaining data length in current transfer segment.

◆ current_remaining_transfer

u32 tls_spi_port::current_remaining_transfer

remaining transfer segments count in current transaction message.

◆ current_transfer

struct tls_spi_transfer* tls_spi_port::current_transfer

current transfer segment in-progressing.

◆ mode

u8 tls_spi_port::mode

SPI transfer mode: mode_0(CPHA=0, CHOL=0), mode_1(CPHA=0, CHOL=1), mode_2(CPHA=1, CHOL=0), mode_3(CPHA=1, CHOL=1).

◆ msg_queue

tls_os_queue_t* tls_spi_port::msg_queue

notify the schedule thread that there's transaction message queued.

◆ speed_hz

u32 tls_spi_port::speed_hz

clock rate to be used.

◆ transtype

u8 tls_spi_port::transtype

transfer type

◆ wait_queue

struct dl_list tls_spi_port::wait_queue

wait list of transaction messages.


蜂鸟W方案开发指导手册: tls_spi_transfer结构体 参考

成员变量
tls_spi_transfer结构体 参考

#include <uni_hostspi.h>

成员变量

struct dl_list | transfer_list
const void * | tx_buf
void * | rx_buf
u32 | len
u32 | rx_len
u32 | delay_usecs

详细描述

a read/write buffer pair

SPI transfers always write the same number of bytes as they read. If the transmit buffer is null, zeroes will be shifted out while filling rx_buf. If the receive buffer is null, the data shifted in will be discarded.

结构体成员变量说明

◆ delay_usecs

u32 tls_spi_transfer::delay_usecs

microseconds to delay after this transfer.

◆ len

u32 tls_spi_transfer::len

size of rx and tx buffers (in bytes).

◆ rx_buf

void* tls_spi_transfer::rx_buf

data to be read, or NULL.

◆ rx_len

u32 tls_spi_transfer::rx_len

size of rx buffers (in bytes).

◆ transfer_list

struct dl_list tls_spi_transfer::transfer_list

transfers are sequenced through tls_spi_message.transfers.

◆ tx_buf

const void* tls_spi_transfer::tx_buf

data to be written, or NULL.


蜂鸟W方案开发指导手册: tls_timer_cfg结构体 参考

成员变量
tls_timer_cfg结构体 参考

#include <uni_timer.h>

成员变量

enum tls_timer_unit | unit
u32 | timeout
bool | is_repeat
tls_timer_irq_callback | callback
void * | arg

详细描述

timer configuration

结构体成员变量说明

◆ arg

void* tls_timer_cfg::arg

parameter fot the timeout callback function

◆ callback

tls_timer_irq_callback tls_timer_cfg::callback

timeout callback function

◆ is_repeat

bool tls_timer_cfg::is_repeat

cycle timer

◆ timeout

u32 tls_timer_cfg::timeout

timeout period

◆ unit

enum tls_timer_unit tls_timer_cfg::unit

timer accuracy


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_7816.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_7816.h
1 /**************************************************************************/
8 #ifndef UNI_7816_H_
9 #define UNI_7816_H_
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 #include <string.h>
16 #include <stdbool.h>
17 #include "uni_regs.h"
18 #include "uni_type_def.h"
19 #include "uni_io.h"
20
21 #define UNI_SC_RST_PIN UNI_IO_PB_23 //(23)
22 #define UNI_SC_PWR_PIN UNI_IO_PB_24 //(29)
23
24 #define UNI_SC_DEFAULT_FD (372)
25
26 typedef struct sc_io_map_ {
27 enum tls_io_name clk_pin_num;
28 uint32_t clk_opt;
29 enum tls_io_name io_pin_num;
30 uint32_t io_opt;
31 uint8_t initialed;
32 } sc_io_map;
33
34 extern sc_io_map sc_io;
35
64 void uni_sc_io_clk_config(uint8_t mode);
65
71 void uni_sc_powerInit(void);
72
78 void uni_sc_poweron(void);
79
85 void uni_sc_poweroff(void);
86
92 void uni_sc_rst_low(void);
93
99 void uni_sc_rst_high(void);
100
106 void uni_sc_hotreset(void);
107
113 void uni_sc_colreset(void);
114
120 void uni_sc_deactive(void);
121
128 void uni_sc_set_bgt(uint8_t bgt);
129
136 void uni_sc_tx_retry_times(uint8_t count);
137
144 void uni_sc_rx_retry_times(uint8_t count);
145
152 void uni_sc_set_etu(uint16_t etu);
153
160 void uni_sc_set_frequency(uint32_t freq);
161
169 static inline void uni_sc_parity_recv(bool bl)
170 {
171 tls_bitband_write(HR_UART2_LINE_CTRL, 9, bl);
172 }
173
181 static inline void uni_sc_7816_mode(bool bl)
182 {
183 tls_bitband_write(HR_UART2_LINE_CTRL, 24, bl);
184 }
185
192 static inline void uni_sc_set_guardtime(uint8_t gt)
193 {
194 tls_reg_write32(HR_UART2_GUARD_TIME, gt);
195 }
196
203 static inline void uni_sc_set_bcwt(uint32_t bwt)
204 {
205 bwt = (bwt > 0xFFFFFF) ? 0xFFFFFF : bwt;
206 tls_reg_write32(HR_UART2_WAIT_TIME, bwt);
207 }
208
216 static inline void uni_sc_tx_errsignal_mask(bool bl)
217 {
218 tls_bitband_write(HR_UART2_INT_MASK, 9, bl);
219 }
220
228 static inline void uni_sc_set_protocol(bool bl)
229 {
230 tls_bitband_write(HR_UART2_LINE_CTRL, 8, bl);
231 }
232
240 static inline uint8_t uni_sc_get_protocol()
241 {
242 return tls_bitband_read(HR_UART2_LINE_CTRL, 8);
243 }
244
252 static inline void uni_sc_clk_enable(bool bl)
253 {
254 tls_bitband_write(HR_UART2_LINE_CTRL, 10, bl);
255 }
256
265 #ifdef __cplusplus
266 }
267 #endif
268
269 #endif


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_adc.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_adc.h
1 /*****************************************************************************
2 *
3 * File Name : uni_adc.h
4 *
5 * Description: adc Driver Module
6 *
7 * All rights reserved.
8 *
9 * Author : dave
10 *
11 * Date : 2014-8-15
12 *****************************************************************************/
13
14 #ifndef UNI_ADC_H
15 #define UNI_ADC_H
16
17 #include "uni_type_def.h"
18
19 //ÿ������dma֮����Ҫһ���ȶ�ʱ�䣬���Բɼ���������ǰ���12��byte���ȶ���Ҫ��ȥ
20 #define ADC_DEST_BUFFER_DMA (u32)0x20028000//(u32)0x20037000 //ǰ��ĵط�����SPI���ܻ���
21 #define ADC_DEST_BUFFER_SIZE 65532//2000 //�԰���Ϊ��λ
22 #define SAMPLE_NUM_PER_CHANNEL 20//2000
23
24
25 /*ADC Result*/
26 #define ADC_RESULT_MASK (0x3FFFF)
27 #define ADC_RESULT_VAL(n) ((n)&ADC_RESULT_MASK)
28
29 /*ADC_ANALOG_CTRL*/
30 #define CONFIG_ADC_CHL_SEL_MASK (0xF<<8)
31 #define CONFIG_ADC_CHL_SEL(n) ((n)<<8)
32
33 #define CONFIG_PD_ADC_MASK (0x1<<2)
34 #define CONFIG_PD_ADC_VAL(n) ((n)<<2) /*1:pd adc, 0: normal work*/
35
36 #define CONFIG_RSTN_ADC_MASK (0x1<<1)
37 #define CONFIG_RSTN_ADC_VAL(n) ((n)<<1) /*1:normal work, 0:adc reset*/
38
39 #define CONFIG_EN_LDO_ADC_MASK (0x1<<0)
40 #define CONFIG_EN_LDO_ADC_VAL(n) ((n)<<0) /*1:ldo work, 0: ldo shutdown*/
41
42 /*PGA_CTRL*/
43 #define CLK_CHOP_SEL_PGA_MASK (0x7<<4)
44 #define CLK_CHOP_SEL_PGA_VAL(n) ((n)<<4)
45
46
47 #define GAIN_CTRL_PGA_MASK (0x3<<7)
48 #define GAIN_CTRL_PGA_VAL(n) ((n)<<7)
49
50
51 #define PGA_BYPASS_MASK (0x1<<3)
52 #define PGA_BYPASS_VAL(n) ((n)<<3) /*1:bypass pga, 0:use pga*/
53
54 #define BYPASS_INNER_REF_SEL (0x1<<2) /*Internal or external reference select*/
55
56 #define PGA_CHOP_ENP_MASK (0x1<<1)
57 #define PGA_CHOP_ENP_VAL(n) ((n)<<1) /*1: enable chop, 0: disable chop*/
58
59 #define PGA_EN_MASK (0x1<<0)
60 #define PGA_EN_VAL(n) ((n)<<0) /*1: enable pga, 0: disable pga*/
61
62
63 /*Temperature Control*/
64 #define TEMP_GAIN_MASK (0x3<<4)
65 #define TEMP_GAIN_VAL(n) ((n)<<4)
66
67 #define TEMP_CAL_OFFSET_MASK (0x1<<1)
68
69 #define TEMP_EN_MASK (0x1<<0)
70 #define TEMP_EN_VAL(n) ((n)<<0) /*1: enable temperature, 0: disable temperature*/
71
72
73 /*ADC CTRL*/
74 #define ANALOG_SWITCH_TIME_MASK (0x3FF<<20)
75 #define ANALOG_SWITCH_TIME_VAL(n) (((n)&0x3FF)<<20)
76
77 #define ANALOG_INIT_TIME_MASK (0x3FF<<8)
78 #define ANALOG_INIT_TIME_VAL(n) (((n)&0x3FF)<<8)
79
80 #define CMP_POLAR_MASK (0x1<<6)
81
82 #define CMP_IRQ_EN_MASK (0x1<<5)
83 #define CMP_IRQ_EN_VAL(n) ((n)<<5) /*1: enable cmp irq, 0: disable cmp irq*/
84
85
86 #define CMP_EN_MASK (0x1<<4)
87 #define CMP_EN_VAL(n) ((n)<<4) /*1: enable cmp function, 0: disable cmp function*/
88
89 #define ADC_IRQ_EN_MASK (0x1<<1)
90 #define ADC_IRQ_EN_VAL(n) ((n)<<1) /*1:enable adc transfer irq, 0: disable*/
91
92 #define ADC_DMA_EN_MASK (0x1<<0)
93 #define ADC_DMA_EN_VAL(n) ((n)<<0) /*1:enable adc dma, 0: disable*/
94
95
96 /*ADC IRQ Status*/
97 #define CMP_INT_MASK (0x1<<1)
98
99 #define ADC_INT_MASK (0x1<<0)
100
101 /*CMP Value*/
102 #define CONFIG_ADC_INPUT_CMP_VAL(n) ((n)&0x3FFFF)
103
104
105 /*ADC Channel*/
106 #define CONFIG_ADC_CHL_OFFSET (0x0E)
107 #define CONFIG_ADC_CHL_VOLT (0x0D)
108 #define CONFIG_ADC_CHL_TEMP (0x0C)
109
110
111
112 #define ADC_INT_TYPE_ADC 0
113 #define ADC_INT_TYPE_DMA 1
114 #define ADC_INT_TYPE_ADC_COMP 2
115
116 #define ADC_REFERENCE_EXTERNAL 0 //�ⲿ�ο�
117 #define ADC_REFERENCE_INTERNAL 1 //�ڲ��ο�
118
119 typedef struct adc_st{
120 u8 dmachannel;
121 void (*adc_cb)(u32 *buf, u16 len);
122 void (*adc_bigger_cb)(u32 *buf, u16 len);
123 void (*adc_dma_cb)(u32 *buf,u16 len);
124 u16 valuelen; /*dma �������ݳ���/ u16 offset; }ST_ADC; /** * @defgroup Driver_APIs Driver APIs * @brief Driver APIs */ /** * @addtogroup Driver_APIs * @{ */ /** * @defgroup ADC_Driver_APIs ADC Driver APIs * @brief ADC driver APIs */ /** * @addtogroup ADC_Driver_APIs * @{ */ /** * @brief This function is used to init adc. * * @param[in] ifusedma if use dma * @param[in] dmachannel dma channel * * @return None * * @note None */ void tls_adc_init(u8 ifusedma,u8 dmachannel); /** * @brief This function is used to register interrupt callback function. * * @param[in] inttype interrupt type: * ADC_INT_TYPE_ADC adc interrupt,user get adc result from the callback function. * ADC_INT_TYPE_DMA dma interrupt,dma transfer the adc result to the user's buffer. * @param[in] callback interrupt callback function. * * @return None * * @note None */ void tls_adc_irq_register(int inttype, void (*callback)(u32 *buf, u16 len)); /** * @brief This function is used to clear the interrupt source. * * @param[in] inttype interrupt type: * ADC_INT_TYPE_ADC adc interrupt,user get adc result from the callback function. * ADC_INT_TYPE_DMA dma interrupt,dma transfer the adc result to the user's buffer. * * @return None * * @note None */ void tls_adc_clear_irq(int inttype); /** * @brief This function is used to register interrupt callback function. * * @param[in] Channel adc channel,from 0 to 3 is single input;4 and 5 is differential input. * @param[in] Length byte data length,is an integer multiple of half word,need <= 0x500 * * @return None * * @note None */ void tls_adc_start_with_dma(int Channel, int Length); /** * @brief This function is used to start adc. * * @param[in] Channel adc channel,from 0 to 3 is single input;4 and 5 is differential input. * * @return None * * @note None */ void tls_adc_start_with_cpu(int Channel); /** * @brief This function is used to read adc result. * * @param[in] None * * @retval adc result * * @note None */ u32 tls_read_adc_result(void); /** * @brief This function is used to stop the adc. * * @param[in] ifusedma if use dma * * @return None * * @note None */ void tls_adc_stop(int ifusedma); /** * @brief This function is used to config adc bigger register. * * @param[in] cmp_data compare data * @param[in] cmp_pol compare pol * * @return None * * @note None */ void tls_adc_config_cmp_reg(int cmp_data, int cmp_pol); /** * @brief This function is used to set adc reference source. * * @param[in] ref ADC_REFERENCE_EXTERNAL,ADC_REFERENCE_INTERNAL * * @return None * * @note None */ void tls_adc_reference_sel(int ref); /** * @brief This function is used to read internal temperature. * * @param[in] None * * @retval temperature * * @note None */ int adc_get_interTemp(void); /** * @brief This function is used to read input voltage. * * @param[in] channel adc channel,from 0 to 3 is single input;4 and 5 is differential input. * * @retval voltage * * @note None */ u16 adc_get_inputVolt(u8 channel); /** * @brief This function is used to read internal voltage. * * @param[in] None * * @retval voltage * * @note None */ u16 adc_get_interVolt(void); /** * @brief This function is used to read temperature. * * @param[in] None * * @retval temperature * * @note None */ int adc_temp(void); /** * @} */ /** * @} */ void tls_adc_enable_calibration_buffer_offset(void); void tls_adc_voltage_start_with_cpu(void); void tls_adc_temp_offset_with_cpu(u8 calTemp12); void tls_adc_voltage_start_with_dma(int Length); void tls_adc_set_clk(int div); void signedToUnsignedData(u32 *adcValue); void tls_adc_buffer_bypass_set(u8 isset); void tls_adc_cmp_start(int Channel, int cmp_data, int cmp_pol); u32 adc_get_offset(void); #endif */
125 u16 offset;
126 }ST_ADC;
127
158 void tls_adc_init(u8 ifusedma,u8 dmachannel);
159
172 void tls_adc_irq_register(int inttype, void (*callback)(u32 *buf, u16 len));
173
185 void tls_adc_clear_irq(int inttype);
186
197 void tls_adc_start_with_dma(int Channel, int Length);
198
208 void tls_adc_start_with_cpu(int Channel);
209
219 u32 tls_read_adc_result(void);
220
230 void tls_adc_stop(int ifusedma);
231
242 void tls_adc_config_cmp_reg(int cmp_data, int cmp_pol);
243
253 void tls_adc_reference_sel(int ref);
254
264 int adc_get_interTemp(void);
265
275 u16 adc_get_inputVolt(u8 channel);
276
286 u16 adc_get_interVolt(void);
287
297 int adc_temp(void);
298
307 void tls_adc_enable_calibration_buffer_offset(void);
308 void tls_adc_voltage_start_with_cpu(void);
309 void tls_adc_temp_offset_with_cpu(u8 calTemp12);
310 void tls_adc_voltage_start_with_dma(int Length);
311 void tls_adc_set_clk(int div);
312 void signedToUnsignedData(u32 *adcValue);
313 void tls_adc_buffer_bypass_set(u8 isset);
314 void tls_adc_cmp_start(int Channel, int cmp_data, int cmp_pol);
315 u32 adc_get_offset(void);
316
317 #endif
318


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_cpu.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_cpu.h
1
7 #ifndef UNI_CPU_H
8 #define UNI_CPU_H
9
11 #define US615_PLL_CLK_MHZ (480)
12
13 enum CPU_CLK{
14 CPU_CLK_240M = 2,
15 CPU_CLK_160M = 3,
16 CPU_CLK_80M = 6,
17 CPU_CLK_40M = 12,
18 CPU_CLK_2M = 240,
19 };
20
21 typedef union {
22 struct {
23 uint32_t CPU: 8;
24 uint32_t WLAN: 8;
25 uint32_t BUS2: 8;
26 uint32_t PD: 4;
27 uint32_t RSV: 3;
28 uint32_t DIV_EN: 1;
29 } b;
30 uint32_t w;
31 } clk_div_reg;
32
33 #define UNIT_MHZ (1000000)
34
35
36 typedef struct{
37 u32 apbclk;
38 u32 cpuclk;
39 u32 wlanclk;
40 }tls_sys_clk;
41
74 void tls_sys_clk_set(u32 clk);
75
76
86 void tls_sys_clk_get(tls_sys_clk *sysclk);
87
96 #endif /* UNI_CPU_H */


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_dma.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_dma.h
1
8 #ifndef __WM_DMA_H_
9 #define __WM_DMA_H_
10
11 #define TLS_DMA_SEL_UART_RX 0
12 #define TLS_DMA_SEL_UART_TX 1
13 #define TLS_DMA_SEL_PWM_CAP0 2
14 #define TLS_DMA_SEL_PWM_CAP1 3
15 #define TLS_DMA_SEL_LSSPI_RX 4
16 #define TLS_DMA_SEL_LSSPI_TX 5
17 #define TLS_DMA_SEL_SDADC_CH0 6
18 #define TLS_DMA_SEL_SDADC_CH1 7
19 #define TLS_DMA_SEL_SDADC_CH2 8
20 #define TLS_DMA_SEL_SDADC_CH3 9
21 #define TLS_DMA_SEL_I2S_RX 10
22 #define TLS_DMA_SEL_I2S_TX 11
23 #define TLS_DMA_SEL_SDIO_HOST 12
24
25
26
27 #define TLS_DMA_FLAGS_HARD_MODE (1 << 0)
28 #define TLS_DMA_FLAGS_CHAIN_MODE (1 << 1)
29 #define TLS_DMA_FLAGS_CHANNEL_SEL(n) ((n) << 2)
30 #define TLS_DMA_FLAGS_CHAIN_LINK_EN (1 << 6)
31 #define TLS_DMA_FLAGS_CHANNEL_VALID (1 << 7)
32
33
34 #define TLS_DMA_DESC_VALID (1U << 31)
35 #define TLS_DMA_DESC_CTRL_SRC_ADD_INC (1 << 0)
36 #define TLS_DMA_DESC_CTRL_DEST_ADD_INC (1 << 2)
37 #define TLS_DMA_DESC_CTRL_DATA_SIZE_BYTE (0 << 4)
38 #define TLS_DMA_DESC_CTRL_DATA_SIZE_SHORT (1 << 4)
39 #define TLS_DMA_DESC_CTRL_DATA_SIZE_WORD (2 << 4)
40 #define TLS_DMA_DESC_CTRL_BURST_SIZE1 (0 << 6)
41 #define TLS_DMA_DESC_CTRL_BURST_SIZE4 (1 << 6)
42 #define TLS_DMA_DESC_CTRL_TOTAL_BYTES(n) ((n) << 7)
43
44
45 /* dma interrupt flags */
46 #define TLS_DMA_IRQ_BURST_DONE (1 << 0)
47 #define TLS_DMA_IRQ_TRANSFER_DONE (1 << 1)
48 #define TLS_DMA_IRQ_BOTH_DONE (TLS_DMA_IRQ_BURST_DONE | TLS_DMA_IRQ_TRANSFER_DONE)
49
50 struct tls_dma_descriptor {
51 unsigned int valid;
52 unsigned int dma_ctrl;
53 unsigned int src_addr;
54 unsigned int dest_addr;
55 struct tls_dma_descriptor *next;
56 };
57
89 void tls_dma_irq_clr(unsigned char ch, unsigned char flags);
90
91
104 void tls_dma_irq_register(unsigned char ch, void (*callback)(void *p), void *arg, unsigned char flags);
105
106
116 int tls_dma_wait_complt(unsigned char ch);
117
118
142 unsigned char tls_dma_start_by_wrap(unsigned char ch, struct tls_dma_descriptor *dma_desc,
143 unsigned char auto_reload, unsigned short src_zize,
144 unsigned short dest_zize);
145
146
170 unsigned char tls_dma_start(unsigned char ch, struct tls_dma_descriptor *dma_desc,
171 unsigned char auto_reload);
172
182 unsigned char tls_dma_stop(unsigned char ch);
183
184
197 unsigned char tls_dma_request(unsigned char ch, unsigned char flags);
198
199
209 void tls_dma_free(unsigned char ch);
210
211
221 void tls_dma_init(void);
222
231 #endif /* __TLS_DMA_H_151606__ */
232


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_efuse.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_efuse.h
1
8 #ifndef UNI_EFUSE_H
9 #define UNI_EFUSE_H
10
11 #include "uni_type_def.h"
12
13 #define TLS_EFUSE_STATUS_OK (0)
14 #define TLS_EFUSE_STATUS_EINVALID (1)
15 #define TLS_EFUSE_STATUS_EIO (2)
16
17 enum {
18 CMD_WIFI_MAC = 0x01,
19 CMD_BT_MAC,
20 CMD_TX_DC,
21 CMD_RX_DC,
22 CMD_TX_IQ_GAIN,
23 CMD_RX_IQ_GAIN,
24 CMD_TX_IQ_PHASE,
25 CMD_RX_IQ_PHASE,
26 CMD_TX_GAIN,
27 CMD_ALL,
28 };
29
30 #define VCG_ADDR (FT_MAGICNUM_ADDR + sizeof(FT_PARAM_ST)+4)
31 #define VCG_LEN (4)
32 //#define TX_GAIN_NEW_ADDR (VCG_ADDR+VCG_LEN)
33 #define TX_GAIN_LEN (28*3)
34
63 int tls_ft_param_init(void);
64
65
76 int tls_ft_param_set(unsigned int opnum, void *data, unsigned int len);
77
88 int tls_ft_param_get(unsigned int opnum, void *data, unsigned int rdlen);
89
90
99 int tls_get_mac_addr(u8 *mac);
100
109 int tls_set_mac_addr(u8 *mac);
118 int tls_get_bt_mac_addr(u8 *mac);
119
128 int tls_set_bt_mac_addr(u8 *mac);
129
138 int tls_get_tx_gain(u8 *txgain);
139
148 int tls_set_tx_gain(u8 *txgain);
149
158 int tls_get_tx_lo(u8 *txlo);
159
169 int tls_set_tx_lo(u8 *txlo);
170
179 int tls_get_tx_iq_gain(u8 *txGain);
180
189 int tls_set_tx_iq_gain(u8 *txGain);
190
199 int tls_get_rx_iq_gain(u8 *rxGain);
200
209 int tls_set_rx_iq_gain(u8 *rxGain);
210
219 int tls_get_tx_iq_phase(u8 *txPhase);
220
229 int tls_set_tx_iq_phase(u8 *txPhase);
230
239 int tls_get_rx_iq_phase(u8 *rxPhase);
240
249 int tls_set_rx_iq_phase(u8 *rxPhase);
250
259 int tls_freq_err_op(u8 *freqerr, u8 flag);
260
270 int tls_rf_vcg_ctrl_op(u8 *vcg, u8 flag);
271
280 #endif /* UNI_EFUSE_H */
281


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_flash.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_flash.h
1
8 #ifndef UNI_FLASH_H
9 #define UNI_FLASH_H
10
11 #include "uni_type_def.h"
12 #include "uni_osal.h"
13
14 #define TLS_FLS_STATUS_OK (0)
15 #define TLS_FLS_STATUS_EINVAL (1)
16 #define TLS_FLS_STATUS_EBUSY (2)
17 #define TLS_FLS_STATUS_EPERM (3)
18 #define TLS_FLS_STATUS_ENOSUPPORT (4)
19 #define TLS_FLS_STATUS_EEXIST (5)
20 #define TLS_FLS_STATUS_ENOMEM (6)
21 #define TLS_FLS_STATUS_EOVERFLOW (7)
22 #define TLS_FLS_STATUS_ENODEV (8)
23 #define TLS_FLS_STATUS_EDEV (9)
24 #define TLS_FLS_STATUS_EIO (10)
25 #define TLS_FLS_STATUS_ENODRV (11)
26
27 #define TLS_FLS_PARAM_TYPE_ID (0)
28 #define TLS_FLS_PARAM_TYPE_SIZE (1)
29 #define TLS_FLS_PARAM_TYPE_PAGE_SIZE (2)
30 #define TLS_FLS_PARAM_TYPE_PROG_SIZE (3)
31 #define TLS_FLS_PARAM_TYPE_SECTOR_SIZE (4)
32
33 #define TLS_FLS_FLAG_UNDER_PROTECT (1<<0)
34 #define TLS_FLS_FLAG_FAST_READ (1<<1)
35 #define TLS_FLS_FLAG_AAAI (1<<2)
36
37 #define FLS_CMD_READ_DEV_ID (0x9F) // read device id //(0x9f)
38
42 struct fls_list
43 {
44 struct fls_list *next;
45 struct fls_list *prev;
46 };
47
48
52 struct tls_fls_drv
53 {
54 struct fls_list drv_list;
55 u32 id;
56 u32 total_size;
57 u32 page_size;
58 u32 program_size;
59 u32 sector_size;
60 u32 clock;
61 u8 mode;
62 u8 cs_active;
63 u8 flags;
64 int (*read) (u32, u8 *, u32);
65 int (*fast_read) (u32, u8 *, u32);
66 int (*page_write) (u32, u8 *);
67 int (*erase) (u32);
68 int (*chip_erase) (void);
69 int (*probe)(u32 id);
70 void (*remove) (void);
71 };
72
76 struct tls_fls
77 {
78 struct fls_list fls_drvs;
79 struct tls_fls_drv *current_drv;
80 tls_os_sem_t *fls_lock;
81 };
82
114 int tls_spifls_init(void);
115
116
129 int tls_spifls_read(u32 addr, u8 * buf, u32 len);
130
131
147 int tls_spifls_write(u32 addr, u8 * buf, u32 len);
148
149 int tls_spifls_erase(u32 sector);
150 int tls_spifls_exit(void);
151
160 #endif /* UNI_FLASH_H */


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_flash_map.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_flash_map.h
1
8 #ifndef __WM_FLASH_MAP_H__
9 #define __WM_FLASH_MAP_H__
10
14 #define FLASH_BASE_ADDR (0x8000000UL)
15
17 #define CODE_UPD_START_ADDR (0x8010000UL)
18
20 #define CODE_RUN_START_ADDR (0x80D0000UL)
21
23 #define USER_ADDR_START (0x81C0000UL)
24
25
27 extern unsigned int TLS_FLASH_PARAM_DEFAULT;
28 extern unsigned int TLS_FLASH_PARAM1_ADDR;
29 extern unsigned int TLS_FLASH_PARAM2_ADDR;
30 extern unsigned int TLS_FLASH_PARAM_RESTORE_ADDR;
31 extern unsigned int TLS_FLASH_OTA_FLAG_ADDR;
32 extern unsigned int TLS_FLASH_END_ADDR;
33
34 #define SIGNATURE_WORD (0xA0FFFF9FUL)
35 #define IMAGE_START_ADDR_MSK (0x400)
36 #endif /*__WM_CONFIG_H__*/
37


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_fls_gd25qxx.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_fls_gd25qxx.h
1
9 #ifndef TLS_EXSPIFLS_H
10 #define TLS_EXSPIFLS_H
11
12 #define SPI_SCLK (10000000)
13 #define FLASH_TOTAL_SIZE (1024*1024)
14 #define PAGE_SIZE 256
15 #define PROGRAM_SIZE 256
16 #define PAGE_ADDR_OFFSET 8
17 #define SECTOR_SIZE 4096
18
19
23 #define EXSPIFLASH_WRITE_ENABLE (0x06)
24 #define EXSPIFLASH_WRITE_DISABLE (0x04)
25 #define EXSPIFLASH_READ_SR1 (0x05)
26 #define EXSPIFLASH_READ_SR2 (0x35)
27 #define EXSPIFLASH_WRITE_SR (0x01)
28 #define EXSPIFLASH_PAGE_PROGRAM (0x02)
29 #define EXSPIFLASH_DATA_READ (0x03)
30 #define EXSPIFLASH_DATA_FAST_READ (0x0b)
31 #define EXSPIFLASH_SECTOR_ERASE (0x20)
32 #define EXSPIFLASH_BLOCK32_ERASE (0x52)
33 #define EXSPIFLASH_BLOCK64_ERASE (0xd8)
34 #define EXSPIFLASH_CHIP_ERASE (0xc7)
35 #define EXSPIFLASH_FLASH_DEVICEID (0x90)
36 #define EXSPIFLASH_FLASH_ID (0x9f)
39 #define FLASH_STATUS_BUSY (1 << 0)
40 #define FLASH_STATUS_WEL (1 << 1)
41
56 int tls_spifls_drv_install(void);
57
58 #endif /* TLS_FLS_GD25QXX_H */


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_gpio.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_gpio.h
1
8 #ifndef UNI_GPIO_H
9 #define UNI_GPIO_H
10
11 #include "uni_type_def.h"
12 #include "uni_io.h"
13
15 typedef void (*tls_gpio_irq_callback)(void *arg);
16
18 enum tls_gpio_dir {
19 UNI_GPIO_DIR_OUTPUT,
20 UNI_GPIO_DIR_INPUT
21 };
22
24 enum tls_gpio_attr {
25 UNI_GPIO_ATTR_FLOATING,
26 UNI_GPIO_ATTR_PULLHIGH,
27 UNI_GPIO_ATTR_PULLLOW
28 };
29
31 enum tls_gpio_irq_trig {
32 UNI_GPIO_IRQ_TRIG_RISING_EDGE,
33 UNI_GPIO_IRQ_TRIG_FALLING_EDGE,
34 UNI_GPIO_IRQ_TRIG_DOUBLE_EDGE,
35 UNI_GPIO_IRQ_TRIG_HIGH_LEVEL,
36 UNI_GPIO_IRQ_TRIG_LOW_LEVEL
37 };
38
71 void tls_gpio_cfg(enum tls_io_name gpio_pin, enum tls_gpio_dir dir, enum tls_gpio_attr attr);
72 void tls_gpio_cfg_attr(enum tls_io_name gpio_pin, enum tls_gpio_attr attr);
73 void tls_gpio_cfg_dir(enum tls_io_name gpio_pin, enum tls_gpio_dir dir);
74
85 u8 tls_gpio_read(enum tls_io_name gpio_pin);
86
87
100 void tls_gpio_write(enum tls_io_name gpio_pin, u8 value);
101
102
113 void tls_gpio_irq_enable(enum tls_io_name gpio_pin, enum tls_gpio_irq_trig mode);
114
115
125 void tls_gpio_irq_disable(enum tls_io_name gpio_pin);
126
127
138 u8 tls_get_gpio_irq_status(enum tls_io_name gpio_pin);
139 u8 tls_get_gpio_irq_status2(enum tls_io_name gpio_pin);
140
150 void tls_clr_gpio_irq_status(enum tls_io_name gpio_pin);
151
152
167 void tls_gpio_isr_register(enum tls_io_name gpio_pin,
168 tls_gpio_irq_callback callback,
169 void *arg);
179 #endif /* end of UNI_GPIO_H */
180


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_gpio_afsel.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_gpio_afsel.h
1
8 #ifndef UNI_GPIO_AFSEL_H
9 #define UNI_GPIO_AFSEL_H
10
11 #include "uni_gpio.h"
12 #include "uni_regs.h"
13 #include "uni_irq.h"
14 #include "uni_osal.h"
15 #include "tls_common.h"
41 void uni_spi_ck_config(enum tls_io_name io_name);
42
51 void uni_spi_cs_config(enum tls_io_name io_name);
52
61 void uni_spi_di_config(enum tls_io_name io_name);
62
71 void uni_spi_do_config(enum tls_io_name io_name);
72
73
81 void uni_uart0_tx_config(enum tls_io_name io_name);
82
90 void uni_uart0_rx_config(enum tls_io_name io_name);
91
99 void uni_uart1_tx_config(enum tls_io_name io_name);
100
108 void uni_uart1_rx_config(enum tls_io_name io_name);
109
117 void uni_uart1_rts_config(enum tls_io_name io_name);
118
126 void uni_uart1_cts_config(enum tls_io_name io_name);
127
135 void uni_uart2_tx_scio_config(enum tls_io_name io_name);
136
144 void uni_uart2_rx_config(enum tls_io_name io_name);
145
153 void uni_uart2_rts_scclk_config(enum tls_io_name io_name);
154
162 void uni_uart2_cts_config(enum tls_io_name io_name);
163
171 void uni_uart3_tx_config(enum tls_io_name io_name);
172
180 void uni_uart3_rx_config(enum tls_io_name io_name);
181
189 void uni_uart4_tx_config(enum tls_io_name io_name);
190
198 void uni_uart4_rx_config(enum tls_io_name io_name);
199
208 void uni_i2s_ck_config(enum tls_io_name io_name);
209
218 void uni_i2s_ws_config(enum tls_io_name io_name);
219
228 void uni_i2s_do_config(enum tls_io_name io_name);
229
238 void uni_i2s_di_config(enum tls_io_name io_name);
239
247 void uni_i2s_mclk_config(enum tls_io_name io_name);
248
256 void uni_i2s_extclk_config(enum tls_io_name io_name);
257
266 void uni_i2c_scl_config(enum tls_io_name io_name);
267
276 void uni_i2c_sda_config(enum tls_io_name io_name);
277
287 void uni_pwm1_config(enum tls_io_name io_name);
288
298 void uni_pwm2_config(enum tls_io_name io_name);
299
307 void uni_pwm3_config(enum tls_io_name io_name);
308
316 void uni_pwm4_config(enum tls_io_name io_name);
317
325 void uni_pwm5_config(enum tls_io_name io_name);
326
334 void uni_pwmbrk_config(enum tls_io_name io_name);
335
344 void uni_swd_config(bool enable);
345
354 void uni_adc_config(u8 Channel);
355
364 void uni_gpio_af_disable(void);
373 #endif /* end of UNI_GPIO_AFSEL_H */
374


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_hostspi.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_hostspi.h
1
8 #ifndef UNI_HOST_SPI_H
9 #define UNI_HOST_SPI_H
10
11 #include "uni_type_def.h"
12 #include "uni_list.h"
13 #ifndef CONFIG_KERNEL_NONE
14 #include "uni_osal.h"
15 #endif
16 #include "uni_ram_config.h"
17
18
19 #define SPI_USE_DMA
20
21 #define SPI_TX_DMA_MASK 0x01
22 #define SPI_RX_DMA_MASK 0x02
23
24 #define SPI_DMA_CMD_ADDR ((u32)(MASTER_SPI_DMA_ADDR))
25 #define SPI_DMA_CMD_MAX_SIZE (0x20)
26
27 #define SPI_DMA_BUF_ADDR ((u32)(SPI_DMA_CMD_ADDR + SPI_DMA_CMD_MAX_SIZE))
28 #define SPI_DMA_BUF_MAX_SIZE 8160
29
30 #define SPI_DMA_MAX_TRANS_SIZE 4092
31
35 #define TLS_SPI_STATUS_OK (0)
36 #define TLS_SPI_STATUS_EINVAL (-1)
37 #define TLS_SPI_STATUS_ENOMEM (-2)
38 #define TLS_SPI_STATUS_EBUSY (-3)
39 #define TLS_SPI_STATUS_ESHUTDOWN (-4)
40 #define TLS_SPI_STATUS_EPERM (-5)
41 #define TLS_SPI_STATUS_ECLKNOSUPPORT (-6)
42 #define TLS_SPI_STATUS_EMODENOSUPPORT (-7)
43
44 #define SPI_MASTER_FIFO_SIZE (32)
45
50 #define SPI_CPHA (0x01)
51 #define SPI_CPOL (0x02)
52 #define TLS_SPI_MODE_0 (0|0)
53 #define TLS_SPI_MODE_1 (0|SPI_CPHA)
54 #define TLS_SPI_MODE_2 (SPI_CPOL|0)
55 #define TLS_SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
56 #define TLS_SPI_CS_LOW 0x00
57 #define TLS_SPI_CS_HIGH 0x01
58 #define TLS_SPI_FCLK_MIN (1000)
59 #define TLS_SPI_FCLK_MAX (APB_CLK/2)
63 #define SPI_DEFAULT_SPEED (2000000)
64 #define SPI_DEFAULT_MODE (TLS_SPI_MODE_0)
65 #define SPI_CS_ACTIVE_MODE (TLS_SPI_CS_LOW)
66 #define SPI_CS_INACTIVE_MODE (TLS_SPI_CS_HIGH)
67
69 #define SPI_MESSAGE_STATUS_IDLE (0)
70 #define SPI_MESSAGE_STATUS_INPROGRESS (1)
71 #define SPI_MESSAGE_STATUS_DONE (2)
72
74 #define SPI_SLAVE_FLASH 0
75 #define SPI_SLAVE_CARD 1
76 #define SPI_SLAVE_CONTROL_PIN 0
77
78 #define SPI_BYTE_TRANSFER 0
79 #define SPI_WORD_TRANSFER 1
80 #define SPI_DMA_TRANSFER 2
90 struct tls_spi_transfer
91 {
92 struct dl_list transfer_list;
95 const void *tx_buf;
96 void *rx_buf;
97 u32 len;
98 u32 rx_len;
99 u32 delay_usecs;
100 };
101
102
111 struct tls_spi_message
112 {
113 struct dl_list queue;
116 struct dl_list transfers;
117 void (*complete) (void *);
118 void *context;
119 u32 status;
120 };
121
132 struct tls_spi_port
133 {
134 u32 speed_hz;
135 u8 cs_active;
137 u8 mode;
140 u8 reconfig;
141
142 struct dl_list wait_queue;
143 #ifndef CONFIG_KERNEL_NONE
144 tls_os_queue_t *lock;
145
146 tls_os_queue_t *msg_queue;
148 #endif
149 struct tls_spi_message *current_message;
151 u32 current_remaining_transfer;
154 struct tls_spi_transfer *current_transfer;
156 u32 current_remaining_bytes;
159 u8 transtype;
160 };
161
193 int tls_spi_init(void);
194
195
210 int tls_spi_setup(u8 mode, u8 cs_active, u32 fclk);
211
225 int tls_spi_write(const u8 * buf, u32 len);
226
240 int tls_spi_read(u8 * buf, u32 len);
241
257 int tls_spi_read_with_cmd(const u8 * txbuf, u32 n_tx, u8 * rxbuf, u32 n_rx);
258
274 int tls_spi_write_with_cmd(const u8 * cmd, u32 n_cmd, const u8 * txbuf, u32 n_tx);
275
289 void tls_spi_trans_type(u8 type);
290
294 void spi_start_transfer(u32 transfer_bytes);
299 #endif /* UNI_HOST_SPI_H */


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_hspi.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_hspi.h
1
10 #ifndef UNI_HSPI_H
11 #define UNI_HSPI_H
12
13 #include "uni_type_def.h"
14 #include "uni_ram_config.h"
15
16 #define HSPI_TX_MEM_MALLOC 0
18 #define HSPI_IO_REUSE_NUM 0
19 #define SDIO_IO_REUSE_NUM 2
20 #define HSPI_INTERFACE_SPI 2
21 #define HSPI_INTERFACE_SDIO 3
24 #define HSPI_RX_CMD_MSG 1
25 #define HSPI_RX_DATA_MSG 2
26
28 #define HSPI_TXBUF_NUM 2
29 #define HSPI_TX_DESC_NUM HSPI_TXBUF_NUM
30 #define HSPI_RXBUF_NUM 3//10
31 #define HSPI_RX_DESC_NUM HSPI_RXBUF_NUM
32 #define HSPI_TXBUF_SIZE 1500
33 #define HSPI_RXBUF_SIZE 1500
34
35 #define HSPI_TX_DESC_SIZE sizeof(struct tls_hspi_tx_desc)
36 #define HSPI_RX_DESC_SIZE sizeof(struct tls_hspi_rx_desc)
37
38 /*****************************************************************************
39 * sdio/hspi sram partition
40 * total size : 0x61800 - 0x67FFFF (26KB)
41 ******************************************************************************/
42 /* HSPI txbuf zone */
43 #define HSPI_TXBUF_BASE_ADDR ((u32)(SLAVE_HSPI_SDIO_ADDR))
44
45 #if HSPI_TX_MEM_MALLOC
46 #define HSPI_TXBUF_TOTAL_SIZE 0
47 #else
48 #define HSPI_TXBUF_TOTAL_SIZE (HSPI_TXBUF_SIZE * HSPI_TXBUF_NUM)
49 #endif
50
51 #define HSPI_TX_DESC_BASE_ADDR ((u32)(HSPI_TXBUF_BASE_ADDR + HSPI_TXBUF_TOTAL_SIZE))
52 #define HSPI_TX_DESC_TOTAL_SIZE (HSPI_TX_DESC_SIZE * HSPI_TX_DESC_NUM) //28*3=84
53
54 #define HSPI_RXBUF_BASE_ADDR ((u32)(HSPI_TX_DESC_BASE_ADDR + HSPI_TX_DESC_TOTAL_SIZE))
55 #define HSPI_RXBUF_TOTAL_SIZE (HSPI_RXBUF_NUM * HSPI_RXBUF_SIZE) //4500
56
57 #define HSPI_RX_DESC_BASE_ADDR ((u32)(HSPI_RXBUF_BASE_ADDR + HSPI_RXBUF_TOTAL_SIZE))
58 #define HSPI_RX_DESC_TOTAL_SIZE (HSPI_RX_DESC_SIZE * HSPI_RX_DESC_NUM) //36
59
60 #if 0
61 #define SDIO_CMD_RXBUF_SIZE (0x100)
62 #define SDIO_CMD_RXBUF_ADDR (0x00068000 - SDIO_CMD_RXBUF_SIZE)
63 #define SDIO_CIS1_ADDR (SDIO_CMD_RXBUF_ADDR - 0x80)
64 #define SDIO_CIS0_ADDR (SDIO_CIS1_ADDR - 0x80)
65 #else
66 #define SDIO_CIS0_ADDR (HSPI_RX_DESC_BASE_ADDR + HSPI_RX_DESC_TOTAL_SIZE) //128
67 #define SDIO_CIS1_ADDR (SDIO_CIS0_ADDR + 0x80) //128
68 #define SDIO_CMD_RXBUF_ADDR (SDIO_CIS1_ADDR + 0x80)
69 #define SDIO_CMD_RXBUF_SIZE 256//(1500) //256
70 #endif
71 #define CIS_FUN0_ADDR SDIO_CIS0_ADDR
72 #define CIS_FUN1_ADDR SDIO_CIS1_ADDR
73
74 #define FN0_TPL_FUNCID (CIS_FUN0_ADDR + 0x00)
75 #define FN0_TPL_FUNCE (CIS_FUN0_ADDR + 0x04)
76 #define FN0_TPL_FUNCE_MAXBLK (CIS_FUN0_ADDR + 0x08)
77 #define FN0_TPL_MANFID_MID (CIS_FUN0_ADDR + 0x0C)
78 #define FN0_TPL_END (CIS_FUN0_ADDR + 0x10)
79
80 #define FN1_TPL_FUNCID (CIS_FUN1_ADDR + 0x00)
81 #define FN1_TPL_FUNCE (CIS_FUN1_ADDR + 0x04)
82 #define FN1_TPL_FUNCE_VER (CIS_FUN1_ADDR + 0x08)
83 #define FN1_TPL_FUNCE_NSN (CIS_FUN1_ADDR + 0x0C)
84 #define FN1_TPL_FUNCE_CSASIZE (CIS_FUN1_ADDR + 0x10)
85 #define FN1_TPL_FUNCE_OCR (CIS_FUN1_ADDR + 0x14)
86 #define FN1_TPL_FUNCE_MINPWR (CIS_FUN1_ADDR + 0x18)
87 #define FN1_TPL_FUNCE_STANDBY (CIS_FUN1_ADDR + 0x1C)
88 #define FN1_TPL_FUNCE_OPTBW (CIS_FUN1_ADDR + 0x20)
89 #define FN1_TPL_FUNCE_NTIMEOUT (CIS_FUN1_ADDR + 0x24)
90 #define FN1_TPL_FUNCE_AVGPWR (CIS_FUN1_ADDR + 0x28)
91 #define FN1_TPL_END (CIS_FUN1_ADDR + 0x30)
92
94 //#define SDIO_RX_DATA_INT (0UL)
95 //#define SDIO_TX_DATA_INT (1UL)
96 //#define SDIO_RX_CMD_INT (2UL)
97 //#define SDIO_TX_CMD_INT (3UL)
98
100 #define HR_IOCTL_GP_SDIO HR_IOCTL_GP_SDIO_I2C
101
102
104 #define SDIO_WP_INT_SRC_CMD_DOWN (1UL<<3)
105 #define SDIO_WP_INT_SRC_CMD_UP (1UL<<2)
106 #define SDIO_WP_INT_SRC_DATA_DOWN (1UL<<1)
107 #define SDIO_WP_INT_SRC_DATA_UP (1UL<<0)
108
109
111 struct tls_hspi_tx_desc {
112 volatile u32 valid_ctrl;
113 u32 buf_info;
114 u32 buf_addr[3];
115 u32 next_desc_addr;
116 #if HSPI_TX_MEM_MALLOC
117 u32 txbuf_addr;
118 #endif
119 };
120
122 struct tls_hspi_rx_desc {
123 u32 valid_ctrl;
124 u32 buf_addr;
125 u32 next_desc_addr;
126 };
127
128
130 struct tls_slave_hspi {
131 u8 ifusermode;
132
133 s16 (*rx_cmd_callback)(char *buf);
134
135 s16 (*rx_data_callback)(char *buf);
136
137 s16 (*tx_data_callback)(char *buf);
138
139 struct tls_hspi_tx_desc *curr_tx_desc;
141 struct tls_hspi_rx_desc *curr_rx_desc;
143 #if HSPI_TX_MEM_MALLOC
144 u8 txdoneflag;
145 #endif
146 };
147
178 int tls_slave_spi_init(void);
179
191 void tls_set_hspi_user_mode(u8 ifenable);
192
193
203 void tls_set_high_speed_interface_type(int type);
204
205
215 void tls_hspi_rx_cmd_callback_register(s16 (*rx_cmd_callback)(char *buf));
216
217
227 void tls_hspi_rx_data_callback_register(s16 (*rx_data_callback)(char *buf));
228
238 void tls_hspi_tx_data_callback_register(s16 (*tx_data_callback)(char *buf));
239
240
252 int tls_hspi_tx_data(char *txbuf, int len);
253
262 #endif /* UNI_HSPI_H */


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_i2c.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_i2c.h
1 /**************************************************************************/
9 #ifndef __WM_I2C_H
10 #define __WM_I2C_H
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 #include "uni_regs.h"
17 #include "uni_type_def.h"
18 #include "uni_cpu.h"
19 #include "uni_irq.h"
20
21 typedef struct
22 {
23 __IO uint32_t PRER_LO;
24 __IO uint32_t PRER_HI;
25 __IO uint32_t CTRL;
26 __O uint32_t TX_RX;
27 __O uint32_t CR_SR;
28 __I uint32_t TXR;
29 __I uint32_t CR;
30 }I2C_T;
31 #define I2C ((I2C_T *)(HR_I2C_BASE_ADDR))
32
59 void tls_i2c_init(u32 freq);
60
62 #define uni_i2c_int_mask(bl) do { tls_bitband_write(HR_I2C_CTRL, 6, bl);}while(0);
63
68 void tls_i2c_stop(void);
69
76 int tls_i2c_wait_ack(void);
77
87 void tls_i2c_write_byte(u8 data, u8 ifstart);
88
96 u8 tls_i2c_read_byte(u8 ifack, u8 ifstop);
97
104 void uni_i2c_transfer_done_register(void (*done)(void));
105
116 int uni_i2c_start_write_it(uint8_t devaddr, uint8_t wordaddr, uint8_t * buf, uint16_t len);
117
124 int uni_i2c_start_read_it(uint8_t devaddr, uint8_t wordaddr, uint8_t * buf, uint16_t len);
133 #ifdef __cplusplus
134 }
135 #endif
136
137 #endif
138


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_i2s.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_i2s.h
1 #ifndef __WM_I2S_H
2 #define __WM_I2S_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <stdbool.h>
9 //#include "uni_regs_cm3.h"
10 #include "uni_regs.h"
11 #include "uni_debug.h"
12 #include "uni_dma.h"
13
14
15 typedef void (*tls_i2s_callback)(uint32_t *data, uint16_t *len);
16
17 typedef struct {
18 __IO uint32_t CTRL;
19 __IO uint32_t INT_MASK;
20 __IO uint32_t INT_SRC;
21 __I uint32_t INT_STATUS;
22 __O uint32_t TX;
23 __I uint32_t RX;
24 } I2S_T;
25
26
27 typedef struct {
28 uint32_t I2S_Mode_MS; //master or slave mode
29 uint32_t I2S_Mode_SS; //stereo or single channel
30 uint32_t I2S_Mode_LR; //left or right channel
31 uint32_t I2S_Trans_STD;
32 uint32_t I2S_DataFormat;
33 uint32_t I2S_AudioFreq;
34 uint32_t I2S_MclkFreq;
35 } I2S_InitDef;
36
37 typedef struct _wm_dma_desc
38 {
39 unsigned int valid;
40 unsigned int dma_ctrl;
41 unsigned int src_addr;
42 unsigned int dest_addr;
43 struct _wm_dma_desc * next;
44 }uni_dma_desc;
45
46 typedef struct _dma_handler_type
47 {
48 uint8_t channel;
49 void (* XferCpltCallback)( struct _dma_handler_type * hdma);
50 void (* XferHalfCpltCallback)( struct _dma_handler_type * hdma);
51 }uni_dma_handler_type;
52
53 #define I2S ((I2S_T *)HR_I2S_REG_BASE)
54
55 #define I2S_MODE_MASTER ((bool)0x0)
56 #define I2S_MODE_SLAVE ((bool)0x1)
57
58 #define I2S_RIGHT_CHANNEL ((bool)0x0)
59 #define I2S_LEFT_CHANNEL ((bool)0x1)
60
61 #define I2S_Standard (0x0UL)
62 #define I2S_Standard_MSB (0x1000000UL)
63 #define I2S_Standard_PCMA (0x2000000UL)
64 #define I2S_Standard_PCMB (0x3000000UL)
65
66 #define I2S_DataFormat_8 ((uint8_t)0x0)
67 #define I2S_DataFormat_16 ((uint8_t)0x10)
68 #define I2S_DataFormat_24 ((uint8_t)0x20)
69 #define I2S_DataFormat_32 ((uint8_t)0x30)
70
71 #define I2S_CTRL_CHSEL_MASK (1UL<<23)
72 #define I2S_CTRL_CHSEL_LEFT (1UL<<23)
73 #define I2S_CTRL_MONO (1UL<<22)
74 #define I2S_CTRL_STEREO (0UL<<22)
75 #define I2S_CTRL_RXDMA_EN (1UL<<21)
76 #define I2S_CTRL_TXDMA_EN (1UL<<20)
77 #define I2S_CTRL_RX_CLR (1UL<<19)
78 #define I2S_CTRL_TX_CLR (1UL<<18)
79 #define I2S_CTRL_LZCEN (1UL<<17)
80 #define I2S_CTRL_RZCEN (1UL<<16)
81 #define I2S_CTRL_RXTH(n) ((n-1)<<12)
82 #define I2S_CTRL_TXTH(n) ((n)<<9)
83 #define I2S_CTRL_SLAVE_SEL (1UL<<8)
84 #define I2S_CTRL_MUTE (1UL<<3)
85 #define I2S_CTRL_RXE (1UL<<2)
86 #define I2S_CTRL_TXE (1UL<<1)
87 #define I2S_CTRL_EN (1UL<<0)
88
89 #define I2S_INT_MASK_LZC ((uint16_t)0x200)
90 #define I2S_INT_MASK_RZC ((uint16_t)0x100)
91 #define I2S_INT_MASK_TXDONE ((uint16_t)0x080)
92 #define I2S_INT_MASK_TXTH ((uint16_t)0x040)
93 #define I2S_INT_MASK_TXOV ((uint16_t)0x020)
94 #define I2S_INT_MASK_TXUD ((uint16_t)0x010)
95 #define I2S_INT_MASK_RXDONE ((uint16_t)0x008)
96 #define I2S_INT_MASK_RXTH ((uint16_t)0x004)
97 #define I2S_INT_MASK_RXOV ((uint16_t)0x002)
98 #define I2S_INT_MASK_RXUD ((uint16_t)0x002)
99
100 #define I2S_FLAG_TX ((uint16_t)0x1000)
101 #define I2S_FLAG_RX ((uint16_t)0x0800)
102 #define I2S_FLAG_I2S ((uint16_t)0x0400)
103 #define I2S_FLAG_LZC ((uint16_t)0x0200)
104 #define I2S_FLAG_RZC ((uint16_t)0x0100)
105 #define I2S_FLAG_TXDONE ((uint16_t)0x0080)
106 #define I2S_FLAG_TXTH ((uint16_t)0x0040)
107 #define I2S_FLAG_TXOV ((uint16_t)0x0020)
108 #define I2S_FLAG_TXUD ((uint16_t)0x0010)
109 #define I2S_FLAG_RXDONE ((uint16_t)0x0008)
110 #define I2S_FLAG_RXTH ((uint16_t)0x0004)
111 #define I2S_FLAG_RXOV ((uint16_t)0x0002)
112 #define I2S_FLAG_RXUD ((uint16_t)0x0001)
113
114 #define UNI_I2S_TX_DMA_CHANNEL (1)
115 #define UNI_I2S_RX_DMA_CHANNEL (5)
116
117
118 typedef struct uni_i2s_buf_s {
119 volatile uint32_t *txbuf;
120 volatile uint32_t txlen;
121 volatile uint32_t txtail;
122 volatile uint32_t *rxbuf;
123 volatile uint32_t rxlen;
124 volatile uint32_t int_txlen;
125 volatile uint32_t rxhead;
126 volatile uint8_t rxdata_ready;
127 volatile uint8_t txdata_done;
128
130 void (*rx_callback)(void);
132 void (*tx_callback)(uint32_t *data, uint16_t *len);
133 } uni_i2s_buf_t;
162 void uni_i2s_register_callback(tls_i2s_callback callback);
163
171 int uni_i2s_port_init(I2S_InitDef *opts);
172
177 void uni_i2s_tx_rx_stop(void);
178
192 int uni_i2s_tx_int(int16_t *data, uint16_t len, int16_t *next_data);
193
207 int uni_i2s_tx_dma(int16_t *data, uint16_t len, int16_t *next_data);
208
224 int uni_i2s_tx_dma_link(int16_t *data, uint16_t len, int16_t *next_data);
225
237 int uni_i2s_rx_int(int16_t *data, uint16_t len);
238
250 int uni_i2s_rx_dma(int16_t *data, uint16_t len);
251
266 int uni_i2s_tx_rx_int(I2S_InitDef *opts, int16_t *data_tx, int16_t *data_rx, uint16_t len);
267
282 int uni_i2s_tx_rx_dma(I2S_InitDef *opts, int16_t *data_tx, int16_t *data_rx, uint16_t len);
283
284 int uni_i2s_transmit_dma(uni_dma_handler_type *hdma, uint16_t *data, uint16_t len);
285 int uni_i2s_receive_dma(uni_dma_handler_type *hdma, uint16_t *data, uint16_t len);
286
287
288 void uni_i2s_set_format(uint32_t format);
289 void uni_i2s_set_word_len(uint8_t len);
290 void uni_i2s_set_freq(uint32_t lr_freq, uint32_t mclk);
291 void uni_i2s_left_channel_sel(bool bl);
292 void uni_i2s_mono_select(bool bl);
293 void uni_i2s_enable(bool bl);
294 void uni_i2s_set_mode(bool bl);
295 void uni_i2s_tx_enable(bool bl);
296 void uni_i2s_tx_dma_enable(bool bl);
297 void uni_i2s_rx_enable(bool bl);
298 void uni_i2s_rx_dma_enable(bool bl);
299 void uni_i2s_module_reset(void);
300 void uni_i2s_int_clear_all(void);
301 void uni_i2s_int_mask_all(void);
302 void uni_i2s_set_txth(uint8_t th);
303 void uni_i2s_set_rxth(uint8_t th);
304 void uni_i2s_rx_fifo_clear();
305 void uni_i2s_tx_fifo_clear();
306
307
317 #ifdef __cplusplus
318 }
319 #endif
320
321 #endif


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_internal_flash.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_internal_flash.h
1
9 #ifndef UNI_INTERNAL_FLASH_H
10 #define UNI_INTERNAL_FLASH_H
11
12 #include "uni_type_def.h"
13 #include "uni_osal.h"
14
15 typedef volatile unsigned char vu8;
16 typedef volatile unsigned short vu16;
17 typedef volatile unsigned long vu32;
18
19 #define M8(adr) (*((vu8 *) (adr)))
20 #define M16(adr) (*((vu16*) (adr)))
21 #define M32(adr) (*((vu32*) (adr)))
22
23
24 #define INSIDE_FLS_SECTOR_SIZE 0x1000
25 #define INSIDE_FLS_PAGE_SIZE 256
26
27
28 #define INSIDE_FLS_BASE_ADDR 0x8000000UL
29 #define INSIDE_FLS_SECBOOT_ADDR (INSIDE_FLS_BASE_ADDR + 0x02000)
30
31
32
33 enum TYPE_FLASH_ID{
34 SPIFLASH_MID_GD = 0xC8,
35 SPIFLASH_MID_ESMT = 0x1C,
36 SPIFLASH_MID_PUYA = 0x85,
37 SPIFLASH_MID_WINBOND = 0xEF,
38 SPIFLASH_MID_FUDANMICRO = 0xA1,
39 SPIFLASH_MID_BOYA = 0x68,
40 SPIFLASH_MID_XMC = 0x20,
41 SPIFLASH_MID_XTX = 0x0B,
42 SPIFLASH_MID_TSINGTENG = 0xEB, /*UNIGROUP TSINGTENG*/
43 };
44
45 typedef union {
46 struct {
47 uint32_t encrypt_en: 1;
48 uint32_t code_decrypt:1;
49 uint32_t key_ready: 1;
50 uint32_t data_decrypt:1;
51 uint32_t key_sel: 1;
52 uint32_t _reserved0: 27;
53 } b;
54 uint32_t w;
55 } FLASH_ENCRYPT_CTRL_Type;
56
60 typedef struct
61 {
62 vu32 ACR;
63 vu32 KEYR;
64 vu32 SR;
65 vu32 CR;
66 vu32 AR;
67 } FLASH_TypeDef;
68
69 #define FLASH_HS 0x00000001
70
72 #define RDPRT_KEY 0x5AA5
73 #define FLASH_KEY1 0x57696E6E
74 #define FLASH_KEY2 0x65724D69
75 #define FLASH_KEY3 0x63726F21
76
78 #define FLASH_PG 0x00000001
79 #define FLASH_PER 0x00000002
80 #define FLASH_MER 0x00000004
81 #define FLASH_STRT 0x00000008
82 #define FLASH_LOCK 0x00000020
83 #define FLASH_ERRIE 0x00000040
84 #define FLASH_EOPIE 0x00000080
85
87 #define FLASH_BSY 0x00000001
88 #define FLASH_PGERR 0x00000002
89 #define FLASH_EOP 0x00000004
90
91
92 #define TLS_FLS_STATUS_OK (0)
93 #define TLS_FLS_STATUS_EINVAL (1)
94 #define TLS_FLS_STATUS_EBUSY (2)
95 #define TLS_FLS_STATUS_EPERM (3)
96 #define TLS_FLS_STATUS_ENOSUPPORT (4)
97 #define TLS_FLS_STATUS_EEXIST (5)
98 #define TLS_FLS_STATUS_ENOMEM (6)
99 #define TLS_FLS_STATUS_EOVERFLOW (7)
100 #define TLS_FLS_STATUS_ENODEV (8)
101 #define TLS_FLS_STATUS_EDEV (9)
102 #define TLS_FLS_STATUS_EIO (10)
103 #define TLS_FLS_STATUS_ENODRV (11)
104
105 #define TLS_FLS_PARAM_TYPE_ID (0)
106 #define TLS_FLS_PARAM_TYPE_SIZE (1)
107 #define TLS_FLS_PARAM_TYPE_PAGE_SIZE (2)
108 #define TLS_FLS_PARAM_TYPE_PROG_SIZE (3)
109 #define TLS_FLS_PARAM_TYPE_SECTOR_SIZE (4)
110
111 #define TLS_FLS_FLAG_UNDER_PROTECT (1<<0)
112 #define TLS_FLS_FLAG_FAST_READ (1<<1)
113 #define TLS_FLS_FLAG_AAAI (1<<2)
114
115 #define CMD_START_Pos 8U
116 #define CMD_START_Msk (1UL << CMD_START_Pos)
121 struct tls_inside_fls
122 {
123 tls_os_sem_t *fls_lock;
124 };
125
156 int tls_flash_unlock(void);
157
167 int tls_flash_lock(void);
168
169
179 void tls_fls_sem_lock(void);
180
190 void tls_fls_sem_unlock(void);
191
192
204 int tls_fls_init(void);
205
218 int tls_fls_read(u32 addr, u8 * buf, u32 len);
219
220
236 int tls_fls_write(u32 addr, u8 * buf, u32 len);
237 int tls_fls_write_without_erase(u32 addr, u8 *buf, u32 len);
238
249 int tls_fls_erase(u32 sector);
250
260 void tls_fls_sys_param_postion_init(void);
261
262
263 #endif /* UNI_INTERNAL_FLASH_H */


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_io.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_io.h
1
8 #ifndef UNI_IO_H
9 #define UNI_IO_H
10
11
12 #define TLS_IO_AB_OFFSET (0x40011400 - 0x40011200)
13
15 enum tls_io_name {
16 UNI_IO_PA_00 = 0,
17 UNI_IO_PA_01,
18 UNI_IO_PA_02,
19 UNI_IO_PA_03,
20 UNI_IO_PA_04,
21 UNI_IO_PA_05,
22 UNI_IO_PA_06,
23 UNI_IO_PA_07,
24 UNI_IO_PA_08,
25 UNI_IO_PA_09,
26 UNI_IO_PA_10,
27 UNI_IO_PA_11,
28 UNI_IO_PA_12,
29 UNI_IO_PA_13,
30 UNI_IO_PA_14,
31 UNI_IO_PA_15,
33 UNI_IO_PB_00,
34 UNI_IO_PB_01,
35 UNI_IO_PB_02,
36 UNI_IO_PB_03,
37 UNI_IO_PB_04,
38 UNI_IO_PB_05,
39 UNI_IO_PB_06,
40 UNI_IO_PB_07,
41 UNI_IO_PB_08,
42 UNI_IO_PB_09,
43 UNI_IO_PB_10,
44 UNI_IO_PB_11,
45 UNI_IO_PB_12,
46 UNI_IO_PB_13,
47 UNI_IO_PB_14,
48 UNI_IO_PB_15,
49 UNI_IO_PB_16,
50 UNI_IO_PB_17,
51 UNI_IO_PB_18,
52 UNI_IO_PB_19,
53 UNI_IO_PB_20,
54 UNI_IO_PB_21,
55 UNI_IO_PB_22,
56 UNI_IO_PB_23,
57 UNI_IO_PB_24,
58 UNI_IO_PB_25,
59 UNI_IO_PB_26,
60 UNI_IO_PB_27,
61 UNI_IO_PB_28,
62 UNI_IO_PB_29,
63 UNI_IO_PB_30,
64 UNI_IO_PB_31
65 };
66
68 #define UNI_IO_OPTION1 1
69
70 #define UNI_IO_OPTION2 2
71
72 #define UNI_IO_OPTION3 3
73
74 #define UNI_IO_OPTION4 4
75
76 #define UNI_IO_OPTION5 5
77
78 #define UNI_IO_OPTION6 6
79
80
81 /* io option1 */
82 #define UNI_IO_OPT1_I2C_DAT UNI_IO_OPTION1
83 #define UNI_IO_OPT1_PWM1 UNI_IO_OPTION1
84 #define UNI_IO_OPT1_PWM2 UNI_IO_OPTION1
85 #define UNI_IO_OPT1_PWM3 UNI_IO_OPTION1
86 #define UNI_IO_OPT1_PWM4 UNI_IO_OPTION1
87 #define UNI_IO_OPT1_PWM5 UNI_IO_OPTION1
88 #define UNI_IO_OPT1_UART0_RXD UNI_IO_OPTION1
89 #define UNI_IO_OPT1_UART0_TXD UNI_IO_OPTION1
90 #define UNI_IO_OPT1_PWM_BRAKE UNI_IO_OPTION1
91 #define UNI_IO_OPT1_I2S_M_EXTCLK UNI_IO_OPTION1
92 #define UNI_IO_OPT1_SPI_M_DO UNI_IO_OPTION1
93 #define UNI_IO_OPT1_SPI_M_DI UNI_IO_OPTION1
94 #define UNI_IO_OPT1_SPI_M_CS UNI_IO_OPTION1
95 #define UNI_IO_OPT1_SPI_M_CK UNI_IO_OPTION1
96 #define UNI_IO_OPT1_I2S_S_RL UNI_IO_OPTION1
97 #define UNI_IO_OPT1_I2S_S_SCL UNI_IO_OPTION1
98 #define UNI_IO_OPT1_I2S_S_SDA UNI_IO_OPTION1
99 #define UNI_IO_OPT1_I2S_M_RL UNI_IO_OPTION1
100 #define UNI_IO_OPT1_I2S_M_SCL UNI_IO_OPTION1
101 #define UNI_IO_OPT1_I2S_M_SDA UNI_IO_OPTION1
102 #define UNI_IO_OPT1_JTAG_RST UNI_IO_OPTION1
103 #define UNI_IO_OPT1_JTAG_TDO UNI_IO_OPTION1
104 #define UNI_IO_OPT1_JTAG_TDI UNI_IO_OPTION1
105 #define UNI_IO_OPT1_JTAG_TCK_SWDCK UNI_IO_OPTION1
106 #define UNI_IO_OPT1_JTAG_TMS_SWDAT UNI_IO_OPTION1
107 #define UNI_IO_OPT1_UART1_RXD UNI_IO_OPTION1
108 #define UNI_IO_OPT1_UART1_TXD UNI_IO_OPTION1
109 #define UNI_IO_OPT1_UART1_RTS UNI_IO_OPTION1
110 #define UNI_IO_OPT1_UART1_CTS UNI_IO_OPTION1
111 #define UNI_IO_OPT1_SDIO_DAT UNI_IO_OPTION1
112
113 /* io option2 */
114 #define UNI_IO_OPT2_PWM1 UNI_IO_OPTION2
115 #define UNI_IO_OPT2_PWM2 UNI_IO_OPTION2
116 #define UNI_IO_OPT2_PWM3 UNI_IO_OPTION2
117 #define UNI_IO_OPT2_PWM4 UNI_IO_OPTION2
118 #define UNI_IO_OPT2_PWM5 UNI_IO_OPTION2
119 #define UNI_IO_OPT2_SPI_M_DO UNI_IO_OPTION2
120 #define UNI_IO_OPT2_SPI_M_DI UNI_IO_OPTION2
121 #define UNI_IO_OPT2_SPI_M_CS UNI_IO_OPTION2
122 #define UNI_IO_OPT2_SPI_M_CK UNI_IO_OPTION2
123 #define UNI_IO_OPT2_I2C_SCL UNI_IO_OPTION2
124 #define UNI_IO_OPT2_I2S_M_EXTCLK UNI_IO_OPTION2
125 #define UNI_IO_OPT2_UART1_RXD UNI_IO_OPTION2
126 #define UNI_IO_OPT2_UART1_TXD UNI_IO_OPTION2
127 #define UNI_IO_OPT2_UART1_RTS UNI_IO_OPTION2
128 #define UNI_IO_OPT2_UART1_CTS UNI_IO_OPTION2
129 #define UNI_IO_OPT2_I2C_DAT UNI_IO_OPTION2
130 #define UNI_IO_OPT2_PWM_BRAKE UNI_IO_OPTION2
131 #define UNI_IO_OPT2_UART0_RTS UNI_IO_OPTION2
132 #define UNI_IO_OPT2_UART0_CTS UNI_IO_OPTION2
133 #define UNI_IO_OPT2_SDIO_DAT UNI_IO_OPTION2
134 #define UNI_IO_OPT2_HSPI_CK UNI_IO_OPTION2
135 #define UNI_IO_OPT2_HSPI_INT UNI_IO_OPTION2
136 #define UNI_IO_OPT2_HSPI_CS UNI_IO_OPTION2
137 #define UNI_IO_OPT2_HSPI_DI UNI_IO_OPTION2
138 #define UNI_IO_OPT2_HSPI_DO UNI_IO_OPTION2
139
140 /* io option3 */
141 #define UNI_IO_OPT3_UART0_RXD UNI_IO_OPTION3
142 #define UNI_IO_OPT3_UART0_TXD UNI_IO_OPTION3
143 #define UNI_IO_OPT3_UART0_RTS UNI_IO_OPTION3
144 #define UNI_IO_OPT3_UART0_CTS UNI_IO_OPTION3
145 #define UNI_IO_OPT3_SPI_M_DO UNI_IO_OPTION3
146 #define UNI_IO_OPT3_SPI_M_DI UNI_IO_OPTION3
147 #define UNI_IO_OPT3_SPI_M_CS UNI_IO_OPTION3
148 #define UNI_IO_OPT3_SDIO_CK UNI_IO_OPTION3
149 #define UNI_IO_OPT3_SDIO_CMD UNI_IO_OPTION3
150 #define UNI_IO_OPT3_SDIO_DAT UNI_IO_OPTION3
151
152 /* io option4 */
153 #define UNI_IO_OPT4_I2S_M_MCLK UNI_IO_OPTION4
154 #define UNI_IO_OPT4_I2S_M_RL UNI_IO_OPTION4
155 #define UNI_IO_OPT4_I2S_M_SCL UNI_IO_OPTION4
156 #define UNI_IO_OPT4_I2S_M_SDA UNI_IO_OPTION4
157
158 /* io option5 */
159 #define UNI_IO_OPT5_GPIO UNI_IO_OPTION5
160
161 /* io option6 */
162 #define UNI_IO_OPT6_ADC UNI_IO_OPTION6
163 #define UNI_IO_OPT6_LCD_COM UNI_IO_OPTION6
164 #define UNI_IO_OPT6_LCD_SEG UNI_IO_OPTION6
165
166
177 void tls_io_cfg_set(enum tls_io_name name, u8 option);
178
179
189 int tls_io_cfg_get(enum tls_io_name name);
190
191
192 #endif /* end of UNI_IO_H */
193


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_irq.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_irq.h
1
9 #ifndef UNI_IRQ_H
10 #define UNI_IRQ_H
11
12 #include "uni_type_def.h"
13
14 typedef void (*intr_handler_func) (void *);
15
19 typedef struct tls_irq_handler
20 {
21 void (*handler) (void *);
22 void *data;
23 u32 counter;
24 } tls_irq_handler_t;
25
55 void tls_irq_init(void);
56
68 void tls_irq_register_handler(u8 vec_no, intr_handler_func handler, void *data);
69 void tls_irq_unregister_handler(u8 vec_no);
70
80 void tls_irq_enable(u8 vec_no);
81
91 void tls_irq_disable(u8 vec_no);
92
93
103 u8 tls_get_isr_count(void);
104
113 #endif /* UNI_IRQ_H */


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_lcd.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_lcd.h
1
9 #ifndef __WM_LCD_H
10 #define __WM_LCD_H
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 #include "uni_regs.h"
17 #include <stdbool.h>
18
23 typedef struct
24 {
26 __IO uint32_t CTRL;
28 __IO uint32_t FRAMECNT;
29 __IO uint32_t COM0;
30 __IO uint32_t COM1;
31 __IO uint32_t COM2;
32 __IO uint32_t COM3;
33 __IO uint32_t COM4;
34 __IO uint32_t COM5;
35 __IO uint32_t COM6;
36 __IO uint32_t COM7;
38 __IO uint32_t COM_EN;
40 __IO uint32_t SEG_EN;
41 } LCD_T;
43 #define LCD ((LCD_T *)HR_LCD_REG_BASE)
44
45 typedef enum
46 {
48 BIAS_STATIC = LCD_BIAS_STATIC,
50 BIAS_ONEHALF = LCD_BIAS_ONEHALF,
52 BIAS_ONETHIRD = LCD_BIAS_ONETHIRD,
54 BIAS_ONEFOURTH = LCD_BIAS_ONEFOURTH,
55 } LCD_BiasDef;
56
57 typedef enum
58 {
60 VLCD27 = LCD_VLCD_27,
62 VLCD29 = LCD_VLCD_29,
64 VLCD31 = LCD_VLCD_31,
66 VLCD33 = LCD_VLCD_33,
67 } LCD_VlcdDef;
68
69 typedef enum
70 {
72 DUTY_STATIC = LCD_DUTY_STATIC,
74 DUTY_ONEHALF = LCD_DUTY_ONEHALF,
76 DUTY_ONETHIRD = LCD_DUTY_ONETHIRD,
78 DUTY_ONEFOURTH = LCD_DUTY_ONEFOURTH,
80 DUTY_ONEFIFTH = LCD_DUTY_ONEFIFTH,
82 DUTY_ONESIXTH = LCD_DUTY_ONESIXTH,
84 DUTY_ONESEVENTH = LCD_DUTY_ONESEVENTH,
86 DUTY_ONEEIGHTH = LCD_DUTY_ONEEIGHTH,
87 } LCD_DutyDef;
88
89 typedef struct tls_lcd_options
90 {
92 bool enable;
94 LCD_BiasDef bias;
96 LCD_DutyDef duty;
98 LCD_VlcdDef vlcd;
100 uint8_t com_number;
102 uint16_t fresh_rate;
103 } tls_lcd_options_t;
104
105
131 void tls_lcd_fresh_ratio(uint8_t com_num, uint16_t freq);
132
137 void tls_lcd_init(tls_lcd_options_t *opts);
138
144 void tls_lcd_fresh_rate(uint16_t freq);
145
153 void tls_lcd_seg_set(int com, int bit, int on_off);
154
163 void tls_lcd_vlcd_sel(LCD_VlcdDef vlcd);
164
178 void tls_lcd_duty_set(LCD_DutyDef duty);
179
189 void tls_lcd_bias_set(LCD_BiasDef bias);
190
195 #define TLS_LCD_CLK_ENABLE(enable) \
196 do { \
197 tls_bitband_write(HR_CLK_BASE_ADDR, HR_CLK_LCD_GATE_Pos, enable); \
198 } while(0)
199
200
206 #define TLS_LCD_ENABLE(enable) \
207 do { \
208 tls_bitband_write(HR_LCD_CR, LCD_CR_EN_Pos, enable); \
209 } while(0)
210
216 #define TLS_LCD_POWERDOWM(enable) \
217 do { \
218 tls_bitband_write(HR_LCD_CR, LCD_CR_PD_Pos, enable); \
219 } while(0)
220
229 #ifdef __cplusplus
230 }
231 #endif
232
233 #endif
234
235


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_pmu.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_pmu.h
1
8 #ifndef UNI_PMU_H
9 #define UNI_PMU_H
10
11 #include "uni_type_def.h"
12
14 typedef enum {
15 TLS_PERIPHERAL_TYPE_I2C = (1 << 0),
16 TLS_PERIPHERAL_TYPE_UART0 = (1 << 1),
17 TLS_PERIPHERAL_TYPE_UART1 = (1 << 2),
18 TLS_PERIPHERAL_TYPE_UART2 = (1 << 3),
19 TLS_PERIPHERAL_TYPE_UART3 = (1 << 4),
20 TLS_PERIPHERAL_TYPE_UART4 = (1 << 5),
23 TLS_PERIPHERAL_TYPE_LSPI = (1 << 7),
24 TLS_PERIPHERAL_TYPE_DMA = (1 << 8),
26 TLS_PERIPHERAL_TYPE_TIMER = (1 << 10),
27 TLS_PERIPHERAL_TYPE_GPIO = (1 << 11),
28 TLS_PERIPHERAL_TYPE_SDADC = (1 << 12),
29 TLS_PERIPHERAL_TYPE_PWM = (1 << 13),
31 TLS_PERIPHERAL_TYPE_I2S = (1 << 15),
32 TLS_PERIPHERAL_TYPE_RSA = (1 << 16),
33 TLS_PERIPHERAL_TYPE_GPSEC = (1 << 17),
35 TLS_PERIPHERAL_TYPE_BT = (1<<20),
36 }tls_peripheral_type_s;
37
39 typedef void (*tls_pmu_irq_callback)(void *arg);
40
76 void tls_pmu_timer1_isr_register(tls_pmu_irq_callback callback, void *arg);
77
78
93 void tls_pmu_timer0_isr_register(tls_pmu_irq_callback callback, void *arg);
94
95
110 void tls_pmu_gpio_isr_register(tls_pmu_irq_callback callback, void *arg);
111
112
127 void tls_pmu_sdio_isr_register(tls_pmu_irq_callback callback, void *arg);
128
129
141 void tls_pmu_clk_select(u8 bypass);
142
143
153 void tls_pmu_timer0_start(u16 second);
154
155
165 void tls_pmu_timer0_stop(void);
166
167
168
178 void tls_pmu_timer1_start(u16 msec);
179
180
190 void tls_pmu_timer1_stop(void);
191
192
193
203 void tls_pmu_standby_start(void);
204
205
215 void tls_pmu_sleep_start(void);
216
226 void tls_close_peripheral_clock(tls_peripheral_type_s devices);
227
237 void tls_open_peripheral_clock(tls_peripheral_type_s devices);
246 #endif
247
248


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_psram.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_psram.h
1 #ifndef __WM_PSRAM_H__
2 #define __WM_PSRAM_H__
3
4 #define PSRAM_ADDR_START 0x30000000
5 #define PSRAM_SIZE_BYTE 0x00800000
6
7 typedef enum{
8 PSRAM_SPI = 0,
9 PSRAM_QPI,
10 } psram_mode_t;
40 void psram_init(psram_mode_t mode);
41
53 int memcpy_dma(unsigned char *dst, unsigned char *src, int num);
61 #endif
62
63
64
65
66


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_pwm.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_pwm.h
1
8 #ifndef UNI_PWM_H
9 #define UNI_PWM_H
10
11 #include "uni_type_def.h"
12
13
15 #define PWM_CHANNEL_MAX_NUM 5
16
18 enum tls_pwm_out_mode
19 {
20 UNI_PWM_OUT_MODE_BRAKE = 0,
21 UNI_PWM_OUT_MODE_ALLSYC,
22 UNI_PWM_OUT_MODE_2SYC,
23 UNI_PWM_OUT_MODE_MC,
24 UNI_PWM_OUT_MODE_INDPT
25 };
26
28 enum tls_pwm_cap_int_type{
29 UNI_PWM_CAP_RISING_EDGE_INT,
30 UNI_PWM_CAP_FALLING_EDGE_INT,
31 UNI_PWM_CAP_RISING_FALLING_EDGE_INT,
32 UNI_PWM_CAP_DMA_INT
33 };
34
36 enum tls_pwm_out_en_state{
37 UNI_PWM_OUT_EN_STATE_TRI,
38 UNI_PWM_OUT_EN_STATE_OUT
39 };
40
42 enum tls_pwm_cnt_type{
43 UNI_PWM_CNT_TYPE_EDGE_ALLGN_CAP,
44 UNI_PWM_CNT_TYPE_EDGE_ALIGN_OUT,
45 UNI_PWM_CNT_TYPE_CENTER_ALIGN
46 };
47
49 enum tls_pwm_loop_type{
50 UNI_PWM_LOOP_TYPE_SINGLE,
51 UNI_PWM_LOOP_TYPE_LOOP
52 };
53
55 enum tls_pwm_waveform_inversion{
56 UNI_PWM_WAVEFORM_NOINVERSION,
57 UNI_PWM_WAVEFORM_INVERSION
58 };
59
61 enum tls_pwm_brake_out_level{
62 UNI_PWM_BRAKE_OUT_HIGH,
63 UNI_PWM_BRAKE_OUT_LOW
64 };
65
67 typedef struct _pwm_init_param{
68 enum tls_pwm_out_mode mode;
69 u8 channel;
70 u16 clkdiv;
71 u8 period;
72 u8 duty;
73 bool dten;
74 u8 dtclkdiv;
75 u8 dtcnt;
76 enum tls_pwm_cnt_type cnt_type;
77 enum tls_pwm_loop_type loop_type;
78 bool inverse_en;
79 u8 pnum;
80 bool pnum_int;
81 }pwm_init_param;
82
83 typedef void (*pwm_irq_callback)(void *arg);
84
114 void tls_pwm_isr_register(u8 channel, pwm_irq_callback callback, void *arg);
115
127 int tls_pwm_duty_config(u8 channel, u8 duty);
128
141 int tls_pwm_freq_config(u8 channel, u16 clkdiv, u8 period);
142
154 int tls_pwm_out_mode_config(u8 channel, enum tls_pwm_out_mode mode);
155
167 int tls_pwm_cnt_type_config(u8 channel, enum tls_pwm_cnt_type cnt_type);
168
180 int tls_pwm_loop_mode_config(u8 channel, enum tls_pwm_loop_type loop_mode);
181
194 int tls_pwm_out_inverse_cmd(u8 channel, bool en);
195
207 int tls_pwm_stoptime_by_period_config(u8 channel, u8 pnum);
208
220 int tls_pwm_output_en_cmd(u8 channel, bool en);
221
235 int tls_pwm_deadzone_config(u8 channel, bool dten, u8 dtclkdiv, u8 dtcnt);
236
248 int tls_pwm_capture_inverse_cmd(u8 channel, bool en);
249
262 int tls_pwm_brake_mode_config(u8 channel, bool en, enum tls_pwm_brake_out_level brok);
263
274 int tls_pwm_capture_mode_config(u8 channel);
275
287 int tls_pwm_stoptime_irq_cmd(u8 channel, bool en);
288
301 int tls_pwm_capture_irq_type_config(u8 channel, enum tls_pwm_cap_int_type int_type);
302
313 int tls_pwm_out_init(pwm_init_param *pwm_param);
314
328 int tls_pwm_cap_init(u8 channel, u16 clkdiv, bool inverse_en, enum tls_pwm_cap_int_type int_type);
329
340 int tls_pwm_start(u8 channel);
341
352 void tls_pwm_freq_set(u8 channel, u32 freq);
353
364 void tls_pwm_duty_set(u8 channel, u8 duty);
365
378 int tls_pwm_init(u8 channel,u32 freq, u8 duty, u8 pnum);
379
390 int tls_pwm_stop(u8 channel);
391
392
393 u16 tls_pwm_get_clkdiv(u8 channel);
394
403 #endif /* UNI_PWM_H */


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_rtc.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_rtc.h
1
8 #ifndef UNI_RTC_H
9 #define UNI_RTC_H
10
11 #include <time.h>
12 #include "uni_type_def.h"
13
15 typedef void (*tls_rtc_irq_callback)(void *arg);
16
46 void tls_set_rtc(struct tm *tblock);
47
57 void tls_get_rtc(struct tm *tblock);
58
73 void tls_rtc_isr_register(tls_rtc_irq_callback callback, void *arg);
74
84 void tls_rtc_timer_start(struct tm *tblock);
85
95 void tls_rtc_timer_stop(void);
96
97
106 #endif
107


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_sasc.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_sasc.h
1 #ifndef __WM_SASC_H_
2 #define __WM_SASC_H_
3
4 #include <core_804.h>
5 #include "uni_regs.h"
6
7 #define HR_SASC_B1_BASE (DEVICE_BASE_ADDR + 0xB000)
8 #define HR_SASC_FLASH_BASE (DEVICE_BASE_ADDR + 0xB100)
9 #define HR_SASC_B2_BASE (DEVICE_BASE_ADDR + 0xB200)
10
11 #define _R1_Pos(val, rgn) ((val&0x1) << (rgn))
12 #define _R1_Msk(rgn) (0x1 << (rgn))
13 #define _R2_Pos(val, rgn) ((val&0x3) << (2*rgn))
14 #define _R2_Msk(rgn) (0x3 << (2*rgn))
15
16 typedef enum {
17 SASC_UN_SE_USER = 0,
18 SASC_UN_SE_SUPER,
19 SASC_SE_USER,
20 SASC_SE_SUPER
21 } sasc_car_e;
22
23 typedef enum {
24 SASC_AP_RW = 0,
25 SASC_AP_RO,
26 SASC_AP_WO,
27 SASC_AP_DENYALL
28 } sasc_ap_e;
29
30 typedef enum {
31 SASC_CD_DA_OF = 0,
32 SASC_CD_DA,
33 SASC_CD_OF,
34 SASC_CD_DENYALL
35 } sasc_cd_e;
36
37 typedef enum {
38 SASC_REGION_SIZE_4B = 0x5,
39 SASC_REGION_SIZE_8B,
40 SASC_REGION_SIZE_16B,
41 SASC_REGION_SIZE_32B,
42 SASC_REGION_SIZE_64B,
43 SASC_REGION_SIZE_128B,
44 SASC_REGION_SIZE_256B,
45 SASC_REGION_SIZE_512B,
46 SASC_REGION_SIZE_1KB,
47 SASC_REGION_SIZE_2KB,
48 SASC_REGION_SIZE_4KB,
49 SASC_REGION_SIZE_8KB,
50 SASC_REGION_SIZE_16KB,
51 SASC_REGION_SIZE_32KB,
52 SASC_REGION_SIZE_64KB,
53 SASC_REGION_SIZE_128KB,
54 SASC_REGION_SIZE_256KB,
55 SASC_REGION_SIZE_512KB,
56 SASC_REGION_SIZE_1MB,
57 SASC_REGION_SIZE_2MB,
58 SASC_REGION_SIZE_4MB,
59 SASC_REGION_SIZE_8MB
60 } sasc_region_size_e;
61
62 typedef struct {
63 sasc_car_e car; /* security and user or super */
64 sasc_ap_e ap; /* super user and normal user access.*/
65 sasc_cd_e cd; /* instruction fetched excution */
66 } sasc_region_attr_t;
67
68 typedef struct {
69 __IOM uint32_t CAR;
70 __IOM uint32_t CR;
71 __IOM uint32_t AP0;
72 __IOM uint32_t CD0;
73 __IOM uint32_t AP1;
74 __IOM uint32_t CD1;
75 __IOM uint32_t AP2;
76 __IOM uint32_t CD2;
77 __IOM uint32_t REGION[8];
78 } SASC_Type;
79
80 #define SASC_B1 ((SASC_Type *) HR_SASC_B1_BASE)
81 #define SASC_FLASH ((SASC_Type *) HR_SASC_FLASH_BASE)
82 #define SASC_B2 ((SASC_Type *) HR_SASC_B2_BASE)
83
114 void uni_sasc_enable_region(SASC_Type *block, uint32_t idx);
115
126 void uni_sasc_disable_region(SASC_Type *block, uint32_t idx);
127
140 void set_region_protect(uint32_t base_addr, uint32_t idx, sasc_region_size_e size, sasc_region_attr_t *attr);
141
150 #endif


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_sdio_host.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_sdio_host.h
1 #ifndef __WM_SDIO_HOST_H_
2 #define __WM_SDIO_HOST_H_
3
4 #include <core_804.h>
5 #include "uni_regs.h"
6
7 typedef struct {
8 __IOM uint32_t MMC_CTL;
9 __IOM uint32_t MMC_IO;
10 __IOM uint32_t MMC_BYTECNTL;
11 __IM uint32_t MMC_TR_BLOCKCNT;
12 __IOM uint32_t MMC_CRCCTL;
13 __IM uint32_t CMD_CRC;
14 __IM uint32_t DAT_CRCL;
15 __IM uint32_t DAT_CRCH;
16 __IOM uint32_t MMC_PORT;
17 __IOM uint32_t MMC_INT_MASK;
18 __IOM uint32_t MMC_INT_SRC;
19 __IOM uint32_t MMC_CARDSEL;
20 __IM uint32_t MMC_SIG;
21 __IOM uint32_t MMC_IO_MBCTL;
22 __IOM uint32_t MMC_BLOCKCNT;
23 __IOM uint32_t MMC_TIMEOUTCNT;
24 __IOM uint32_t CMD_BUF[16];
25 __IOM uint32_t BUF_CTL;
26 uint32_t RESERVED3[31U];
27 __IOM uint32_t DATA_BUF[128];
28 }SDIO_HOST_Type;
29
30 #define SDIO_HOST ((SDIO_HOST_Type *)HR_SDIO_HOST_BASE_ADDR)
31
32 typedef struct
33 {
34 long long CardCapacity;
35 u32 CardBlockSize;
36 u16 RCA;
37 u8 CardType;
38 } SD_CardInfo_t;
39 extern SD_CardInfo_t SDCardInfo;
69 int sdh_card_init(uint32_t *rca_ref);
70
81 int uni_sd_card_set_bus_width(uint32_t rca, uint8_t bus_width);
82
93 int uni_sd_card_block_read(uint32_t sd_addr, char *buf);
94
105 int uni_sd_card_block_write(uint32_t rca, uint32_t sd_addr, char *buf);
106
118 int uni_sd_card_blocks_read(uint32_t sd_addr, char *buf, uint32_t buflen);
119
131 int uni_sd_card_blocks_write(uint32_t rca, uint32_t sd_addr, char *buf, uint32_t buflen);
132
141 #endif //__WM_SDIO_HOST_H_
142


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_spi_hal.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_spi_hal.h
1 /*****************************************************************************
2 *
3 * File Name : uni_spi_hal.h
4 *
5 * Description: host spi Driver Module
6 *
7 * All rights reserved.
8 *
9 * Author : dave
10 *
11 * Date : 2014-6-6
12 *****************************************************************************/
13 #include "uni_regs.h"
14 #include "uni_list.h"
15 #include "uni_hostspi.h"
16 #include "uni_cpu.h"
17
18
19 static __inline void spi_set_mode(u8 mode);
20
21
22 static __inline void spi_set_mode(u8 mode)
23 {
24 u32 reg_val;
25
26 reg_val = tls_reg_read32(HR_SPI_SPICFG_REG);
27
28 switch (mode) {
29 case TLS_SPI_MODE_0:
30 reg_val &= ~(0x03U);
31 reg_val |= (SPI_SET_CPOL(0) | SPI_SET_CPHA(0));
32 break;
33
34 case TLS_SPI_MODE_1:
35 reg_val &= ~(0x03U);
36 reg_val |= (SPI_SET_CPOL(0) | SPI_SET_CPHA(1));
37 break;
38
39 case TLS_SPI_MODE_2:
40 reg_val &= ~(0x03U);
41 reg_val |= (SPI_SET_CPOL(1) | SPI_SET_CPHA(0));
42 break;
43
44 case TLS_SPI_MODE_3:
45 reg_val &= ~(0x03U);
46 reg_val |= (SPI_SET_CPOL(1) | SPI_SET_CPHA(1));
47 break;
48
49 default:
50 break;
51 }
52
53 tls_reg_write32(HR_SPI_SPICFG_REG, reg_val);
54 }
55
56 static __inline void spi_set_endian(u8 endian)
57 {
58 u32 reg_val;
59
60 reg_val = tls_reg_read32(HR_SPI_SPICFG_REG);
61
62 if (endian == 0) {
63 reg_val &= ~(0x01U << 3);
64 reg_val |= SPI_LITTLE_ENDIAN;
65 } else if(endian == 1) {
66 reg_val &= ~(0x01U << 3);
67 reg_val |= SPI_BIG_ENDIAN;
68 }
69
70 tls_reg_write32(HR_SPI_SPICFG_REG, reg_val);
71 }
72
73 static __inline void spi_set_chipselect_mode(u8 cs_active)
74 {
75 u32 reg_val;
76
77 reg_val = tls_reg_read32(HR_SPI_CHCFG_REG);
78
79 if (cs_active == 0) {
80 reg_val &= ~(0x01U << 2);
81 reg_val |= SPI_CS_LOW;
82 } else if(cs_active == 1) {
83 reg_val &= ~(0x01U << 2);
84 reg_val |= SPI_CS_HIGH;
85 }
86
87 tls_reg_write32(HR_SPI_CHCFG_REG, reg_val);
88 }
89
90 static __inline void spi_clear_fifo(void)
91 {
92 u32 reg_val;
93
94 reg_val = tls_reg_read32(HR_SPI_CHCFG_REG);
95
96 reg_val |= SPI_CLEAR_FIFOS;
97
98 tls_reg_write32(HR_SPI_CHCFG_REG, reg_val);
99 }
100
101 static __inline void spi_set_rx_channel(u8 on_off)
102 {
103 u32 reg_val;
104
105 reg_val = tls_reg_read32(HR_SPI_CHCFG_REG);
106
107 if (on_off == 0) {
108 reg_val &= ~(0x01U << 20);
109 reg_val |= SPI_RX_CHANNEL_OFF;
110 } else if(on_off == 1) {
111 reg_val &= ~(0x01U << 20);
112 reg_val |= SPI_RX_CHANNEL_ON;
113 }
114
115 tls_reg_write32(HR_SPI_CHCFG_REG, reg_val);
116 }
117
118 static __inline void spi_set_tx_channel(u8 on_off)
119 {
120 u32 reg_val;
121
122 reg_val = tls_reg_read32(HR_SPI_CHCFG_REG);
123
124 if (on_off == 0) {
125 reg_val &= ~(0x01U << 19);
126 reg_val |= SPI_TX_CHANNEL_OFF;
127 } else if(on_off == 1) {
128 reg_val &= ~(0x01U << 19);
129 reg_val |= SPI_TX_CHANNEL_ON;
130 }
131
132 tls_reg_write32(HR_SPI_CHCFG_REG, reg_val);
133 }
134
135 static __inline void spi_set_sclk_length(u16 sclk_num, u8 invalid_rx_sclk_num)
136 {
137 u32 reg_val;
138
139 reg_val = tls_reg_read32(HR_SPI_CHCFG_REG);
140
141 reg_val &= ~((0xffU << 23) | (0xffff << 3));
142 reg_val |= SPI_VALID_CLKS_NUM(sclk_num) | SPI_RX_INVALID_BITS(invalid_rx_sclk_num);
143
144 tls_reg_write32(HR_SPI_CHCFG_REG, reg_val);
145 }
146
147 static __inline void spi_force_cs_out(u8 enable)
148 {
149 u32 reg_val;
150
151 reg_val = tls_reg_read32(HR_SPI_CHCFG_REG);
152
153 if (enable) {
154 reg_val |= SPI_FORCE_SPI_CS_OUT;
155 } else {
156 reg_val &= ~SPI_FORCE_SPI_CS_OUT;
157 }
158
159 tls_reg_write32(HR_SPI_CHCFG_REG, reg_val);
160 }
161
162 static __inline void spi_sclk_start(void)
163 {
164 u32 reg_val;
165
166 reg_val = tls_reg_read32(HR_SPI_CHCFG_REG);
167
168 reg_val |= SPI_START;
169
170 tls_reg_write32(HR_SPI_CHCFG_REG, reg_val);
171 }
172
173 static __inline void spi_set_sclk(u32 fclk)
174 {
175 u32 reg_val;
176 tls_sys_clk sysclk;
177
178 tls_sys_clk_get(&sysclk);
179
180 reg_val = tls_reg_read32(HR_SPI_CLKCFG_REG);
181
182 reg_val &= ~(0xffffU);
183 reg_val |= sysclk.apbclk*UNIT_MHZ/(fclk*2) - 1;
184
185 tls_reg_write32(HR_SPI_CLKCFG_REG, reg_val);
186 }
187
188 static __inline void spi_set_tx_trigger_level(u8 level)
189 {
190 u32 reg_val;
191
192 reg_val = tls_reg_read32(HR_SPI_MODECFG_REG);
193
194 reg_val &= ~(0x07U << 2);
195 reg_val |= SPI_TX_TRIGGER_LEVEL(level);
196
197 tls_reg_write32(HR_SPI_MODECFG_REG, reg_val);
198 }
199
200 static __inline void spi_set_rx_trigger_level(u8 level)
201 {
202 u32 reg_val;
203
204 reg_val = tls_reg_read32(HR_SPI_MODECFG_REG);
205
206 reg_val &= ~(0x07U << 6);
207 reg_val |= SPI_RX_TRIGGER_LEVEL(level);
208
209 tls_reg_write32(HR_SPI_MODECFG_REG, reg_val);
210 }
211
212 static __inline uint8_t spi_i2s_get_busy_status(void)
213 {
214 u32 reg_val;
215
216 reg_val = tls_reg_read32(HR_SPI_STATUS_REG);
217
218 return SPI_IS_BUSY(reg_val);
219 }
220
221
222 static __inline void spi_set_timeout(u32 timeout, u8 enable)
223 {
224 u32 reg_val;
225
226 reg_val = SPI_TIME_OUT(timeout);
227 reg_val |= enable ? SPI_TIMER_EN : 0;
228
229 tls_reg_write32(HR_SPI_TIMEOUT_REG, reg_val);
230 }
231
232 static __inline void spi_get_status(u8 *busy, u8 *rx_fifo_level, u8 *tx_fifo_level)
233 {
234 u32 reg_val;
235
236 reg_val = tls_reg_read32(HR_SPI_STATUS_REG);
237
238 if (busy) {*busy = SPI_IS_BUSY(reg_val);}
239 if (rx_fifo_level) {*rx_fifo_level = SPI_GET_RX_FIFO_CNT(reg_val);}
240 if (tx_fifo_level) {*tx_fifo_level = 32 - SPI_GET_TX_FIFO_CNT(reg_val);}
241 }
242
243 static __inline u32 spi_int_mask(void)
244 {
245 u32 reg_val;
246
247 reg_val = tls_reg_read32(HR_SPI_INT_MASK_REG);
248
249 return reg_val & SPI_INT_MASK_ALL;
250 }
251
252 static __inline void spi_mask_int(u32 mask)
253 {
254 u32 reg_val;
255
256 reg_val = tls_reg_read32(HR_SPI_INT_MASK_REG);
257
258 reg_val |= mask & SPI_INT_MASK_ALL;
259
260 tls_reg_write32(HR_SPI_INT_MASK_REG, reg_val);
261 }
262
263 static __inline void spi_unmask_int(u32 mask)
264 {
265 u32 reg_val;
266
267 reg_val = tls_reg_read32(HR_SPI_INT_MASK_REG);
268
269 reg_val &= ~(mask & SPI_INT_MASK_ALL);
270
271 tls_reg_write32(HR_SPI_INT_MASK_REG, reg_val);
272 }
273
274 static __inline u32 spi_get_int_status(void)
275 {
276 u32 reg_val;
277
278 reg_val = tls_reg_read32(HR_SPI_INT_STATUS_REG);
279
280 return reg_val;
281 }
282
283 static __inline void spi_clear_int_status(u32 int_srcs)
284 {
285 u32 reg_val;
286
287 reg_val = tls_reg_read32(HR_SPI_INT_STATUS_REG);
288
289 reg_val &= ~(int_srcs & SPI_INT_CLEAR_ALL);
290 reg_val |= int_srcs & SPI_INT_CLEAR_ALL;
291
292 tls_reg_write32(HR_SPI_INT_STATUS_REG, reg_val);
293 }
294
295 static __inline void spi_data_put(u32 data)
296 {
297 tls_reg_write32(HR_SPI_TXDATA_REG, data);
298 }
299
300 static __inline u32 spi_data_get(void)
301 {
302 return tls_reg_read32(HR_SPI_RXDATA_REG);
303 }
304


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_timer.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_timer.h
1
8 #ifndef UNI_TIMER_H
9 #define UNI_TIMER_H
10
11 #include "uni_type_def.h"
13 #define UNI_TIMER_ID_INVALID 0xFF
14
16 typedef void (*tls_timer_irq_callback)(void *arg);
17
19 enum tls_timer_unit{
20 TLS_TIMER_UNIT_US = 0,
21 TLS_TIMER_UNIT_MS
22 };
23
25 struct tls_timer_cfg {
26 enum tls_timer_unit unit;
27 u32 timeout;
28 bool is_repeat;
29 tls_timer_irq_callback callback;
30 void *arg;
31 };
32
67 u8 tls_timer_create(struct tls_timer_cfg *cfg);
68
78 void tls_timer_start(u8 timer_id);
79
89 void tls_timer_stop(u8 timer_id);
90
102 void tls_timer_change(u8 timer_id, u32 newtime);
103
113 u32 tls_timer_read(u8 timer_id);
114
124 void tls_timer_destroy(u8 timer_id);
125
134 #endif /* UNI_TIMER_H */
135


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_tipc.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_tipc.h
1 #ifndef __WM_TIPC_H_
2 #define __WM_TIPC_H_
3
4 #include <core_804.h>
5 #include "uni_regs.h"
6
7 #define HR_TIPC_BASE (HR_APB_BASE_ADDR + 0x2400)
8
9 typedef union {
10 struct {
11 uint32_t I2C: 1;
12 uint32_t SAR_ADC: 1;
13 uint32_t SPI_LS: 1;
14 uint32_t UART0: 1;
15 uint32_t UART1: 1;
16 uint32_t UART2: 1;
17 uint32_t UART3: 1;
18 uint32_t UART4: 1;
19 uint32_t UART5: 1;
20 uint32_t PORTA: 1;
21 uint32_t PORTB: 1;
22 uint32_t WD: 1;
23 uint32_t TIMER: 1;
24 uint32_t RFC: 1;
25 uint32_t LCD: 1;
26 uint32_t PWM: 1;
27 uint32_t I2S: 1;
28 uint32_t BT_MODEM: 1;
29 uint32_t _reserved0: 14;
30 }b;
31 uint32_t w;
32 } TIPC_VLD0_Type;
33
34 typedef union {
35 struct {
36 uint32_t SDIO_HOST: 1;
37 uint32_t FLASH: 1;
38 uint32_t PSRAM: 1;
39 uint32_t RSA: 1;
40 uint32_t DMA: 1;
41 uint32_t GPSEC: 1;
42 uint32_t BT: 1;
43 uint32_t PMU: 1;
44 uint32_t CLK_RST: 1;
45 uint32_t MMU: 1;
46 uint32_t BBP: 1;
47 uint32_t MAC: 1;
48 uint32_t SEC: 1;
49 uint32_t _reserved0: 1;
50 uint32_t SDIO_SLAVE: 1;
51 uint32_t SPI_HS: 1;
52 uint32_t SDIO_WRAPPER: 1;
53 uint32_t RF_BIST: 1;
54 uint32_t _reserved1: 14;
55 }b;
56 uint32_t w;
57 } TIPC_VLD1_Type;
58
59 typedef struct {
60 __IOM uint32_t VLD0;
61 __IOM uint32_t VLD1;
62 } TIPC_Type;
63
64 #define TIPC ((TIPC_Type *) HR_TIPC_BASE)
65
95 __STATIC_INLINE void uni_tipc_enable_i2c(void)
96 {
97 TIPC_VLD0_Type vld0;
98 vld0.w = TIPC->VLD0;
99 vld0.b.I2C = 1;
100 TIPC->VLD0 = vld0.w;
101 }
102
112 __STATIC_INLINE void uni_tipc_disable_i2c(void)
113 {
114 TIPC_VLD0_Type vld0;
115 vld0.w = TIPC->VLD0;
116 vld0.b.I2C = 0;
117 TIPC->VLD0 = vld0.w;
118 }
119
129 __STATIC_INLINE void uni_tipc_enable_uart0(void)
130 {
131 TIPC_VLD0_Type vld0;
132 vld0.w = TIPC->VLD0;
133 vld0.b.UART0 = 1;
134 TIPC->VLD0 = vld0.w;
135 }
136
146 __STATIC_INLINE void uni_tipc_disable_uart0(void)
147 {
148 TIPC_VLD0_Type vld0;
149 vld0.w = TIPC->VLD0;
150 vld0.b.UART0 = 0;
151 TIPC->VLD0 = vld0.w;
152 }
153
163 __STATIC_INLINE void uni_tipc_enable_sar_adc(void)
164 {
165 TIPC_VLD0_Type vld0;
166 vld0.w = TIPC->VLD0;
167 vld0.b.SAR_ADC = 1;
168 TIPC->VLD0 = vld0.w;
169 }
170
180 __STATIC_INLINE void uni_tipc_disable_sar_adc(void)
181 {
182 TIPC_VLD0_Type vld0;
183 vld0.w = TIPC->VLD0;
184 vld0.b.SAR_ADC = 0;
185 TIPC->VLD0 = vld0.w;
186 }
187
197 __STATIC_INLINE void uni_tipc_enable_lspi(void)
198 {
199 TIPC_VLD0_Type vld0;
200 vld0.w = TIPC->VLD0;
201 vld0.b.SPI_LS = 1;
202 TIPC->VLD0 = vld0.w;
203 }
204
214 __STATIC_INLINE void uni_tipc_disable_lspi(void)
215 {
216 TIPC_VLD0_Type vld0;
217 vld0.w = TIPC->VLD0;
218 vld0.b.SPI_LS = 0;
219 TIPC->VLD0 = vld0.w;
220 }
221
231 __STATIC_INLINE void uni_tipc_enable_uart1(void)
232 {
233 TIPC_VLD0_Type vld0;
234 vld0.w = TIPC->VLD0;
235 vld0.b.UART1 = 1;
236 TIPC->VLD0 = vld0.w;
237 }
238
248 __STATIC_INLINE void uni_tipc_disable_uart1(void)
249 {
250 TIPC_VLD0_Type vld0;
251 vld0.w = TIPC->VLD0;
252 vld0.b.UART1 = 0;
253 TIPC->VLD0 = vld0.w;
254 }
255
265 __STATIC_INLINE void uni_tipc_enable_uart2(void)
266 {
267 TIPC_VLD0_Type vld0;
268 vld0.w = TIPC->VLD0;
269 vld0.b.UART2 = 1;
270 TIPC->VLD0 = vld0.w;
271 }
272
282 __STATIC_INLINE void uni_tipc_disable_uart2(void)
283 {
284 TIPC_VLD0_Type vld0;
285 vld0.w = TIPC->VLD0;
286 vld0.b.UART2 = 0;
287 TIPC->VLD0 = vld0.w;
288 }
289
299 __STATIC_INLINE void uni_tipc_enable_uart3(void)
300 {
301 TIPC_VLD0_Type vld0;
302 vld0.w = TIPC->VLD0;
303 vld0.b.UART3 = 1;
304 TIPC->VLD0 = vld0.w;
305 }
306
316 __STATIC_INLINE void uni_tipc_disable_uart3(void)
317 {
318 TIPC_VLD0_Type vld0;
319 vld0.w = TIPC->VLD0;
320 vld0.b.UART3 = 0;
321 TIPC->VLD0 = vld0.w;
322 }
323
333 __STATIC_INLINE void uni_tipc_enable_uart4(void)
334 {
335 TIPC_VLD0_Type vld0;
336 vld0.w = TIPC->VLD0;
337 vld0.b.UART4 = 1;
338 TIPC->VLD0 = vld0.w;
339 }
340
350 __STATIC_INLINE void uni_tipc_disable_uart4(void)
351 {
352 TIPC_VLD0_Type vld0;
353 vld0.w = TIPC->VLD0;
354 vld0.b.UART4 = 0;
355 TIPC->VLD0 = vld0.w;
356 }
357
367 __STATIC_INLINE void uni_tipc_enable_uart5(void)
368 {
369 TIPC_VLD0_Type vld0;
370 vld0.w = TIPC->VLD0;
371 vld0.b.UART5 = 1;
372 TIPC->VLD0 = vld0.w;
373 }
374
384 __STATIC_INLINE void uni_tipc_disable_uart5(void)
385 {
386 TIPC_VLD0_Type vld0;
387 vld0.w = TIPC->VLD0;
388 vld0.b.UART5 = 0;
389 TIPC->VLD0 = vld0.w;
390 }
391
401 __STATIC_INLINE void uni_tipc_enable_porta(void)
402 {
403 TIPC_VLD0_Type vld0;
404 vld0.w = TIPC->VLD0;
405 vld0.b.PORTA = 1;
406 TIPC->VLD0 = vld0.w;
407 }
408
418 __STATIC_INLINE void uni_tipc_disable_porta(void)
419 {
420 TIPC_VLD0_Type vld0;
421 vld0.w = TIPC->VLD0;
422 vld0.b.PORTA = 0;
423 TIPC->VLD0 = vld0.w;
424 }
425
435 __STATIC_INLINE void uni_tipc_enable_portb(void)
436 {
437 TIPC_VLD0_Type vld0;
438 vld0.w = TIPC->VLD0;
439 vld0.b.PORTB = 1;
440 TIPC->VLD0 = vld0.w;
441 }
442
452 __STATIC_INLINE void uni_tipc_disable_portb(void)
453 {
454 TIPC_VLD0_Type vld0;
455 vld0.w = TIPC->VLD0;
456 vld0.b.PORTB = 0;
457 TIPC->VLD0 = vld0.w;
458 }
459
469 __STATIC_INLINE void uni_tipc_enable_watch_dog(void)
470 {
471 TIPC_VLD0_Type vld0;
472 vld0.w = TIPC->VLD0;
473 vld0.b.WD = 1;
474 TIPC->VLD0 = vld0.w;
475 }
476
486 __STATIC_INLINE void uni_tipc_disable_watch_dog(void)
487 {
488 TIPC_VLD0_Type vld0;
489 vld0.w = TIPC->VLD0;
490 vld0.b.WD = 0;
491 TIPC->VLD0 = vld0.w;
492 }
493
503 __STATIC_INLINE void uni_tipc_enable_timer(void)
504 {
505 TIPC_VLD0_Type vld0;
506 vld0.w = TIPC->VLD0;
507 vld0.b.TIMER = 1;
508 TIPC->VLD0 = vld0.w;
509 }
510
520 __STATIC_INLINE void uni_tipc_disable_timer(void)
521 {
522 TIPC_VLD0_Type vld0;
523 vld0.w = TIPC->VLD0;
524 vld0.b.TIMER = 0;
525 TIPC->VLD0 = vld0.w;
526 }
527
537 __STATIC_INLINE void uni_tipc_enable_rf_controler(void)
538 {
539 TIPC_VLD0_Type vld0;
540 vld0.w = TIPC->VLD0;
541 vld0.b.RFC = 1;
542 TIPC->VLD0 = vld0.w;
543 }
544
554 __STATIC_INLINE void uni_tipc_disable_rf_controler(void)
555 {
556 TIPC_VLD0_Type vld0;
557 vld0.w = TIPC->VLD0;
558 vld0.b.RFC = 0;
559 TIPC->VLD0 = vld0.w;
560 }
561
571 __STATIC_INLINE void uni_tipc_enable_lcd(void)
572 {
573 TIPC_VLD0_Type vld0;
574 vld0.w = TIPC->VLD0;
575 vld0.b.LCD = 1;
576 TIPC->VLD0 = vld0.w;
577 }
578
588 __STATIC_INLINE void uni_tipc_disable_lcd(void)
589 {
590 TIPC_VLD0_Type vld0;
591 vld0.w = TIPC->VLD0;
592 vld0.b.LCD = 0;
593 TIPC->VLD0 = vld0.w;
594 }
595
605 __STATIC_INLINE void uni_tipc_enable_pwm(void)
606 {
607 TIPC_VLD0_Type vld0;
608 vld0.w = TIPC->VLD0;
609 vld0.b.PWM = 1;
610 TIPC->VLD0 = vld0.w;
611 }
612
622 __STATIC_INLINE void uni_tipc_disable_pwm(void)
623 {
624 TIPC_VLD0_Type vld0;
625 vld0.w = TIPC->VLD0;
626 vld0.b.PWM = 0;
627 TIPC->VLD0 = vld0.w;
628 }
629
639 __STATIC_INLINE void uni_tipc_enable_i2s(void)
640 {
641 TIPC_VLD0_Type vld0;
642 vld0.w = TIPC->VLD0;
643 vld0.b.I2S = 1;
644 TIPC->VLD0 = vld0.w;
645 }
646
656 __STATIC_INLINE void uni_tipc_disable_i2s(void)
657 {
658 TIPC_VLD0_Type vld0;
659 vld0.w = TIPC->VLD0;
660 vld0.b.I2S = 0;
661 TIPC->VLD0 = vld0.w;
662 }
663
673 __STATIC_INLINE void uni_tipc_enable_bt_modem(void)
674 {
675 TIPC_VLD0_Type vld0;
676 vld0.w = TIPC->VLD0;
677 vld0.b.BT_MODEM = 1;
678 TIPC->VLD0 = vld0.w;
679 }
680
690 __STATIC_INLINE void uni_tipc_disable_bt_modem(void)
691 {
692 TIPC_VLD0_Type vld0;
693 vld0.w = TIPC->VLD0;
694 vld0.b.BT_MODEM = 0;
695 TIPC->VLD0 = vld0.w;
696 }
697
707 __STATIC_INLINE void uni_tipc_enable_sdio_host(void)
708 {
709 TIPC_VLD1_Type vld1;
710 vld1.w = TIPC->VLD1;
711 vld1.b.SDIO_HOST = 1;
712 TIPC->VLD1 = vld1.w;
713 }
714
724 __STATIC_INLINE void uni_tipc_disable_sdio_host(void)
725 {
726 TIPC_VLD1_Type vld1;
727 vld1.w = TIPC->VLD1;
728 vld1.b.SDIO_HOST = 0;
729 TIPC->VLD1 = vld1.w;
730 }
731
741 __STATIC_INLINE void uni_tipc_enable_flash(void)
742 {
743 TIPC_VLD1_Type vld1;
744 vld1.w = TIPC->VLD1;
745 vld1.b.FLASH = 1;
746 TIPC->VLD1 = vld1.w;
747 }
748
758 __STATIC_INLINE void uni_tipc_disable_flash(void)
759 {
760 TIPC_VLD1_Type vld1;
761 vld1.w = TIPC->VLD1;
762 vld1.b.FLASH = 0;
763 TIPC->VLD1 = vld1.w;
764 }
765
775 __STATIC_INLINE void uni_tipc_enable_psram(void)
776 {
777 TIPC_VLD1_Type vld1;
778 vld1.w = TIPC->VLD1;
779 vld1.b.PSRAM = 1;
780 TIPC->VLD1 = vld1.w;
781 }
782
792 __STATIC_INLINE void uni_tipc_disable_psram(void)
793 {
794 TIPC_VLD1_Type vld1;
795 vld1.w = TIPC->VLD1;
796 vld1.b.PSRAM = 0;
797 TIPC->VLD1 = vld1.w;
798 }
799
809 __STATIC_INLINE void uni_tipc_enable_rsa(void)
810 {
811 TIPC_VLD1_Type vld1;
812 vld1.w = TIPC->VLD1;
813 vld1.b.RSA = 1;
814 TIPC->VLD1 = vld1.w;
815 }
816
826 __STATIC_INLINE void uni_tipc_disable_rsa(void)
827 {
828 TIPC_VLD1_Type vld1;
829 vld1.w = TIPC->VLD1;
830 vld1.b.RSA = 0;
831 TIPC->VLD1 = vld1.w;
832 }
833
843 __STATIC_INLINE void uni_tipc_enable_dma(void)
844 {
845 TIPC_VLD1_Type vld1;
846 vld1.w = TIPC->VLD1;
847 vld1.b.DMA = 1;
848 TIPC->VLD1 = vld1.w;
849 }
850
860 __STATIC_INLINE void uni_tipc_disable_dma(void)
861 {
862 TIPC_VLD1_Type vld1;
863 vld1.w = TIPC->VLD1;
864 vld1.b.DMA = 0;
865 TIPC->VLD1 = vld1.w;
866 }
867
877 __STATIC_INLINE void uni_tipc_enable_gpsec(void)
878 {
879 TIPC_VLD1_Type vld1;
880 vld1.w = TIPC->VLD1;
881 vld1.b.GPSEC = 1;
882 TIPC->VLD1 = vld1.w;
883 }
884
894 __STATIC_INLINE void uni_tipc_disable_gpsec(void)
895 {
896 TIPC_VLD1_Type vld1;
897 vld1.w = TIPC->VLD1;
898 vld1.b.GPSEC = 0;
899 TIPC->VLD1 = vld1.w;
900 }
901
911 __STATIC_INLINE void uni_tipc_enable_bt(void)
912 {
913 TIPC_VLD1_Type vld1;
914 vld1.w = TIPC->VLD1;
915 vld1.b.BT = 1;
916 TIPC->VLD1 = vld1.w;
917 }
918
928 __STATIC_INLINE void uni_tipc_disable_bt(void)
929 {
930 TIPC_VLD1_Type vld1;
931 vld1.w = TIPC->VLD1;
932 vld1.b.BT = 0;
933 TIPC->VLD1 = vld1.w;
934 }
935
945 __STATIC_INLINE void uni_tipc_enable_pmu(void)
946 {
947 TIPC_VLD1_Type vld1;
948 vld1.w = TIPC->VLD1;
949 vld1.b.PMU = 1;
950 TIPC->VLD1 = vld1.w;
951 }
952
962 __STATIC_INLINE void uni_tipc_disable_pmu(void)
963 {
964 TIPC_VLD1_Type vld1;
965 vld1.w = TIPC->VLD1;
966 vld1.b.PMU = 0;
967 TIPC->VLD1 = vld1.w;
968 }
969
979 __STATIC_INLINE void uni_tipc_enable_clk_rst(void)
980 {
981 TIPC_VLD1_Type vld1;
982 vld1.w = TIPC->VLD1;
983 vld1.b.CLK_RST = 1;
984 TIPC->VLD1 = vld1.w;
985 }
986
996 __STATIC_INLINE void uni_tipc_disable_clk_rst(void)
997 {
998 TIPC_VLD1_Type vld1;
999 vld1.w = TIPC->VLD1;
1000 vld1.b.CLK_RST = 0;
1001 TIPC->VLD1 = vld1.w;
1002 }
1003
1013 __STATIC_INLINE void uni_tipc_enable_mmu(void)
1014 {
1015 TIPC_VLD1_Type vld1;
1016 vld1.w = TIPC->VLD1;
1017 vld1.b.MMU = 1;
1018 TIPC->VLD1 = vld1.w;
1019 }
1020
1030 __STATIC_INLINE void uni_tipc_disable_mmu(void)
1031 {
1032 TIPC_VLD1_Type vld1;
1033 vld1.w = TIPC->VLD1;
1034 vld1.b.MMU = 0;
1035 TIPC->VLD1 = vld1.w;
1036 }
1037
1047 __STATIC_INLINE void uni_tipc_enable_bbp(void)
1048 {
1049 TIPC_VLD1_Type vld1;
1050 vld1.w = TIPC->VLD1;
1051 vld1.b.BBP = 1;
1052 TIPC->VLD1 = vld1.w;
1053 }
1054
1064 __STATIC_INLINE void uni_tipc_disable_bbp(void)
1065 {
1066 TIPC_VLD1_Type vld1;
1067 vld1.w = TIPC->VLD1;
1068 vld1.b.BBP = 0;
1069 TIPC->VLD1 = vld1.w;
1070 }
1071
1081 __STATIC_INLINE void uni_tipc_enable_mac(void)
1082 {
1083 TIPC_VLD1_Type vld1;
1084 vld1.w = TIPC->VLD1;
1085 vld1.b.MAC = 1;
1086 TIPC->VLD1 = vld1.w;
1087 }
1088
1098 __STATIC_INLINE void uni_tipc_disable_mac(void)
1099 {
1100 TIPC_VLD1_Type vld1;
1101 vld1.w = TIPC->VLD1;
1102 vld1.b.MAC = 0;
1103 TIPC->VLD1 = vld1.w;
1104 }
1105
1115 __STATIC_INLINE void uni_tipc_enable_sec(void)
1116 {
1117 TIPC_VLD1_Type vld1;
1118 vld1.w = TIPC->VLD1;
1119 vld1.b.SEC = 1;
1120 TIPC->VLD1 = vld1.w;
1121 }
1122
1132 __STATIC_INLINE void uni_tipc_disable_sec(void)
1133 {
1134 TIPC_VLD1_Type vld1;
1135 vld1.w = TIPC->VLD1;
1136 vld1.b.SEC = 0;
1137 TIPC->VLD1 = vld1.w;
1138 }
1139
1149 __STATIC_INLINE void uni_tipc_enable_sdio_slave(void)
1150 {
1151 TIPC_VLD1_Type vld1;
1152 vld1.w = TIPC->VLD1;
1153 vld1.b.SDIO_SLAVE = 1;
1154 TIPC->VLD1 = vld1.w;
1155 }
1156
1166 __STATIC_INLINE void uni_tipc_disable_sdio_slave(void)
1167 {
1168 TIPC_VLD1_Type vld1;
1169 vld1.w = TIPC->VLD1;
1170 vld1.b.SDIO_SLAVE = 0;
1171 TIPC->VLD1 = vld1.w;
1172 }
1173
1183 __STATIC_INLINE void uni_tipc_enable_hspi(void)
1184 {
1185 TIPC_VLD1_Type vld1;
1186 vld1.w = TIPC->VLD1;
1187 vld1.b.SPI_HS = 1;
1188 TIPC->VLD1 = vld1.w;
1189 }
1190
1200 __STATIC_INLINE void uni_tipc_disable_hspi(void)
1201 {
1202 TIPC_VLD1_Type vld1;
1203 vld1.w = TIPC->VLD1;
1204 vld1.b.SPI_HS = 0;
1205 TIPC->VLD1 = vld1.w;
1206 }
1207
1217 __STATIC_INLINE void uni_tipc_enable_sdio_wrapper(void)
1218 {
1219 TIPC_VLD1_Type vld1;
1220 vld1.w = TIPC->VLD1;
1221 vld1.b.SDIO_WRAPPER = 1;
1222 TIPC->VLD1 = vld1.w;
1223 }
1224
1234 __STATIC_INLINE void uni_tipc_disable_sdio_wrapper(void)
1235 {
1236 TIPC_VLD1_Type vld1;
1237 vld1.w = TIPC->VLD1;
1238 vld1.b.SDIO_WRAPPER = 0;
1239 TIPC->VLD1 = vld1.w;
1240 }
1241
1251 __STATIC_INLINE void uni_tipc_enable_rf_bist(void)
1252 {
1253 TIPC_VLD1_Type vld1;
1254 vld1.w = TIPC->VLD1;
1255 vld1.b.RF_BIST = 1;
1256 TIPC->VLD1 = vld1.w;
1257 }
1258
1268 __STATIC_INLINE void uni_tipc_disable_rf_bist(void)
1269 {
1270 TIPC_VLD1_Type vld1;
1271 vld1.w = TIPC->VLD1;
1272 vld1.b.RF_BIST = 0;
1273 TIPC->VLD1 = vld1.w;
1274 }
1275
1284 #endif


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_uart.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_uart.h
1
8 #ifndef UNI_UART_H
9 #define UNI_UART_H
10 #include "uni_list.h"
11 //#include "uni_regs.h"
12 #include "uni_type_def.h"
13 #include "uni_osal.h"
14
15 #define TLS_UART_RX_BUF_SIZE 4096
16 #define TLS_UART_TX_BUF_SIZE 4096
17 #define WAKEUP_CHARS 256
18
19 #define MBOX_MSG_UART_RX 1
20 #define MBOX_MSG_UART_TX 2
21
22
24 #define UART_BAUDRATE_B600 600
25 #define UART_BAUDRATE_B1200 1200
26 #define UART_BAUDRATE_B1800 1800
27 #define UART_BAUDRATE_B2400 2400
28 #define UART_BAUDRATE_B4800 4800
29 #define UART_BAUDRATE_B9600 9600
30 #define UART_BAUDRATE_B19200 19200
31 #define UART_BAUDRATE_B38400 38400
32 #define UART_BAUDRATE_B57600 57600
33 #define UART_BAUDRATE_B115200 115200
34 #define UART_BAUDRATE_B230400 230400
35 #define UART_BAUDRATE_B460800 460800
36 #define UART_BAUDRATE_B921600 921600
37 #define UART_BAUDRATE_B1000000 1000000
38 #define UART_BAUDRATE_B1250000 1250000
39 #define UART_BAUDRATE_B1500000 1500000
40 #define UART_BAUDRATE_B2000000 2000000
41
42 #define UART_RX_INT_FLAG (UIS_RX_FIFO | UIS_RX_FIFO_TIMEOUT | UIS_BREAK |\
43 UIS_OVERRUN | UIS_FRM_ERR | UIS_PARITY_ERR)
44 #define UART_RX_ERR_INT_FLAG (UIS_BREAK | UIS_FRM_ERR | \
45 UIS_PARITY_ERR)
46
47 #define UART_TX_INT_FLAG (UIS_TX_FIFO | UIS_TX_FIFO_EMPTY)
48
50 #define CIRC_CNT(head,tail,size) (((head) - (tail)) & ((size)-1))
51
55 #define CIRC_SPACE(head,tail,size) CIRC_CNT((tail),((head)+1),(size))
56
60 #define CIRC_CNT_TO_END(head,tail,size) \
61 ({int end = (size) - (tail); \
62 int n = ((head) + end) & ((size)-1); \
63 n < end ? n : end;})
64
66 #define CIRC_SPACE_TO_END(head,tail,size) \
67 ({int end = (size) - 1 - (head); \
68 int n = (end + (tail)) & ((size)-1); \
69 n <= end ? n : end+1;})
70
71 #define CIRC_SPACE_TO_END_FULL(head,tail,size) \
72 ({int end = (size) - 1 - (head); \
73 int n = (end + (tail)) & ((size)-1); \
74 n < end ? n : end+1;})
75
76 #define uart_circ_empty(circ) ((circ)->head == (circ)->tail)
77 #define uart_circ_chars_pending(circ) \
78 (CIRC_CNT((circ)->head, (circ)->tail, TLS_UART_TX_BUF_SIZE))
79
83 struct tls_uart_baud_rate
84 {
85 u32 baud_rate;
86 u16 ubdiv;
87 u16 ubdiv_frac;
88 };
89
90
94 enum
95 {
96 TLS_UART_0 = 0,
97 TLS_UART_1 = 1,
98 TLS_UART_2 = 2,
99 TLS_UART_3 = 3,
100 TLS_UART_4 = 4,
101 TLS_UART_MAX = 5,
102 };
103
104
108 typedef enum TLS_UART_PMODE
109 {
110 TLS_UART_PMODE_DISABLED = 0,
111 TLS_UART_PMODE_ODD = 1,
112 TLS_UART_PMODE_EVEN = 2,
113 TLS_UART_PMODE_MARK = 3,
114 TLS_UART_PMODE_SPACE = 4,
115 } TLS_UART_PMODE_T;
116
120 typedef enum TLS_UART_CHSIZE
121 {
122 TLS_UART_CHSIZE_5BIT = (0x00 << 0),
123 TLS_UART_CHSIZE_6BIT = (0x01 << 0),
124 TLS_UART_CHSIZE_7BIT = (0x02 << 0),
125 TLS_UART_CHSIZE_8BIT = (0x03 << 0),
126 } TLS_UART_CHSIZE_T;
127
131 typedef enum TLS_UART_FLOW_CTRL_MODE
132 {
133 TLS_UART_FLOW_CTRL_NONE,
134 TLS_UART_FLOW_CTRL_HARDWARE,
135 } TLS_UART_FLOW_CTRL_MODE_T;
136
140 typedef enum TLS_UART_RX_FLOW_CTRL_FLAG
141 {
142 TLS_UART_RX_DISABLE,
143 TLS_UART_RX_ENABLE,
144 } TLS_UART_RX_FLOW_CTRL_FLAG_T;
145
149 typedef enum TLS_UART_STOPBITS
150 {
151 TLS_UART_ONE_STOPBITS,
152 TLS_UART_TWO_STOPBITS,
153 } TLS_UART_STOPBITS_T;
154
155
159 typedef enum TLS_UART_STATUS
160 {
161 TLS_UART_STATUS_OK,
162 TLS_UART_STATUS_ERROR,
163 } TLS_UART_STATUS_T;
164
165
169 typedef enum TLS_UART_MODE
170 {
171 TLS_UART_MODE_POLL,
172 TLS_UART_MODE_INT,
173 } TLS_UART_MODE_T;
174
178 struct tls_uart_icount
179 {
180 u32 cts;
181 u32 dsr;
182 u32 rng;
183 u32 dcd;
184 u32 rx;
185 u32 tx;
186 u32 frame;
187 u32 overrun;
188 u32 parity;
189 u32 brk;
190 u32 buf_overrun;
191 };
192
193
194
198 typedef struct tls_uart_options
199 {
200 u32 baudrate;
202 TLS_UART_CHSIZE_T charlength;
204 TLS_UART_PMODE_T paritytype;
206 TLS_UART_FLOW_CTRL_MODE_T flow_ctrl;
208 TLS_UART_STOPBITS_T stopbits;
210 } tls_uart_options_t;
211
212
216 typedef struct tls_uart_circ_buf
217 {
218 volatile u8 *buf;
219 volatile u32 head;
220 volatile u32 tail;
221 } tls_uart_circ_buf_t;
222
226 typedef struct TLS_UART_REGS
227 {
228 u32 UR_LC;
229 u32 UR_FC;
230 u32 UR_DMAC;
231 u32 UR_FIFOC;
232 u32 UR_BD;
233 u32 UR_INTM;
234 u32 UR_INTS;
235 u32 UR_FIFOS;
236 u32 UR_TXW;
237 u32 UR_RES0;
238 u32 UR_RES1;
239 u32 UR_RES2;
240 u32 UR_RXW;
241 } TLS_UART_REGS_T;
242
243
247 typedef struct tls_uart_port
248 {
249 u32 uart_no;
251 u32 uart_irq_no;
253 u32 plus_char_cnt;
254
255 TLS_UART_MODE_T uart_mode;
257 struct tls_uart_options opts;
259 int fcStatus;
261 enum TLS_UART_RX_FLOW_CTRL_FLAG rxstatus;
262
263 u32 tx_fifofull;
265 TLS_UART_REGS_T volatile *regs;
267 struct tls_uart_icount icount;
269 struct tls_uart_circ_buf recv;
271 // struct tls_uart_circ_buf xmit;
272
273 struct dl_list tx_msg_pending_list;
274
275 struct dl_list tx_msg_to_be_freed_list;
276
277 u8 hw_stopped;
278
279 tls_os_sem_t *tx_sem;
280
281 char *buf_ptr;
282
283 u16 buf_len;
284
285 s16(*rx_callback) (u16 len, void* priv_data);
286
287 s16(*tx_callback) (struct tls_uart_port * port);
288 s16(*tx_free_callback) (struct tls_uart_port * port);
289
290 bool tx_dma_on;
291 bool rx_dma_on;
292
293 void *priv_data;
294 } tls_uart_port_t;
295
299 typedef struct tls_uart_tx_msg
300 {
301 struct dl_list list;
302 char *buf;
303 u16 buflen;
304 u16 offset;
305 void (*finish_callback) (void *arg);
306 void *callback_arg;
307 } tls_uart_tx_msg_t;
308
343 int tls_uart_port_init(u16 uart_no, tls_uart_options_t * opts, u8 modeChoose);
344
345
356 void tls_uart_rx_callback_register(u16 uart_no, s16(*rx_callback) (u16 len, void* user_data), void* user_data);
357
366 void tls_uart_tx_callback_register(u16 uart_no, s16(*tx_callback) (struct tls_uart_port *port));
367
368
380 int tls_uart_read(u16 uart_no, u8 * buf, u16 readsize);
381
382
395 int tls_uart_write(u16 uart_no, char *buf, u16 writesize);
396
397
410 int tls_uart_dma_write(char *buf, u16 writesize, void (*cmpl_callback) (void *p), u16 uart_no);
411
412
424 int tls_uart_set_parity(u16 uart_no, TLS_UART_PMODE_T paritytype);
425
426
438 int tls_uart_set_baud_rate(u16 uart_no, u32 baudrate);
439
451 int tls_uart_set_stop_bits(u16 uart_no, TLS_UART_STOPBITS_T stopbits);
452
460 void tls_uart_push(int uart_no, u8* data, int length);
461
462 int tls_uart_write_async(u16 uart_no, char *buf, u16 writesize);
463
464
465 #endif /* UNI_UART_H */


蜂鸟W方案开发指导手册: Z:/w800/unione_lite_app_hb_w/components/chip_us615/unisdk/include/driver/uni_watchdog.h 源文件

  • Z:
  • w800
  • unione_lite_app_hb_w
  • components
  • chip_us615
  • unisdk
  • include
  • driver
uni_watchdog.h
1
8 #ifndef UNI_WATCHDOG_H
9 #define UNI_WATCHDOG_H
10
40 void tls_watchdog_clr(void);
41
51 void tls_watchdog_init(u32 usec);
52
62 void tls_sys_reset(void);
63
72 #endif /* UNI_WATCHDOG_H */
73