Tab5 features, StackChan, fixes, drivers.... (#526)

This commit is contained in:
Shadowtrance
2026-05-29 07:31:25 +10:00
committed by GitHub
parent 5c78d55b04
commit a59fbf4ed5
140 changed files with 2500 additions and 835 deletions
@@ -85,6 +85,24 @@ error_t i2c_controller_register16le_get(Device* device, uint8_t address, uint8_t
return ERROR_NONE;
}
error_t i2c_controller_register16le_set(Device* device, uint8_t address, uint8_t reg, uint16_t value, TickType_t timeout) {
uint8_t buf[2] = { static_cast<uint8_t>(value & 0xFF), static_cast<uint8_t>(value >> 8) };
return i2c_controller_write_register(device, address, reg, buf, 2, timeout);
}
error_t i2c_controller_register16be_get(Device* device, uint8_t address, uint8_t reg, uint16_t* value, TickType_t timeout) {
uint8_t buf[2] = {};
error_t err = i2c_controller_read_register(device, address, reg, buf, 2, timeout);
if (err != ERROR_NONE) return err;
*value = static_cast<uint16_t>((buf[0] << 8) | buf[1]);
return ERROR_NONE;
}
error_t i2c_controller_register16be_set(Device* device, uint8_t address, uint8_t reg, uint16_t value, TickType_t timeout) {
uint8_t buf[2] = { static_cast<uint8_t>(value >> 8), static_cast<uint8_t>(value & 0xFF) };
return i2c_controller_write_register(device, address, reg, buf, 2, timeout);
}
const struct DeviceType I2C_CONTROLLER_TYPE {
.name = "i2c-controller"
};
@@ -32,6 +32,12 @@ error_t i2s_controller_reset(struct Device* device) {
return I2S_DRIVER_API(driver)->reset(device);
}
error_t i2s_controller_set_rx_tdm_config(struct Device* device, const struct I2sTdmRxConfig* config) {
const auto* driver = device_get_driver(device);
if (!I2S_DRIVER_API(driver)->set_rx_tdm_config) return ERROR_NOT_SUPPORTED;
return I2S_DRIVER_API(driver)->set_rx_tdm_config(device, config);
}
const struct DeviceType I2S_CONTROLLER_TYPE {
.name = "i2s-controller"
};
+1
View File
@@ -100,6 +100,7 @@ const struct ModuleSymbol KERNEL_SYMBOLS[] = {
DEFINE_MODULE_SYMBOL(i2s_controller_set_config),
DEFINE_MODULE_SYMBOL(i2s_controller_get_config),
DEFINE_MODULE_SYMBOL(i2s_controller_reset),
DEFINE_MODULE_SYMBOL(i2s_controller_set_rx_tdm_config),
DEFINE_MODULE_SYMBOL(I2S_CONTROLLER_TYPE),
// drivers/root
DEFINE_MODULE_SYMBOL(root_is_model),