This commit is contained in:
Siwat Sirichai 2023-09-28 14:22:19 +07:00
parent cf35e07c2f
commit 35cbbbf295
6 changed files with 43 additions and 6 deletions

View file

@ -6,7 +6,7 @@ uint8_t inputBufferB;
PCF8574 inputBankA(INPUT_BANK_A_ADDRESS);
PCF8574 inputBankB(INPUT_BANK_B_ADDRESS);
Adafruit_PWMServoDriver pwmBank = Adafruit_PWMServoDriver(PWM_BANK_ADDRESS);
I2C_eeprom ESPMega_EEPROM(EEPROM_ADDRESS);
FRAM ESPMega_FRAM;
#ifdef ANALOG_CARD_ENABLE
Adafruit_ADS1115 analogInputBankA;
@ -23,7 +23,7 @@ void ESPMega_begin()
inputBankA.begin();
inputBankB.begin();
pwmBank.begin();
ESPMega_EEPROM.begin();
ESPMega_FRAM.begin(FRAM_ADDRESS);
// ESPMegaPRO v3 use the PWMBank to drive Half Bridge
// Push Pull Output is required.
pwmBank.setOutputMode(true);

View file

@ -5,7 +5,7 @@
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
#include <PCF8574.h>
#include <I2C_eeprom.h>
#include <FRAM.h>
#include <TimeLib.h>
#include <DS1307RTC.h>
#include <time.h>
@ -24,12 +24,12 @@
#define DAC1_ADDRESS 0x61
#define DAC2_ADDRESS 0x62
#define DAC3_ADDRESS 0x63
#define EEPROM_ADDRESS 0x5A
#define FRAM_ADDRESS 0x56
//#define USE_INTERRUPT
#define INPUT_BANK_A_INTERRUPT 36
#define INPUT_BANK_B_INTERRUPT 39
extern I2C_eeprom ESPMega_EEPROM;
extern FRAM ESPMega_FRAM;
#define ESPMega_configNTP configTime
struct rtctime_t {
uint8_t hours;