2024-06-03 16:27:41 +08:00
|
|
|
#ifndef MAIN_H
|
|
|
|
#define MAIN_H
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
#include "pico/stdlib.h"
|
|
|
|
#include "hardware/gpio.h"
|
2024-09-08 18:39:35 +08:00
|
|
|
#include "Lib/pico-onewire/api/one_wire.h"
|
|
|
|
#include "Lib/radio-switch.h"
|
2024-06-03 16:27:41 +08:00
|
|
|
|
|
|
|
#include "hardware/clocks.h"
|
|
|
|
#include "hardware/watchdog.h"
|
|
|
|
#include "pico/multicore.h"
|
|
|
|
#include "hardware/i2c.h"
|
|
|
|
#include "pico/binary_info.h"
|
|
|
|
#include "hardware/uart.h"
|
|
|
|
#include "hardware/pwm.h"
|
|
|
|
#include "hardware/adc.h"
|
|
|
|
|
|
|
|
#include "pico/cyw43_arch.h"
|
2024-11-11 17:37:06 +08:00
|
|
|
|
2024-06-03 16:27:41 +08:00
|
|
|
#include "lwip/pbuf.h"
|
|
|
|
#include "lwip/tcp.h"
|
2024-11-11 17:37:06 +08:00
|
|
|
#include "lwip/ip_addr.h" // 包含 IP 地址结构体定义
|
|
|
|
|
|
|
|
#include "hardware/vreg.h"
|
|
|
|
#include "hardware/clocks.h"
|
2024-06-03 16:27:41 +08:00
|
|
|
|
|
|
|
#define BUFER 1024
|
|
|
|
#define DS18B20_PIN 15 // DS18B20 引脚
|
|
|
|
#define CH4_PIN 14 // CH4 引脚
|
|
|
|
#define _433_MHZ_PIN 13
|
|
|
|
|
|
|
|
#define SIGN_CH4 1
|
|
|
|
#define SIGN_DS18B20 2
|
|
|
|
#define SIGN_CO 3
|
|
|
|
#define SIGN_CO2 4
|
|
|
|
#define SIGN_RP2040 5
|
|
|
|
|
|
|
|
#define WIFI_SSID "your_wifi_ssid"
|
|
|
|
#define WIFI_PASSWORD "your_wifi_password"
|
|
|
|
|
|
|
|
#define UART1 uart1
|
|
|
|
#define BAUD_RATE 9600
|
|
|
|
#define DATA_BITS 8
|
|
|
|
#define STOP_BITS 1
|
|
|
|
#define PARITY UART_PARITY_NONE
|
|
|
|
#define UART1_TX_PIN 5 // MH-Z14B T
|
|
|
|
#define UART1_RX_PIN 4 // MH-Z14B R
|
|
|
|
|
|
|
|
#define UART0 uart0
|
2024-06-04 09:54:09 +08:00
|
|
|
#define UART0_TX_PIN 1 //
|
|
|
|
#define UART0_RX_PIN 0 //
|
2024-06-03 16:27:41 +08:00
|
|
|
|
|
|
|
#endif
|