添加了半成品的浇水部分,没有实际作用,目前浇水功能直接用硬件实现;
加入了对毕设论文的记录;
This commit is contained in:
parent
3b6408a650
commit
fe11958be3
17 changed files with 6973 additions and 6919 deletions
|
|
@ -1,81 +1,83 @@
|
|||
/*
|
||||
* config.h - 配置整个工程
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
|
||||
|
||||
#define PM_DEBUG
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 模拟定时器使用的定时器
|
||||
*/
|
||||
#define SIMULAT_TIMER_PITX PIT1
|
||||
|
||||
|
||||
/*
|
||||
* 调试模块,或8266
|
||||
*/
|
||||
#define WIFI_UARTX UART0 // PTA1,PTA2
|
||||
#define DEBUG_UARTX UART0 // PTA1,PTA2
|
||||
|
||||
/*
|
||||
* 云台
|
||||
*/
|
||||
#define ORIENT_UARTX UART1 // PTC3,PTC4
|
||||
#define RE_DE_PINX PTC1
|
||||
|
||||
/*
|
||||
* 输入模块
|
||||
*/
|
||||
#define UP_KEY_PINX PTA4
|
||||
#define DOWN_KEY_PINX PTA5
|
||||
#define OK_KEY_PINX PTE20
|
||||
#define RET_KEY_PINX PTE30
|
||||
#define AMS_KEY_PINX PTD5
|
||||
#define WIFI_KEY_PINX PTD7
|
||||
#define MR_KEY_PINX PTE23
|
||||
#define MB_KEY_PINX PTD4
|
||||
#define MUVB_KEY_PINX PTA16
|
||||
// knob用必须是PTA或PTD端口的
|
||||
#define KNOB_A_PINX PTD7
|
||||
#define KNOB_B_PINX PTD6
|
||||
#define KNOB_KEY_PINX PTE20
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 显示模块
|
||||
*/
|
||||
#define TFT_UARTX UART2 // PTD2,PTD3
|
||||
|
||||
|
||||
/*
|
||||
* 时间模块
|
||||
*/
|
||||
#define DS1302_CE_PINX PTB2
|
||||
#define DS1302_CLK_PINX PTB1
|
||||
#define DS1302_IO_PINX PTB3
|
||||
|
||||
/*
|
||||
* 控制执行模块
|
||||
*
|
||||
*/
|
||||
#define LGRED_PINX PTC17
|
||||
#define LGBLUE_PINX PTC13
|
||||
#define LGUVB_PINX PTC16
|
||||
#define WATER_PINX PTD1
|
||||
|
||||
/*
|
||||
* led控制,多选几个任意端口
|
||||
*/
|
||||
#define LG1_PINX PTC9
|
||||
#define LG2_PINX PTC8
|
||||
#define LG3_PINX PTC7
|
||||
#endif // CONFIG_H
|
||||
/*
|
||||
* config.h - 配置整个工程
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
|
||||
|
||||
|
||||
#define PM_DEBUG
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 模拟定时器使用的定时器
|
||||
*/
|
||||
#define SIMULAT_TIMER_PITX PIT1
|
||||
|
||||
|
||||
/*
|
||||
* 调试模块,或8266
|
||||
*/
|
||||
#define WIFI_UARTX UART0 // PTA1,PTA2
|
||||
#define DEBUG_UARTX UART0 // PTA1,PTA2
|
||||
|
||||
/*
|
||||
* 云台
|
||||
*/
|
||||
#define ORIENT_UARTX UART1 // PTC3,PTC4
|
||||
#define RE_DE_PINX PTC1
|
||||
|
||||
/*
|
||||
* 输入模块
|
||||
*/
|
||||
#define UP_KEY_PINX PTA4
|
||||
#define DOWN_KEY_PINX PTA5
|
||||
#define OK_KEY_PINX PTE20
|
||||
#define RET_KEY_PINX PTE30
|
||||
#define AMS_KEY_PINX PTD5
|
||||
#define WIFI_KEY_PINX PTD7
|
||||
#define MR_KEY_PINX PTE23
|
||||
#define MB_KEY_PINX PTD4
|
||||
#define MUVB_KEY_PINX PTA16
|
||||
// knob用必须是PTA或PTD端口的
|
||||
#define KNOB_A_PINX PTD7
|
||||
#define KNOB_B_PINX PTD6
|
||||
#define KNOB_KEY_PINX PTE20
|
||||
|
||||
#define MOISTURE_ADC0_CHN ADC0_DP1 // PTE16
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 显示模块
|
||||
*/
|
||||
#define TFT_UARTX UART2 // PTD2,PTD3
|
||||
|
||||
|
||||
/*
|
||||
* 时间模块
|
||||
*/
|
||||
#define DS1302_CE_PINX PTB2
|
||||
#define DS1302_CLK_PINX PTB1
|
||||
#define DS1302_IO_PINX PTB3
|
||||
|
||||
/*
|
||||
* 控制执行模块
|
||||
*
|
||||
*/
|
||||
#define LGRED_PINX PTC17
|
||||
#define LGBLUE_PINX PTC13
|
||||
#define LGUVB_PINX PTC16
|
||||
#define WATER_PINX PTD1
|
||||
|
||||
/*
|
||||
* led控制,多选几个任意端口
|
||||
*/
|
||||
#define LG1_PINX PTC9
|
||||
#define LG2_PINX PTC8
|
||||
#define LG3_PINX PTC7
|
||||
#endif // CONFIG_H
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* 文件:input.h
|
||||
* 功能:将外设输入的数据转换为单片机内存中的数据
|
||||
*/
|
||||
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
|
||||
|
||||
typedef struct InData_
|
||||
{
|
||||
uint8_t isWifiOn : 1;
|
||||
uint8_t isPlanMode : 1;
|
||||
|
||||
uint8_t isRedL : 1;
|
||||
uint8_t isBlueL : 1;
|
||||
uint8_t isUvbL : 1;
|
||||
|
||||
uint8_t knobV;
|
||||
} InData;
|
||||
|
||||
|
||||
void InitInput(void);
|
||||
|
||||
void
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // INPUT_H
|
||||
32
plan_manage_main/src/app/include/water.h
Normal file
32
plan_manage_main/src/app/include/water.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* water.h - ½½Ë®
|
||||
*/
|
||||
|
||||
|
||||
#ifndef WARER_H
|
||||
#define WARER_H
|
||||
|
||||
|
||||
#define MOISTURE_RATIO 0.1
|
||||
#define MOISTURE_MIN 1
|
||||
|
||||
|
||||
|
||||
|
||||
void water_init(void);
|
||||
|
||||
|
||||
uint16_t get_moisture(void);
|
||||
|
||||
|
||||
void water_ctr(uint16_t sv_moist);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* WARER_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue