mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
**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
40 lines
1.4 KiB
C++
40 lines
1.4 KiB
C++
// SPDX-License-Identifier: Apache-2.0
|
|
#include <tactility/drivers/i2s_controller.h>
|
|
#include <tactility/error.h>
|
|
#include <tactility/device.h>
|
|
|
|
#define I2S_DRIVER_API(driver) ((struct I2sControllerApi*)driver->api)
|
|
|
|
extern "C" {
|
|
|
|
error_t i2s_controller_read(Device* device, void* data, size_t dataSize, size_t* bytesRead, TickType_t timeout) {
|
|
const auto* driver = device_get_driver(device);
|
|
return I2S_DRIVER_API(driver)->read(device, data, dataSize, bytesRead, timeout);
|
|
}
|
|
|
|
error_t i2s_controller_write(Device* device, const void* data, size_t dataSize, size_t* bytesWritten, TickType_t timeout) {
|
|
const auto* driver = device_get_driver(device);
|
|
return I2S_DRIVER_API(driver)->write(device, data, dataSize, bytesWritten, timeout);
|
|
}
|
|
|
|
error_t i2s_controller_set_config(Device* device, const struct I2sConfig* config) {
|
|
const auto* driver = device_get_driver(device);
|
|
return I2S_DRIVER_API(driver)->set_config(device, config);
|
|
}
|
|
|
|
error_t i2s_controller_get_config(Device* device, struct I2sConfig* config) {
|
|
const auto* driver = device_get_driver(device);
|
|
return I2S_DRIVER_API(driver)->get_config(device, config);
|
|
}
|
|
|
|
error_t i2s_controller_reset(struct Device* device) {
|
|
const auto* driver = device_get_driver(device);
|
|
return I2S_DRIVER_API(driver)->reset(device);
|
|
}
|
|
|
|
const struct DeviceType I2S_CONTROLLER_TYPE {
|
|
.name = "i2s-controller"
|
|
};
|
|
|
|
}
|