STM32F10X_HD, USE_STDPERIPH_DRIVER
一
#include "stm32f10x.h"
#include "delay.h"
#include "usart.h"
#include "lcd1602.h"
#include "adxl362.h"
void Hardware_Init(void)
{
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
Delay_Init();
Usart1_Init(115200);
ADXL362_Init();
Lcd1602_Init();
}
int main(void)
{
Hardware_Init();
Lcd1602_DisString(0x80, "OneNET-IOT");
while(1)
{
ADXL362_GetValue();
Lcd1602_DisString(0xC0, "X%0.1f,Y%0.1f,Z%0.1f", adxl362Info.x, adxl362Info.y, adxl362Info.z);
DelayMs(200);
}
}
二
#include "stm32f10x.h"
#include "onenet.h"
#include "esp8266.h"
#include "delay.h"
#include "led.h"
#include "beep.h"
#include "key.h"
#include "usart.h"
#include <string.h>
void Hardware_Init(void)
{
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
Delay_Init();
Usart1_Init(115200);
Usart2_Init(115200);
Led_Init();
Beep_Init();
Key_Init();
UsartPrintf(USART_DEBUG, " Hardware init OK\r\n");
}
int main(void)
{
unsigned sho