Update examples
This commit is contained in:
parent
e1e89bc044
commit
a45c3b1784
276 changed files with 66091 additions and 48794 deletions
94
examples/Sensor/PCF8563_SimpleTime/LoRaBoards.h
Normal file
94
examples/Sensor/PCF8563_SimpleTime/LoRaBoards.h
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
/**
|
||||
* @file boards.h
|
||||
* @author Lewis He (lewishe@outlook.com)
|
||||
* @license MIT
|
||||
* @copyright Copyright (c) 2024 ShenZhen XinYuan Electronic Technology Co., Ltd
|
||||
* @date 2024-04-25
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "utilities.h"
|
||||
|
||||
#ifdef HAS_SDCARD
|
||||
#include <SD.h>
|
||||
#endif
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
#include <FS.h>
|
||||
#include <WiFi.h>
|
||||
#endif
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <SPI.h>
|
||||
#include <Wire.h>
|
||||
#include <U8g2lib.h>
|
||||
#include <XPowersLib.h>
|
||||
|
||||
#ifndef DISPLAY_MODEL
|
||||
#define DISPLAY_MODEL U8G2_SSD1306_128X64_NONAME_F_HW_I2C
|
||||
#endif
|
||||
|
||||
#ifndef OLED_WIRE_PORT
|
||||
#define OLED_WIRE_PORT Wire
|
||||
#endif
|
||||
|
||||
#ifndef PMU_WIRE_PORT
|
||||
#define PMU_WIRE_PORT Wire
|
||||
#endif
|
||||
|
||||
#ifndef DISPLAY_ADDR
|
||||
#define DISPLAY_ADDR 0x3C
|
||||
#endif
|
||||
|
||||
#ifndef LORA_FREQ_CONFIG
|
||||
#define LORA_FREQ_CONFIG 915.0
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
String chipModel;
|
||||
float psramSize;
|
||||
uint8_t chipModelRev;
|
||||
uint8_t chipFreq;
|
||||
uint8_t flashSize;
|
||||
uint8_t flashSpeed;
|
||||
} DevInfo_t;
|
||||
|
||||
|
||||
void setupBoards();
|
||||
|
||||
bool beginSDCard();
|
||||
|
||||
bool beginDisplay();
|
||||
|
||||
void disablePeripherals();
|
||||
|
||||
bool beginPower();
|
||||
|
||||
void printResult(bool radio_online);
|
||||
|
||||
void flashLed();
|
||||
|
||||
extern XPowersLibInterface *PMU;
|
||||
extern DISPLAY_MODEL *u8g2;
|
||||
extern bool pmuInterrupt;
|
||||
|
||||
#define U8G2_HOR_ALIGN_CENTER(t) ((u8g2->getDisplayWidth() - (u8g2->getUTF8Width(t))) / 2)
|
||||
#define U8G2_HOR_ALIGN_RIGHT(t) ( u8g2->getDisplayWidth() - u8g2->getUTF8Width(t))
|
||||
|
||||
|
||||
#if defined(ARDUINO_ARCH_ESP32)
|
||||
|
||||
#if defined(HAS_SDCARD)
|
||||
extern SPIClass SDCardSPI;
|
||||
#endif
|
||||
|
||||
#define SerialGPS Serial1
|
||||
#elif defined(ARDUINO_ARCH_STM32)
|
||||
extern HardwareSerial SerialGPS;
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue