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
73 lines
2.0 KiB
C
73 lines
2.0 KiB
C
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
|
|
#include <tactility/freertos/freertos.h>
|
|
#include <tactility/error.h>
|
|
|
|
struct Device;
|
|
|
|
/**
|
|
* @brief API for SPI controller drivers.
|
|
*/
|
|
struct SpiControllerApi {
|
|
/**
|
|
* @brief Locks the SPI controller.
|
|
* @param[in] device the SPI controller device
|
|
* @retval ERROR_NONE when the operation was successful
|
|
*/
|
|
error_t (*lock)(struct Device* device);
|
|
|
|
/**
|
|
* @brief Tries to lock the SPI controller.
|
|
* @param[in] device the SPI controller device
|
|
* @param[in] timeout the maximum time to wait for the lock
|
|
* @retval ERROR_NONE when the operation was successful
|
|
* @retval ERROR_TIMEOUT when the operation timed out
|
|
*/
|
|
error_t (*try_lock)(struct Device* device, TickType_t timeout);
|
|
|
|
/**
|
|
* @brief Unlocks the SPI controller.
|
|
* @param[in] device the SPI controller device
|
|
* @retval ERROR_NONE when the operation was successful
|
|
*/
|
|
error_t (*unlock)(struct Device* device);
|
|
};
|
|
|
|
/**
|
|
* @brief Locks the SPI controller using the specified controller.
|
|
* @param[in] device the SPI controller device
|
|
* @retval ERROR_NONE when the operation was successful
|
|
*/
|
|
error_t spi_controller_lock(struct Device* device);
|
|
|
|
/**
|
|
* @brief Tries to lock the SPI controller using the specified controller.
|
|
* @param[in] device the SPI controller device
|
|
* @param[in] timeout the maximum ticks to wait for the lock
|
|
* @retval ERROR_NONE when the operation was successful
|
|
* @retval ERROR_TIMEOUT when the operation timed out
|
|
*/
|
|
error_t spi_controller_try_lock(struct Device* device, TickType_t timeout);
|
|
|
|
/**
|
|
* @brief Unlocks the SPI controller using the specified controller.
|
|
* @param[in] device the SPI controller device
|
|
* @retval ERROR_NONE when the operation was successful
|
|
*/
|
|
error_t spi_controller_unlock(struct Device* device);
|
|
|
|
extern const struct DeviceType SPI_CONTROLLER_TYPE;
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|