I2Cwrapper v0.5.0
Generic framework for Arduino I2C target devices
|
Firmware module for the I2Cwrapper firmare. More...
Firmware module for the I2Cwrapper firmare.
Allows I2C-control of touch buttons and hall sensorsof an ESP32. Meant mostly as a simple demo for user contributed modules using the interrupt mechanism. Will not compile for platforms other than ESP32.
Copyright (c) 2022 juh
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
Functions | |
void | touchDetected0 () |
void | touchDetected1 () |
void | touchDetected2 () |
void | touchDetected3 () |
void | touchDetected4 () |
void | touchDetected5 () |
void | touchDetected6 () |
void | touchDetected7 () |
void | touchDetected8 () |
void | touchDetected9 () |
log ("ESP32sensorsI2C module enabled.\n") | |
bufferIn | read (measure) |
bufferIn | read (sleep) |
if (!ESP32sensorsTouchSetCyclesChanged) | |
touchSetCycles (measure, sleep) | |
bufferIn | read (pin) |
bufferOut | write ((uint16_t) touchRead(pin)) |
bufferIn | read (threshold) |
bufferIn | read (falling) |
log (" enabling int for touch pin #") | |
log (pin) | |
log (" (=touch") | |
switch (digitalPinToTouchChannel(pin)) | |
log (") with threshold=") | |
log (threshold) | |
log ("\n") | |
if (ESP32sensorsTouchSetCyclesChanged) | |
for (uint8_t i=0;i< SOC_TOUCH_SENSOR_NUM;i++) | |
Variables | |
uint16_t | isAttached = 0 |
uint16_t | ESP32sensorsTouchSetCycles_old_sleep_cycle |
uint16_t | ESP32sensorsTouchSetCycles_old_meas_cycle |
bool | ESP32sensorsTouchSetCyclesChanged = false |
case | ESP32sensorsTouchSetCyclesCmd |
uint16_t | sleep |
break | |
case | ESP32sensorsTouchReadCmd |
case | ESP32sensorsEnableInterruptsCmd |
uint16_t | threshold |
bool | falling |
case | ESP32sensorsHallReadCmd |
case | ESP32sensorsTemperatureReadCmd |
for | ( | ) |
if | ( | ! | ESP32sensorsTouchSetCyclesChanged | ) |
log | ( | " enabling int for touch pin #" | ) |
log | ( | ) |
log | ( | " | ) |
log | ( | "\n" | ) |
log | ( | "ESP32sensorsI2C module enabled.\n" | ) |
log | ( | pin | ) |
log | ( | threshold | ) |
bufferIn read | ( | measure | ) |
bufferIn read | ( | pin | ) |
switch | ( | digitalPinToTouchChannel(pin) | ) |
void touchDetected0 | ( | ) |
void touchDetected1 | ( | ) |
void touchDetected2 | ( | ) |
void touchDetected3 | ( | ) |
void touchDetected4 | ( | ) |
void touchDetected5 | ( | ) |
void touchDetected6 | ( | ) |
void touchDetected7 | ( | ) |
void touchDetected8 | ( | ) |
void touchDetected9 | ( | ) |
touchSetCycles | ( | measure | , |
sleep | |||
) |
bufferOut write | ( | (uint16_t) touchRead(pin) | ) |
break |
case ESP32sensorsEnableInterruptsCmd |
case ESP32sensorsHallReadCmd |
case ESP32sensorsTemperatureReadCmd |
case ESP32sensorsTouchReadCmd |
uint16_t ESP32sensorsTouchSetCycles_old_meas_cycle |
uint16_t ESP32sensorsTouchSetCycles_old_sleep_cycle |
bool ESP32sensorsTouchSetCyclesChanged = false |
case ESP32sensorsTouchSetCyclesCmd |
bool falling |
uint16_t isAttached = 0 |
uint16_t sleep |
uint16_t threshold |