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/PIN.h>
47 #include <ti/drivers/Power.h>
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
77 typedef struct {
83  uint8_t intPriority;
86 
94 typedef struct {
95  uint8_t numberOfChannelsUsed;
96  I2S_ChannelConfig channelsUsed;
97  I2S_DataInterfaceUse interfaceConfig;
98 }I2SCC26XX_DataInterface;
108 typedef struct {
109  uint16_t memoryStep;
110  uint16_t delay;
111  I2S_Callback callback;
112  I2S_RegUpdate pointerSet;
113  I2S_StopInterface stopInterface;
114  I2S_Transaction *activeTransfer;
115 }I2SCC26XX_Interface;
127 typedef void (*I2SCC26XX_PtrUpdate)(I2S_Handle handle, I2SCC26XX_Interface *interface);
128 
134 typedef struct {
135 
136  bool isOpen;
137  bool invertWS;
140  uint8_t memorySlotLength;
143  uint8_t dataShift;
150  uint8_t bitsPerWord;
151  uint8_t beforeWordPadding;
152  uint8_t afterWordPadding;
153  uint8_t dmaBuffSizeConfig;
154  I2S_SamplingEdge samplingEdge;
157  I2S_Role moduleRole;
160  I2S_PhaseType phaseType;
163  uint16_t MCLKDivider;
164  uint16_t SCKDivider;
165  uint16_t WSDivider;
166  uint16_t startUpDelay;
167  I2SCC26XX_DataInterface dataInterfaceSD0;
168  I2SCC26XX_DataInterface dataInterfaceSD1;
170  /* PIN driver state object and handle */
171  PIN_State pinState;
172  PIN_Handle hPin;
174  /* I2S SYS/BIOS objects */
175  HwiP_Struct hwi;
176  I2SCC26XX_PtrUpdate ptrUpdateFxn;
177  I2SCC26XX_Interface read;
178  I2SCC26XX_Interface write;
179  I2S_Callback errorCallback;
181  /* I2S pre and post notification functions */
182  void *i2sPreFxn;
183  void *i2sPostFxn;
184  Power_NotifyObj i2sPreObj;
185  Power_NotifyObj i2sPostObj;
186  volatile bool i2sPowerConstraint;
188 } I2SCC26XX_Object;
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 #endif /* ti_drivers_i2s_I2SCC26XX__include */
uint8_t PIN_Id
Pin identifier data type.
Definition: PIN.h:578
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:705
Power Manager.
PIN_Id pinMCLK
Definition: I2SCC26XX.h:81
void(* I2S_RegUpdate)(uint32_t ui32Base, uint32_t ui32NextPointer)
The definition of a function used to set the I2S register.
Definition: I2S.h:715
I2S Global configuration.
Definition: I2S.h:659
I2S_DataInterfaceUse
I2S data interface configuration.
Definition: I2S.h:782
I2S_PhaseType
I2S phase setting.
Definition: I2S.h:770
I2S_Role
I2S master / slave selection.
Definition: I2S.h:746
I2S Hardware attributes.
Definition: I2SCC26XX.h:77
Device-specific pin & GPIO driver for CC26xx family [def].
uint8_t intPriority
Definition: I2SCC26XX.h:83
PIN_Id pinSCK
Definition: I2SCC26XX.h:80
Inter-Integrated Circuit Sound (I2S) Bus Driver.
I2S_ChannelConfig
Channels used selection.
Definition: I2S.h:798
Power notify object structure.
Definition: Power.h:443
I2S_SamplingEdge
I2S sampling setting.
Definition: I2S.h:758
PIN_Id pinSD1
Definition: I2SCC26XX.h:78
void(* I2S_StopInterface)(I2S_Handle handle)
The definition of a function used to stop an I2S interface.
Definition: I2S.h:723
underlying data structure for type PIN_State
Definition: PIN.h:708
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:127
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:675
PIN_Id pinSD0
Definition: I2SCC26XX.h:79
Generic PIN & GPIO driver.
PIN_Id pinWS
Definition: I2SCC26XX.h:82
© Copyright 1995-2021, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale