*
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file main.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 18-April-2011
|
||||
* @brief Main program body
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx.h"
|
||||
#include "usart.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
uint32_t i;
|
||||
USART_Configuration();
|
||||
USART_NVIC_Config();
|
||||
i=0x1ffffff;
|
||||
while (1)
|
||||
{
|
||||
printf("\r\nWelcome to WaveShare STM32F4 series MCU Board Open407Z\r\n");
|
||||
while(i--);
|
||||
i=0x1ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,88 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file I2C/EEPROM/stm32f4xx_conf.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 30-September-2011
|
||||
* @brief Library configuration file.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F4xx_CONF_H
|
||||
#define __STM32F4xx_CONF_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/* Uncomment the line below to enable peripheral header file inclusion */
|
||||
#include "stm32f4xx_adc.h"
|
||||
#include "stm32f4xx_can.h"
|
||||
#include "stm32f4xx_crc.h"
|
||||
#include "stm32f4xx_cryp.h"
|
||||
#include "stm32f4xx_dac.h"
|
||||
#include "stm32f4xx_dbgmcu.h"
|
||||
#include "stm32f4xx_dcmi.h"
|
||||
#include "stm32f4xx_dma.h"
|
||||
#include "stm32f4xx_exti.h"
|
||||
#include "stm32f4xx_flash.h"
|
||||
#include "stm32f4xx_fsmc.h"
|
||||
#include "stm32f4xx_hash.h"
|
||||
#include "stm32f4xx_gpio.h"
|
||||
#include "stm32f4xx_i2c.h"
|
||||
#include "stm32f4xx_iwdg.h"
|
||||
#include "stm32f4xx_pwr.h"
|
||||
#include "stm32f4xx_rcc.h"
|
||||
#include "stm32f4xx_rng.h"
|
||||
#include "stm32f4xx_rtc.h"
|
||||
#include "stm32f4xx_sdio.h"
|
||||
#include "stm32f4xx_spi.h"
|
||||
#include "stm32f4xx_syscfg.h"
|
||||
#include "stm32f4xx_tim.h"
|
||||
#include "stm32f4xx_usart.h"
|
||||
#include "stm32f4xx_wwdg.h"
|
||||
#include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* If an external clock source is used, then the value of the following define
|
||||
should be set to the value of the external clock source, else, if no external
|
||||
clock is used, keep this define commented */
|
||||
/*#define I2S_EXTERNAL_CLOCK_VAL 12288000 */ /* Value of the external clock in Hz */
|
||||
|
||||
|
||||
/* Uncomment the line below to expanse the "assert_param" macro in the
|
||||
Standard Peripheral Library drivers code */
|
||||
/* #define USE_FULL_ASSERT 1 */
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
#ifdef USE_FULL_ASSERT
|
||||
|
||||
/**
|
||||
* @brief The assert_param macro is used for function's parameters check.
|
||||
* @param expr: If expr is false, it calls assert_failed function
|
||||
* which reports the name of the source file and the source
|
||||
* line number of the call that failed.
|
||||
* If expr is true, it returns no value.
|
||||
* @retval None
|
||||
*/
|
||||
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
void assert_failed(uint8_t* file, uint32_t line);
|
||||
#else
|
||||
#define assert_param(expr) ((void)0)
|
||||
#endif /* USE_FULL_ASSERT */
|
||||
|
||||
#endif /* __STM32F4xx_CONF_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,176 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file I2C/EEPROM/stm32f4xx_it.c
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 30-September-2011
|
||||
* @brief Main Interrupt Service Routines.
|
||||
* This file provides template for all exceptions handler and
|
||||
* peripherals interrupt service routine.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx_it.h"
|
||||
#include "usart.h"
|
||||
|
||||
/** @addtogroup STM32F4xx_StdPeriph_Examples
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup I2C_EEPROM
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* Cortex-M4 Processor Exceptions Handlers */
|
||||
/******************************************************************************/
|
||||
|
||||
/**
|
||||
* @brief This function handles NMI exception.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void NMI_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Hard Fault exception.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void HardFault_Handler(void)
|
||||
{
|
||||
/* Go to infinite loop when Hard Fault exception occurs */
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Memory Manage exception.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void MemManage_Handler(void)
|
||||
{
|
||||
/* Go to infinite loop when Memory Manage exception occurs */
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Bus Fault exception.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void BusFault_Handler(void)
|
||||
{
|
||||
/* Go to infinite loop when Bus Fault exception occurs */
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Usage Fault exception.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void UsageFault_Handler(void)
|
||||
{
|
||||
/* Go to infinite loop when Usage Fault exception occurs */
|
||||
while (1)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SVCall exception.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SVC_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles Debug Monitor exception.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void DebugMon_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles PendSVC exception.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void PendSV_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles SysTick Handler.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SysTick_Handler(void)
|
||||
{
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
/* STM32F4xx Peripherals Interrupt Handlers */
|
||||
/* Add here the Interrupt Handler for the used peripheral(s) (PPP), for the */
|
||||
/* available peripheral interrupt handler's name please refer to the startup */
|
||||
/* file (startup_stm32f4xx.s). */
|
||||
/******************************************************************************/
|
||||
void USARTx_IRQHANDLER(void)
|
||||
{
|
||||
if(USART_GetITStatus(Open_USART, USART_IT_RXNE) != RESET)
|
||||
{
|
||||
//USART_ClearITPendingBit(USART2,USART_IT_RXNE);
|
||||
printf("\n\rUSART Hyperterminal Interrupts Receive a word: %c\n\r",USART_ReceiveData(Open_USART));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief This function handles PPP interrupt request.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
/*void PPP_IRQHandler(void)
|
||||
{
|
||||
}*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,54 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file I2C/EEPROM/stm32f4xx_it.h
|
||||
* @author MCD Application Team
|
||||
* @version V1.0.0
|
||||
* @date 30-September-2011
|
||||
* @brief This file contains the headers of the interrupt handlers.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
|
||||
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
|
||||
* TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
|
||||
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
|
||||
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
|
||||
*
|
||||
* <h2><center>© COPYRIGHT 2011 STMicroelectronics</center></h2>
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __STM32F4xx_IT_H
|
||||
#define __STM32F4xx_IT_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx.h"
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported functions ------------------------------------------------------- */
|
||||
|
||||
void NMI_Handler(void);
|
||||
void HardFault_Handler(void);
|
||||
void MemManage_Handler(void);
|
||||
void BusFault_Handler(void);
|
||||
void UsageFault_Handler(void);
|
||||
void SVC_Handler(void);
|
||||
void DebugMon_Handler(void);
|
||||
void PendSV_Handler(void);
|
||||
void SysTick_Handler(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __STM32F4xx_IT_H */
|
||||
|
||||
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,121 @@
|
||||
#include "usart.h"
|
||||
|
||||
#ifdef __GNUC__
|
||||
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
|
||||
set to 'Yes') calls __io_putchar() */
|
||||
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
|
||||
#else
|
||||
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : USART_Configuration
|
||||
* Description : Configure Open_USART
|
||||
* Input : None
|
||||
* Output : None
|
||||
* Return : None
|
||||
* Attention : None
|
||||
*******************************************************************************/
|
||||
void USART_Configuration(void)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
USART_InitTypeDef USART_InitStructure;
|
||||
|
||||
RCC_AHB1PeriphClockCmd(Open_USART_TX_GPIO_CLK,ENABLE);
|
||||
RCC_AHB1PeriphClockCmd(Open_USART_RX_GPIO_CLK,ENABLE);
|
||||
|
||||
#ifdef USART1_OPEN
|
||||
RCC_APB2PeriphClockCmd(Open_USART_CLK,ENABLE);
|
||||
#else
|
||||
RCC_APB1PeriphClockCmd(Open_USART_CLK,ENABLE);
|
||||
#endif
|
||||
|
||||
|
||||
GPIO_PinAFConfig(Open_USART_TX_GPIO_PORT, Open_USART_TX_SOURCE, Open_USART_TX_AF);
|
||||
GPIO_PinAFConfig(Open_USART_RX_GPIO_PORT, Open_USART_RX_SOURCE, Open_USART_RX_AF);
|
||||
|
||||
/*
|
||||
* Open_USART_TX -> PA9 , Open_USART_RX -PA10
|
||||
*/
|
||||
GPIO_InitStructure.GPIO_Pin = Open_USART_TX_PIN;
|
||||
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
|
||||
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(Open_USART_TX_GPIO_PORT, &GPIO_InitStructure);
|
||||
|
||||
GPIO_InitStructure.GPIO_Pin = Open_USART_RX_PIN;
|
||||
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
|
||||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
|
||||
GPIO_Init(Open_USART_RX_GPIO_PORT, &GPIO_InitStructure);
|
||||
|
||||
/*
|
||||
USARTx configured as follow:
|
||||
- BaudRate = 115200 baud
|
||||
- Word Length = 8 Bits
|
||||
- One Stop Bit
|
||||
- No parity
|
||||
- Hardware flow control disabled (RTS and CTS signals)
|
||||
- Receive and transmit
|
||||
*/
|
||||
|
||||
USART_InitStructure.USART_BaudRate = 115200;
|
||||
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
|
||||
USART_InitStructure.USART_StopBits = USART_StopBits_1;
|
||||
USART_InitStructure.USART_Parity = USART_Parity_No;
|
||||
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
|
||||
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
|
||||
USART_Init(Open_USART, &USART_InitStructure);
|
||||
/* Enable the Open_USART Transmit interrupt: this interrupt is generated when the
|
||||
Open_USART transmit data register is empty */
|
||||
USART_ITConfig(Open_USART,USART_IT_RXNE,ENABLE);
|
||||
|
||||
USART_Cmd(Open_USART, ENABLE);
|
||||
|
||||
}
|
||||
|
||||
void USART_NVIC_Config(void)
|
||||
{
|
||||
NVIC_InitTypeDef NVIC_InitStructure;
|
||||
|
||||
/* Enable the USARTx Interrupt */
|
||||
NVIC_InitStructure.NVIC_IRQChannel = Open_USART_IRQn;
|
||||
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
|
||||
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
|
||||
NVIC_Init(&NVIC_InitStructure);
|
||||
}
|
||||
|
||||
/* Use no semihosting */
|
||||
#if 1
|
||||
#pragma import(__use_no_semihosting)
|
||||
struct __FILE
|
||||
{
|
||||
int handle;
|
||||
};
|
||||
FILE __stdout;
|
||||
|
||||
_sys_exit(int x)
|
||||
{
|
||||
x = x;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Retargets the C library printf function to the USART.
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
PUTCHAR_PROTOTYPE
|
||||
{
|
||||
/* Place your implementation of fputc here */
|
||||
/* e.g. write a character to the USART */
|
||||
USART_SendData(Open_USART, (uint8_t) ch);
|
||||
|
||||
/* Loop until the end of transmission */
|
||||
while (USART_GetFlagStatus(Open_USART, USART_FLAG_TC) == RESET)
|
||||
{}
|
||||
|
||||
return ch;
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
#ifndef _USART_H
|
||||
#define _USART_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include "stm32f4xx.h"
|
||||
|
||||
//#define USART1_OPEN
|
||||
//#define USART2_OPEN
|
||||
#define USART3_OPEN
|
||||
|
||||
/**
|
||||
* @brief Definition for COM port1, connected to USART3
|
||||
*/
|
||||
#ifdef USART1_OPEN
|
||||
#define Open_USART USART1
|
||||
#define Open_USART_CLK RCC_APB2Periph_USART1
|
||||
|
||||
#define Open_USART_TX_PIN GPIO_Pin_9
|
||||
#define Open_USART_TX_GPIO_PORT GPIOA
|
||||
#define Open_USART_TX_GPIO_CLK RCC_AHB1Periph_GPIOA
|
||||
#define Open_USART_TX_SOURCE GPIO_PinSource9
|
||||
#define Open_USART_TX_AF GPIO_AF_USART1
|
||||
|
||||
|
||||
#define Open_USART_RX_PIN GPIO_Pin_10
|
||||
#define Open_USART_RX_GPIO_PORT GPIOA
|
||||
#define Open_USART_RX_GPIO_CLK RCC_AHB1Periph_GPIOA
|
||||
#define Open_USART_RX_SOURCE GPIO_PinSource10
|
||||
#define Open_USART_RX_AF GPIO_AF_USART1
|
||||
|
||||
#define Open_USART_IRQn USART1_IRQn
|
||||
#define USARTx_IRQHANDLER USART1_IRQHandler
|
||||
|
||||
#elif defined USART2_OPEN
|
||||
#define Open_USART USART2
|
||||
#define Open_USART_CLK RCC_APB1Periph_USART2
|
||||
|
||||
#define Open_USART_TX_PIN GPIO_Pin_2
|
||||
#define Open_USART_TX_GPIO_PORT GPIOA
|
||||
#define Open_USART_TX_GPIO_CLK RCC_AHB1Periph_GPIOA
|
||||
#define Open_USART_TX_SOURCE GPIO_PinSource2
|
||||
#define Open_USART_TX_AF GPIO_AF_USART2
|
||||
|
||||
|
||||
#define Open_USART_RX_PIN GPIO_Pin_3
|
||||
#define Open_USART_RX_GPIO_PORT GPIOA
|
||||
#define Open_USART_RX_GPIO_CLK RCC_AHB1Periph_GPIOA
|
||||
#define Open_USART_RX_SOURCE GPIO_PinSource3
|
||||
#define Open_USART_RX_AF GPIO_AF_USART2
|
||||
|
||||
#define Open_USART_IRQn USART2_IRQn
|
||||
#define USARTx_IRQHANDLER USART2_IRQHandler
|
||||
|
||||
#elif defined USART3_OPEN
|
||||
#define Open_USART USART3
|
||||
#define Open_USART_CLK RCC_APB1Periph_USART3
|
||||
|
||||
#define Open_USART_TX_PIN GPIO_Pin_10
|
||||
#define Open_USART_TX_GPIO_PORT GPIOC
|
||||
#define Open_USART_TX_GPIO_CLK RCC_AHB1Periph_GPIOC
|
||||
#define Open_USART_TX_SOURCE GPIO_PinSource10
|
||||
#define Open_USART_TX_AF GPIO_AF_USART3
|
||||
|
||||
|
||||
#define Open_USART_RX_PIN GPIO_Pin_11
|
||||
#define Open_USART_RX_GPIO_PORT GPIOC
|
||||
#define Open_USART_RX_GPIO_CLK RCC_AHB1Periph_GPIOC
|
||||
#define Open_USART_RX_SOURCE GPIO_PinSource11
|
||||
#define Open_USART_RX_AF GPIO_AF_USART3
|
||||
|
||||
#define Open_USART_IRQn USART3_IRQn
|
||||
#define USARTx_IRQHANDLER USART3_IRQHandler
|
||||
#else
|
||||
#error "Please select The COM to be used (in usart.h)"
|
||||
#endif
|
||||
|
||||
void USART_Configuration(void);
|
||||
void USART_NVIC_Config(void);
|
||||
|
||||
#endif /*_USART_H*/
|
||||
Reference in New Issue
Block a user