File: main.c
//Function: Initialize the serial port, turn on the timer interrupt, and then keep receiving data. Sending is implemented in the interrupt
#include "stm32f10x.h"
#include "usart.h"
u8 USART_rx_data;
int main(void)
{
}
File: usart.c
#include "stm32f10x.h"
#include "stdio.h"
#include "usart.h"
unsigned short CRC16(unsigned char* puchMsg, unsigned short usDataLen)
{
}
void RCC_Configuration(void)
{
}
//------------------------------------------------------------------
//Function name: void GPIO_Configuration()
//Input parameter: null
//Return parameter: null
//Description: GPIO initialization function
//------------------------------------------------------------------
void GPIO_Configuration(void)
{
}
//------------------------------------------------------------------
//Function name: void NVIC_Configuration()
//Input parameter: null
//Return parameter: null
//Description: NVIC initialization function
//------------------------------------------------------------------
void NVIC_Configuration(void)
{
}
//------------------------------------------------------------------
//Function name: void USART_Configuration()
//Input parameter: null
//Return parameter: null
//Description: Serial port initialization function
//------------------------------------------------------------------
void USART_Configuration(void){
//USART_ITConfig(USART1, USART_IT_TXE, ENABLE);
//USART_ITConfig(USART1, USART_IT_TC, ENABLE);
}[page]
//------------------------------------------------------------------
//Function name: void Time_Init()
//Input parameter: null
//Return parameter: null
//Description: Timer initialization function
//------------------------------------------------------------------
void Time_Init(void)
{
}
File: usart.h
#ifndef _USART_H
#define _USART_H
#include
#include "stm32f10x.h"
void RCC_Configuration(void);
void GPIO_Configuration(void);
void NVIC_Configuration(void);
void USART_Configuration(void);
void Time_Init(void);
unsigned short CRC16(unsigned char* puchMsg, unsigned short usDataLen);
#endif
File: stm32f103x_it.c
//You need to set the serial port receiving interrupt and timer 3 interrupt, the interrupt time is 1ms
//------------------------------------------------------------------
//Function name: void USART1_IRQHandler(void)
//Input parameter: null
//Return parameter: null
//Description: Serial port receive interrupt service
//------------------------------------------------------------------
void USART1_IRQHandler(void)
{
//
//
}
//------------------------------------------------------------------
//Function name: void TIM2_IRQHandler(void)
//Input parameter: null
//Return parameter: null
//Description: Timer 2 interrupt service
//------------------------------------------------------------------
void TIM2_IRQHandler(void)
{
}
//------------------------------------------------------------------
//Function name: void TIM3_IRQHandler(void)
//Input parameter: null
//Return parameter: null
//Description: Timer 3 interrupt service
//------------------------------------------------------------------
void TIM3_IRQHandler(void)
{
//
}
Previous article:STM32 serial communication
Next article:STM32 drives TFT display ILI9325
Recommended ReadingLatest update time:2024-11-16 15:35
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- SinlinxA33 Set up qt program to start automatically
- Several considerations for selecting a thermometer
- Which one has faster sampling speed, ADS1220 or AD7799?
- 2005 National Undergraduate Electronic Design Competition Topic
- EEWORLD University----[High Precision Laboratory] Interface: HDMI
- How to Make DSP Digital Oscillator Generate Phase-Shifted Sine Wave
- WIFI 6 is coming, do you know about it?
- Discuss one of the STM32H750
- Book an appointment to win a gift: Book an appointment for the live broadcast of power integrity design of ideal power distribution network, gain knowledge and win a Keysight gift
- The first article GD32VF103C START development board unboxing running lights