I2SLPF3.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 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  */
236 #ifndef ti_drivers_i2s_I2SLPF3__include
237 #define ti_drivers_i2s_I2SLPF3__include
238 
239 #include <stdint.h>
240 #include <stdbool.h>
241 
242 #include <ti/drivers/I2S.h>
244 #include <ti/drivers/dpl/HwiP.h>
245 #include <ti/drivers/Power.h>
246 
247 #include <ti/devices/DeviceFamily.h>
248 #include DeviceFamily_constructPath(inc/hw_ckmd.h)
249 
250 #ifdef __cplusplus
251 extern "C" {
252 #endif
253 
262 typedef enum
263 {
264  I2SLPF3_AFCLK_SRC_CLKREF = CKMD_AFCLKSEL_SRC_CLKREF,
265  I2SLPF3_AFCLK_SRC_CLKHF = CKMD_AFCLKSEL_SRC_CLKHF,
266  I2SLPF3_AFCLK_SRC_CLKAF = CKMD_AFCLKSEL_SRC_CLKAF,
268 
296 typedef struct
297 {
298  I2SLPF3_AfclkSrc afclkSrc;
300  uint_least8_t sd1Pin;
301  uint_least8_t sd1PinMux;
302  uint_least8_t sd0Pin;
303  uint_least8_t sd0PinMux;
304  uint_least8_t sckPin;
305  uint_least8_t sckPinMux;
306  uint_least8_t cclkPin;
307  uint_least8_t cclkPinMux;
308  uint_least8_t wsPin;
309  uint_least8_t wsPinMux;
310  uint8_t intPriority;
312 
320 typedef struct
321 {
322  uint8_t numberOfChannelsUsed;
323  I2S_ChannelConfig channelsUsed;
324  I2S_DataInterfaceUse interfaceConfig;
325 } I2SLPF3_DataInterface;
335 typedef struct
336 {
338  uint16_t memoryStep;
339 
343  uint16_t delay;
344 
346  I2S_Callback callback;
347 
349  I2S_RegUpdate pointerSet;
350 
352  I2S_StopInterface stopInterface;
353 
355  I2S_Transaction *activeTransfer;
356 } I2SLPF3_Interface;
369 typedef void (*I2SLPF3_PtrUpdate)(I2S_Handle handle, I2SLPF3_Interface *interface);
370 
376 typedef struct
377 {
379  bool isOpen;
380 
385  bool invertWS;
386 
393  uint32_t memorySlotLength;
394 
404  uint8_t dataShift;
405 
407  uint8_t bitsPerWord;
408 
412  uint8_t beforeWordPadding;
413 
417  uint8_t afterWordPadding;
418 
425  uint16_t dmaBuffSizeConfig;
426 
428  I2S_SamplingEdge samplingEdge;
429 
431  I2S_Role moduleRole;
432 
434  I2S_PhaseType phaseType;
435 
437  uint16_t CCLKDivider;
438 
440  uint16_t SCKDivider;
441 
443  uint16_t WSDivider;
444 
446  uint16_t startUpDelay;
447 
449  I2SLPF3_DataInterface dataInterfaceSD0;
450 
452  I2SLPF3_DataInterface dataInterfaceSD1;
453 
454  /*
455  * I2S SYS/BIOS objects
456  */
458  HwiP_Struct hwi;
459 
461  I2SLPF3_PtrUpdate ptrUpdateFxn;
462 
464  I2SLPF3_Interface read;
465 
467  I2SLPF3_Interface write;
468 
470  I2S_Callback errorCallback;
471 
472  /*
473  * I2S pre and post notification functions
474  */
476  void *i2sPreFxn;
477 
479  void *i2sPostFxn;
480 
482  Power_NotifyObj i2sPreObj;
483 
485  Power_NotifyObj i2sPostObj;
486 
490  volatile bool i2sPowerConstraint;
491 
492 } I2SLPF3_Object;
495 #ifdef __cplusplus
496 }
497 #endif
498 
499 #endif /* ti_drivers_i2s_I2SLPF3__include */
uint_least8_t wsPin
Definition: I2SLPF3.h:308
uint_least8_t sd1PinMux
Definition: I2SLPF3.h:301
HwiP structure.
Definition: HwiP.h:78
PowerLPF3_AfoscFreq afoscFreq
Definition: I2SLPF3.h:299
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
Definition: I2SLPF3.h:265
Power Manager.
uint_least8_t cclkPinMux
Definition: I2SLPF3.h:307
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
Semaphore module for the RTOS Porting Interface.
uint8_t intPriority
Definition: I2SLPF3.h:310
I2S_Role
I2S controller / target selection.
Definition: I2S.h:756
uint_least8_t sckPinMux
Definition: I2SLPF3.h:305
uint_least8_t sd1Pin
Definition: I2SLPF3.h:300
PowerLPF3_AfoscFreq
The possible frequencies to configure the AFOSC to.
Definition: PowerCC27XX.h:364
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 cclkPin
Definition: I2SLPF3.h:306
Definition: I2SLPF3.h:266
Definition: I2SLPF3.h:264
I2S Hardware attributes.
Definition: I2SLPF3.h:296
I2SLPF3_AfclkSrc
Audio Frequency Clock Source.
Definition: I2SLPF3.h:262
uint_least8_t sd0Pin
Definition: I2SLPF3.h:302
uint_least8_t sckPin
Definition: I2SLPF3.h:304
uint_least8_t wsPinMux
Definition: I2SLPF3.h:309
I2S transaction descriptor.
Definition: I2S.h:679
uint_least8_t sd0PinMux
Definition: I2SLPF3.h:303
Hardware Interrupt module for the RTOS Porting Interface.
I2SLPF3_AfclkSrc afclkSrc
Definition: I2SLPF3.h:298
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale