嫁妆是什么意思| 双相情感障碍是什么| 任性的女孩有什么特点| 什么是a货翡翠| 10000是什么电话| 知我者莫若你什么意思| 碧潭飘雪是什么茶| 怀孕补铁吃什么| bbc是什么意思| 皮肤发黑是什么原因引起的| 男人到了什么年龄就性功能下降| 晚上没有睡意什么原因| 银耳有什么作用| 往事不堪回首是什么意思| 肺部ct挂什么科| 莫言是什么学历| 动脉夹层是什么病| 琉璃和玻璃有什么区别| 丑未相冲的结果是什么| 灰指甲什么样| 三大产能营养素是什么| 嫌恶是什么意思| 表述是什么意思| 肾上腺分泌什么激素| 旁支是什么意思| 豆粕是什么| 痔疮术后吃什么恢复快| 且慢是什么意思| 大运什么意思| 春天有什么植物| 尿蛋白高是什么病| 空调长时间不用再开注意什么| 得水痘不能吃什么| 怀不上孕是什么原因造成的| 糖丸是什么疫苗| ccu是什么意思| 福建安溪名茶是什么| 吃什么雌激素会增多| 女人右眼皮跳是什么预兆| 乳头凹陷是什么原因| 飞机什么东西不能带| 裳能组什么词| 异卵双胞胎是什么意思| 闫和阎有什么区别| 兰蔻是什么牌子| 大便干燥用什么药| 中考送什么礼物| 县委办公室主任是什么级别| 好样的什么意思| 机票什么时候买便宜| 中度贫血吃什么补血最快| 如日中天是什么生肖| 什么食物含锌最多| 办理护照需要什么| 快的反义词是什么| 子宫腺肌症是什么意思| 看痔疮挂什么科| 棺材一般用什么木头| 外阴红肿疼痛用什么药| 舌根发硬是什么原因| 胆汁是什么颜色| 波罗蜜多什么意思| 脖子粗大是什么病的症状| 小腿前侧肌肉叫什么| 喝茶叶有什么好处| 肚脐上面疼是什么原因| 医生为什么会建议竖切| 嘴唇起泡用什么药| 11月23日是什么星座| 知乎是干什么的| b12是什么| 蔬菜用什么肥料最好| 西腾手表属于什么档次| 血小板为什么会高| 一个土一个贝念什么| 人肉什么味道| ipad什么时候出新款| ky什么意思| 血常规挂什么科| 来龙去脉是什么生肖| 冲床工是做什么的| 身上经常出汗是什么原因| 58年属什么生肖| edo是什么意思| 非洲割礼是什么| 牙周炎有什么症状| 流感吃什么药| 双抗是什么药| 什么血压计最准确| 什么叫牙冠| 高祖父的爸爸叫什么| 右上眼皮跳是什么预兆| 会厌炎是什么病| 鸡米头是什么| 水命中什么水命最好| 一颗颗什么| tf口红什么牌子| 恨铁不成钢是什么意思| 宫外孕有什么危害| 闭目养神什么意思| 三个土是什么字| 奇脉见于什么病| 体外射精是什么意思| 大耗是什么意思| 混油皮是什么特征| trust什么意思| 姓林的女孩取什么名字好| 堪称什么意思| 自限性疾病是什么意思| 蛆是什么| coupon是什么意思| 瑞字属于五行属什么| 鱼在鱼缸底部不动为什么| 汗腺是什么| 李什么名字好听| 梵音是什么意思| 小生化是检查什么项目| 腹泻是什么原因引起的| 小猫的耳朵像什么| 二胎政策什么时候开放的| 尿蛋白尿潜血同时出现说明什么| 老汉推车是什么意思| 薄荷长什么样| 背沟深代表什么| 俗不可耐是什么意思| 赭石色是什么颜色| 市公安局局长是什么级别| 湖水蓝是什么颜色| 水瓶座与什么星座最配| 空灵是什么意思| 蓝颜知己是什么关系| 把脉能看出什么| 孕妇脚抽筋是什么原因| 低密度脂蛋白高的原因是什么| e大饼是什么牌子| 腺样体增生是什么意思| 体重突然下降是什么原因| 30是什么意思| 妍字属于五行属什么| 棉涤是什么面料| 人体缺甲是什么症状| 小孩阑尾炎是由什么原因引起的| 金蝉吃什么| 男扮女装叫什么| 苎麻是什么面料| 拉油便是什么原因| 酒喝多了喝什么解酒| 陈皮有什么好处| 新生的什么| 梦见自己来月经了什么预兆| 国家副主席是什么级别| 女人梦到蝎子什么征兆| 什么是内分泌| 淋巴细胞百分比高是什么原因| 年轻人创业做什么好| 什么是精神病| 中药和中成药有什么区别| 路亚什么意思| 牛骨煲汤搭配什么最好| 慌张的近义词是什么| 贲门炎吃什么药| 情劫是什么| 王五行属性是什么| 子宫肌壁回声不均匀是什么意思| 白带过氧化氢阳性什么意思| 78年的马是什么命| columbia是什么牌子| 塔罗牌是什么| 吃止痛药有什么副作用| 渡情劫是什么意思| 一生一世是什么意思| 白术有什么作用| 总是想睡觉是什么原因| 鸡全蛋粉是什么东西| 麦穗鱼吃什么| 心绪是什么意思| 睡眠不好什么原因| 长痣是什么原因引起的| 女生的胸长什么样子| 脚转筋是什么原因引起的| 牙龈长泡是什么原因| 月经崩漏吃什么止血| 关节炎有什么症状| 腮腺炎是什么引起的| 维生素是什么| 百合为什么是苦的| 更是什么结构的字| 达菲是什么药| 科目一和科目四有什么区别| 配偶什么意思| 人被老鼠咬了什么预兆| 头皮发热是什么原因| 见多识广是什么生肖| 甲状腺彩超能查出什么| 什么水果是寒性的| 血脂查什么项目| 吉林有什么特产| 什么叫基因| 艾司唑仑片是什么药| 信天翁是什么鸟| 失眠看什么科最好| 上嘴唇发黑是什么原因| 吃什么调节内分泌最快| 河粉是什么做的| 羊水穿刺是检查什么| 罗汉肉是什么肉| 强迫症是什么| 放下执念是什么意思| 虾黄是虾的什么部位| 激动是什么意思| 夜尿频多吃什么药效果好| 什么样的血管瘤不用治| 解暑喝什么| 精液是什么形成的| 喝椰子粉有什么好处| 中暑吃什么水果| 六月十五号是什么星座| 珍珠鸟吃什么食物| 鲸属于什么类动物| 什么叫引产| 孢子是什么| 适得其反是什么意思| 煮玉米放什么好吃| 肌酐高说明什么问题| 梵蒂冈为什么没人敢打| 满血复活是什么意思| 六月六日是什么星座| 积液是什么东西| 手脚冰凉什么原因| 被蝎子蛰了用什么药| 鸦雀无声是什么意思| 脸上起红疙瘩是什么原因| 穿刺是检查什么的| 喝生姜水有什么好处| 压箱钱是什么意思| 黄体酮是什么| 处女座后面是什么星座| 真菌怕什么| 右侧后背疼是什么原因| 右小腿抽筋是什么原因| 牙疼吃什么止疼药见效快| 花木兰是什么朝代| 轻断食是什么意思| 游离甲状腺素是什么| 一什么花瓣| 阿奇霉素是什么药| 什么蔬菜补血| 早孕试纸什么时候测最准确| 白花花是什么意思| 智齿疼吃什么药| 血管细是什么原因| 大便的颜色代表什么| 欧巴是什么意思| 四大才子是什么生肖| 变异性哮喘吃什么药| 肾水不足是什么意思| 今年什么时候起伏| 脐带血能治疗什么病| u盘什么牌子好| 皴是什么意思| 葡萄什么时候种植| 输卵管发炎有什么症状表现| 鼻基底填充用什么材料比较好| 胎儿永存左上腔静脉是什么意思| 百度
打印
[M0]

