29 lines
559 B
C
29 lines
559 B
C
#include <impuls_counter.h>
|
|
|
|
#ifndef SONOFF_POW_H
|
|
#define SONOFF_POW_H
|
|
|
|
#ifndef IRAM_ATTR
|
|
#define IRAM_ATTR __attribute__((section(".iram.text")))
|
|
#endif
|
|
|
|
#define CF_PIN 14
|
|
#define CF1_PIN 13
|
|
#define SEL_PIN 5
|
|
#define RELAY_PIN 12
|
|
|
|
struct cse {
|
|
struct impuls_measurement power;
|
|
struct impuls_measurement current;
|
|
struct impuls_measurement voltage;
|
|
uint64_t energy;
|
|
};
|
|
|
|
extern struct cse cse;
|
|
|
|
void IRAM_ATTR cse_measure_isr ( void );
|
|
void cse_init( uint32_t cycle_len );
|
|
void cse_update();
|
|
|
|
#endif /* end of include guard: SONOFF_POW_H */
|