no-OS
stm32_tdm.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef STM32_TDM_H_
40 #define STM32_TDM_H_
41 
42 #include <stdint.h>
43 #include "no_os_tdm.h"
44 #include "stm32_hal.h"
45 
53  SAI_Block_TypeDef *base;
54 };
55 
62  SAI_HandleTypeDef hsai;
63 };
64 
69 
70 
71 /* Initialize the TDM communication peripheral. */
72 int32_t stm32_tdm_init(struct no_os_tdm_desc **desc,
73  const struct no_os_tdm_init_param *param);
74 
75 /* Free the resources allocated by stm32_tdm_init(). */
76 int32_t stm32_tdm_remove(struct no_os_tdm_desc *desc);
77 
78 /* Write and read data to/from TDM. */
79 int32_t stm32_tdm_read(struct no_os_tdm_desc *desc, void *data,
80  uint16_t bytes_number);
81 
82 #endif // STM32_TDM_H_
NO_OS_TDM_MASTER_RX
@ NO_OS_TDM_MASTER_RX
Definition: no_os_tdm.h:54
no_os_tdm_desc::extra
void * extra
Definition: no_os_tdm.h:96
stm32_tdm_init_param::base
SAI_Block_TypeDef * base
Definition: stm32_tdm.h:53
stm32_tdm_read
int32_t stm32_tdm_read(struct no_os_tdm_desc *desc, void *data, uint16_t nb_samples)
Read data using SAI TDM mode.
Definition: stm32_tdm.c:197
no_os_tdm_init_param::fs_active_length
uint8_t fs_active_length
Definition: no_os_tdm.h:77
no_os_tdm_init_param::data_offset
uint8_t data_offset
Definition: no_os_tdm.h:69
stm32_tdm_init_param
Structure holding the initialization parameters for stm32 platform specific TDM parameters.
Definition: stm32_tdm.h:51
stm32_tdm_desc
stm32 platform specific TDM descriptor
Definition: stm32_tdm.h:60
no_os_tdm_init_param::fs_lastbit
bool fs_lastbit
Definition: no_os_tdm.h:79
stm32_tdm_platform_ops
const struct no_os_tdm_platform_ops stm32_tdm_platform_ops
stm32 specific TDM platform ops structure
Definition: stm32_tdm.c:50
NO_OS_TDM_SLAVE_RX
@ NO_OS_TDM_SLAVE_RX
Definition: no_os_tdm.h:56
stm32_tdm_platform_ops
const struct no_os_tdm_platform_ops stm32_tdm_platform_ops
stm32 platform specific TDM platform ops structure
Definition: stm32_tdm.c:50
stm32_tdm_init
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:62
no_os_tdm_init_param::mode
enum no_os_tdm_mode mode
Definition: no_os_tdm.h:65
no_os_tdm_desc
Structure holding TDM descriptor.
Definition: no_os_tdm.h:92
no_os_error.h
Error codes definition.
no_os_tdm_init_param::fs_active_low
bool fs_active_low
Definition: no_os_tdm.h:75
no_os_tdm_platform_ops
Structure holding TDM function pointers that point to the platform specific function.
Definition: no_os_tdm.h:104
stm32_tdm.h
Header file for the stm32 tdm driver.
stm32_tdm_init
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:62
stm32_tdm_desc::hsai
SAI_HandleTypeDef hsai
Definition: stm32_tdm.h:62
no_os_tdm_init_param::data_lsb_first
bool data_lsb_first
Definition: no_os_tdm.h:71
NO_OS_TDM_SLAVE_TX
@ NO_OS_TDM_SLAVE_TX
Definition: no_os_tdm.h:55
no_os_tdm_init_param::extra
void * extra
Definition: no_os_tdm.h:85
stm32_tdm_remove
int32_t stm32_tdm_remove(struct no_os_tdm_desc *desc)
Free the resources allocated by stm32_tdm_init().
Definition: stm32_tdm.c:175
NO_OS_TDM_MASTER_TX
@ NO_OS_TDM_MASTER_TX
Definition: no_os_tdm.h:53
no_os_tdm_platform_ops::tdm_ops_init
int32_t(* tdm_ops_init)(struct no_os_tdm_desc **, const struct no_os_tdm_init_param *)
Definition: no_os_tdm.h:106
stm32_gpio.h
Header file for stm32 gpio specifics.
stm32_tdm_read
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:197
stm32_tdm_remove
int32_t stm32_tdm_remove(struct no_os_tdm_desc *desc)
Free the resources allocated by stm32_tdm_init().
Definition: stm32_tdm.c:175
no_os_tdm_init_param::data_size
uint8_t data_size
Definition: no_os_tdm.h:67
no_os_tdm_init_param
Structure holding the parameters for TDM initialization.
Definition: no_os_tdm.h:63
no_os_tdm_init_param::slots_per_frame
uint8_t slots_per_frame
Definition: no_os_tdm.h:73
no_os_gpio.h
Header file of GPIO Interface.
no_os_tdm.h
Header file of TDM Interface.
stm32_hal.h
no_os_tdm_init_param::rising_edge_sampling
bool rising_edge_sampling
Definition: no_os_tdm.h:81
errno.h
Error macro definition for ARM Compiler.