蒋平安委员:建设新疆现代畜牧业示范区正当时

[复制链接]
23696|34
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
rickluo|  楼主 | 2024-2-27 11:14 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
沙发
rickluo|  楼主 | 2024-2-27 11:15 | 只看该作者
参考手册,见附件文档,

PRM0008 PT32x007x参考手册1.1.zip

6.17 MB

板凳
rickluo|  楼主 | 2024-2-27 11:17 | 只看该作者
测试板原理图,见附件


PT32L007X_TSSOP20原理图.zip

51.93 KB

地板
rickluo|  楼主 | 2024-2-27 11:20 | 只看该作者

5
wzjhuohua| | 2024-2-28 08:28 | 只看该作者
有啥特色没有??
6
qintian0303| | 2024-2-28 08:37 | 只看该作者
引脚好少啊
7
rickluo|  楼主 | 2024-2-28 08:50 | 只看该作者
wzjhuohua 发表于 2024-2-28 08:28
有啥特色没有??

超低功耗,flash  64K  ram 16K
8
rickluo|  楼主 | 2024-2-28 08:51 | 只看该作者

是的,针对小引脚,多引脚的有PT32L076,PT32L076xx是基于Cortex-M0内核的一款32位高性能MCU,最高主频支持64MHz,Flash 64/128Kbyte, RAM 16/32Kbyte, 支持工作电压1.8~5.5v, 工作温度为-40~+105度。支持外部4~25MHz高速晶体振荡器及32.768KHz低速晶体振荡器,支持内部32MHz高速RC振荡器及32K/38.4K低速RC振荡器,支持PLL倍频。内部集成了6通道DMA控制器,4路 UART,2路LPUART,2路SPI,2路I2C等丰富的串口外设,12位1M采样率的SARADC,支持26个外部通道,多达11个定时器,其中包括1 个 16 位带死区控制和紧急刹车,用于电机控制的高级控制定时器 TIM1,1 个 16 位用于辅助电机控制的高级控制定时器 TIM8,3个16位通用定时器TIM5/6/7, 2个16位基本定时器TIM2/3, 1个16位低功耗定时器TIM4,1个可用于低功耗下电机控制TIM10,1个独立看门狗1个窗口看门狗。支持液晶显示LCD接口,其中包括2*42、4*40、6*38及8*36等,支持7位DAC,4路比较器,4路运算放大器。部分IO大电流驱动功能。支持Sleep模式和Deep Sleep模式。支持AES128/192/256, 乘法器&除法器,低电压检测功能,看门狗唤醒,芯片内部唯一码,CRC校验等功能。

