Implementation of TDM driver using STM32's SAI peripheral.
More...
#include <stdlib.h>
#include <errno.h>
#include "no_os_gpio.h"
#include "stm32_gpio.h"
#include "no_os_tdm.h"
#include "stm32_tdm.h"
#include "no_os_error.h"
#include "no_os_alloc.h"
#include "no_os_irq.h"
#include "stm32_irq.h"
#include "no_os_lf256fifo.h"
Implementation of TDM driver using STM32's SAI peripheral.
- 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
◆ stm32_pause_tdm_transfer()
Pause SAI DMA transfer.
- Parameters
-
| desc | - The TDM descriptor. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ stm32_resume_tdm_transfer()
Resume SAI DMA transfer.
- Parameters
-
| desc | - The TDM descriptor. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ stm32_stop_tdm_transfer()
Stop SAI DMA transfer.
- Parameters
-
| desc | - The TDM descriptor. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ stm32_tdm_init()
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()
Free the resources allocated by stm32_tdm_init().
- Parameters
-
| desc | - The TDM descriptor. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ stm32_tdm_platform_ops
Initial value:= {
}
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:40
int32_t stm32_resume_tdm_transfer(struct no_os_tdm_desc *desc)
Resume SAI DMA transfer.
Definition stm32_tdm.c:329
int32_t stm32_tdm_remove(struct no_os_tdm_desc *desc)
Free the resources allocated by stm32_tdm_init().
Definition stm32_tdm.c:208
int32_t stm32_stop_tdm_transfer(struct no_os_tdm_desc *desc)
Stop SAI DMA transfer.
Definition stm32_tdm.c:278
int32_t stm32_pause_tdm_transfer(struct no_os_tdm_desc *desc)
Pause SAI DMA transfer.
Definition stm32_tdm.c:304
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:243
stm32 platform specific TDM platform ops structure
stm32 specific TDM platform ops structure