Lines Matching +full:data +full:- +full:ready

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,
24 * Left/Right Justified Data Format.
39 /** I2S data stream format options */
42 /** Data Format bit field position. */
44 /** Data Format bit field mask. */
47 /** @brief Standard I2S Data Format.
49 * Serial data is transmitted in two's complement with the MSB first. Both
50 * Word Select (WS) and Serial Data (SD) signals are sampled on the rising edge
52 * WS changes. Left channel data are sent first indicated by WS = 0, followed
53 * by right channel data indicated by WS = 1.
55 * -. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
56 * SCK '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '
57 * -. .-------------------------------.
58 * WS '-------------------------------' '----
59 * -.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.
61 * -'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'
66 /** @brief PCM Short Frame Sync Data Format.
68 * Serial data is transmitted in two's complement with the MSB first. Both
69 * Word Select (WS) and Serial Data (SD) signals are sampled on the falling edge
72 * An arbitrary number of data words can be sent in one frame.
74 * .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
75 * SCK -' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-
76 * .---. .---.
77 * WS -' '- -' '-
78 * -.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---
80 * -'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---
85 /** @brief PCM Long Frame Sync Data Format.
87 * Serial data is transmitted in two's complement with the MSB first. Both
88 * Word Select (WS) and Serial Data (SD) signals are sampled on the falling edge
92 * number of data words can be sent in one frame.
94 * .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
95 * SCK -' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-
96 * .--- ---. ---. ---. .---
97 * WS -' '- '- '- -'
98 * -.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---
100 * -'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---
106 * @brief Left Justified Data Format.
108 * Serial data is transmitted in two's complement with the MSB first. Both
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
112 * transition. Left channel data are sent first indicated by WS = 1, followed
113 * by right channel data indicated by WS = 0.
115 * .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
116 * SCK -' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-
117 * .-------------------------------. .-
118 * WS ---' '-------------------------------'
119 * ---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.-
121 * ---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'-
127 * @brief Right Justified Data Format.
129 * Serial data is transmitted in two's complement with the MSB first. Both
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
133 * transition. Left channel data are sent first indicated by WS = 1, followed
134 * by right channel data indicated by WS = 0.
136 * .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-. .-.
137 * SCK -' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-' '-
138 * .-------------------------------. .-
139 * WS ---' '-------------------------------'
140 * ---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.---.-
142 * ---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'---'-
154 /** Data Format bit field position. */
156 /** Data Format bit field mask. */
178 /** Run bit clock when sending data only */
210 /** Receive data */
212 /** Transmit data */
214 /** Both receive and transmit data */
220 /** @brief The interface is not ready.
222 * The interface was initialized but is not yet ready to receive /
223 * transmit data. Call i2s_configure() to configure interface and change
224 * its state to READY.
227 /** The interface is ready to receive / transmit data. */
229 /** The interface is receiving / transmitting data. */
239 /** @brief Start the transmission / reception of data.
241 * If I2S_DIR_TX is set some data has to be queued for transmission by
242 * the i2s_write() function. This trigger can be used in READY state
246 /** @brief Stop the transmission / reception of data.
248 * Stop the transmission / reception of data at the end of the current
251 * RX block is transmitted / received the state is changed to READY.
258 * Send all data in the transmit queue and stop the transmission.
262 * are transmitted the state is changed to READY.
269 * state other than NOT_READY and changes the interface state to READY.
275 * interface state to READY.
292 * @remark When I2S data format is selected parameter channels is ignored,
296 /** Number of bits representing one data word. */
300 /** Data stream format as defined by I2S_FMT_* constants. */
306 /** Memory slab to store RX/TX data. */
339 * will be configured by data provided via cfg parameter.
341 * The function can be called in NOT_READY or READY state only. If executed
342 * successfully the function will change the interface state to READY.
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()
388 * @brief Read data from the RX queue.
390 * Data received by the I2S interface is stored in the RX queue consisting of
395 * The data is read in chunks equal to the size of the memory block. If the
396 * interface is in READY state the number of bytes read can be smaller.
398 * If there is no data in the RX queue the function will block waiting for
401 * is non-blocking.
405 * valid data stored in RX queue. Afterwards the function will return -EIO
409 * @param mem_block Pointer to the RX memory block containing received data.
413 * @retval -EIO The interface is in NOT_READY or ERROR state and there are no
414 * more data blocks in the RX queue.
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()
428 * @brief Read data from the RX queue into a provided buffer
430 * Data received by the I2S interface is stored in the RX queue consisting of
436 * of data, which is parameterized for the channel via i2s_configure().
441 * @param buf Destination buffer for read data, which must be at least the
446 * @retval -EIO The interface is in NOT_READY or ERROR state and there are no
447 * more data blocks in the RX queue.
448 * @retval -EBUSY Returned without waiting.
449 * @retval -EAGAIN Waiting period timed out.
454 * @brief Write data to the TX queue.
456 * Data to be sent by the I2S interface is stored first in the TX queue. TX
459 * block and will release it when all data are transmitted.
464 * set to K_NO_WAIT the function is non-blocking.
466 * Writing to the TX queue is only possible if the interface is in READY or
470 * @param mem_block Pointer to the TX memory block containing data to be sent.
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()
489 * @brief Write data to the TX queue from a provided buffer
492 * and copies the provided data buffer into it. It is otherwise equivalent
496 * @param buf Pointer to a buffer containing the data to transmit.
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()