Browse Source

Inkplate class adjustments

v0.9.4
Guy Turcotte 2 years ago
parent
commit
7f4de6bc9e
  1. 2
      examples/Others/Inkplate_Peripheral_Mode/src/main.cpp
  2. 2
      include/drivers/touch_keys.hpp
  3. 18
      include/graphical/inkplate.hpp

2
examples/Others/Inkplate_Peripheral_Mode/src/main.cpp

@ -356,7 +356,7 @@ void peripheral_task(void * param)
if (b == '?')
{
std::cout << "#R("
<< display.getPanelState()
<< (int)display.getPanelState()
<< ")*"
<< std::endl << std::flush;
}

2
include/drivers/touch_keys.hpp

@ -17,7 +17,7 @@ class TouchKeys : NonCopyable
*
* Read one of the three touchkeys.
*
* @param key touchkey number (0, 1 or 2)
* @param key touchkey (KEY_0, KEY_1, or KEY_2)
* @return uint8_t 1 if touched, 0 if not
*/
uint8_t read_key(Key key);

18
include/graphical/inkplate.hpp

@ -29,19 +29,21 @@ class Inkplate : public Graphics
Inkplate(DisplayMode mode);
void begin() { inkplate_platform.setup(); }
void begin() { inkplate_platform.setup(); }
inline void einkOn() { e_ink.turn_on(); }
inline void einkOff() { e_ink.turn_off(); }
inline void einkOn() { e_ink.turn_on(); }
inline void einkOff() { e_ink.turn_off(); }
inline uint8_t getPanelState() { return (uint8_t) e_ink.get_panel_state(); }
inline PanelState getPanelState() { e_ink.get_panel_state(); }
inline double readBattery() { return battery.read_level(); }
inline double readBattery() { return battery.read_level(); }
uint8_t readPowerGood() { e_ink.read_power_good(); }
uint8_t readPowerGood() { return e_ink.read_power_good(); }
inline void disconnect() { network_client.disconnect(); }
uint8_t readTouchPad(int c) { return touch_keys.read_key((TouchKeys::Key) c); }
inline void disconnect() { network_client.disconnect(); }
inline bool isConnected() { return network_client.isConnected(); }
inline int _getRotation() { return Graphics::getRotation(); }
inline int _getRotation() { return Graphics::getRotation(); }
inline bool joinAP(const char * ssid, const char * pass) {
return network_client.joinAP(ssid, pass); }

Loading…
Cancel
Save