libwebsockets/lib/plat/freertos/esp32/drivers/lws-plat-gpio.h
Andy Green 15ce46d971 drivers: initial generic gpio and i2c plus bitbang
Make a start on generic peripheral and bus drivers to provide
meta-functionality regardless of platform.

On the one hand this simply provides...

 - bitbang i2c on top of esp-idf gpio apis
 - ssd1306 oled chip driver as found on Heltec WB32
 - modifications to the minimal example test for esp32 to use that

... on the other hand, those capabilities are provided by creating:

 - an abstract i2c class object
 - an abstract gpio class object
 - i2c class implementation using the abstract gpio for bitbang
 - an abstract display class object
 - an abstract display state (brightness, animated change,
    on/off/init tracking, autodim after inactive, auto-off /
    blanking after inactive)

... with the intention, eg, you only have to add a platform
implementation for the gpio to be able to use the i2c-based
display drivers and state handling, and i2c bitbang, without
any other modifications.
2020-06-10 19:17:08 +01:00

26 lines
1.2 KiB
C

/*
* lws generic gpio - esp32 platform wrapper
*
* Written in 2010-2020 by Andy Green <andy@warmcat.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
extern const lws_gpio_ops_t lws_gpio_plat;