Implement UI scaling and more (#501)
**New Features** * Runtime font accessors and new symbol fonts for text, launcher, statusbar, and shared icons. * Added font height base setting to device.properties * Text fonts now have 3 sizes: small, default, large **Improvements** * Renamed `UiScale` to `UiDensity` * Statusbar, toolbar and many UI components now compute heights and spacing from fonts/density. * SSD1306 initialization sequence refined for more stable startup. * Multiple image assets replaced by symbol-font rendering. * Many layout improvements related to density, font scaling and icon scaling * Updated folder name capitalization for newer style
This commit is contained in:
committed by
GitHub
parent
72c9b2b113
commit
9a11e6f47b
@@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/bindings/gpio.h>
|
||||
#include <tactility/drivers/esp32_gpio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define GPIO_ACTIVE_HIGH GPIO_FLAG_ACTIVE_HIGH
|
||||
#define GPIO_ACTIVE_LOW GPIO_FLAG_ACTIVE_LOW
|
||||
|
||||
#define GPIO_DIRECTION_INPUT GPIO_FLAG_DIRECTION_INPUT
|
||||
#define GPIO_DIRECTION_OUTPUT GPIO_FLAG_DIRECTION_OUTPUT
|
||||
#define GPIO_DIRECTION_INPUT_OUTPUT GPIO_FLAG_DIRECTION_INPUT_OUTPUT
|
||||
|
||||
#define GPIO_PULL_UP GPIO_FLAG_PULL_UP
|
||||
#define GPIO_PULL_DOWN GPIO_FLAG_PULL_DOWN
|
||||
|
||||
DEFINE_DEVICETREE(esp32_gpio, struct Esp32GpioConfig)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/esp32_i2c.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
DEFINE_DEVICETREE(esp32_i2c, struct Esp32I2cConfig)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,17 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/esp32_i2s.h>
|
||||
#include <tactility/drivers/esp32_gpio.h>
|
||||
#include <driver/i2s_common.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
DEFINE_DEVICETREE(esp32_i2s, struct Esp32I2sConfig)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/esp32_spi.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
DEFINE_DEVICETREE(esp32_spi, struct Esp32SpiConfig)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/bindings/bindings.h>
|
||||
#include <tactility/drivers/esp32_uart.h>
|
||||
#include <driver/uart.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
DEFINE_DEVICETREE(esp32_uart, struct Esp32UartConfig)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,16 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
struct Esp32GpioConfig {
|
||||
uint8_t gpioCount;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,20 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/drivers/gpio.h>
|
||||
#include <hal/i2c_types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Esp32I2cConfig {
|
||||
i2c_port_t port;
|
||||
uint32_t clockFrequency;
|
||||
struct GpioPinSpec pinSda;
|
||||
struct GpioPinSpec pinScl;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,23 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <tactility/drivers/i2s_controller.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
#include <driver/i2s_common.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Esp32I2sConfig {
|
||||
i2s_port_t port;
|
||||
struct GpioPinSpec pin_bclk;
|
||||
struct GpioPinSpec pin_ws;
|
||||
struct GpioPinSpec pin_data_out;
|
||||
struct GpioPinSpec pin_data_in;
|
||||
struct GpioPinSpec pin_mclk;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,30 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <driver/spi_common.h>
|
||||
#include <tactility/drivers/spi_controller.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Esp32SpiConfig {
|
||||
spi_host_device_t host;
|
||||
/** Clock pin */
|
||||
struct GpioPinSpec pin_sclk;
|
||||
/** Data 0 pin */
|
||||
struct GpioPinSpec pin_mosi;
|
||||
/** Data 1 pin */
|
||||
struct GpioPinSpec pin_miso;
|
||||
/** Data 2 pin */
|
||||
struct GpioPinSpec pin_wp;
|
||||
/** Data 3 pin */
|
||||
struct GpioPinSpec pin_hd;
|
||||
/** Data transfer size limit in bytes. 0 means the platform decides the limit. */
|
||||
int max_transfer_size;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <driver/uart.h>
|
||||
#include <tactility/drivers/uart_controller.h>
|
||||
#include <tactility/drivers/gpio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct Esp32UartConfig {
|
||||
uart_port_t port;
|
||||
struct GpioPinSpec pin_tx;
|
||||
struct GpioPinSpec pin_rx;
|
||||
struct GpioPinSpec pin_cts;
|
||||
struct GpioPinSpec pin_rts;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <esp_err.h>
|
||||
|
||||
#include <tactility/error.h>
|
||||
|
||||
/** Convert an esp_err_t to an error_t */
|
||||
error_t esp_err_to_error(esp_err_t error);
|
||||
Reference in New Issue
Block a user