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 I2SCC26XX_HWAttrs_ {
83  uint8_t intPriority;
86 
94 typedef struct I2SCC26XX_DataInterface_ {
95  uint8_t numberOfChannelsUsed;
96  I2S_ChannelConfig channelsUsed;
97  I2S_DataInterfaceUse interfaceConfig;
98 }I2SCC26XX_DataInterface;
108 typedef struct I2SCC26XX_Interface_ {
109  uint16_t memoryStep;
110  uint16_t delay;
111  I2S_Callback callback;
112  I2S_RegUpdate pointerSet;
113  I2S_Transaction *activeTransfer;
114 }I2SCC26XX_Interface;
126 typedef void (*I2SCC26XX_PtrUpdate)(I2S_Handle handle, I2SCC26XX_Interface *interface);
127 
133 typedef struct I2SCC26XX_Object_ {
134 
135  bool isOpen;
136  bool invertWS;
139  uint8_t memorySlotLength;
142  uint8_t bitsPerWord;
143  uint8_t beforeWordPadding;
144  uint8_t afterWordPadding;
145  uint8_t dmaBuffSizeConfig;
146  I2S_SamplingEdge samplingEdge;
149  I2S_Role moduleRole;
152  I2S_PhaseType phaseType;
155  uint16_t MCLKDivider;
156  uint16_t SCKDivider;
157  uint16_t WSDivider;
158  uint16_t startUpDelay;
159  I2SCC26XX_DataInterface dataInterfaceSD0;
160  I2SCC26XX_DataInterface dataInterfaceSD1;
162  /* PIN driver state object and handle */
163  PIN_State pinState;
164  PIN_Handle hPin;
166  /* I2S SYS/BIOS objects */
167  HwiP_Struct hwi;
168  I2SCC26XX_PtrUpdate ptrUpdateFxn;
169  I2SCC26XX_Interface read;
170  I2SCC26XX_Interface write;
171  I2S_Callback errorCallback;
173  /* I2S pre and post notification functions */
174  void *i2sPreFxn;
175  void *i2sPostFxn;
176  Power_NotifyObj i2sPreObj;
177  Power_NotifyObj i2sPostObj;
178  volatile bool i2sPowerConstraint;
180 } I2SCC26XX_Object;
183 #ifdef __cplusplus
184 }
185 #endif
186 
187 #endif /* ti_drivers_i2s_I2SCC26XX__include */
uint8_t PIN_Id
Pin identifier data type.
Definition: PIN.h:577
PIN_Id pinSD0
Definition: I2SCC26XX.h:79
enum I2S_ChannelConfig_ I2S_ChannelConfig
Channels used selection.
enum I2S_Role_ I2S_Role
I2S master / slave selection.
enum I2S_SamplingEdge_ I2S_SamplingEdge
I2S sampling setting.
struct I2SCC26XX_HWAttrs_ I2SCC26XX_HWAttrs
I2S Hardware attributes.
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:686
Power Manager.
enum I2S_DataInterfaceUse_ I2S_DataInterfaceUse
I2S data interface configuration.
void(* I2S_RegUpdate)(uint32_t ui32Base, uint32_t ui32NextPointer)
The definition of a function used to set the I2S register.
Definition: I2S.h:696
PIN_Id pinMCLK
Definition: I2SCC26XX.h:81
PIN_Id pinSD1
Definition: I2SCC26XX.h:78
Device-specific pin & GPIO driver for CC26xx family [def].
PIN_Id pinWS
Definition: I2SCC26XX.h:82
uint8_t intPriority
Definition: I2SCC26XX.h:83
Inter-Integrated Circuit Sound (I2S) Bus Driver.
enum I2S_PhaseType_ I2S_PhaseType
I2S phase setting.
Power notify object structure.
Definition: Power.h:443
I2S transaction descriptor.
Definition: I2S.h:656
I2S Hardware attributes.
Definition: I2SCC26XX.h:77
underlying data structure for type PIN_State
Definition: PIN.h:707
I2S Global configuration.
Definition: I2S.h:952
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:126
PIN_Id pinSCK
Definition: I2SCC26XX.h:80
Generic PIN & GPIO driver.
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale