first commit for opensource

first commit for opensource
This commit is contained in:
supowang
2019-09-16 13:19:50 +08:00
parent 08ab013b8e
commit edb2879617
6303 changed files with 5472815 additions and 23 deletions

View File

@@ -0,0 +1,62 @@
#include "sensor_demo.h"
#include "E53_IA1.h"
void e53_ia1_demo(void)
{
Init_E53_IA1();
while (1)
{
E53_IA1_Read_Data();
printf("\r\n******************************BH1750 Value is %d\r\n", (int)E53_IA1_Data.Lux);
printf("\r\n******************************Humidity is %d\r\n",(int)E53_IA1_Data.Humidity);
printf("\r\n******************************Temperature is %d\r\n", (int)E53_IA1_Data.Temperature);
HAL_GPIO_TogglePin(IA1_Motor_GPIO_Port, IA1_Motor_Pin);
HAL_GPIO_TogglePin(IA1_Light_GPIO_Port, IA1_Light_Pin);
osDelay(3000);
}
}
void e53_st1_demo(void)
{
Init_E53_ST1();
while (1)
{
E53_ST1_Read_Data();
printf("\r\n******************************Longitude Value is %.6f\r\n", E53_ST1_Data.Longitude);
printf("\r\n******************************Latitude is %.6f\r\n", E53_ST1_Data.Latitude);
E53_ST1_Beep(ST1_ON);
E53_ST1_LED_StatusSet(ST1_ON);
osDelay(2000);
E53_ST1_Beep(ST1_OFF);
E53_ST1_LED_StatusSet(ST1_OFF);
osDelay(2000);
}
}
void e53_sf1_demo(void)
{
Init_E53_SF1();
while (1)
{
E53_SF1_Read_Data();
printf("\r\n******************************Smoke Value is %d\r\n", E53_SF1_Data.Smoke_Value);
E53SF1_Beep(ON);
osDelay(2000);
E53SF1_Beep(OFF);
osDelay(2000);
}
}
void application_entry(void *arg)
{
e53_ia1_demo();
//e53_st1_demo();
//e53_sf1_demo();
while (1) {
printf("This is a sensor demo!\r\n");
tos_task_delay(1000);
}
}

View File

@@ -0,0 +1,21 @@
#ifndef __SENSOR_DEMO_H__
#define __SENSOR_DEMO_H__
#include "mcu_init.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
char data[32];
}ReportData_TypeDef;
void application_entry(void *arg);
#ifdef __cplusplus
}
#endif
#endif /* __APP_DEMO_H__ */