no-OS
Loading...
Searching...
No Matches
stm32_tdm.h File Reference

Header file for the stm32 tdm driver. More...

#include <stdint.h>
#include "no_os_tdm.h"
#include "stm32_hal.h"
#include "no_os_irq.h"
Include dependency graph for stm32_tdm.h:

Classes

struct  stm32_tdm_init_param
 Structure holding the initialization parameters for stm32 platform specific TDM parameters. More...
 
struct  stm32_tdm_desc
 stm32 platform specific TDM descriptor More...
 

Enumerations

enum  stm32_tdm_synchonous {
  ASYNCHRONOUS ,
  INTERNAL_SYNC ,
  EXTERNAL_SYNC
}
 Enum holding the permissible values for synchronization specific TDM parameters. More...
 

Functions

int32_t stm32_tdm_init (struct no_os_tdm_desc **desc, const struct no_os_tdm_init_param *param)
 Initialize the TDM communication peripheral.
 
int32_t stm32_tdm_remove (struct no_os_tdm_desc *desc)
 Free the resources allocated by stm32_tdm_init().
 
int32_t stm32_tdm_read (struct no_os_tdm_desc *desc, void *data, uint16_t bytes_number)
 Read data using SAI TDM mode.
 
int32_t stm32_stop_tdm_transfer (struct no_os_tdm_desc *desc)
 Stop SAI DMA transfer.
 
int32_t stm32_pause_tdm_transfer (struct no_os_tdm_desc *desc)
 Pause SAI DMA transfer.
 
int32_t stm32_resume_tdm_transfer (struct no_os_tdm_desc *desc)
 Resume SAI DMA transfer.
 

Variables

const struct no_os_tdm_platform_ops stm32_tdm_platform_ops
 stm32 specific TDM platform ops structure
 

Detailed Description

Header file for the stm32 tdm driver.

Author
Darius Berghe (dariu.nosp@m.s.be.nosp@m.rghe@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2020(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Enumeration Type Documentation

◆ stm32_tdm_synchonous

Enum holding the permissible values for synchronization specific TDM parameters.

Enumerator
ASYNCHRONOUS 
INTERNAL_SYNC 
EXTERNAL_SYNC 

Function Documentation

◆ stm32_pause_tdm_transfer()

int32_t stm32_pause_tdm_transfer ( struct no_os_tdm_desc * desc)

Pause SAI DMA transfer.

Parameters
desc- The TDM descriptor.
Returns
0 in case of success, negative error code otherwise.

◆ stm32_resume_tdm_transfer()

int32_t stm32_resume_tdm_transfer ( struct no_os_tdm_desc * desc)

Resume SAI DMA transfer.

Parameters
desc- The TDM descriptor.
Returns
0 in case of success, negative error code otherwise.

◆ stm32_stop_tdm_transfer()

int32_t stm32_stop_tdm_transfer ( struct no_os_tdm_desc * desc)

Stop SAI DMA transfer.

Parameters
desc- The TDM descriptor.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
desc- The TDM descriptor.
param- The structure that contains the TDM parameters.
Returns
0 in case of success, negative error code otherwise.

◆ 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.

Parameters
desc- The TDM descriptor.
data- The buffer to fill with the received data.
nb_samples- Number of samples to read.
Returns
0 in case of success, negative error code otherwise.

◆ stm32_tdm_remove()

int32_t stm32_tdm_remove ( struct no_os_tdm_desc * desc)

Free the resources allocated by stm32_tdm_init().

Parameters
desc- The TDM descriptor.
Returns
0 in case of success, negative error code otherwise.

Variable Documentation

◆ stm32_tdm_platform_ops

const struct no_os_tdm_platform_ops stm32_tdm_platform_ops
extern

stm32 specific TDM platform ops structure

stm32 specific TDM platform ops structure