stm32
荒原狼的技术博客
这个作者很懒,什么都没留下…
展开
-
PPS(packed pixel stream)是什么
3. Packed pixel streamsThe packed pixel stream (PPS) packets are long packets used to transmit RGB image data formatted as pixels to a video mode display module.The packet consists of the DI byte, a two-byte WC, an ECC byte, a payload of length WC byte原创 2022-05-26 19:30:23 · 534 阅读 · 0 评论 -
STM32 全局变量不加 volatile 而被优化的问题
在一个项目中,首先在一个 A文件中定义了一些全局变量,并赋初值,并在 B文件里引用,并重新在一个函数中重新赋值。在main函数的起始处中调用该赋值函数,发现并没有被重新赋值。一般情况下,在中断中使用的全局变量必须要 volatile 修饰,或者一些 IO 口变量必须要 volatile 修饰,但此次发现,即使非中断的情况下,全局变量最好也要用 volatile 修饰,不然就会出现预想不到的错误,这类错误还很难调试,很难排查。...原创 2022-05-26 16:28:28 · 1149 阅读 · 0 评论 -
STM32 在keil下进行strtol函数的功能测试
STM32 在keil下进行strtol函数的功能测试源码:void test_str2num_strtol(void){ int a; printf("\r\n\r\n0x1234 = %d,",strtol("0x1234",NULL,0)); printf("\r\n1234 = %d,",strtol("1234",NULL,0)); print...原创 2019-12-27 17:33:15 · 735 阅读 · 0 评论 -
STM32 在keil 下进行 atoi 函数功能测试
STM32 在keil 下进行 atoi 函数功能测试:源码:void test_str2num(void){ int a; printf("\r\n\r\n0x1234 = %d,",atoi("0x1234")); printf("\r\n0x1234 = %d,",atoi("0x1234")); printf("\r\n1234 = %d,",at...原创 2019-12-27 17:08:41 · 3785 阅读 · 2 评论 -
STM32 keil 下编程,各种数据类型的长度
源码:void test_str2num(void){ printf("\r\n\r\nint is %d",sizeof(int)); printf("\r\nlong int is %d",sizeof(long int)); printf("\r\nlong long int is %d",sizeof(long long int)); printf(...原创 2019-12-27 16:29:58 · 1854 阅读 · 0 评论 -
STM32F446VE 在MDK下编译测试大小端模式
源程序如下: i = 0x12345678; printf("\r\ni = 0x%X,",i); printf("addri = 0x%X,",&i); printf("\r\naddru8i = 0x%X,",(u8*)(&i)); printf("u8i = 0x%X,",*((u8*)(&i))); ...原创 2019-12-25 16:46:47 · 851 阅读 · 0 评论 -
STM32的IIC端口配置开漏输出,可以随时读取端口电平状态
查了下数据手册,里面有这么一句话:The input data register (GPIOx_IDR) captures the data present on the I/O pin at every AHB1 clock cycle.在另外一个手册里,有这么一句话:The written data on GPIOx_ODR can be read from GPIOx_IDR regis...原创 2019-12-24 19:58:18 · 3717 阅读 · 0 评论 -
STM32F103串口配置,并且使用printf进行打印
首先要配置串口时钟: // USART1 clock enable RCC_APB2PeriphClockCmd( RCC_APB2Periph_USART1 | RCC_APB2Periph_GPIOA | RCC_APB2Periph_AFIO, ENABLE);然后再配置端口,在配置串口,再使能即可。 void USART1_Ini...原创 2018-09-02 18:25:36 · 15335 阅读 · 2 评论