dfifo.h
Go to the documentation of this file.
1 /********************************************************************************************************
2  * @file dfifo.h
3  *
4  * @brief This is the source file for TLSR8258
5  *
6  * @author Driver Group
7  * @date May 8, 2018
8  *
9  * @par Copyright (c) 2018, Telink Semiconductor (Shanghai) Co., Ltd.
10  * All rights reserved.
11  *
12  * The information contained herein is confidential property of Telink
13  * Semiconductor (Shanghai) Co., Ltd. and is available under the terms
14  * of Commercial License Agreement between Telink Semiconductor (Shanghai)
15  * Co., Ltd. and the licensee or the terms described here-in. This heading
16  * MUST NOT be removed from this file.
17  *
18  * Licensees are granted free, non-transferable use of the information in this
19  * file under Mutual Non-Disclosure Agreement. NO WARRENTY of ANY KIND is provided.
20  * @par History:
21  * 1.initial release(DEC. 26 2018)
22  *
23  * @version A001
24  *
25  *******************************************************************************************************/
26 #ifndef DFIFO_H
27 #define DFIFO_H
28 
29 #include "register.h"
30 
31 
37 static inline void dfifo_enable_dfifo2(void)
38 {
40 }
41 
47 static inline void dfifo_disable_dfifo2(void)
48 {
50 }
51 
58 static inline void dfifo_set_dfifo0(unsigned short* pbuff,unsigned int size_buff)
59 {
60  reg_dfifo0_addr = (unsigned short)((unsigned int)pbuff);
61  reg_dfifo0_size = (size_buff>>4)-1;
62 }
63 
70 static inline void dfifo_set_dfifo1(unsigned short* pbuff,unsigned int size_buff)
71 {
72  reg_dfifo1_addr = (unsigned short)((unsigned int)pbuff);
73  reg_dfifo1_size = (size_buff>>4)-1;
74 }
75 
82 static inline void dfifo_set_dfifo2(unsigned short* pbuff,unsigned int size_buff)
83 {
84  reg_dfifo2_addr = (unsigned short)((unsigned int)pbuff);
85  reg_dfifo2_size = (size_buff>>4)-1;
86 }
87 
94 static inline void adc_config_misc_channel_buf(unsigned short* pbuff,unsigned int size_buff)
95 
96 {
97  reg_dfifo_misc_chn_addr = (unsigned short)((unsigned int)pbuff);
98  reg_dfifo_misc_chn_size = (size_buff>>4)-1;
99 
100  reg_dfifo2_wptr = 0; //clear dfifo2 write pointer
101 }
102 
110 static inline void audio_config_mic_buf(unsigned short* pbuff,unsigned int size_buff)
111 {
112  reg_dfifo_audio_addr = (unsigned short)((unsigned int)pbuff);
113  reg_dfifo_audio_size = (size_buff>>4)-1;
114 }
115 
116 #endif
117 
118 
#define reg_dfifo2_wptr
Definition: register_8258.h:984
#define reg_dfifo_mode
Definition: register_8258.h:930
static void dfifo_set_dfifo1(unsigned short *pbuff, unsigned int size_buff)
This function performs to start w/r data into/from DFIFO1.
Definition: dfifo.h:70
#define reg_dfifo2_size
Definition: register_8258.h:914
#define reg_dfifo_misc_chn_size
Definition: register_8258.h:921
#define reg_dfifo1_size
Definition: register_8258.h:909
static void adc_config_misc_channel_buf(unsigned short *pbuff, unsigned int size_buff)
This function performs to set MISC channel.
Definition: dfifo.h:94
#define reg_dfifo_misc_chn_addr
Definition: register_8258.h:920
#define reg_dfifo_audio_addr
Definition: register_8258.h:917
static void dfifo_disable_dfifo2(void)
This function performs to disable audio input of DFIFO2.
Definition: dfifo.h:47
#define reg_dfifo1_addr
Definition: register_8258.h:908
Definition: register_8258.h:934
static void audio_config_mic_buf(unsigned short *pbuff, unsigned int size_buff)
configure the mic buffer's address and size
Definition: dfifo.h:110
static void dfifo_set_dfifo0(unsigned short *pbuff, unsigned int size_buff)
This function performs to start w/r data into/from DFIFO0.
Definition: dfifo.h:58
#define reg_dfifo_audio_size
Definition: register_8258.h:918
static void dfifo_enable_dfifo2(void)
This function performs to enable audio input of DFIFO2.
Definition: dfifo.h:37
static void dfifo_set_dfifo2(unsigned short *pbuff, unsigned int size_buff)
This function performs to start w/r data into/from DFIFO2.
Definition: dfifo.h:82
#define reg_dfifo2_addr
Definition: register_8258.h:913
#define reg_dfifo0_addr
Definition: register_8258.h:904
#define reg_dfifo0_size
Definition: register_8258.h:905