no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
48 SAI_Block_TypeDef *base;
50 //struct no_os_irq_ctrl_desc *nvic;
51};
52
69
74
75
76/* Initialize the TDM communication peripheral. */
77int32_t stm32_tdm_init(struct no_os_tdm_desc **desc,
78 const struct no_os_tdm_init_param *param);
79
80/* Free the resources allocated by stm32_tdm_init(). */
81int32_t stm32_tdm_remove(struct no_os_tdm_desc *desc);
82
83/* Write and read data to/from TDM. */
84int32_t stm32_tdm_read(struct no_os_tdm_desc *desc, void *data,
85 uint16_t bytes_number);
86
87/* Stop TDM DMA Data transfer */
88int32_t stm32_stop_tdm_transfer(struct no_os_tdm_desc *desc);
89
90/* Pause TDM DMA Data transfer */
91int32_t stm32_pause_tdm_transfer(struct no_os_tdm_desc *desc);
92
93/* Resume TDM DMA Data transfer */
94int32_t stm32_resume_tdm_transfer(struct no_os_tdm_desc *desc);
95
96
97#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:339
int32_t stm32_tdm_remove(struct no_os_tdm_desc *desc)
Free the resources allocated by stm32_tdm_init().
Definition stm32_tdm.c:231
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:253
int32_t stm32_stop_tdm_transfer(struct no_os_tdm_desc *desc)
Stop SAI DMA transfer.
Definition stm32_tdm.c:288
int32_t stm32_pause_tdm_transfer(struct no_os_tdm_desc *desc)
Pause SAI DMA transfer.
Definition stm32_tdm.c:314
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:92
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:108
stm32 platform specific TDM descriptor
Definition stm32_tdm.h:57
struct no_os_irq_ctrl_desc * nvic_rx_halfcplt
Definition stm32_tdm.h:61
struct no_os_callback_desc rx_half_callback
Definition stm32_tdm.h:65
SAI_HandleTypeDef hsai
Definition stm32_tdm.h:59
struct no_os_callback_desc rx_callback
Definition stm32_tdm.h:67
struct no_os_irq_ctrl_desc * nvic_rxcplt
Definition stm32_tdm.h:63
Structure holding the initialization parameters for stm32 platform specific TDM parameters.
Definition stm32_tdm.h:46
SAI_Block_TypeDef * base
Definition stm32_tdm.h:48