no-OS
Loading...
Searching...
No Matches
stm32_tdm.h
Go to the documentation of this file.
1/***************************************************************************/
33#ifndef STM32_TDM_H_
34#define STM32_TDM_H_
35
36#include <stdint.h>
37#include "no_os_tdm.h"
38#include "stm32_hal.h"
39#include "no_os_irq.h"
40
51
59 SAI_Block_TypeDef *base;
63 //struct no_os_irq_ctrl_desc *nvic;
64};
65
82
87
88
89/* Initialize the TDM communication peripheral. */
90int32_t stm32_tdm_init(struct no_os_tdm_desc **desc,
91 const struct no_os_tdm_init_param *param);
92
93/* Free the resources allocated by stm32_tdm_init(). */
94int32_t stm32_tdm_remove(struct no_os_tdm_desc *desc);
95
96/* Write and read data to/from TDM. */
97int32_t stm32_tdm_read(struct no_os_tdm_desc *desc, void *data,
98 uint16_t bytes_number);
99
100/* Stop TDM DMA Data transfer */
101int32_t stm32_stop_tdm_transfer(struct no_os_tdm_desc *desc);
102
103/* Pause TDM DMA Data transfer */
104int32_t stm32_pause_tdm_transfer(struct no_os_tdm_desc *desc);
105
106/* Resume TDM DMA Data transfer */
107int32_t stm32_resume_tdm_transfer(struct no_os_tdm_desc *desc);
108
109
110#endif // STM32_TDM_H_
Header file of IRQ interface.
Header file of TDM Interface.
const struct no_os_tdm_platform_ops stm32_tdm_platform_ops
stm32 platform specific TDM platform ops structure
Definition stm32_tdm.c:48
int32_t stm32_tdm_init(struct no_os_tdm_desc **desc, const struct no_os_tdm_init_param *param)
Initialize the TDM communication peripheral.
Definition stm32_tdm.c:63
int32_t stm32_resume_tdm_transfer(struct no_os_tdm_desc *desc)
Resume SAI DMA transfer.
Definition stm32_tdm.c:352
int32_t stm32_tdm_remove(struct no_os_tdm_desc *desc)
Free the resources allocated by stm32_tdm_init().
Definition stm32_tdm.c:231
stm32_tdm_synchonous
Enum holding the permissible values for synchronization specific TDM parameters.
Definition stm32_tdm.h:46
@ INTERNAL_SYNC
Definition stm32_tdm.h:48
@ ASYNCHRONOUS
Definition stm32_tdm.h:47
@ EXTERNAL_SYNC
Definition stm32_tdm.h:49
int32_t stm32_tdm_read(struct no_os_tdm_desc *desc, void *data, uint16_t bytes_number)
Read data using SAI TDM mode.
Definition stm32_tdm.c:266
int32_t stm32_stop_tdm_transfer(struct no_os_tdm_desc *desc)
Stop SAI DMA transfer.
Definition stm32_tdm.c:301
int32_t stm32_pause_tdm_transfer(struct no_os_tdm_desc *desc)
Pause SAI DMA transfer.
Definition stm32_tdm.c:327
Structure describing a callback to be registered.
Definition no_os_irq.h:136
Definition no_os_irq.h:117
Structure holding TDM descriptor.
Definition no_os_tdm.h:94
Structure holding the parameters for TDM initialization.
Definition no_os_tdm.h:57
Structure holding TDM function pointers that point to the platform specific function.
Definition no_os_tdm.h:110
stm32 platform specific TDM descriptor
Definition stm32_tdm.h:70
struct no_os_irq_ctrl_desc * nvic_rx_halfcplt
Definition stm32_tdm.h:74
struct no_os_callback_desc rx_half_callback
Definition stm32_tdm.h:78
SAI_HandleTypeDef hsai
Definition stm32_tdm.h:72
struct no_os_callback_desc rx_callback
Definition stm32_tdm.h:80
struct no_os_irq_ctrl_desc * nvic_rxcplt
Definition stm32_tdm.h:76
Structure holding the initialization parameters for stm32 platform specific TDM parameters.
Definition stm32_tdm.h:57
enum stm32_tdm_synchonous synchronous
Definition stm32_tdm.h:61
SAI_Block_TypeDef * base
Definition stm32_tdm.h:59