@@ -23,6 +23,19 @@ extern "C" {
23
23
24
24
#include "audio_defines.h"
25
25
26
+ /**
27
+ * @brief Helper macro to configure the modules parameters.
28
+ */
29
+ #define AUDIO_MODULE_PARAMETERS (p , dest , stk , stk_size , pri , fifo_rx , fifo_tx , slab , slab_size ) \
30
+ (p).description = (dest); \
31
+ (p).thread.stack = (stk); \
32
+ (p).thread.stack_size = (stk_size); \
33
+ (p).thread.priority = (pri); \
34
+ (p).thread.msg_rx = (fifo_rx); \
35
+ (p).thread.msg_tx = (fifo_tx); \
36
+ (p).thread.data_slab = (slab); \
37
+ (p).thread.data_size = (slab_size);
38
+
26
39
/**
27
40
* @brief Number of valid location bits.
28
41
*/
@@ -409,6 +422,10 @@ int audio_module_stop(struct audio_module_handle *handle);
409
422
/**
410
423
* @brief Send an audio data item to an audio module, all data is consumed by the module.
411
424
*
425
+ * @note: The data pointer and its associated size that are passed via the audio data
426
+ * pointer, can be NULL and/or 0. It is the responsibility of the low level module functions
427
+ * to handle this correctly.
428
+ *
412
429
* @param handle [in/out] The handle for the receiving module instance.
413
430
* @param audio_data [in] Pointer to the audio data to send to the module.
414
431
* @param response_cb [in] Pointer to a callback to run when the buffer is
@@ -423,6 +440,10 @@ int audio_module_data_tx(struct audio_module_handle *handle,
423
440
/**
424
441
* @brief Retrieve an audio data item from an audio module.
425
442
*
443
+ * @note: The data pointer and its associated size that are passed via the audio data
444
+ * pointer, can be NULL and/or 0. It is the responsibility of the low level module functions
445
+ * to handle this correctly.
446
+ *
426
447
* @param handle [in/out] The handle to the module instance.
427
448
* @param audio_data [out] Pointer to the audio data from the module.
428
449
* @param timeout [in] Non-negative waiting period to wait for operation to complete
@@ -441,6 +462,10 @@ int audio_module_data_rx(struct audio_module_handle *handle, struct audio_data *
441
462
* returned via the module or final module's output FIFO. All the input data is consumed
442
463
* within the call and thus the input data buffer maybe released once the function returns.
443
464
*
465
+ * @note: The data I/O pointers and their associated sizes that are passed via the audio data
466
+ * pointers, can be NULL and/or 0. It is the responsibility of the low level module functions
467
+ * to handle this correctly.
468
+ *
444
469
* @param handle_tx [in/out] The handle to the module to send the input audio data to.
445
470
* @param handle_rx [in/out] The handle to the module to receive audio data from.
446
471
* @param audio_data_tx [in] Pointer to the audio data to send.
0 commit comments