9
xch| | 2024-2-28 12:12 | 只看该作者
看起来没低功耗 lpuart,没有异步工作的低功耗 timer ,但是为啥叫超低功耗?
10
wangxiangtan2| | 2024-2-29 08:34 | 只看该作者
怎么领,在哪儿领老哥
11
rickluo|  楼主 | 2024-2-29 09:09 | 只看该作者
可以的,发我地址,我快递给您,运费到付
12
rickluo|  楼主 | 2024-2-29 09:09 | 只看该作者
wzjhuohua 发表于 2024-2-28 08:28
有啥特色没有??

大众化才是最好的,
13
rickluo|  楼主 | 2024-2-29 09:10 | 只看该作者
xch 发表于 2024-2-28 12:12
看起来没低功耗 lpuart,没有异步工作的低功耗 timer ,但是为啥叫超低功耗? ...

详细数据手册,请查收!

PT32L007x数据手册1.1.pdf

2.88 MB

14
gyh974| | 2024-2-29 10:28 | 只看该作者
什么内核?
15
804879880| | 2024-2-29 11:07 | 只看该作者
有MCU具体需求的可联系 可联系电话15332235813;微信号:daishishuai3。
16
rickluo|  楼主 | 2024-2-29 11:54 | 只看该作者

M0内核
17
rickluo|  楼主 | 2024-2-29 11:57 | 只看该作者
wangxiangtan2 发表于 2024-2-29 08:34
怎么领,在哪儿领老哥

TEL/VX:18566239000
18
rickluo|  楼主 | 2024-3-1 10:32 | 只看该作者


渠道多多,多多关注
19
rickluo|  楼主 | 2024-3-25 14:41 | 只看该作者
  /******************************************************************************
  * @file    PT32x007x_uart.c
  * @author  应用开发团队
  * @version V1.5.0
  * @date    2023/11/20
  * @brief    This file provides firmware functions to manage the following
  *          functionalities of the Universal synchronous asynchronous receiver
  *          transmitter (USART):
  *           + Initialization and Configuration
  *           + STOP Mode
  *           + BaudRate
  *           + Data transfers
  *           + Multi-Processor Communication
  *           + Half-duplex mode
  *           + Smartcard mode
  *           + Interrupts and flags management
  *            
  ******************************************************************************
  * @attention
  *
  *
  *****************************************************************************/


/* Includes ------------------------------------------------------------------*/
#include "PT32x007x_uart.h"


