当前位置:文档之家› STM内部温度传感器串口显示完整程序

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

[80乙NN入fP86TLN£W8乙丄dflCTM丄入门]:各霸尅勒昭护轴兀(g) @ @ @
•4r耳5F第誓曹a
审嚣敢尊®猱姆W WIS
S T M 3 2 F 1 0 3 内部温度传感器用串口传递到P C ±显示
程序如下:
#include "”
ttinclude
#include "”
ttinclude <>
ttdefine DR_ADDRESS ((uint32_t) 0x4001244C) n\r〃,a, b, c, d);
Delay_ARMJISHU(8000000);
}
}
void ADC_GP 10_Conf i gur at ion (vo id) //ADC 配置函数
{
GPIO_InitTypeDef GPIO_InitStructure;
//PCO作为模拟通道10输入引脚
=GPI0_Pin_0; 〃管脚 1
=GPIO_Mode_AIN;//输入模式
GPI0_Init(GPI0C, &GPI0_InitStructure);//GPI0 组
当前STM32芯片内部温度为:00&8°C.
当M-STM32芯片內部温度为:0047°C .
当前STM32芯片内部温度为;00489 .
当前STM32芯片內部温度为:0触TC.
当前STM32芯片内部温度为;0047^C .
当前STM32芯片内部温度为:如匸TC.
当前STM32芯片内部温度为:0047ff C .
当前STM32芯片内部温度为:0047^C .
当M-STM32芯片內部温度为:0047°C .
当前STM32芯片内部温度为;8047^ .
当前STM32芯片內部温度为:0酣6°C.
关于一些数据格式的定义解释:
ttifndef _STM32F10x_TYPE_H#define _STM32F10x_TYPE_H
typedef signed long?s32;
typedef signed char?s8;
typedef signed long?const sc32;typedef signed short const scl6;typedef signed charconst sc8: typedef volatile signed long?vs32;超级终端显示如下: 当前STM32芯片內部温度为:0046°C .
typedef signed short sl6;
typedef volatile signed short vsl6:
volatile unsigned charconst vuc8;
typedef enum {FALSE 二 0, TRUE 二!FALSE} bool: typedef enum {RESET = 0, typedef volatile signed char?vs8:
typedef volatile signed long?const vsc32;typedef volatile signed short const vscl6:typedef volatile signed charconst vsc8:
typedef unsigned long?u32; typedef unsigned short ul6:
typedef unsigned char?u8;
typedef unsigned long?const uc32;typedef unsigned short const
ucl6;typedef unsigned charconst uc8; typedef volatile unsigned long?vu32;
typedef volatile unsigned short vul6:
typedef volatile unsigned char?vu8;
typedef volatile unsigned long?const vuc32:typedef volatile unsigned
short const vucl6;typedef
SET = !RESET} FlagStatus, ITStatus;
typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;ttdefine
IS_FUNCTIONAL_STATE(STATE) (((STATE)二二DISABLE) | ((STATE)二二ENABLE)) typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
ttdefine U8JIAX? ((u8) 255)
ttdefine S8_MAX?((s8)127)
ttdefine S8_MIN?((s8)-128)
ttdefine U16J1AX? ((ul6) 65535u)
ttdefine S16JIAX?((sl6) 32767)
ttdefine S16_MIN?((sl6)-32768)
ttdefine U32JIAX?
ttdefine S32JIAX?
ttdefine S32_MIN?
ttendif。

相关主题