I2SWFF3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025 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  */
337 #ifndef ti_drivers_i2s_I2SWFF3__include
338 #define ti_drivers_i2s_I2SWFF3__include
339 
340 #include <stdint.h>
341 #include <stdbool.h>
342 
343 #include <ti/drivers/I2S.h>
345 #include <ti/drivers/dpl/HwiP.h>
346 #include <ti/drivers/Power.h>
347 
348 #include <ti/devices/DeviceFamily.h>
349 #include DeviceFamily_constructPath(driverlib/i2s.h)
350 
351 #ifdef __cplusplus
352 extern "C" {
353 #endif
354 
363 typedef enum
364 {
366  I2SWFF3_CLK_SRC_SOC_CLK = I2S_CLK_SRC_SOC_CLK,
368  I2SWFF3_CLK_SRC_SOC_PLL_CLK = I2S_CLK_SRC_SOC_PLL_CLK,
370  I2SWFF3_CLK_SRC_HFXT_CLK = I2S_CLK_SRC_HFXT_CLK,
372 
380 typedef struct
381 {
385  uint32_t tref:21;
387  uint32_t reserved0:11;
393  uint32_t delta:17;
395  uint32_t deltaSign:1;
397  uint32_t reserved1:2;
403  uint32_t div:10;
405  uint32_t reserved2:2;
406 
407 } I2SWFF3_ADFS;
408 
444 typedef struct
445 {
446  I2SWFF3_ClkSrc clkSrc;
448  uint32_t audioClkFreq;
450  uint_least8_t sd1Pin;
451  uint_least8_t sd1PinMux;
452  uint_least8_t sd0Pin;
453  uint_least8_t sd0PinMux;
454  uint_least8_t sckPin;
455  uint_least8_t sckPinMux;
456  uint_least8_t cclkPin;
457  uint_least8_t cclkPinMux;
458  uint_least8_t wsPin;
459  uint_least8_t wsPinMux;
460  uint8_t intPriority;
462 
470 typedef struct
471 {
472  uint8_t numberOfChannelsUsed;
473  I2S_ChannelConfig channelsUsed;
474  I2S_DataInterfaceUse interfaceConfig;
475 } I2SWFF3_DataInterface;
485 typedef struct
486 {
488  uint16_t memoryStep;
489 
493  uint16_t delay;
494 
496  I2S_Callback callback;
497 
499  I2S_RegUpdate pointerSet;
500 
502  I2S_StopInterface stopInterface;
503 
505  I2S_Transaction *activeTransfer;
506 } I2SWFF3_Interface;
519 typedef void (*I2SWFF3_PtrUpdate)(I2S_Handle handle, I2SWFF3_Interface *interface);
520 
526 typedef struct
527 {
529  volatile bool isOpen;
530 
535  bool invertWS;
536 
543  uint32_t memorySlotLength;
544 
554  uint8_t dataShift;
555 
557  uint8_t bitsPerWord;
558 
562  uint8_t beforeWordPadding;
563 
567  uint8_t afterWordPadding;
568 
575  uint16_t dmaBuffSizeConfig;
576 
578  I2S_SamplingEdge samplingEdge;
579 
581  I2S_Role moduleRole;
582 
584  I2S_PhaseType phaseType;
585 
587  uint16_t CCLKDivider;
588 
590  uint16_t SCKDivider;
591 
593  uint16_t WSDivider;
594 
596  uint16_t startUpDelay;
597 
599  I2SWFF3_DataInterface dataInterfaceSD0;
600 
602  I2SWFF3_DataInterface dataInterfaceSD1;
603 
604  /*
605  * I2S SYS/BIOS objects
606  */
608  HwiP_Struct hwi;
609 
611  I2SWFF3_PtrUpdate ptrUpdateFxn;
612 
614  I2SWFF3_Interface read;
615 
617  I2SWFF3_Interface write;
618 
620  I2S_Callback errorCallback;
621 
622  /*
623  * I2S pre and post notification functions
624  */
626  void *i2sPreFxn;
627 
629  void *i2sPostFxn;
630 
632  Power_NotifyObj i2sPreObj;
633 
635  Power_NotifyObj i2sPostObj;
636 
640  volatile bool i2sPowerConstraint;
641 
642 } I2SWFF3_Object;
645 #ifdef __cplusplus
646 }
647 #endif
648 
649 #endif /* ti_drivers_i2s_I2SWFF3__include */
uint32_t audioClkFreq
Definition: I2SWFF3.h:448
HwiP structure.
Definition: HwiP.h:166
uint_least8_t sckPin
Definition: I2SWFF3.h:454
uint_least8_t cclkPin
Definition: I2SWFF3.h:456
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:723
Power Manager.
I2SWFF3_ClkSrc clkSrc
Definition: I2SWFF3.h:446
void(* I2S_RegUpdate)(uint32_t ui32Base, uint32_t ui32NextPointer)
The definition of a function used to set the I2S register.
Definition: I2S.h:733
Definition: I2SWFF3.h:370
I2S Global configuration.
Definition: I2S.h:673
I2S_DataInterfaceUse
I2S data interface configuration.
Definition: I2S.h:836
uint_least8_t sd1PinMux
Definition: I2SWFF3.h:451
I2S_PhaseType
I2S phase setting.
Definition: I2S.h:809
uint_least8_t sckPinMux
Definition: I2SWFF3.h:455
Definition: I2SWFF3.h:366
Semaphore module for the RTOS Porting Interface.
I2S_Role
I2S controller / target selection.
Definition: I2S.h:769
Inter-Integrated Circuit Sound (I2S) Bus Driver.
uint_least8_t sd0Pin
Definition: I2SWFF3.h:452
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
uint_least8_t wsPinMux
Definition: I2SWFF3.h:459
uint_least8_t sd0PinMux
Definition: I2SWFF3.h:453
I2S_ChannelConfig
Channels used selection.
Definition: I2S.h:870
Power notify object structure.
Definition: Power.h:441
I2S_SamplingEdge
I2S sampling setting.
Definition: I2S.h:782
Definition: I2SWFF3.h:368
I2SWFF3_ADFS adfs
Definition: I2SWFF3.h:447
I2S Hardware attributes.
Definition: I2SWFF3.h:444
void(* I2S_StopInterface)(I2S_Handle handle)
The definition of a function used to stop an I2S interface.
Definition: I2S.h:741
uint_least8_t wsPin
Definition: I2SWFF3.h:458
uint_least8_t sd1Pin
Definition: I2SWFF3.h:450
Adaptive Digital Frequency Synthesizer (ADFS)
Definition: I2SWFF3.h:380
I2SWFF3_ClkSrc
Clock Source.
Definition: I2SWFF3.h:363
uint_least8_t cclkPinMux
Definition: I2SWFF3.h:457
uint8_t intPriority
Definition: I2SWFF3.h:460
I2S transaction descriptor.
Definition: I2S.h:690
Hardware Interrupt module for the RTOS Porting Interface.
© Copyright 1995-2026, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale