日本黄色一级经典视频|伊人久久精品视频|亚洲黄色色周成人视频九九九|av免费网址黄色小短片|黄色Av无码亚洲成年人|亚洲1区2区3区无码|真人黄片免费观看|无码一级小说欧美日免费三级|日韩中文字幕91在线看|精品久久久无码中文字幕边打电话

當(dāng)前位置:首頁(yè) > 單片機(jī) > 單片機(jī)
[導(dǎo)讀] 1,開(kāi)發(fā)環(huán)境 1,適用芯片:STM32F4全部芯片 2,固件庫(kù):STM32F4xx_DSP_StdPeriph_Lib_V1.8.0 3,IDE:MDK5172,驅(qū)動(dòng)源碼 USART.h文件/*************************************************************

1,開(kāi)發(fā)環(huán)境

1,適用芯片:STM32F4全部芯片

2,固件庫(kù):STM32F4xx_DSP_StdPeriph_Lib_V1.8.0

3,IDE:MDK517


2,驅(qū)動(dòng)源碼

USART.h文件

/****************************************************************

* Copyright (C) 2016, XinLi, all right reserved.

* File name: USART.h

* Date: 2016.03.22

* Description: USART Driver

*****************************************************************/

#ifndef __USART_H

#define __USART_H

/****************************************************************

* Header include

*****************************************************************/

#include "stm32f4xx.h"

/****************************************************************

* Macro definition

*****************************************************************/

#define USART1_BufferSize_Tx (0)

#define USART1_BufferSize_Rx (0)

#define USART2_BufferSize_Tx (0)

#define USART2_BufferSize_Rx (0)

#if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F469_479xx) || defined(STM32F446xx) || defined(STM32F412xG) || defined(STM32F413_423xx)

#define USART3_BufferSize_Tx (0)

#define USART3_BufferSize_Rx (0)

#endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F469_479xx || STM32F446xx || STM32F412xG || STM32F413_423xx */

#if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F469_479xx) || defined(STM32F446xx) || defined(STM32F413_423xx)

#define USART4_BufferSize_Tx (0)

#define USART4_BufferSize_Rx (0)

#define USART5_BufferSize_Tx (0)

#define USART5_BufferSize_Rx (0)

#endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F469_479xx || STM32F446xx || STM32F413_423xx */

#define USART6_BufferSize_Tx (0)

#define USART6_BufferSize_Rx (0)

#if defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F469_479xx) || defined(STM32F413_423xx)

#define USART7_BufferSize_Tx (0)

#define USART7_BufferSize_Rx (0)

#define USART8_BufferSize_Tx (0)

#define USART8_BufferSize_Rx (0)

#endif /* STM32F427_437xx || STM32F429_439xx || STM32F469_479xx || STM32F413_423xx */

#if defined(STM32F413_423xx)

#define USART9_BufferSize_Tx (0)

#define USART9_BufferSize_Rx (0)

#define USART10_BufferSize_Tx (0)

#define USART10_BufferSize_Rx (0)

#endif /* STM32F413_423xx */

/********************* USART1 Configuration *********************/

#define RCC_AHB1Periph_USART1_Tx RCC_AHB1Periph_GPIOA

#define RCC_AHB1Periph_USART1_Rx RCC_AHB1Periph_GPIOA

#define GPIO_USART1_Tx GPIOA

#define GPIO_USART1_Rx GPIOA

#define GPIO_Pin_USART1_Tx GPIO_Pin_9

#define GPIO_Pin_USART1_Rx GPIO_Pin_10

#define GPIO_PinSource_USART1_Tx GPIO_PinSource9

#define GPIO_PinSource_USART1_Rx GPIO_PinSource10

/****************************************************************/

/********************* USART2 Configuration *********************/

#define RCC_AHB1Periph_USART2_Tx RCC_AHB1Periph_GPIOA

#define RCC_AHB1Periph_USART2_Rx RCC_AHB1Periph_GPIOA

#define GPIO_USART2_Tx GPIOA

#define GPIO_USART2_Rx GPIOA

#define GPIO_Pin_USART2_Tx GPIO_Pin_2

#define GPIO_Pin_USART2_Rx GPIO_Pin_3

#define GPIO_PinSource_USART2_Tx GPIO_PinSource2

#define GPIO_PinSource_USART2_Rx GPIO_PinSource3

/****************************************************************/

#if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F469_479xx) || defined(STM32F446xx) || defined(STM32F412xG) || defined(STM32F413_423xx)

/********************* USART3 Configuration *********************/