/** @defgroup UART
  * @brief UART driver modules
  * @{
  */

/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/\
#define Init_CR_MASK        (u32)0xFFFFFE80
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/


/**
  * @brief  Initializes the UARTx peripheral according to the specified
  *         parameters in the USART_InitStruct .
  * @param  UARTx: where x can be from 0 to 1 to select the UART peripheral.
  * @param  UART_InitStruct: pointer to a UART_InitTypeDef structure that contains
  *         the configuration information for the specified UART peripheral.
  * @retval None
  */
void UART_Init(UART_TypeDef* UARTx, UART_InitTypeDef* UART_InitStruct)
{
        u32  tmpreg = 0, remainder = 0,quotient = 0, pclk = 0;
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_UART_BaudRate(UART_InitStruct->UART_BaudRate));
        assert_param(IS_UART_WordLengthAndParity(UART_InitStruct->UART_WordLengthAndParity));
        assert_param(IS_UART_StopBitLength(UART_InitStruct->UART_StopBitLength));
        assert_param(IS_UART_ParityMode(UART_InitStruct->UART_ParityMode));
        assert_param(IS_UART_Receiver(UART_InitStruct->UART_Receiver));
   assert_param(IS_UART_LoopbackMode(UART_InitStruct->UART_LoopbackMode));
        UARTx->RXFR = UART_RXFR_RXFR;
        UARTx->TXFR = UART_TXFR_TXFR;
       
        tmpreg &= Init_CR_MASK;
        tmpreg |=  (UART_InitStruct ->UART_WordLengthAndParity  | \
                                                        UART_InitStruct ->UART_StopBitLength        | \
                                                        UART_InitStruct ->UART_ParityMode           | \
                                                        UART_InitStruct->UART_LoopbackMode          | \
                                                        UART_InitStruct->UART_Receiver);
        UARTx->CR = tmpreg;
       
        pclk = RCC_GetClockFreq(RCC_PCLK);
   
        quotient =  (pclk / (16 * UART_InitStruct->UART_BaudRate));
  remainder = (pclk % (16 * UART_InitStruct->UART_BaudRate));
  if(quotient==0)
        {
                UARTx->BRR=1;
        }
        else
        {
                if (remainder > (8 * UART_InitStruct->UART_BaudRate))
                {
                        UARTx->BRR = (u16) (quotient + 1);         
                }
                else
                {
                        UARTx->BRR = (u16) quotient;        
                }
        }
}

/**
  * @brief  Fills each UART_InitStruct member with its default value.
  * @param  UART_InitStruct: pointer to a UART_InitTypeDef structure
  *         which will be initialized.
  * @retval None
  */
void UART_StructInit(UART_InitTypeDef* UART_InitStruct)
{
        /* USART_InitStruct members default value */
        UART_InitStruct->UART_BaudRate = 19200;
        UART_InitStruct->UART_WordLengthAndParity = UART_WordLengthAndParity_8DP;
        UART_InitStruct->UART_StopBitLength = UART_StopBitLength_1;
        UART_InitStruct->UART_ParityMode = UART_ParityMode_Odd;
        UART_InitStruct->UART_Receiver = UART_Receiver_Enable;
        UART_InitStruct->UART_LoopbackMode = UART_LoopbackMode_Disable;
}

/**
  * @brief  Enables or disables the specified UART peripheral.
  * @param  UARTx: where x can be from 0 to 1 to select the UART peripheral.
  * @param  NewState: new state of the USARTx peripheral.
  *          This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void UART_Cmd(UART_TypeDef* UARTx, FunctionalState NewState)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_FUNCTIONAL_STATE(NewState));
        if (NewState != DISABLE)
        {
                /* Enable the selected USART by setting the UE bit in the CR1 register */
                UARTx->CR |= UART_CR_EN;
        }
        else
        {
                /* Disable the selected USART by clearing the UE bit in the CR1 register */
                UARTx->CR &= (~UART_CR_EN);
        }
}

/**
  * @brief  Transmits single data through the UARTx peripheral.
  * @param  UARTx: where x can be from 0 or 1 to select the UART peripheral.
  * @param  Data: the data to transmit.
  * @retval None
  */
void UART_SendData(UART_TypeDef* UARTx, u16 Data)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_UART_DATA(Data));
        /* While the TxFIFO contain 8 characters. */
        while((UARTx->SR & UART_SR_TXF));
        /* Transmit Data */
        UARTx->DR = (Data & (u16)0x01FF);
}

