File indexing completed on 2025-05-11 08:23:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef LIBBSP_ARM_SHARED_LPC_I2S_H
0037 #define LIBBSP_ARM_SHARED_LPC_I2S_H
0038
0039 #include <bsp/utility.h>
0040
0041 #ifdef __cplusplus
0042 extern "C" {
0043 #endif
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 typedef struct {
0060 uint32_t dao;
0061 uint32_t dai;
0062 uint32_t txfifo;
0063 uint32_t rxfifo;
0064 uint32_t state;
0065 uint32_t dma [2];
0066 uint32_t irq;
0067 uint32_t txrate;
0068 uint32_t rxrate;
0069 } lpc_i2s;
0070
0071
0072
0073
0074
0075
0076
0077 #define I2S_DAIO_WORDWIDTH(val) BSP_FLD32(val, 0, 1)
0078 #define I2S_DAIO_MONO BSP_BIT32(2)
0079 #define I2S_DAIO_STOP BSP_BIT32(3)
0080 #define I2S_DAIO_RESET BSP_BIT32(4)
0081 #define I2S_DAIO_WS_SEL BSP_BIT32(5)
0082 #define I2S_DAIO_WS_HALFPERIOD(val) BSP_FLD32(val, 6, 14)
0083 #define I2S_DAIO_MUTE BSP_BIT32(15)
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093 #define I2S_STATE_IRQ BSP_BIT32(0)
0094 #define I2S_STATE_DMAREQ_0 BSP_BIT32(1)
0095 #define I2S_STATE_DMAREQ_1 BSP_BIT32(2)
0096 #define I2S_STATE_RX_LEVEL_GET(reg) BSP_FLD32GET(reg, 8, 11)
0097 #define I2S_STATE_TX_LEVEL_GET(reg) BSP_FLD32GET(reg, 16, 19)
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107 #define I2S_DMA_RX_ENABLE BSP_BIT32(0)
0108 #define I2S_DMA_TX_ENABLE BSP_BIT32(1)
0109 #define I2S_DMA_RX_DEPTH(val) BSP_FLD32(val, 8, 11)
0110 #define I2S_DMA_TX_DEPTH(val) BSP_FLD32(val, 16, 19)
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120 #define I2S_IRQ_RX BSP_BIT32(0)
0121 #define I2S_IRQ_TX BSP_BIT32(1)
0122 #define I2S_IRQ_RX_DEPTH(val) BSP_FLD32(val, 8, 11)
0123 #define I2S_IRQ_TX_DEPTH(val) BSP_FLD32(val, 16, 19)
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133 #define LPC24XX_I2S_RATE(val) BSP_FLD32(val, 0, 9)
0134 #define LPC32XX_I2S_RATE_X_DIVIDER(val) BSP_FLD32(val, 0, 7)
0135 #define LPC32XX_I2S_RATE_Y_DIVIDER(val) BSP_FLD32(val, 8, 15)
0136
0137
0138
0139
0140
0141 #ifdef __cplusplus
0142 }
0143 #endif
0144
0145 #endif