aboutsummaryrefslogtreecommitdiffstats
path: root/octvc1/octvc1_macro.h
blob: e32515bc74ef8ad22c285f2f38067817fd980634 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\

File: OCTVC1_MACRO.h

Copyright (c) 2015 Octasic Inc. All rights reserved.

Description: 

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.


Release: OCTSDR Software Development Kit OCTSDR_GSM-02.04.00-B662 (2015/10/28)

$Revision: $

\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/

#ifndef __OCTVC1_MACRO_H__
#define __OCTVC1_MACRO_H__


/*****************************  INCLUDE FILES  *******************************/
#include "../octdev_types.h"
#include "../octdev_macro.h"
#include "octvc1_handle.h"


/************************  COMMON DEFINITIONS  *******************************/

/*-------------------------------------------------------------------------------------
 	Generic swap macros
-------------------------------------------------------------------------------------*/

                
/*--------------------------------------------------------------------------
	32-bit Endian Swapping when target is Little Endian 
----------------------------------------------------------------------------*/
#if !defined( mOCTVC1_SWAP32_IF_LE )
#define mOCTVC1_SWAP32_IF_LE( f_ulValue )  mOCT_SWAP32_IF_LE( f_ulValue )
#endif /* mOCTVC1_SWAP32_IF_LE */

/*--------------------------------------------------------------------------
	16-bit Endian Swapping when target is Little Endian 
----------------------------------------------------------------------------*/
#if !defined( mOCTVC1_SWAP16_IF_LE )
#define mOCTVC1_SWAP16_IF_LE( f_usValue ) mOCT_SWAP16_IF_LE( f_usValue )
#endif /* mOCTVC1_SWAP16_IF_LE */

/*--------------------------------------------------------------------------
	Create a TSST Identifier 
----------------------------------------------------------------------------*/

#define mOCTVC1_MAKE_TSST_ID( f_ulStream, f_ulTimeslot ) \
		( ( ((f_ulStream) & 0x1f) << 10 ) + \
			((f_ulTimeslot) & 0x3ff) )

/*--------------------------------------------------------------------------
	Get Vocoder Mask from a Vocoder Type Value
----------------------------------------------------------------------------*/
/* what 32-bit DWORD index the bit mask corresponds to */
#define mOCTVC1_GET_VOCMASK_INDEX( f_ulEncoderType ) \
	(  (((f_ulEncoderType) >> 5) & 0x3) )

/* The actual bit mask for the 32-bit index */
#define mOCTVC1_GET_VOCMASK_BIT( f_ulEncoderType ) \
	(  (1 << ((f_ulEncoderType) & 0x1F))  )
            
              

#endif /* __OCTVC1_MACRO_H__ */