STMicroelectronics' implementation of an I2S driver, also including DMA support.

Dependents:   temp X_NUCLEO_CCA01M1 X_NUCLEO_CCA01M1 X_NUCLEO_CCA02M1

Platform compatibility

This driver has been designed to support a wide range of the Nucleo F4 Family of platforms and MCUs, but not all members of this family support I2S and/or some of the members might require slight modifications to the sources of this driver in order to make it work on those.

This driver has for now been tested only with the following platforms:

Committer:
Wolfgang Betz
Date:
Fri Jan 27 08:35:23 2017 +0100
Revision:
19:ef6ef1795e30
Parent:
17:7a4a4631672c
Child:
22:e04af8667cad
Rename two API methods

- `set_protocol` => `protocol`
- `set_mode` => `mode`

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wolfgang Betz 0:752e74bf5ef1 1 #include "drivers/I2S.h"
Wolfgang Betz 0:752e74bf5ef1 2 #include "platform/critical.h"
Wolfgang Betz 0:752e74bf5ef1 3 #include "platform/mbed_assert.h"
Wolfgang Betz 0:752e74bf5ef1 4
Wolfgang Betz 0:752e74bf5ef1 5 #if DEVICE_I2S
Wolfgang Betz 0:752e74bf5ef1 6
Wolfgang Betz 10:1a612c2e4a85 7 I2S* I2S::_owner = NULL;
Wolfgang Betz 10:1a612c2e4a85 8 SingletonPtr<PlatformMutex> I2S::_mutex; // intentional class level lock!
Wolfgang Betz 0:752e74bf5ef1 9
Wolfgang Betz 10:1a612c2e4a85 10 events::EventQueue I2S::i2s_bh_queue;
Wolfgang Betz 0:752e74bf5ef1 11
Wolfgang Betz 10:1a612c2e4a85 12 void I2S::lock() {
Wolfgang Betz 10:1a612c2e4a85 13 #if defined(NDEBUG) || !defined(MBED_CONF_RTOS_PRESENT)
Wolfgang Betz 10:1a612c2e4a85 14 _mutex->lock(); // intentional class level lock!
Wolfgang Betz 0:752e74bf5ef1 15 #else
Wolfgang Betz 10:1a612c2e4a85 16 osStatus ret = _mutex->lock(); // intentional class level lock!
Wolfgang Betz 10:1a612c2e4a85 17 MBED_ASSERT(ret == osOK);
Wolfgang Betz 0:752e74bf5ef1 18 #endif
Wolfgang Betz 10:1a612c2e4a85 19 }
Wolfgang Betz 10:1a612c2e4a85 20
Wolfgang Betz 10:1a612c2e4a85 21 void I2S::unlock() {
Wolfgang Betz 10:1a612c2e4a85 22 #if defined(NDEBUG) || !defined(MBED_CONF_RTOS_PRESENT)
Wolfgang Betz 10:1a612c2e4a85 23 _mutex->unlock(); // intentional class level lock!
Wolfgang Betz 10:1a612c2e4a85 24 #else
Wolfgang Betz 10:1a612c2e4a85 25 osStatus ret = _mutex->unlock(); // intentional class level lock!
Wolfgang Betz 10:1a612c2e4a85 26 MBED_ASSERT(ret == osOK);
Wolfgang Betz 10:1a612c2e4a85 27 #endif
Wolfgang Betz 10:1a612c2e4a85 28 }
Wolfgang Betz 0:752e74bf5ef1 29
Wolfgang Betz 10:1a612c2e4a85 30 I2S::I2S(PinName dpin, PinName clk, PinName wsel, PinName fdpin, PinName mck) :
Wolfgang Betz 16:04e1abb4cca3 31 _i2s(),
Wolfgang Betz 10:1a612c2e4a85 32 _irq_tx(this), _irq_rx(this),
Wolfgang Betz 10:1a612c2e4a85 33 _priority(MEDIUM),
Wolfgang Betz 10:1a612c2e4a85 34 _dbits(16),
Wolfgang Betz 10:1a612c2e4a85 35 _fbits(16),
Wolfgang Betz 10:1a612c2e4a85 36 _polarity(0),
Wolfgang Betz 10:1a612c2e4a85 37 _protocol(PHILIPS),
Wolfgang Betz 10:1a612c2e4a85 38 _mode(MASTER_TX),
Wolfgang Betz 10:1a612c2e4a85 39 _circular(false),
Wolfgang Betz 10:1a612c2e4a85 40 _hz(44100) {
Wolfgang Betz 10:1a612c2e4a85 41 lock();
Wolfgang Betz 10:1a612c2e4a85 42 /* Init instance */
Wolfgang Betz 10:1a612c2e4a85 43 i2s_init(&_i2s, dpin, clk, wsel, fdpin, mck, _mode);
Wolfgang Betz 10:1a612c2e4a85 44 acquire();
Wolfgang Betz 10:1a612c2e4a85 45 unlock();
Wolfgang Betz 10:1a612c2e4a85 46 }
Wolfgang Betz 0:752e74bf5ef1 47
Wolfgang Betz 10:1a612c2e4a85 48 int I2S::format(int dbits, int fbits, int polarity) {
Wolfgang Betz 10:1a612c2e4a85 49 lock();
Wolfgang Betz 10:1a612c2e4a85 50 if (i2s_active(&_i2s)) {
Wolfgang Betz 9:c4c2240e06d6 51 unlock();
Wolfgang Betz 10:1a612c2e4a85 52 return -1;
Wolfgang Betz 0:752e74bf5ef1 53 }
Wolfgang Betz 10:1a612c2e4a85 54 _dbits = dbits;
Wolfgang Betz 10:1a612c2e4a85 55 _fbits = fbits;
Wolfgang Betz 10:1a612c2e4a85 56 _polarity = polarity;
Wolfgang Betz 10:1a612c2e4a85 57 I2S::_owner = NULL; // Not that elegant, but works. rmeyer
Wolfgang Betz 10:1a612c2e4a85 58 acquire();
Wolfgang Betz 10:1a612c2e4a85 59 unlock();
Wolfgang Betz 10:1a612c2e4a85 60 return 0;
Wolfgang Betz 10:1a612c2e4a85 61 }
Wolfgang Betz 0:752e74bf5ef1 62
Wolfgang Betz 10:1a612c2e4a85 63 int I2S::audio_frequency(unsigned int hz) {
Wolfgang Betz 10:1a612c2e4a85 64 lock();
Wolfgang Betz 10:1a612c2e4a85 65 if (i2s_active(&_i2s)) {
Wolfgang Betz 9:c4c2240e06d6 66 unlock();
Wolfgang Betz 10:1a612c2e4a85 67 return -1;
Wolfgang Betz 0:752e74bf5ef1 68 }
Wolfgang Betz 10:1a612c2e4a85 69 _hz = hz;
Wolfgang Betz 10:1a612c2e4a85 70 I2S::_owner = NULL; // Not that elegant, but works. rmeyer
Wolfgang Betz 10:1a612c2e4a85 71 acquire();
Wolfgang Betz 10:1a612c2e4a85 72 unlock();
Wolfgang Betz 10:1a612c2e4a85 73 return 0;
Wolfgang Betz 10:1a612c2e4a85 74 }
Wolfgang Betz 0:752e74bf5ef1 75
Wolfgang Betz 19:ef6ef1795e30 76 int I2S::protocol(i2s_bitorder_t protocol) {
Wolfgang Betz 10:1a612c2e4a85 77 lock();
Wolfgang Betz 10:1a612c2e4a85 78 if (i2s_active(&_i2s)) {
Wolfgang Betz 9:c4c2240e06d6 79 unlock();
Wolfgang Betz 10:1a612c2e4a85 80 return -1;
Wolfgang Betz 0:752e74bf5ef1 81 }
Wolfgang Betz 10:1a612c2e4a85 82 _protocol = protocol;
Wolfgang Betz 10:1a612c2e4a85 83 I2S::_owner = NULL; // Not that elegant, but works. rmeyer
Wolfgang Betz 10:1a612c2e4a85 84 acquire();
Wolfgang Betz 10:1a612c2e4a85 85 unlock();
Wolfgang Betz 10:1a612c2e4a85 86 return 0;
Wolfgang Betz 10:1a612c2e4a85 87 }
Wolfgang Betz 0:752e74bf5ef1 88
Wolfgang Betz 19:ef6ef1795e30 89 int I2S::mode(i2s_mode_t mode, bool circular) {
Wolfgang Betz 10:1a612c2e4a85 90 lock();
Wolfgang Betz 10:1a612c2e4a85 91 if (i2s_active(&_i2s)) {
Wolfgang Betz 9:c4c2240e06d6 92 unlock();
Wolfgang Betz 10:1a612c2e4a85 93 return -1;
Wolfgang Betz 10:1a612c2e4a85 94 }
Wolfgang Betz 10:1a612c2e4a85 95 _mode = mode;
Wolfgang Betz 10:1a612c2e4a85 96 _circular = circular;
Wolfgang Betz 10:1a612c2e4a85 97 I2S::_owner = NULL; // Not that elegant, but works. rmeyer
Wolfgang Betz 10:1a612c2e4a85 98 acquire();
Wolfgang Betz 10:1a612c2e4a85 99 unlock();
Wolfgang Betz 10:1a612c2e4a85 100 return 0;
Wolfgang Betz 10:1a612c2e4a85 101 }
Wolfgang Betz 10:1a612c2e4a85 102
Wolfgang Betz 10:1a612c2e4a85 103 int I2S::harmonize(I2S &dev_i2s_1, I2S &dev_i2s_2) {
Wolfgang Betz 10:1a612c2e4a85 104 dev_i2s_1.lock();
Wolfgang Betz 10:1a612c2e4a85 105 if (i2s_active(&dev_i2s_1._i2s)) {
Wolfgang Betz 10:1a612c2e4a85 106 dev_i2s_1.unlock();
Wolfgang Betz 10:1a612c2e4a85 107 return -1;
Wolfgang Betz 0:752e74bf5ef1 108 }
Wolfgang Betz 9:c4c2240e06d6 109
Wolfgang Betz 10:1a612c2e4a85 110 dev_i2s_2.lock();
Wolfgang Betz 10:1a612c2e4a85 111 if (i2s_active(&dev_i2s_2._i2s)) {
Wolfgang Betz 11:50562a5f8a93 112 dev_i2s_2.unlock();
Wolfgang Betz 9:c4c2240e06d6 113 dev_i2s_1.unlock();
Wolfgang Betz 10:1a612c2e4a85 114 return -1;
Wolfgang Betz 9:c4c2240e06d6 115 }
Wolfgang Betz 9:c4c2240e06d6 116
Wolfgang Betz 10:1a612c2e4a85 117 uint32_t hz1 = dev_i2s_1._hz;
Wolfgang Betz 10:1a612c2e4a85 118 uint32_t hz2 = dev_i2s_2._hz;
Wolfgang Betz 10:1a612c2e4a85 119 int8_t ret = i2s_harmonize(&dev_i2s_1._i2s, &hz1, &dev_i2s_2._i2s, &hz2);
Wolfgang Betz 0:752e74bf5ef1 120
Wolfgang Betz 10:1a612c2e4a85 121 if(ret == 0) {
Wolfgang Betz 10:1a612c2e4a85 122 dev_i2s_1.audio_frequency(hz1);
Wolfgang Betz 10:1a612c2e4a85 123 dev_i2s_2.audio_frequency(hz2);
Wolfgang Betz 9:c4c2240e06d6 124 }
Wolfgang Betz 0:752e74bf5ef1 125
Wolfgang Betz 10:1a612c2e4a85 126 dev_i2s_2.unlock();
Wolfgang Betz 10:1a612c2e4a85 127 dev_i2s_1.unlock();
Wolfgang Betz 10:1a612c2e4a85 128
Wolfgang Betz 10:1a612c2e4a85 129 return ret;
Wolfgang Betz 10:1a612c2e4a85 130 }
Wolfgang Betz 10:1a612c2e4a85 131
Wolfgang Betz 10:1a612c2e4a85 132 void I2S::abort_transfer()
Wolfgang Betz 10:1a612c2e4a85 133 {
Wolfgang Betz 10:1a612c2e4a85 134 lock();
Wolfgang Betz 10:1a612c2e4a85 135 i2s_abort_asynch(&_i2s);
Wolfgang Betz 10:1a612c2e4a85 136 #if TRANSACTION_QUEUE_SIZE_I2S
Wolfgang Betz 10:1a612c2e4a85 137 dequeue_transaction();
Wolfgang Betz 10:1a612c2e4a85 138 #endif
Wolfgang Betz 10:1a612c2e4a85 139 unlock();
Wolfgang Betz 10:1a612c2e4a85 140 }
Wolfgang Betz 10:1a612c2e4a85 141
Wolfgang Betz 0:752e74bf5ef1 142
Wolfgang Betz 10:1a612c2e4a85 143 void I2S::clear_transfer_buffer()
Wolfgang Betz 10:1a612c2e4a85 144 {
Wolfgang Betz 10:1a612c2e4a85 145 #if TRANSACTION_QUEUE_SIZE_I2S
Wolfgang Betz 10:1a612c2e4a85 146 lock();
Wolfgang Betz 10:1a612c2e4a85 147 _transaction_buffer.reset();
Wolfgang Betz 10:1a612c2e4a85 148 unlock();
Wolfgang Betz 10:1a612c2e4a85 149 #endif
Wolfgang Betz 10:1a612c2e4a85 150 }
Wolfgang Betz 0:752e74bf5ef1 151
Wolfgang Betz 10:1a612c2e4a85 152 void I2S::abort_all_transfers()
Wolfgang Betz 10:1a612c2e4a85 153 {
Wolfgang Betz 10:1a612c2e4a85 154 lock();
Wolfgang Betz 10:1a612c2e4a85 155 clear_transfer_buffer();
Wolfgang Betz 10:1a612c2e4a85 156 abort_transfer();
Wolfgang Betz 10:1a612c2e4a85 157 unlock();
Wolfgang Betz 10:1a612c2e4a85 158 }
Wolfgang Betz 10:1a612c2e4a85 159
Wolfgang Betz 10:1a612c2e4a85 160 int I2S::get_transfer_status()
Wolfgang Betz 10:1a612c2e4a85 161 {
Wolfgang Betz 10:1a612c2e4a85 162 lock();
Wolfgang Betz 10:1a612c2e4a85 163 if (i2s_active(&_i2s)) {
Wolfgang Betz 9:c4c2240e06d6 164 unlock();
Wolfgang Betz 10:1a612c2e4a85 165 return -1;
Wolfgang Betz 0:752e74bf5ef1 166 }
Wolfgang Betz 10:1a612c2e4a85 167 unlock();
Wolfgang Betz 10:1a612c2e4a85 168 return 0;
Wolfgang Betz 10:1a612c2e4a85 169 }
Wolfgang Betz 0:752e74bf5ef1 170
Wolfgang Betz 10:1a612c2e4a85 171 unsigned int I2S::get_module()
Wolfgang Betz 10:1a612c2e4a85 172 {
Wolfgang Betz 10:1a612c2e4a85 173 return i2s_get_module(&_i2s);
Wolfgang Betz 10:1a612c2e4a85 174 }
Wolfgang Betz 0:752e74bf5ef1 175
Wolfgang Betz 10:1a612c2e4a85 176 int I2S::set_dma_priority(i2s_dma_prio_t prio)
Wolfgang Betz 10:1a612c2e4a85 177 {
Wolfgang Betz 10:1a612c2e4a85 178 lock();
Wolfgang Betz 10:1a612c2e4a85 179 if (i2s_active(&_i2s)) {
Wolfgang Betz 10:1a612c2e4a85 180 unlock();
Wolfgang Betz 10:1a612c2e4a85 181 return -1;
Wolfgang Betz 10:1a612c2e4a85 182 }
Wolfgang Betz 10:1a612c2e4a85 183 _priority = prio;
Wolfgang Betz 10:1a612c2e4a85 184 unlock();
Wolfgang Betz 10:1a612c2e4a85 185 return 0;
Wolfgang Betz 10:1a612c2e4a85 186 }
Wolfgang Betz 10:1a612c2e4a85 187
Wolfgang Betz 17:7a4a4631672c 188 int I2S::queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, const mbed::event_callback_t& callback, int event)
Wolfgang Betz 19:ef6ef1795e30 189 { // NOTE: MUST be called with lock held!
Wolfgang Betz 10:1a612c2e4a85 190 #if TRANSACTION_QUEUE_SIZE_I2S
Wolfgang Betz 17:7a4a4631672c 191 mbed::transaction_t t;
Wolfgang Betz 10:1a612c2e4a85 192
Wolfgang Betz 10:1a612c2e4a85 193 t.tx_buffer = const_cast<void *>(tx_buffer);
Wolfgang Betz 10:1a612c2e4a85 194 t.tx_length = tx_length;
Wolfgang Betz 10:1a612c2e4a85 195 t.rx_buffer = rx_buffer;
Wolfgang Betz 10:1a612c2e4a85 196 t.rx_length = rx_length;
Wolfgang Betz 10:1a612c2e4a85 197 t.event = event;
Wolfgang Betz 10:1a612c2e4a85 198 t.callback = callback;
Wolfgang Betz 10:1a612c2e4a85 199 t.width = 16;
Wolfgang Betz 17:7a4a4631672c 200 mbed::Transaction<I2S> transaction(this, t);
Wolfgang Betz 10:1a612c2e4a85 201 core_util_critical_section_enter();
Wolfgang Betz 10:1a612c2e4a85 202 if (_transaction_buffer.full()) {
Wolfgang Betz 9:c4c2240e06d6 203 core_util_critical_section_enter();
Wolfgang Betz 10:1a612c2e4a85 204 return -1; // the buffer is full
Wolfgang Betz 10:1a612c2e4a85 205 } else {
Wolfgang Betz 10:1a612c2e4a85 206 _transaction_buffer.push(transaction);
Wolfgang Betz 10:1a612c2e4a85 207 core_util_critical_section_exit();
Wolfgang Betz 10:1a612c2e4a85 208 return 0;
Wolfgang Betz 10:1a612c2e4a85 209 }
Wolfgang Betz 9:c4c2240e06d6 210 #else
Wolfgang Betz 10:1a612c2e4a85 211 return -1;
Wolfgang Betz 9:c4c2240e06d6 212 #endif
Wolfgang Betz 10:1a612c2e4a85 213 }
Wolfgang Betz 0:752e74bf5ef1 214
Wolfgang Betz 0:752e74bf5ef1 215
Wolfgang Betz 9:c4c2240e06d6 216 // ignore the fact that there are multiple physical i2s's, and always update if it wasn't us last
Wolfgang Betz 19:ef6ef1795e30 217 void I2S::acquire() { // NOTE: MUST be called with lock held!
Wolfgang Betz 10:1a612c2e4a85 218 if (_owner != this) {
Wolfgang Betz 10:1a612c2e4a85 219 i2s_format(&_i2s, _dbits, _fbits, _polarity);
Wolfgang Betz 10:1a612c2e4a85 220 i2s_audio_frequency(&_i2s, _hz);
Wolfgang Betz 10:1a612c2e4a85 221 i2s_set_protocol(&_i2s, _protocol);
Wolfgang Betz 10:1a612c2e4a85 222 i2s_set_mode(&_i2s, _mode);
Wolfgang Betz 10:1a612c2e4a85 223 _owner = this;
Wolfgang Betz 0:752e74bf5ef1 224 }
Wolfgang Betz 10:1a612c2e4a85 225 }
Wolfgang Betz 0:752e74bf5ef1 226
Wolfgang Betz 10:1a612c2e4a85 227 void I2S::start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length,
Wolfgang Betz 17:7a4a4631672c 228 const mbed::event_callback_t& callback, int event)
Wolfgang Betz 19:ef6ef1795e30 229 { // NOTE: MUST be called with lock held!
Wolfgang Betz 10:1a612c2e4a85 230 acquire();
Wolfgang Betz 10:1a612c2e4a85 231 _callback = callback;
Wolfgang Betz 10:1a612c2e4a85 232 _irq_tx.callback(&I2S::irq_handler_asynch_tx);
Wolfgang Betz 10:1a612c2e4a85 233 _irq_rx.callback(&I2S::irq_handler_asynch_rx);
Wolfgang Betz 10:1a612c2e4a85 234 i2s_transfer(&_i2s,
Wolfgang Betz 10:1a612c2e4a85 235 const_cast<void *>(tx_buffer), tx_length, rx_buffer, rx_length,
Wolfgang Betz 10:1a612c2e4a85 236 _circular, _priority,
Wolfgang Betz 10:1a612c2e4a85 237 _irq_tx.entry(), _irq_rx.entry(),
Wolfgang Betz 10:1a612c2e4a85 238 event);
Wolfgang Betz 10:1a612c2e4a85 239 }
Wolfgang Betz 0:752e74bf5ef1 240
Wolfgang Betz 0:752e74bf5ef1 241 #if TRANSACTION_QUEUE_SIZE_I2S
Wolfgang Betz 0:752e74bf5ef1 242
Wolfgang Betz 17:7a4a4631672c 243 void I2S::start_transaction(mbed::transaction_t *data)
Wolfgang Betz 19:ef6ef1795e30 244 { // NOTE: MUST be called with lock held!
Wolfgang Betz 10:1a612c2e4a85 245 start_transfer(data->tx_buffer, data->tx_length, data->rx_buffer, data->rx_length, data->callback, data->event);
Wolfgang Betz 10:1a612c2e4a85 246 }
Wolfgang Betz 0:752e74bf5ef1 247
Wolfgang Betz 10:1a612c2e4a85 248 void I2S::dequeue_transaction()
Wolfgang Betz 10:1a612c2e4a85 249 {
Wolfgang Betz 10:1a612c2e4a85 250 lock();
Wolfgang Betz 10:1a612c2e4a85 251 if (!i2s_active(&_i2s)) {
Wolfgang Betz 17:7a4a4631672c 252 mbed::Transaction<I2S> t;
Wolfgang Betz 10:1a612c2e4a85 253 if (_transaction_buffer.pop(t)) {
Wolfgang Betz 10:1a612c2e4a85 254 I2S* obj = t.get_object();
Wolfgang Betz 17:7a4a4631672c 255 mbed::transaction_t* data = t.get_transaction();
Wolfgang Betz 16:04e1abb4cca3 256 MBED_ASSERT(obj == this);
Wolfgang Betz 10:1a612c2e4a85 257 obj->start_transaction(data);
Wolfgang Betz 9:c4c2240e06d6 258 }
Wolfgang Betz 0:752e74bf5ef1 259 }
Wolfgang Betz 10:1a612c2e4a85 260 unlock();
Wolfgang Betz 10:1a612c2e4a85 261 }
Wolfgang Betz 0:752e74bf5ef1 262
Wolfgang Betz 0:752e74bf5ef1 263 #endif
Wolfgang Betz 0:752e74bf5ef1 264
Wolfgang Betz 10:1a612c2e4a85 265 void I2S::irq_handler_asynch_rx(void)
Wolfgang Betz 10:1a612c2e4a85 266 {
Wolfgang Betz 10:1a612c2e4a85 267 int event = i2s_irq_handler_asynch(&_i2s, I2S_RX_EVENT);
Wolfgang Betz 10:1a612c2e4a85 268 if (_callback && (event & I2S_EVENT_ALL)) {
Wolfgang Betz 10:1a612c2e4a85 269 I2sBhHandler::i2s_defer_function(_callback, event & I2S_EVENT_ALL);
Wolfgang Betz 10:1a612c2e4a85 270 }
Wolfgang Betz 0:752e74bf5ef1 271 #if TRANSACTION_QUEUE_SIZE_I2S
Wolfgang Betz 10:1a612c2e4a85 272 if (event & I2S_EVENT_INTERNAL_TRANSFER_COMPLETE) {
Wolfgang Betz 17:7a4a4631672c 273 I2sBhHandler::i2s_defer_function(mbed::Callback<void()>(this, &I2S::dequeue_transaction));
Wolfgang Betz 10:1a612c2e4a85 274 }
Wolfgang Betz 0:752e74bf5ef1 275 #endif
Wolfgang Betz 10:1a612c2e4a85 276 }
Davide Aliprandi 4:21603d68bcf7 277
Wolfgang Betz 10:1a612c2e4a85 278 void I2S::irq_handler_asynch_tx(void)
Wolfgang Betz 10:1a612c2e4a85 279 {
Wolfgang Betz 10:1a612c2e4a85 280 int event = i2s_irq_handler_asynch(&_i2s, I2S_TX_EVENT);
Wolfgang Betz 10:1a612c2e4a85 281 if (_callback && (event & I2S_EVENT_ALL)) {
Wolfgang Betz 10:1a612c2e4a85 282 I2sBhHandler::i2s_defer_function(_callback, event & I2S_EVENT_ALL);
Wolfgang Betz 10:1a612c2e4a85 283 }
Wolfgang Betz 9:c4c2240e06d6 284 #if TRANSACTION_QUEUE_SIZE_I2S
Wolfgang Betz 10:1a612c2e4a85 285 if (event & I2S_EVENT_INTERNAL_TRANSFER_COMPLETE) {
Wolfgang Betz 17:7a4a4631672c 286 I2sBhHandler::i2s_defer_function(mbed::Callback<void()>(this, &I2S::dequeue_transaction));
Wolfgang Betz 10:1a612c2e4a85 287 }
Wolfgang Betz 9:c4c2240e06d6 288 #endif
Wolfgang Betz 10:1a612c2e4a85 289 }
Davide Aliprandi 4:21603d68bcf7 290
Wolfgang Betz 17:7a4a4631672c 291 #endif // DEVICE_I2S