I2SCC26XX.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
39 #ifndef ti_drivers_i2s_I2SCC26XX__include
40 #define ti_drivers_i2s_I2SCC26XX__include
41 
42 #include <ti/drivers/I2S.h>
43 #include <ti/drivers/dpl/SemaphoreP.h>
44 #include <ti/drivers/dpl/HwiP.h>
45 #include <ti/drivers/Power.h>
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
75 typedef struct
76 {
77  uint_least8_t pinSD1;
78  uint_least8_t pinSD0;
79  uint_least8_t pinSCK;
80  uint_least8_t pinMCLK;
81  uint_least8_t pinWS;
82  uint8_t intPriority;
84 
92 typedef struct
93 {
94  uint8_t numberOfChannelsUsed;
95  I2S_ChannelConfig channelsUsed;
96  I2S_DataInterfaceUse interfaceConfig;
97 } I2SCC26XX_DataInterface;
107 typedef struct
108 {
109  uint16_t memoryStep;
110  uint16_t delay;
112  I2S_Callback callback;
113  I2S_RegUpdate pointerSet;
114  I2S_StopInterface stopInterface;
115  I2S_Transaction *activeTransfer;
116 } I2SCC26XX_Interface;
128 typedef void (*I2SCC26XX_PtrUpdate)(I2S_Handle handle, I2SCC26XX_Interface *interface);
129 
135 typedef struct
136 {
137 
138  bool isOpen;
139  bool invertWS;
142  uint8_t memorySlotLength;
146  uint8_t dataShift;
153  uint8_t bitsPerWord;
154  uint8_t beforeWordPadding;
156  uint8_t afterWordPadding;
158  uint8_t dmaBuffSizeConfig;
161  I2S_SamplingEdge samplingEdge;
164  I2S_Role moduleRole;
167  I2S_PhaseType phaseType;
170  uint16_t MCLKDivider;
171  uint16_t SCKDivider;
172  uint16_t WSDivider;
173  uint16_t startUpDelay;
174  I2SCC26XX_DataInterface dataInterfaceSD0;
175  I2SCC26XX_DataInterface dataInterfaceSD1;
177  /* I2S SYS/BIOS objects */
178  HwiP_Struct hwi;
179  I2SCC26XX_PtrUpdate ptrUpdateFxn;
180  I2SCC26XX_Interface read;
181  I2SCC26XX_Interface write;
182  I2S_Callback errorCallback;
184  /* I2S pre and post notification functions */
185  void *i2sPreFxn;
186  void *i2sPostFxn;
187  Power_NotifyObj i2sPreObj;
188  Power_NotifyObj i2sPostObj;
189  volatile bool i2sPowerConstraint;
192 } I2SCC26XX_Object;
195 #ifdef __cplusplus
196 }
197 #endif
198 
199 #endif /* ti_drivers_i2s_I2SCC26XX__include */
uint_least8_t pinMCLK
Definition: I2SCC26XX.h:80
void(* I2S_Callback)(I2S_Handle handle, int_fast16_t status, I2S_Transaction *transactionPtr)
The definition of a user-callback function used by the I2S driver.
Definition: I2S.h:707
uint_least8_t pinWS
Definition: I2SCC26XX.h:81
Power Manager.
void(* I2S_RegUpdate)(uint32_t ui32Base, uint32_t ui32NextPointer)
The definition of a function used to set the I2S register.
Definition: I2S.h:717
I2S Global configuration.
Definition: I2S.h:659
I2S_DataInterfaceUse
I2S data interface configuration.
Definition: I2S.h:789
I2S_PhaseType
I2S phase setting.
Definition: I2S.h:776
uint_least8_t pinSD1
Definition: I2SCC26XX.h:77
I2S_Role
I2S master / slave selection.
Definition: I2S.h:750
I2S Hardware attributes.
Definition: I2SCC26XX.h:75
uint_least8_t pinSCK
Definition: I2SCC26XX.h:79
uint8_t intPriority
Definition: I2SCC26XX.h:82
Inter-Integrated Circuit Sound (I2S) Bus Driver.
I2S_ChannelConfig
Channels used selection.
Definition: I2S.h:806
Power notify object structure.
Definition: Power.h:442
I2S_SamplingEdge
I2S sampling setting.
Definition: I2S.h:763
void(* I2S_StopInterface)(I2S_Handle handle)
The definition of a function used to stop an I2S interface.
Definition: I2S.h:725
uint_least8_t pinSD0
Definition: I2SCC26XX.h:78
void(* I2SCC26XX_PtrUpdate)(I2S_Handle handle, I2SCC26XX_Interface *interface)
The definition of a function used by the I2S driver to refresh the pointer.
Definition: I2SCC26XX.h:128
This file contains snippets to be used in the TI Driver s documentation *******************************************************************************TI Drivers is a collective of peripheral drivers for TI s SimpleLink portfolio The drivers are centered around a portable application programming interface(API) which enables seamless migration across the SimpleLink SDK portfolio. Unless specifically stated otherwise
[drivers_common_overview]
I2S transaction descriptor.
Definition: I2S.h:676
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale