| 167 | } |
| 168 | |
| 169 | static error_t write(Device* device, const void* data, size_t data_size, size_t* bytes_written, TickType_t timeout) { |
| 170 | if (xPortInIsrContext()) return ERROR_ISR_STATUS; |
| 171 | auto* driver_data = GET_DATA(device); |
| 172 | if (!driver_data->tx_handle) return ERROR_NOT_SUPPORTED; |
| 173 | |
| 174 | lock(driver_data); |
| 175 | const esp_err_t esp_error = i2s_channel_write(driver_data->tx_handle, data, data_size, bytes_written, timeout); |
| 176 | unlock(driver_data); |
| 177 | return esp_err_to_error(esp_error); |
| 178 | } |
| 179 | |
| 180 | static error_t set_config(Device* device, const struct I2sConfig* config) { |
| 181 | if (xPortInIsrContext()) return ERROR_ISR_STATUS; |
no test coverage detected