/**
  * @brief  Returns the most recent received data by the UARTx peripheral.
  * @param  UARTx: where x can be from 0 to 1 to select the UART peripheral.
  * @retval The received data.
  */
u16 UART_ReceiveData(UART_TypeDef* UARTx)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        /* Receive Data */
        return (u16)(UARTx->DR & (u16)0x01FF);
}

/**
  * @brief  This function reset the Rx and the Tx FIFOs
  * @param  UARTx: where x can be from 0 to 1 to select the UART peripheral.
  * @param  FIFO: Transmit FIFO or receive FIFO for the UART .
  *          This parameter can be:
  *            @ARG Rx_FIFO: Receive FIFO .
  *            @arg Tx_FIFO: Transmit FIFO .
  * @retval None.
  */
void UART_FifoReset(UART_TypeDef* UARTx, u8 UART_FIFO)
{
  assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_UART_FIFO(UART_FIFO));
        switch (UART_FIFO)
        {
                case FIFO_RX :
                        UARTx->RXFR = UART_RXFR_RXFR;
                        break;
                case FIFO_TX :
                        UARTx->TXFR = UART_TXFR_TXFR;
                        break;
        }
}

/**
  * @brief  Enables or disables the UART's Half Duplex communication.
  * @param  UARTx: where x can be from 0 to 1 to select the UART peripheral.
  * @param  NewState: new state of the UART Communication.
  *          This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void UART_HalfDuplexCmd(UART_TypeDef* UARTx, FunctionalState NewState)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_FUNCTIONAL_STATE(NewState));
        if (NewState != DISABLE)
        {
                /* Enable the Half-Duplex mode by setting the OWE bit in the CR register */
                UARTx->CR |= UART_CR_SLME;
        }
        else
        {
                /* Disable the Half-Duplex mode by clearing the OWE bit in the CR register */
                UARTx->CR  &= (u32)~((u32)UART_CR_SLME);
        }
}

/**
  * @brief  Enables or disables the UART's transmitter or receiver.
  * @param  UARTx: where x can be from 0 to 1 to select the UART peripheral.
  * @param  UART_Direction: specifies the UART direction.
  *          This parameter can be any combination of the following values:
  *            @arg UART_SingleLineDirection_Tx: UART Single Line Direction Transmitter
  *            @arg UART_SingleLineDirection_Rx: UART Single Line Direction Receiver
  * @param  NewState: new state of the USART transfer direction.
  *          This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void UART_HalfDuplexDirectionConfig(UART_TypeDef* UARTx, u32 Direction)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_UART_SingleLineDirection(Direction));
        if (Direction != UART_SingleLineDirection_Rx)
        {
                /* Set NSS pin internally by software */
                UARTx->CR |= UART_SingleLineDirection_Tx;
        }
        else
        {
                /* Reset NSS pin internally by software */
                UARTx->CR &= ~UART_SingleLineDirection_Tx;
        }
}

/**
  * @brief  Enables or disables the UART's IrDA interface.
  * @param  UARTx: where x can be 0 to select the UART peripheral.
  * @param  NewState: new state of the IrDA mode.
  *          This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void UART_IrDACmd(UART_TypeDef* UARTx, FunctionalState NewState)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_FUNCTIONAL_STATE(NewState));
        if (NewState != DISABLE)
        {
                /* Enable the IrDA mode by setting the IRE bit in the IMCR register */
                UARTx->IMCR |= UART_IMCR_IRE;
        }
        else
        {
                /* Disable the IrDA mode by clearing the EN bit in the IMCR register */
                UARTx->IMCR &= ~UART_IMCR_IRE;
        }
}

/**
  * @brief  Configures the IrDA's Pin polarity
  * @param  UARTx: where x can be 0 to select the UART peripheral.
  * @param  NewState: new defined levels for the USART data.
  *          This parameter can be:
  *            @arg ENABLE: pin(s) signal values are inverted (Vdd =0, Gnd =1).
  *            @arg pin(s) signal works using the standard logic levels (Vdd =1, Gnd =0).
  * @NOTE   This function has to be called before calling UART_Cmd() function.
  * @retval None
  */
