I2SCC26XX.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2023, 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  */
42 #ifndef ti_drivers_i2s_I2SCC26XX__include
43 #define ti_drivers_i2s_I2SCC26XX__include
44 
45 #include <ti/drivers/I2S.h>
46 #include <ti/drivers/dpl/SemaphoreP.h>
47 #include <ti/drivers/dpl/HwiP.h>
48 #include <ti/drivers/Power.h>
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
78 typedef struct
79 {
80  uint_least8_t pinSD1;
81  uint_least8_t pinSD0;
82  uint_least8_t pinSCK;
83  uint_least8_t pinCCLK;
84  uint_least8_t pinWS;
85  uint8_t intPriority;
87 
95 typedef struct
96 {
97  uint8_t numberOfChannelsUsed;
98  I2S_ChannelConfig channelsUsed;
99  I2S_DataInterfaceUse interfaceConfig;
100 } I2SCC26XX_DataInterface;
110 typedef struct
111 {
112  uint16_t memoryStep;
113  uint16_t delay;
115  I2S_Callback callback;
116  I2S_RegUpdate pointerSet;
117  I2S_StopInterface stopInterface;
118  I2S_Transaction *activeTransfer;
119 } I2SCC26XX_Interface;
131 typedef void (*I2SCC26XX_PtrUpdate)(I2S_Handle handle, I2SCC26XX_Interface *interface);
132 
138 typedef struct
139 {
140 
141  bool isOpen;
142  bool invertWS;
145  uint8_t memorySlotLength;
149  uint8_t dataShift;
156  uint8_t bitsPerWord;
157  uint8_t beforeWordPadding;
159  uint8_t afterWordPadding;
161  uint8_t dmaBuffSizeConfig;
164  I2S_SamplingEdge samplingEdge;
167  I2S_Role moduleRole;
170  I2S_PhaseType phaseType;
173  uint16_t CCLKDivider;
174  uint16_t SCKDivider;
175  uint16_t WSDivider;
176  uint16_t startUpDelay;
177  I2SCC26XX_DataInterface dataInterfaceSD0;
178  I2SCC26XX_DataInterface dataInterfaceSD1;
180  /* I2S SYS/BIOS objects */
181  HwiP_Struct hwi;
182  I2SCC26XX_PtrUpdate ptrUpdateFxn;
183  I2SCC26XX_Interface read;
184  I2SCC26XX_Interface write;
185  I2S_Callback errorCallback;
187  /* I2S pre and post notification functions */
188  void *i2sPreFxn;
189  void *i2sPostFxn;
190  Power_NotifyObj i2sPreObj;
191  Power_NotifyObj i2sPostObj;
192  volatile bool i2sPowerConstraint;
195 } I2SCC26XX_Object;
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 #endif /* ti_drivers_i2s_I2SCC26XX__include */
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:712
uint_least8_t pinWS
Definition: I2SCC26XX.h:84
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:722
I2S Global configuration.
Definition: I2S.h:664
I2S_DataInterfaceUse
I2S data interface configuration.
Definition: I2S.h:794
I2S_PhaseType
I2S phase setting.
Definition: I2S.h:781
uint_least8_t pinSD1
Definition: I2SCC26XX.h:80
I2S_Role
I2S controller / target selection.
Definition: I2S.h:755
I2S Hardware attributes.
Definition: I2SCC26XX.h:78
uint_least8_t pinSCK
Definition: I2SCC26XX.h:82
uint8_t intPriority
Definition: I2SCC26XX.h:85
Inter-Integrated Circuit Sound (I2S) Bus Driver.
I2S_ChannelConfig
Channels used selection.
Definition: I2S.h:811
Power notify object structure.
Definition: Power.h:442
I2S_SamplingEdge
I2S sampling setting.
Definition: I2S.h:768
void(* I2S_StopInterface)(I2S_Handle handle)
The definition of a function used to stop an I2S interface.
Definition: I2S.h:730
uint_least8_t pinSD0
Definition: I2SCC26XX.h:81
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:131
uint_least8_t pinCCLK
Definition: I2SCC26XX.h:83
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:681
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale