Lines Matching +full:2 +full:- +full:word
4 * SPDX-License-Identifier: Apache-2.0
9 * @brief Public APIs for the I2S (Inter-IC Sound) bus drivers.
20 * @brief I2S (Inter-IC Sound) Interface
23 * as common non-standard extensions such as PCM Short/Long Frame Sync,
50 * Word Select (WS) and Serial Data (SD) signals are sampled on the rising edge
55 * -. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
56 * SCK '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '
57 * -. .-------------------------------.
58 * WS '-------------------------------' '----
59 * -.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.
61 * -'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'
69 * Word Select (WS) and Serial Data (SD) signals are sampled on the falling edge
71 * indicates the start of the PCM word. The frame sync is one clock cycle long.
74 * .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
75 * SCK -' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-
76 * .---. .---.
77 * WS -' '- -' '-
78 * -.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---
80 * -'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---
81 * | Word 1 | Word 2 | Word 3 | Word n |
88 * Word Select (WS) and Serial Data (SD) signals are sampled on the falling edge
90 * indicates the start of the PCM word. The frame sync has an arbitrary length,
94 * .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
95 * SCK -' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-
96 * .--- ---. ---. ---. .---
97 * WS -' '- '- '- -'
98 * -.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---
100 * -'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---
101 * | Word 1 | Word 2 | Word 3 | Word n |
103 #define I2S_FMT_DATA_FORMAT_PCM_LONG (2 << I2S_FMT_DATA_FORMAT_SHIFT)
109 * Word Select (WS) and Serial Data (SD) signals are sampled on the rising edge
110 * of the clock signal (SCK). The bits within the data word are left justified
115 * .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
116 * SCK -' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-
117 * .-------------------------------. .-
118 * WS ---' '-------------------------------'
119 * ---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.-
121 * ---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'-
130 * Word Select (WS) and Serial Data (SD) signals are sampled on the rising edge
131 * of the clock signal (SCK). The bits within the data word are right justified
136 * .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
137 * SCK -' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-
138 * .-------------------------------. .-
139 * WS ---' '-------------------------------'
140 * ---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.-
142 * ---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'-
169 #define I2S_FMT_CLK_IF_NB (2 << I2S_FMT_CLK_FORMAT_SHIFT)
185 #define I2S_OPT_FRAME_CLK_MASTER (0 << 2)
187 #define I2S_OPT_FRAME_CLK_SLAVE BIT(2)
201 * So, in this mode, 2 sets of buffers fixed in size are used. Static Arrays
285 * memory blocks in a slab has to be at least 2 per queue. Size of the memory
287 * word_size_bytes). As an example 16 bit word will occupy 2 bytes, 24 or 32
288 * bit word will occupy 4 bytes.
293 * number of words in a frame is always 2.
296 /** Number of bits representing one data word. */
344 * If the function is called with the parameter cfg->frame_clk_freq set to 0
354 * @retval -EINVAL Invalid argument.
355 * @retval -ENOSYS I2S_DIR_BOTH value is not supported.
365 (const struct i2s_driver_api *)dev->api; in z_impl_i2s_configure()
367 return api->configure(dev, dir, cfg); in z_impl_i2s_configure()
376 * or NULL if un-configured
382 (const struct i2s_driver_api *)dev->api; in i2s_config_get()
384 return api->config_get(dev, dir); in i2s_config_get()
401 * is non-blocking.
405 * valid data stored in RX queue. Afterwards the function will return -EIO
413 * @retval -EIO The interface is in NOT_READY or ERROR state and there are no
415 * @retval -EBUSY Returned without waiting.
416 * @retval -EAGAIN Waiting period timed out.
422 (const struct i2s_driver_api *)dev->api; in i2s_read()
424 return api->read(dev, mem_block, size); in i2s_read()
446 * @retval -EIO The interface is in NOT_READY or ERROR state and there are no
448 * @retval -EBUSY Returned without waiting.
449 * @retval -EAGAIN Waiting period timed out.
464 * set to K_NO_WAIT the function is non-blocking.
475 * @retval -EIO The interface is not in READY or RUNNING state.
476 * @retval -EBUSY Returned without waiting.
477 * @retval -EAGAIN Waiting period timed out.
483 (const struct i2s_driver_api *)dev->api; in i2s_write()
485 return api->write(dev, mem_block, size); in i2s_write()
501 * @retval -EIO The interface is not in READY or RUNNING state.
502 * @retval -EBUSY Returned without waiting.
503 * @retval -EAGAIN Waiting period timed out.
504 * @retval -ENOMEM No memory in TX slab queue.
505 * @retval -EINVAL Size parameter larger than TX queue memory block.
520 * @retval -EINVAL Invalid argument.
521 * @retval -EIO The trigger cannot be executed in the current state or a DMA
523 * @retval -ENOMEM RX/TX memory block not available.
524 * @retval -ENOSYS I2S_DIR_BOTH value is not supported.
534 (const struct i2s_driver_api *)dev->api; in z_impl_i2s_trigger()
536 return api->trigger(dev, dir, cmd); in z_impl_i2s_trigger()