void UART_IrDAPolarityConfig(UART_TypeDef* UARTx, FunctionalState NewState)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_FUNCTIONAL_STATE(NewState));
        if (NewState != DISABLE)
        {
                /* Enable the binary data inversion feature by setting the DATAINV bit in
                   the CR2 register */
                UARTx->IMCR |= UART_IMCR_IRPN;
        }
        else
        {
                /* Disable the binary data inversion feature by clearing the DATAINV bit in
                   the CR2 register */
                UARTx->IMCR &= ~UART_IMCR_IRPN;
        }
}

/**
  * @brief  Sets the infrared duty cycle for UART peripheral.
  * @param  UARTx: where x can be 0 to select the UART peripheral.
  * @param  IrDADutyCycle: specifies the infrared duty cycle.
  * @note   This function has to be called before calling UART_Cmd() function.
  * @retval None
  */
void UART_IrDADutyCycleConfig(UART_TypeDef* UARTx, u16 IrDADutyCycle)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_UART_InfraredDutyCycle(IrDADutyCycle));
        /* Clear the IrDA's modulation PWM duty cycle */
        UARTx->IMDCR &= ~UART_IMDCR_DUTY;
        /* Set the IrDA's modulation PWM duty cycle*/
        UARTx->IMDCR |= IrDADutyCycle;
}

/**
  * @brief  Enables or disables the specified USART interrupts.
  * @param  UARTx: where x can be from 1 to 8 to select the USART peripheral.
  * @param  UART_IT: specifies the UART interrupt sources to be enabled or disabled.
  *          This parameter can be one of the following values:
  *            @arg UART_IT_RXNEI: specifies the interrupt source for Receiver FIFO buffer non-empty interrupt.
  *            @arg UART_IT_RXFI: specifies the interrupt source for Receiver FIFO buffer full interrupt.
  *            @arg UART_IT_PEI: specifies the interrupt source for Parity error interrupt.
  *            @arg UART_IT_FEI: specifies the interrupt source for Frame error interrupt.
  *            @arg UART_IT_OVRI: specifies the interrupt source for Receiver FIFO buffer overflow interrupt.
  *            @arg UART_IT_TXEI: specifies the interrupt source for Transmitter FIFO buffer empty interrupt.
  *            @arg UART_IT_TXFI: specifies the interrupt source for Transmitter FIFO buffer full interrupt.
  *            @arg UART_IT_TXOI: specifies the interrupt source for Transfer end interrupt
  * @param  NewState: new state of the specified USARTx interrupts.
  *          This parameter can be: ENABLE or DISABLE.
  * @retval None
  */
void UART_ITConfig(UART_TypeDef* UARTx, u32 UART_IT, FunctionalState NewState)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_UART_IT(UART_IT));
        assert_param(IS_FUNCTIONAL_STATE(NewState));
        if (NewState != DISABLE)
        {
                UARTx->IE |= UART_IT;
        }
        else
        {
                UARTx->IE &= ~UART_IT;
        }
}

/**
  * @brief  Checks whether the specified UART flag is set or not.
  * @param  UARTx: where x can be from 0 to 1 to select the UART peripheral.
  * @param  UART_FLAG: specifies the flag to check.
  *          This parameter can be one of the following values:
  *            @arg UART_FLAG_RXNE: Receiver FIFO not empty flag.
  *            @arg UART_FLAG_RXF: Receiver FIFO full flag.
  *            @arg UART_FLAG_PE: Parity error flag.
  *            @arg UART_FLAG_FE: Frame error flag.
  *            @arg UART_FLAG_OVR: Receiver FIFO buffer overflow flag.
  *            @arg UART_FLAG_TXE: Transmitter FIFO empty flag.
  *            @arg UART_FLAG_TXF: Transmitter FIFO full flag.
  *            @arg UART_FLAG_TXO: Transfer end flag.
  * @retval The new state of UART_FLAG (SET or RESET).
  */
FlagStatus UART_GetFlagStatus(UART_TypeDef* UARTx, u32 UART_FLAG)
{
        FlagStatus bitstatus = RESET;
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_UART_FLAG(UART_FLAG));
        if ((UARTx->SR & UART_FLAG) != (u16)RESET)
        {
                bitstatus = SET;
        }
        else
        {
                bitstatus = RESET;
        }
        return bitstatus;
}

/**
  * @brief  Clears the UARTx's pending flags.
  * @param  UARTx: where x can be from 0 to 1 to select the USART peripheral.
  * @param  USART_FLAG: specifies the flag to clear.
  *          This parameter can be any combination of the following values:
  *            @arg UART_FLAG_PE: Parity error flag.
  *            @arg UART_FLAG_FE: Frame error flag.
  *            @arg UART_FLAG_OVR: Receiver FIFO buffer overflow flag.
  * @retval None
  */
