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>
46 #include <ti/drivers/Power.h>
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
76 typedef struct {
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  uint8_t numberOfChannelsUsed;
94  I2S_ChannelConfig channelsUsed;
95  I2S_DataInterfaceUse interfaceConfig;
96 }I2SCC26XX_DataInterface;
106 typedef struct {
107  uint16_t memoryStep;
108  uint16_t delay;
109  I2S_Callback callback;
110  I2S_RegUpdate pointerSet;
111  I2S_StopInterface stopInterface;
112  I2S_Transaction *activeTransfer;
113 }I2SCC26XX_Interface;
125 typedef void (*I2SCC26XX_PtrUpdate)(I2S_Handle handle, I2SCC26XX_Interface *interface);
126 
132 typedef struct {
133 
134  bool isOpen;
135  bool invertWS;
138  uint8_t memorySlotLength;
141  uint8_t dataShift;
148  uint8_t bitsPerWord;
149  uint8_t beforeWordPadding;
150  uint8_t afterWordPadding;
151  uint8_t dmaBuffSizeConfig;
152  I2S_SamplingEdge samplingEdge;
155  I2S_Role moduleRole;
158  I2S_PhaseType phaseType;
161  uint16_t MCLKDivider;
162  uint16_t SCKDivider;
163  uint16_t WSDivider;
164  uint16_t startUpDelay;
165  I2SCC26XX_DataInterface dataInterfaceSD0;
166  I2SCC26XX_DataInterface dataInterfaceSD1;
168  /* PIN driver state object and handle */
169  PIN_State pinState;
170  PIN_Handle hPin;
172  /* I2S SYS/BIOS objects */
173  HwiP_Struct hwi;
174  I2SCC26XX_PtrUpdate ptrUpdateFxn;
175  I2SCC26XX_Interface read;
176  I2SCC26XX_Interface write;
177  I2S_Callback errorCallback;
179  /* I2S pre and post notification functions */
180  void *i2sPreFxn;
181  void *i2sPostFxn;
182  Power_NotifyObj i2sPreObj;
183  Power_NotifyObj i2sPostObj;
184  volatile bool i2sPowerConstraint;
186 } I2SCC26XX_Object;
189 #ifdef __cplusplus
190 }
191 #endif
192 
193 #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:705
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:715
I2S Global configuration.
Definition: I2S.h:659
I2S_DataInterfaceUse
I2S data interface configuration.
Definition: I2S.h:783
I2S_PhaseType
I2S phase setting.
Definition: I2S.h:771
uint_least8_t pinSD1
Definition: I2SCC26XX.h:77
I2S_Role
I2S master / slave selection.
Definition: I2S.h:747
I2S Hardware attributes.
Definition: I2SCC26XX.h:76
uint_least8_t pinSCK
Definition: I2SCC26XX.h:79
Device-specific pin & GPIO driver for CC26xx family [def].
uint8_t intPriority
Definition: I2SCC26XX.h:82
Inter-Integrated Circuit Sound (I2S) Bus Driver.
I2S_ChannelConfig
Channels used selection.
Definition: I2S.h:799
Power notify object structure.
Definition: Power.h:443
I2S_SamplingEdge
I2S sampling setting.
Definition: I2S.h:759
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:714
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:125
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
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale