| /* |
| * Copyright 2023 Google LLC |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| #ifndef EXAMPLES_SOUNDSTREAM_I2S_H_ |
| #define EXAMPLES_SOUNDSTREAM_I2S_H_ |
| |
| #include <compartment.h> |
| |
| #include "sw/device/lib/dif/dif_i2s.h" |
| |
| typedef dif_i2s_irq_t i2s_irq_t; |
| const i2s_irq_t kI2sIrqRxWatermark = kDifI2sIrqRxWatermark; |
| const i2s_irq_t kI2sIrqTxWatermark = kDifI2sIrqTxWatermark; |
| const i2s_irq_t kI2sIrqTxEmpty = kDifI2sIrqTxEmpty; |
| |
| void __cheri_compartment("i2s") i2s_init(void); |
| void __cheri_compartment("i2s") i2s_isr(void); |
| void __cheri_compartment("i2s") i2s_irq_acknowledge_all(void); |
| void __cheri_compartment("i2s") |
| i2s_irq_set_enabled(i2s_irq_t irq_id, bool enabled); |
| bool __cheri_compartment("i2s") i2s_rx_watermark_seen(void); |
| void __cheri_compartment("i2s") i2s_wait_for_rx_watermark(void); |
| void __cheri_compartment("i2s") i2s_rxfifo_clear(void); |
| bool __cheri_compartment("i2s") i2s_rxfifo_is_empty(void); |
| void __cheri_compartment("i2s") i2s_record_begin(void); |
| void __cheri_compartment("i2s") i2s_record_end(void); |
| uint32_t __cheri_compartment("i2s") i2s_get_rdata(void); |
| |
| #endif // EXAMPLES_SOUNDSTREAM_I2S_H_ |