void UART_ClearFlag(UART_TypeDef* UARTx, u32 UART_FLAG)
{
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_UART_FLAG(UART_FLAG));
        if(UART_FLAG==UART_FLAG_PE || UART_FLAG==UART_FLAG_FE || UART_FLAG==UART_FLAG_OVR)
        {
                UARTx->SR = UART_FLAG;
        }
}

/**
  * @brief  Checks whether the specified UART intterrupt status is set or not.
  * @param  UARTx: where x can be from 0 to 1 to select the USART peripheral.
  * @param  UART_IT: Specify the intterrupt status to be checked.
  *         This parameter can be one of the following values:
        *            @arg UART_IT_RXNEI: specifies the interrupt source for Receiver FIFO buffer non-empty interrupt.
  *            @arg UART_IT_RXFI: specifies the interrupt source for Receiver FIFO buffer full interrupt.
  *            @arg UART_IT_PEI: specifies the interrupt source for Parity error interrupt.
  *            @arg UART_IT_FEI: specifies the interrupt source for Frame error interrupt.
  *            @arg UART_IT_OVRI: specifies the interrupt source for Receiver FIFO buffer overflow interrupt.
  *            @arg UART_IT_TXEI: specifies the interrupt source for Transmitter FIFO buffer empty interrupt.
  *            @arg UART_IT_TXFI: specifies the interrupt source for Transmitter FIFO buffer full interrupt.
  *            @arg UART_IT_TXOI: specifies the interrupt source for Transfer completed interrupt
  * @return ITStatus of UART_IT (SET or RESET).
  */
ITStatus UART_GetITStatus(UART_TypeDef* UARTx, u32 UART_IT)
{
        ITStatus bitstatus = RESET;
        u32 enablestatus = 0;
        /* Check the parameters */
        assert_param(IS_UART_ALL_PERIPH(UARTx));
        assert_param(IS_UART_IT(UART_IT));
        /**/
        enablestatus = (u32)(UARTx->IE & UART_IT);
        /*  */
        if (((u32)(UARTx->SR & UART_IT) != (u32)RESET) && (enablestatus != (u32)RESET))
        {
                /* */
                bitstatus = SET;
        }
        else
        {
                /* */
                bitstatus = RESET;
        }
        /**/
        return  bitstatus;
}

/**
  * @}
  */


20
rgjinxuan| | 2024-4-28 17:58 | 只看该作者
我要一块   VX:19924580103
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

69

主题

470

帖子

4

粉丝
冥想是什么 血糖高忌什么食物 蜘蛛怕什么 郁是什么生肖 窦性心动过缓吃什么药
99年发生了什么事情 天蝎和什么星座最配 cva医学上是什么意思 中性粒细胞绝对值偏高是什么原因 健康管理是干什么的
多梦是什么原因 4月9号是什么星座 白萝卜煮水喝有什么功效 投诉护士找什么部门 什么样的充电宝不能带上飞机
喝醋对身体有什么好处 景色奇异的异是什么意思 脸为什么肿 肝多发小囊肿什么意思 卡密什么意思
打猎是什么意思travellingsim.com 胃体隆起是什么意思hcv9jop6ns9r.cn 二月初十是什么星座huizhijixie.com rf医学上是什么意思hcv9jop6ns9r.cn 喝酒对身体有什么好处和坏处qingzhougame.com
身份证穿什么衣服ff14chat.com 金童玉女指什么生肖0735v.com 梦见抓了好多鱼是什么意思hcv9jop7ns5r.cn 小月子能吃什么水果shenchushe.com 槟榔是什么味道的hcv8jop4ns5r.cn
医院归什么部门管理hcv8jop2ns6r.cn 4月18日什么星座hcv9jop6ns5r.cn 什么的月光sanhestory.com 刮痧红色说明什么原因hcv9jop6ns5r.cn 甲亢病吃什么药效果好hcv8jop3ns8r.cn
9月19号什么星座hcv9jop2ns9r.cn 84是什么意思hcv8jop8ns9r.cn 家里养什么花最好onlinewuye.com 喝柠檬水有什么好处hcv9jop8ns3r.cn 双鱼座是什么星象bjhyzcsm.com
百度