TI-RTOS Drivers  tidrivers_full_2_20_00_08
Codec1.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2016 Texas Instruments Incorporated
3  *
4  * All rights reserved not granted herein.
5  *
6  * Limited License.
7  *
8  * Texas Instruments Incorporated grants a world-wide, royalty-free,
9  * non-exclusive license under copyrights and patents it now or hereafter
10  * owns or controls to make, have made, use, import, offer to sell and sell
11  * ("Utilize") this software subject to the terms herein. With respect to the
12  * foregoing patent license, such license is granted solely to the extent that
13  * any such patent is necessary to Utilize the software alone. The patent
14  * license shall not apply to any combinations which include this software,
15  * other than combinations with devices manufactured by or for TI
16  * ("TI Devices"). No hardware patent is licensed hereunder.
17  *
18  * Redistributions must preserve existing copyright notices and reproduce
19  * this license (including the above copyright notice and the disclaimer and
20  * (if applicable) source code license limitations below) in the documentation
21  * and/or other materials provided with the distribution
22  *
23  * Redistribution and use in binary form, without modification, are permitted
24  * provided that the following conditions are met:
25  *
26  * * No reverse engineering, decompilation, or disassembly of this software is
27  * permitted with respect to any software provided in binary form.
28  *
29  * * any redistribution and use are licensed by TI for use only with TI Devices.
30  *
31  * * Nothing shall obligate TI to provide you with source code for the software
32  * licensed and provided to you in object code.
33  *
34  * If software source code is provided to you, modification and redistribution
35  * of the source code are permitted provided that the following conditions are
36  * met:
37  *
38  * * any redistribution and use of the source code, including any resulting
39  * derivative works, are licensed by TI for use only with TI Devices.
40  *
41  * * any redistribution and use of any object code compiled from the source
42  * code and any resulting derivative works, are licensed by TI for use only
43  * with TI Devices.
44  *
45  * Neither the name of Texas Instruments Incorporated nor the names of its
46  * suppliers may be used to endorse or promote products derived from this
47  * software without specific prior written permission.
48  *
49  * DISCLAIMER.
50  *
51  * THIS SOFTWARE IS PROVIDED BY TI AND TI'S LICENSORS "AS IS" AND ANY EXPRESS
52  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
53  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
54  * NO EVENT SHALL TI AND TI'S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT,
55  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
56  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
58  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
59  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
60  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
61  */
62 
73 #ifndef ti_drivers_pdm_Codec1__include
74 #define ti_drivers_pdm_Codec1__include
75 
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79 
80 #include <stdint.h>
81 
82 
90 extern uint8_t Codec1_encodeSingle(int16_t audSample);
91 
92 
100 extern int16_t Codec1_decodeSingle(uint8_t nibble_4bits);
101 
119 extern uint8_t Codec1_encodeBuff(uint8_t* dst, int16_t* src, int16_t srcSize, int8_t *si, int16_t *pv);
120 
136 extern void Codec1_decodeBuff(int16_t* dst, uint8_t* src, unsigned srcSize, int8_t *si, int16_t *pv);
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif /* ti_drivers_pdm_Codec1__include */
void Codec1_decodeBuff(int16_t *dst, uint8_t *src, unsigned srcSize, int8_t *si, int16_t *pv)
This routine decodes a buffer with TI codec Type 1.
uint8_t Codec1_encodeBuff(uint8_t *dst, int16_t *src, int16_t srcSize, int8_t *si, int16_t *pv)
This routine encode a buffer with TI codec Type 1.
uint8_t Codec1_encodeSingle(int16_t audSample)
This routine encodes one int16 sample with TI Codec Type 1.
int16_t Codec1_decodeSingle(uint8_t nibble_4bits)
This routine decode a 4-bit nibble sample to a uint16 PCM audio sample.
Copyright 2016, Texas Instruments Incorporated