1. 首页
  2. 编程语言
  3. C
  4. stm32F源码

stm32F源码

上传者: 2019-04-09 10:07:33上传 ZIP文件 3.16MB 热度 78次
#include "stm32f10x.h" #include "./systick/bsp_SysTick.h" #include "./led/bsp_led.h" #include "./usart/bsp_usart.h" #include "./ds18b20/bsp_ds18b20.h" /** * @brief 主函数 * @param 无 * @retval 无 */ int main(void) { uint8_t uc, ucDs18b20Id [ 8 ]; /* 配置SysTick 为1us中断一 次 */ SysTick_Init(); /* LED 端口初始化 */ LED_GPIO_Config(); USART_Config(); //初始化串口1 printf("\r\n this is a ds18b20 test demo \r\n"); while( DS18B20_Init() ) printf("\r\n no ds18b20 exit \r\n"); printf("\r\n ds18b20 exit \r\n"); DS18B20_ReadId ( ucDs18b20Id ); // 读取 DS18B20 的序列号 printf("\r\nDS18B20的序列号是: 0x"); for ( uc = 0; uc < 8; uc ++ ) // 打印 DS18B20 的序列号 printf ( "%.2x", ucDs18b20Id [ uc ] ); 次 */ SysTick_Init(); /* LED 端口初始化 */ LED_GPIO_Config(); USART_Config(); //初始化串口1 printf("\r\n this is a ds18b20 test demo \r\n"); while( DS18B20_Init() ) printf("\r\n no ds18b20 exit \r\n"); printf("\r\n ds18b20 exit \r\n"); DS18B20_ReadId ( ucDs18b20Id ); // 读取 DS18B20 的序列号 printf("\r\nDS18B20的序列号是: 0x"); for ( uc = 0; uc < 8; uc ++ ) // 打印 DS18B20 的序列号 printf ( "%.2x", ucDs18b20Id [ uc ] );
用户评论