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  */
197 #ifndef ti_drivers_i2s_I2SCC26XX__include
198 #define ti_drivers_i2s_I2SCC26XX__include
199 
200 #include <ti/drivers/I2S.h>
202 #include <ti/drivers/dpl/HwiP.h>
203 #include <ti/drivers/Power.h>
204 
205 #ifdef __cplusplus
206 extern "C" {
207 #endif
208 
233 typedef struct
234 {
235  uint_least8_t pinSD1;
236  uint_least8_t pinSD0;
237  uint_least8_t pinSCK;
238  uint_least8_t pinCCLK;
239  uint_least8_t pinWS;
240  uint8_t intPriority;
242 
250 typedef struct
251 {
252  uint8_t numberOfChannelsUsed;
253  I2S_ChannelConfig channelsUsed;
254  I2S_DataInterfaceUse interfaceConfig;
255 } I2SCC26XX_DataInterface;
265 typedef struct
266 {
268  uint16_t memoryStep;
269 
273  uint16_t delay;
274 
276  I2S_Callback callback;
277 
279  I2S_RegUpdate pointerSet;
280 
282  I2S_StopInterface stopInterface;
283 
285  I2S_Transaction *activeTransfer;
286 } I2SCC26XX_Interface;
298 typedef void (*I2SCC26XX_PtrUpdate)(I2S_Handle handle, I2SCC26XX_Interface *interface);
299 
305 typedef struct
306 {
307 
309  bool isOpen;
310 
315  bool invertWS;
316 
323  uint8_t memorySlotLength;
324 
334  uint8_t dataShift;
335 
337  uint8_t bitsPerWord;
338 
342  uint8_t beforeWordPadding;
343 
347  uint8_t afterWordPadding;
348 
355  uint8_t dmaBuffSizeConfig;
356 
358  I2S_SamplingEdge samplingEdge;
359 
361  I2S_Role moduleRole;
362 
364  I2S_PhaseType phaseType;
365 
367  uint16_t CCLKDivider;
368 
370  uint16_t SCKDivider;
371 
373  uint16_t WSDivider;
374 
376  uint16_t startUpDelay;
377 
379  I2SCC26XX_DataInterface dataInterfaceSD0;
380 
382  I2SCC26XX_DataInterface dataInterfaceSD1;
383 
384  /*
385  * I2S SYS/BIOS objects
386  */
388  HwiP_Struct hwi;
389 
391  I2SCC26XX_PtrUpdate ptrUpdateFxn;
392 
394  I2SCC26XX_Interface read;
395 
397  I2SCC26XX_Interface write;
398 
400  I2S_Callback errorCallback;
401 
402  /*
403  * I2S pre and post notification functions
404  */
406  void *i2sPreFxn;
407 
409  void *i2sPostFxn;
410 
412  Power_NotifyObj i2sPreObj;
413 
415  Power_NotifyObj i2sPostObj;
416 
420  volatile bool i2sPowerConstraint;
421 
422 } I2SCC26XX_Object;
425 #ifdef __cplusplus
426 }
427 #endif
428 
429 #endif /* ti_drivers_i2s_I2SCC26XX__include */
HwiP structure.
Definition: HwiP.h:78
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:710
uint_least8_t pinWS
Definition: I2SCC26XX.h:239
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:720
I2S Global configuration.
Definition: I2S.h:662
I2S_DataInterfaceUse
I2S data interface configuration.
Definition: I2S.h:822
I2S_PhaseType
I2S phase setting.
Definition: I2S.h:796
uint_least8_t pinSD1
Definition: I2SCC26XX.h:235
Semaphore module for the RTOS Porting Interface.
I2S_Role
I2S controller / target selection.
Definition: I2S.h:756
I2S Hardware attributes.
Definition: I2SCC26XX.h:233
uint_least8_t pinSCK
Definition: I2SCC26XX.h:237
uint8_t intPriority
Definition: I2SCC26XX.h:240
Inter-Integrated Circuit Sound (I2S) Bus Driver.
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 TI Drivers are designed to be thread safe and work seamlessly inside of a real time operating and NoRTOS with examples provided for each variant the drivers are supported by SysConfig to enable easy re configuration of the drivers par and NoRTOS</b > li< b > Thread safe APIs</b > li< b > SysConfig support</b > li< b > Example usage</b > li< b > Power management support</b > par Driver Initialization parblock TI Driver APIs follow a common initialization model This model typically consists and close the driver Unless otherwise the initialization< b > may be called multiple times by the application It is only required that the initialization is done once For drivers which have an open< b > it must be called per instance of the driver to be used Each instance of the driver corresponds to a unique index in the ref< b > Driver_config</b > Multiple software entities may use the same driver concurrently For a Bluetooth or WiFi stack may utilize a driver instance The application may concurrently use the same driver assuming it has opened a unique instance of the driver Let s examine the ADC driver for example include Driver_init h A couple observations from this code we use the that s all we need for full details on the ADC and other reference the< b > Drivers and Documentation</b > section below endparblock *******************************************************************************The Display driver is designed abstract to operations &considerations specific to a given output method *******************************************************************************< TABLE >< TR align="center">< TH > Display Driver Interface</TH >< TH > Implementations</TH ></TR >< TR align="center">< TD > ref Display h</TD >< TD > ref DisplayHost h n ref DisplayUart2 h</TD ></TR ></TABLE > *******************************************************************************< TABLE >< TR align="center">< TH > Display Driver Interface</TH >< TH > Implementations</TH ></TR >< TR align="center">< TD > ref Display h</TD >< TD > ref DisplaySharp h n ref DisplayHost h n ref DisplayExt h n ref DisplayUart2 h</TD ></TR ></TABLE > *******************************************************************************Logging is a lightweight framework for instrumenting target code *******************************************************************************< TABLE >< TR align="center">< TH > Log Interface</TH >< TH > Sinks</TH ></TR >< TR align="center">< TD >< a class="el" href="../../../tiutils/html/group__ti__log__LOG.html"> Log h</a ></TD >< TD > ref LogSinkBuf h n ref LogSinkUART h</TD ></TR ></TABLE > *******************************************************************************< TABLE >< TR align="center">< TH > Log Interface</TH >< TH > Sinks</TH ></TR >< TR align="center">< TD >< a class="el" href="../../../tiutils/html/group__ti__log__LOG.html"> Log h</a ></TD >< TD > ref LogSinkBuf h n ref LogSinkUART h n ref LogSinkITM h</TD ></TR ></TABLE > *******************************************************************************The NoRTOS framework module is provided to enable use of drivers without an underlying operating system The module provides interfaces used by drivers to perform block register interrupts and more li ref NoRTOS h *******************************************************************************The Driver Porting NoRTOS</TD ></TR >< TR >< TD > ref EventP h</TD >< TD > Pendable bit event groups</TD >< TD > TI FreeRTOS</TD ></TR >< TR >< TD > ref HwiP h</TD >< TD > Hardware interrupt interface
Definition: doxygen_drivers.txt:196
I2S_ChannelConfig
Channels used selection.
Definition: I2S.h:856
Power notify object structure.
Definition: Power.h:441
I2S_SamplingEdge
I2S sampling setting.
Definition: I2S.h:769
void(* I2S_StopInterface)(I2S_Handle handle)
The definition of a function used to stop an I2S interface.
Definition: I2S.h:728
uint_least8_t pinSD0
Definition: I2SCC26XX.h:236
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:298
uint_least8_t pinCCLK
Definition: I2SCC26XX.h:238
I2S transaction descriptor.
Definition: I2S.h:679
Hardware Interrupt module for the RTOS Porting Interface.
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale