no-OS
Functions
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 tdm.c:

Functions

int32_t tdm_init (struct tdm_desc **desc, const struct tdm_init_param *param)
 Initialize the TDM communication peripheral. More...
 
int32_t tdm_remove (struct tdm_desc *desc)
 Free the resources allocated by tdm_init(). More...
 
int32_t tdm_read (struct tdm_desc *desc, void *data, uint16_t nb_samples)
 Read data using the TDM interface. More...
 
int32_t tdm_write (struct tdm_desc *desc, void *data, uint16_t nb_samples)
 Write data using the TDM interface. More...
 

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.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ tdm_init()

int32_t tdm_init ( struct tdm_desc **  desc,
const struct tdm_init_param param 
)

Initialize the TDM communication peripheral.

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

◆ tdm_read()

int32_t tdm_read ( struct 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
SUCCESS in case of success, negative error code otherwise.

◆ tdm_remove()

int32_t tdm_remove ( struct tdm_desc desc)

Free the resources allocated by tdm_init().

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

◆ tdm_write()

int32_t tdm_write ( struct 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
SUCCESS in case of success, negative error code otherwise.