#define RCC_AHB1Periph_USART3_Tx RCC_AHB1Periph_GPIOB

#define RCC_AHB1Periph_USART3_Rx RCC_AHB1Periph_GPIOB

#define GPIO_USART3_Tx GPIOB

#define GPIO_USART3_Rx GPIOB

#define GPIO_Pin_USART3_Tx GPIO_Pin_10

#define GPIO_Pin_USART3_Rx GPIO_Pin_11

#define GPIO_PinSource_USART3_Tx GPIO_PinSource10

#define GPIO_PinSource_USART3_Rx GPIO_PinSource11

/****************************************************************/

#endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F469_479xx || STM32F446xx || STM32F412xG || STM32F413_423xx */

#if defined(STM32F40_41xxx) || defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F469_479xx) || defined(STM32F446xx) || defined(STM32F413_423xx)

/********************* USART4 Configuration *********************/

#define RCC_AHB1Periph_USART4_Tx RCC_AHB1Periph_GPIOC

#define RCC_AHB1Periph_USART4_Rx RCC_AHB1Periph_GPIOC

#define GPIO_USART4_Tx GPIOC

#define GPIO_USART4_Rx GPIOC

#define GPIO_Pin_USART4_Tx GPIO_Pin_10

#define GPIO_Pin_USART4_Rx GPIO_Pin_11

#define GPIO_PinSource_USART4_Tx GPIO_PinSource10

#define GPIO_PinSource_USART4_Rx GPIO_PinSource11

/****************************************************************/

/********************* USART5 Configuration *********************/

#define RCC_AHB1Periph_USART5_Tx RCC_AHB1Periph_GPIOC

#define RCC_AHB1Periph_USART5_Rx RCC_AHB1Periph_GPIOD

#define GPIO_USART5_Tx GPIOC

#define GPIO_USART5_Rx GPIOD

#define GPIO_Pin_USART5_Tx GPIO_Pin_12

#define GPIO_Pin_USART5_Rx GPIO_Pin_2

#define GPIO_PinSource_USART5_Tx GPIO_PinSource12

#define GPIO_PinSource_USART5_Rx GPIO_PinSource2

/****************************************************************/

#endif /* STM32F40_41xxx || STM32F427_437xx || STM32F429_439xx || STM32F469_479xx || STM32F446xx || STM32F413_423xx */

/********************* USART6 Configuration *********************/

#define RCC_AHB1Periph_USART6_Tx RCC_AHB1Periph_GPIOC

#define RCC_AHB1Periph_USART6_Rx RCC_AHB1Periph_GPIOC

#define GPIO_USART6_Tx GPIOC

#define GPIO_USART6_Rx GPIOC

#define GPIO_Pin_USART6_Tx GPIO_Pin_6

#define GPIO_Pin_USART6_Rx GPIO_Pin_7

#define GPIO_PinSource_USART6_Tx GPIO_PinSource6

#define GPIO_PinSource_USART6_Rx GPIO_PinSource7

/****************************************************************/

#if defined(STM32F427_437xx) || defined(STM32F429_439xx) || defined(STM32F469_479xx) || defined(STM32F413_423xx)

/********************* USART7 Configuration *********************/

#define RCC_AHB1Periph_USART7_Tx RCC_AHB1Periph_GPIOE

#define RCC_AHB1Periph_USART7_Rx RCC_AHB1Periph_GPIOE

#define GPIO_USART7_Tx GPIOE

#define GPIO_USART7_Rx GPIOE

#define GPIO_Pin_USART7_Tx GPIO_Pin_8

#define GPIO_Pin_USART7_Rx GPIO_Pin_7

#define GPIO_PinSource_USART7_Tx GPIO_PinSource8

#define GPIO_PinSource_USART7_Rx GPIO_PinSource7

/****************************************************************/

/********************* USART8 Configuration *********************/

#define RCC_AHB1Periph_USART8_Tx RCC_AHB1Periph_GPIOE

#define RCC

本站聲明: 本文章由作者或相關(guān)機(jī)構(gòu)授權(quán)發(fā)布,目的在于傳遞更多信息,并不代表本站贊同其觀點(diǎn),本站亦不保證或承諾內(nèi)容真實(shí)性等。需要轉(zhuǎn)載請(qǐng)聯(lián)系該專欄作者,如若文章內(nèi)容侵犯您的權(quán)益,請(qǐng)及時(shí)聯(lián)系本站刪除( 郵箱:macysun@21ic.com )。
換一批
延伸閱讀
關(guān)閉