
STM32
glimmer_windy
这个作者很懒,什么都没留下…
展开
-
常量强制转化为一个结构体指针,该常量为结构体的起始地址。
#include<stdio.h>typedef struct DD STU;struct DD{int a;int b;char t;};void main(void){STU c,b;b.t=4;printf("%p\n",&(((STU*) 0x40)->b));//输出(STU*) 0x40)->b的地址为00000044printf...原创 2020-04-17 20:06:47 · 1111 阅读 · 0 评论 -
串口中断状态函数理解
ITStatus USART_GetITStatus(USART_TypeDef* USARTx, uint16_t USART_IT){uint32_t bitpos = 0x00, itmask = 0x00, usartreg = 0x00;ITStatus bitstatus = RESET;/* Check the parameters /assert_param(IS_USART_ALL_PERIPH(USARTx));assert_param(IS_USART_GET_IT(USA原创 2020-07-03 11:42:10 · 1341 阅读 · 0 评论 -
定时器中断标志位理解
1、定时器中断标志位程序ITStatus TIM_GetITStatus(TIM_TypeDef* TIMx, uint16_t TIM_IT){ITStatus bitstatus = RESET;uint16_t itstatus = 0x0, itenable = 0x0;/* Check the parameters */assert_param(IS_TIM_ALL_PERI...原创 2020-03-20 21:55:19 · 14876 阅读 · 1 评论 -
串口中断服务函数
串口中断服务函数详解void USART1_IRQHandle(void) //串口1中断服务程序{u8 Res;if(USART_GetITStatus(USART1, USART_IT_RXNE) != RESET) //接收中断(接收到的数据必须是0x0d 0x0a结尾){Res =USART_ReceiveData(USART1); //读取接...原创 2020-03-02 17:00:09 · 8381 阅读 · 0 评论