no-OS
Loading...
Searching...
No Matches
no_os_tdm.c File Reference

Implementation of the TDM interface. More...

#include <inttypes.h>
#include "no_os_tdm.h"
#include <stdlib.h>
#include "no_os_error.h"
Include dependency graph for no_os_tdm.c:

Functions

int32_t no_os_tdm_init (struct no_os_tdm_desc **desc, const struct no_os_tdm_init_param *param)
 Initialize the TDM communication peripheral.
 
int32_t no_os_tdm_remove (struct no_os_tdm_desc *desc)
 Free the resources allocated by no_os_tdm_init().
 
int32_t no_os_tdm_read (struct no_os_tdm_desc *desc, void *data, uint16_t nb_samples)
 Read data using the TDM interface.
 
int32_t no_os_tdm_pause (struct no_os_tdm_desc *desc)
 Pause TDM DMA transfer.
 
int32_t no_os_tdm_resume (struct no_os_tdm_desc *desc)
 Resume TDM DMA transfer.
 
int32_t no_os_tdm_stop (struct no_os_tdm_desc *desc)
 Stop TDM DMA transfer.
 
int32_t no_os_tdm_write (struct no_os_tdm_desc *desc, void *data, uint16_t nb_samples)
 Write data using the TDM interface.
 

Detailed Description

Implementation of the TDM interface.

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

Function Documentation

◆ no_os_tdm_init()

int32_t no_os_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.

◆ no_os_tdm_pause()

int32_t no_os_tdm_pause ( struct no_os_tdm_desc * desc)

Pause TDM DMA transfer.

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

◆ no_os_tdm_read()

int32_t no_os_tdm_read ( struct no_os_tdm_desc * desc,
void * data,
uint16_t nb_samples )

Read data using the TDM interface.

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

◆ no_os_tdm_remove()

int32_t no_os_tdm_remove ( struct no_os_tdm_desc * desc)

Free the resources allocated by no_os_tdm_init().

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

◆ no_os_tdm_resume()

int32_t no_os_tdm_resume ( struct no_os_tdm_desc * desc)

Resume TDM DMA transfer.

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

◆ no_os_tdm_stop()

int32_t no_os_tdm_stop ( struct no_os_tdm_desc * desc)

Stop TDM DMA transfer.

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

◆ no_os_tdm_write()

int32_t no_os_tdm_write ( struct no_os_tdm_desc * desc,
void * data,
uint16_t nb_samples )

Write data using the TDM interface.

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