|
|
|
@ -2,15 +2,15 @@
@@ -2,15 +2,15 @@
|
|
|
|
|
#include <string.h> |
|
|
|
|
|
|
|
|
|
#include "esp_log.h" |
|
|
|
|
#include "sdkconfig.h" |
|
|
|
|
#include "i2c_mutex.h" |
|
|
|
|
#include "sdkconfig.h" |
|
|
|
|
|
|
|
|
|
#include "freertos/FreeRTOS.h" |
|
|
|
|
#include "freertos/task.h" |
|
|
|
|
|
|
|
|
|
#include "u8g2_esp32_hal.h" |
|
|
|
|
|
|
|
|
|
static const char * TAG = "u8g2_hal"; |
|
|
|
|
static const char *TAG = "u8g2_hal"; |
|
|
|
|
static const unsigned int I2C_TIMEOUT_MS = 100; |
|
|
|
|
|
|
|
|
|
static spi_device_handle_t handle_spi; // SPI handle.
|
|
|
|
@ -107,8 +107,8 @@ uint8_t u8g2_esp32_i2c_byte_cb(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int,
@@ -107,8 +107,8 @@ uint8_t u8g2_esp32_i2c_byte_cb(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int,
|
|
|
|
|
#define TXBUF_SIZE 32 |
|
|
|
|
static uint8_t txbuf[TXBUF_SIZE]; |
|
|
|
|
static uint8_t *txbuf_ptr; |
|
|
|
|
// ESP_LOGV(TAG, "i2c_cb: Received a msg: %d, arg_int: %d, arg_ptr: %p", msg,
|
|
|
|
|
// arg_int, arg_ptr);
|
|
|
|
|
// ESP_LOGV(TAG, "i2c_cb: Received a msg: %d, arg_int: %d, arg_ptr: %p", msg,
|
|
|
|
|
// arg_int, arg_ptr);
|
|
|
|
|
switch (msg) { |
|
|
|
|
case U8X8_MSG_BYTE_SET_DC: { |
|
|
|
|
if (u8x8->pins[U8X8_PIN_DC] != U8X8_PIN_NONE) { |
|
|
|
|