Cosmo-Z Library  2.0.5
adc.h
1 /*
2  * adc.h
3  *
4  * Created on: 2017/10/10
5  * Author: user
6  */
7 
8 #ifndef SRC_ADC_H_
9 #define SRC_ADC_H_
10 
11 #include <stdint.h> // uint32_tなどの定義
12 
13 // ユーザ非公開のAPI関数
14 #if __cplusplus
15 extern "C" {
16 #endif
17 
18 #define ADCSPI_RDCMD (1 << 30)
19 #define ADCSPI_WRCMD (1 << 31)
20 #define ADCSPI_RDBUSY (1 << 13)
21 #define ADCSPI_WRBUSY (1 << 14)
22 #define CALIB_START (1)
23 #define CALIB_STOP (0)
24 
25 typedef enum {ADC12BIT,ADC14BIT,ADC16BIT,ADCMORE} ADCResolution;
26 
27 typedef enum {ADCDISP_HEX,ADCDISP_DEC} ADCDISP;
28 typedef enum {ADCCHIP_ADNONE,ADCCHIP_AD9633,ADCCHIP_AD9253,ADCCHIP_AD9653} ADCCHIP;
29 
30 typedef struct t_adc_settings {
31  int board_num;
32  int freq;
33  int div;
34  ADCDISP dispmode;
35  int testmode;
36  int boardver;
37  double samplingfreq;
38  ADCResolution resolution;
39  int actual_adcnum;
40  ADCCHIP chip[8];
41  int maxfreq[8];
43 
44 extern t_adc_settings adc_settings;
45 
46 void check_adccommand();
47 
48 #if __cplusplus
49 }
50 #endif
51 
52 #endif /* SRC_ADC_H_ */
Definition: adc.h:30