内部温度传感器串口显示完整程序

合集下载
相关主题
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

STM32F103 内部温度传感器用串口传递到PC上显示程序如下:
#include ""
#include ""
#include ""
#include <>
#define DR_ADDRESS ((uint32_t)0x4001244C) n\r", a, b, c, d);
Delay_ARMJISHU(8000000);
}
}
void ADC_GPIO_Configuration(void) //ADC配置函数
{
GPIO_InitTypeDef GPIO_InitStructure;
//PC0 作为模拟通道10输入引脚
= GPIO_Pin_0; //管脚1
= GPIO_Mode_AIN;//输入模式
GPIO_Init(GPIOC, &GPIO_InitStructure); //GPIO组}
超级终端显示如下:
关于一些数据格式的定义解释:
#ifndef __STM32F10x_TYPE_H
#define __STM32F10x_TYPE_H
typedef signed longs32;
typedef signed short s16;
typedef signed chars8;
typedef signed longconst sc32;?
typedef signed short const sc16;?
typedef signed charconst sc8;
typedef volatile signed longvs32;
typedef volatile signed short vs16;
typedef volatile signed charvs8;
typedef volatile signed longconst vsc32;?typedef volatile signed short const vsc16;?typedef volatile signed charconst vsc8; typedef unsigned longu32;
typedef unsigned short u16;
typedef unsigned charu8;
typedef unsigned longconst uc32;?
typedef unsigned short const uc16;?
typedef unsigned charconst uc8;
typedef volatile unsigned longvu32;
typedef volatile unsigned short vu16;
typedef volatile unsigned charvu8;
typedef volatile unsigned longconst vuc32;?
typedef volatile unsigned short const vuc16;?
typedef volatile unsigned charconst vuc8;
typedef enum {FALSE = 0, TRUE = !FALSE} bool;
typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
#define U8_MAX((u8)255)
#define S8_MAX((s8)127)
#define S8_MIN((s8)-128)
#define U16_MAX((u16)65535u) #define S16_MAX((s16)32767) #define S16_MIN((s16)-32768) #define U32_MAX((u32)95uL) #define S32_MAX((s32)47)
#define S32_MIN((s32)-48)
#endif。

相关文档
最新文档