1 /*
2  * Copyright 2014 Ettus Research LLC
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef _CLKDIST_H_
19 #define _CLKDIST_H_
20 
21 #include <stdbool.h>
22 
23 #include <octoclock.h>
24 
25 typedef enum {
26     Reg0=0, Reg1, Reg2, Reg3, Reg4, Reg5, Reg6, Reg7,
27     Reg8_Status_Control,
28     Read_Command=0xE,
29     RAM_EEPROM_Unlock=0x1F,
30     RAM_EEPROM_Lock=0x3f
31 } CDCE18005;
32 
33 typedef enum {
34     Primary_GPS,
35     Secondary_Ext
36 } TI_Input_10_MHz;
37 
38 typedef enum {
39     Lo,
40     Hi
41 } Levels;
42 
43 void setup_TI_CDCE18005(TI_Input_10_MHz which_input);
44 
45 void reset_TI_CDCE18005(void);
46 
47 uint32_t get_TI_CDCE18005(CDCE18005 which_register);
48 
49 void set_TI_CDCE18005(CDCE18005 which_register, uint32_t bits);
50 
51 bool check_TI_CDCE18005(TI_Input_10_MHz which_input, CDCE18005 which_register);
52 
53 #endif /* _CLKDIST_H_ */
54