/***********************************************************************************************************************
* Copyright (C) All rights reserved.
***********************************************************************************************************************/
/***********************************************************************************************************************
* @file sci.c
* @brief This file implements device driver for SCI module.
* @version 1.0.0
* @date 2019/12/24
***********************************************************************************************************************/
/***********************************************************************************************************************
Macro definitions
***********************************************************************************************************************/
/***********************************************************************************************************************
Includes
***********************************************************************************************************************/
#include "stdlib.h"
#include "BAT32G137.h"
#include "userdefine.h"
#include "sci.h"
#include "dma.h"
/***********************************************************************************************************************
Pragma directive
***********************************************************************************************************************/
/* Start user code for pragma. Do not edit comment generated here */
/* End user code. Do not edit comment generated here */
/***********************************************************************************************************************
Global variables and functions
***********************************************************************************************************************/
const uint16_t sps_tbl[16] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768};
#if defined USE_SCI_UART0_TX
volatile uint8_t *gp_uart0_tx_address; /* uart0 transmit buffer address */
volatile uint16_t g_uart0_tx_count; /* uart0 transmit data number */
#endif
#if defined USE_SCI_UART0_RX
volatile uint8_t *gp_uart0_rx_address; /* uart0 receive buffer address */
volatile uint16_t g_uart0_rx_count; /* uart0 receive data number */
volatile uint16_t g_uart0_rx_length; /* uart0 receive data length */
#endif
#if defined USE_SCI_SPI00
volatile uint8_t *gp_spi00_rx_address; /* spi00 receive buffer address */
volatile uint16_t g_spi00_rx_length; /* spi00 receive data length */
volatile uint16_t g_spi00_rx_count; /* spi00 receive data count */
volatile uint8_t *gp_spi00_tx_address; /* spi00 send buffer address */
volatile uint16_t g_spi00_tx_length; /* spi00 send data length */
volatile uint16_t g_spi00_tx_count; /* spi00 send data count */
#endif
#if defined USE_SCI_SPI01
volatile uint8_t *gp_spi01_rx_address; /* spi01 receive buffer address */
volatile uint16_t g_spi01_rx_length; /* spi01 receive data length */
volatile uint16_t g_spi01_rx_count; /* spi01 receive data count */
volatile uint8_t *gp_spi01_tx_address; /* spi01 send buffer address */
volatile uint16_t g_spi01_tx_length; /* spi01 send data length */
volatile uint16_t g_spi01_tx_count; /* spi01 send data count */
#endif
#if defined USE_SCI_IIC00
volatile uint8_t g_iic00_master_status_flag; /* iic00 start flag for send address check by master mode */
volatile uint8_t *gp_iic00_tx_address; /* iic00 send data pointer by master mode */
volatile uint16_t g_iic00_tx_count; /* iic00 send data size by master mode */
volatile uint8_t *gp_iic00_rx_address; /* iic00 receive data pointer by master mode */
volatile uint16_t g_iic00_rx_count; /* iic00 receive data size by master mode */
volatile uint16_t g_iic00_rx_length; /* iic00 receive data length by master mode */
#endif
#if defined USE_SCI_IIC01
volatile uint8_t g_iic01_master_status_flag; /* iic01 start flag for send address check by master mode */
volatile uint8_t *gp_iic01_tx_address; /* iic01 send data pointer by master mode */
volatile uint16_t g_iic01_tx_count; /* iic01 send data size by master mode */
volatile uint8_t *gp_iic01_rx_address; /* iic01 receive data pointer by master mode */
volatile uint16_t g_iic01_rx_count; /* iic01 receive data size by master mode */
volatile uint16_t g_iic01_rx_length; /* iic01 receive data length by master mode */
#endif
#if defined USE_SCI_UART1_TX
volatile uint8_t *gp_uart1_tx_address; /* uart1 transmit buffer address */
volatile uint16_t g_uart1_tx_count; /* uart1 transmit data number */
#endif
#if defined USE_SCI_UART1_RX
volatile uint8_t *gp_uart1_rx_address; /* uart1 receive buffer address */
volatile uint16_t g_uart1_rx_count; /* uart1 receive data number */
volatile uint16_t g_uart1_rx_length; /* uart1 receive data length */
#endif
#if defined USE_SCI_SPI10
volatile uint8_t *gp_spi10_rx_address; /* spi10 receive buffer address */
volatile uint16_t g_spi10_rx_length; /* spi10 receive data length */
volatile uint16_t g_spi10_rx_count; /* spi10 receive data count */
volatile uint8_t *gp_spi10_tx_address; /* spi10 send buffer address */
volatile uint16_t g_spi10_tx_length; /* spi10 send data length */
volatile uint16_t g_spi10_tx_count; /* spi10 send data count */
#endif
#if defined USE_SCI_SPI11
volatile uint8_t *gp_spi11_rx_address; /* spi11 receive buffer address */
volatile uint16_t g_spi11_rx_length; /* spi11 receive data length */
volatile uint16_t g_spi11_rx_count; /* spi11 receive data count */
volatile uint8_t *gp_spi11_tx_address; /* spi11 send buffer address */
volatile uint16_t g_spi11_tx_length; /* spi11 send data length */
volatile uint16_t g_spi11_tx_count; /* spi11 send data count */
#endif
#if defined USE_SCI_IIC10
volatile uint8_t g_iic10_master_status_flag; /* iic10 start flag for send address check by master mode */
volatile uint8_t *gp_iic10_tx_address; /* iic10 send data pointer by master mode */
volatile uint16_t g_iic10_tx_count; /* iic10 send data size by master mode */
volatile uint8_t *gp_iic10_rx_address; /* iic10 receive data pointer by master mode */
volatile uint16_t g_iic10_rx_count; /* iic10 receive data size by master mode */
volatile uint16_t g_iic10_rx_length; /* iic10 receive data length by master mode */
#endif
#if defined USE_SCI_IIC11
volatile uint8_t g_iic11_master_status_flag; /* iic11 start flag for send address check by master mode */
volatile uint8_t *gp_iic11_tx_address; /* iic11 send data pointer by master mode */
volatile uint16_t g_iic11_tx_count; /* iic11 send data size by master mode */
volatile uint8_t *gp_iic11_rx_address; /* iic11 receive data pointer by master mode */
volatile uint16_t g_iic11_rx_count; /* iic11 receive data size by master mode */
volatile uint16_t g_iic11_rx_length; /* iic11 receive data length by master mode */
#endif
#if defined USE_SCI_UART2_TX
volatile uint8_t *gp_uart2_tx_address; /* uart2 transmit buffer address */
volatile uint16_t g_uart2_tx_count; /* uart2 transmit data number */
#endif
#if defined USE_SCI_UART2_RX
volatile uint8_t *gp_uart2_rx_address; /* uart2 receive buffer address */
volatile uint16_t g_uart2_rx_count; /* uart2 receive data number */
volatile uint16_t g_uart2_rx_length; /* uart2 receive data length */
#endif
#if defined USE_SCI_SPI20
volatile uint8_t *gp_spi20_rx_address; /* spi20 receive buffer address */
volatile uint16_t g_spi20_rx_length; /* spi20 receive data length */
volatile uint16_t g_spi20_rx_count; /* spi20 receive data count */
vol
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 819 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/default.jpg!1)
喜欢吃火锅的泪
- 粉丝: 132
- 资源: 18
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
- Scratch语言教程相关项目资源
- 【kubernetes】实战:HPA自动扩/缩容
- IMG_20240911_192612.jpg
- 基于opencv和springboot的人脸分离应用
- 多智能体事件触发、一致性控制 状态轨迹图、控制输入图、事件触发图… 易于上手,有注释,有参考文献(与参考文献略有区别,适当变换能
- Xtensa架构所有版本中包含的核心指令介绍:加载指令/存储指令/跳转和调用指令/条件分支指/移动指令令/算术指令/位逻辑指令等
- 信捷PLC动态分期付款程序,动态解锁安全性高,无限期锁机直到终极解锁 函数功能块,只需要输入起始地址,可以直接使用 简单使用
- Unity Find Reference 2 2.5.8
- 8266 Modbus TCP协议转RTU串口通讯 TCP转RTU 不是实物,不是实物,不是实物 程序里包含了常用命令的处理
- 基于C#开发的腾讯滑块识别算法+JS轨道加密算法+源码(毕业设计&课程设计&项目开发)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)