Go to the source code of this file.
Defines | |
| #define | ADS8320_CLK PIN_B6 |
| #define | ADS8320_CS PIN_B5 |
| #define | ADS8320_DOUT PIN_B7 |
Functions | |
| float | convert_to_volts (long data) |
| void | init_ext_adc () |
| long | read_ext_adc () |
|
|
Definition at line 21 of file ads8320.h. Referenced by init_ext_adc(), and read_ext_adc(). |
|
|
Definition at line 23 of file ads8320.h. Referenced by init_ext_adc(), and read_ext_adc(). |
|
|
Definition at line 22 of file ads8320.h. Referenced by read_ext_adc(). |
|
|
Definition at line 59 of file ads8320.h. 00059 {
00060
00061 return ((float)data*5.0/0xffff);
00062 }
|
|
|
Definition at line 28 of file ads8320.h. References ADS8320_CLK, and ADS8320_CS. 00028 {
00029 output_high(ADS8320_CS);
00030 output_high(ADS8320_CLK);
00031 }
|
|
|
Definition at line 34 of file ads8320.h. References ADS8320_CLK, ADS8320_CS, and ADS8320_DOUT. 00034 {
00035 int i;
00036 long data;
00037
00038 data=0;
00039 output_low(ADS8320_CS);
00040 for(i=0;i<=5;i++) // take sample and send start bit
00041 {
00042 output_low(ADS8320_CLK);
00043 delay_us(1);
00044 output_high(ADS8320_CLK);
00045 delay_us(1);
00046 }
00047 for(i=0;i<16;++i) { // send sample over spi
00048 output_low(ADS8320_CLK);
00049 delay_us(1);
00050 shift_left(&data,2,input(ADS8320_DOUT));
00051 output_high(ADS8320_CLK);
00052 delay_us(1);
00053 }
00054
00055 output_high(ADS8320_CS);
00056 return(data);
00057 }
|
1.3.9.1