RTEMS 6.1-rc2
Loading...
Searching...
No Matches
lpc-i2s.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
11/*
12 * Copyright (c) 2010 embedded brains GmbH & Co. KG
13 *
14 * Redistribution and use in source and binary forms, with or without
15 * modification, are permitted provided that the following conditions
16 * are met:
17 * 1. Redistributions of source code must retain the above copyright
18 * notice, this list of conditions and the following disclaimer.
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 * POSSIBILITY OF SUCH DAMAGE.
34 */
35
36#ifndef LIBBSP_ARM_SHARED_LPC_I2S_H
37#define LIBBSP_ARM_SHARED_LPC_I2S_H
38
39#include <bsp/utility.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
59typedef struct {
60 uint32_t dao;
61 uint32_t dai;
62 uint32_t txfifo;
63 uint32_t rxfifo;
64 uint32_t state;
65 uint32_t dma [2];
66 uint32_t irq;
67 uint32_t txrate;
68 uint32_t rxrate;
69} lpc_i2s;
70
77#define I2S_DAIO_WORDWIDTH(val) BSP_FLD32(val, 0, 1)
78#define I2S_DAIO_MONO BSP_BIT32(2)
79#define I2S_DAIO_STOP BSP_BIT32(3)
80#define I2S_DAIO_RESET BSP_BIT32(4)
81#define I2S_DAIO_WS_SEL BSP_BIT32(5)
82#define I2S_DAIO_WS_HALFPERIOD(val) BSP_FLD32(val, 6, 14)
83#define I2S_DAIO_MUTE BSP_BIT32(15)
84
93#define I2S_STATE_IRQ BSP_BIT32(0)
94#define I2S_STATE_DMAREQ_0 BSP_BIT32(1)
95#define I2S_STATE_DMAREQ_1 BSP_BIT32(2)
96#define I2S_STATE_RX_LEVEL_GET(reg) BSP_FLD32GET(reg, 8, 11)
97#define I2S_STATE_TX_LEVEL_GET(reg) BSP_FLD32GET(reg, 16, 19)
98
107#define I2S_DMA_RX_ENABLE BSP_BIT32(0)
108#define I2S_DMA_TX_ENABLE BSP_BIT32(1)
109#define I2S_DMA_RX_DEPTH(val) BSP_FLD32(val, 8, 11)
110#define I2S_DMA_TX_DEPTH(val) BSP_FLD32(val, 16, 19)
111
120#define I2S_IRQ_RX BSP_BIT32(0)
121#define I2S_IRQ_TX BSP_BIT32(1)
122#define I2S_IRQ_RX_DEPTH(val) BSP_FLD32(val, 8, 11)
123#define I2S_IRQ_TX_DEPTH(val) BSP_FLD32(val, 16, 19)
124
133#define LPC24XX_I2S_RATE(val) BSP_FLD32(val, 0, 9)
134#define LPC32XX_I2S_RATE_X_DIVIDER(val) BSP_FLD32(val, 0, 7)
135#define LPC32XX_I2S_RATE_Y_DIVIDER(val) BSP_FLD32(val, 8, 15)
136
141#ifdef __cplusplus
142}
143#endif /* __cplusplus */
144
145#endif /* LIBBSP_ARM_SHARED_LPC_I2S_H */
This header file provides utility macros for BSPs.
I2S control block.
Definition: lpc-i2s.h:59