/***********************************************************************************************************************
* 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
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
BAT32G137国产芯片开发实例,可以很方便的实现每个模块的调试和验证,适用于大型智能家居,智能充电器等产品开发 (819个子文件)
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
userdefine.h.base@1.0.0 52KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
isr_BAT32G137.c.base@1.0.0 15KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
system_BAT32G137.c.base@1.0.0 14KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
startup_BAT32G137.s.base@1.0.0 12KB
共 819 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
喜欢吃火锅的泪
- 粉丝: 134
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- C#销售管理系统源码数据库 SQL2008源码类型 WinForm
- 课程设计《基于树莓派、Arduino做的 人脸识别门禁系统》+源码+文档说明+答辩PPT+实训报告(高分作品)
- 基于 SpringBoot 构建宠物健康顾问系统:功能解析与宠物福祉提升
- 修正预训练偏差的数据集调整与迁移学习性能优化
- 毕业设计基于tensorflow、keras-pytorch实现对自然场景的文字检测及端到端的OCR中文文字识别
- 超越少样本范式的大型语言模型提示编程研究
- 天然产物化学中化合物的核磁与质谱分析
- 数据库实训课程设计 《基于javaweb实现学生选课管理系统》+源码+实训报告+文档说明(高分作品)
- 大规模数学推理数据合成方法ScaleQuest的提出与应用
- C#ERP数据管理系统源码数据库 SQL2008源码类型 WinForm
- 自然语言处理指令调优方法集合Flan 2022的设计与效果分析
- 游览器插件!快速便捷!!助理数据采集
- 2023年全国职业院校技能大赛赛项赛题GZ053 视觉艺术设计赛项赛题10套
- 独家首发的inRvana 2.6.0 WordPress主题 开心版
- 基于STM32F103RCT6的cubemx开发的hal库IIC驱动0.96寸OLED屏显示内容,OLED屏4条线VCC\GND\SDA\SCL连接到单片机开发板
- 深入探索:在 C++ 中自定义 Allocator 的实现与应用
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功