Mauricio Donatti / AMC7812B
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers amc7812b.h Source File

amc7812b.h

00001 /*******************************************************
00002 *
00003 * Texas Instruments AMC7812B library
00004 *
00005 * Author: Mauricio Donatti
00006 * E-mail: mauricio.donatti@lnls.br
00007 *
00008 * March 2018
00009 *
00010 *******************************************************/
00011 
00012 #include "mbed.h"
00013 
00014 //AMC7812B register map
00015 #define     LT          0x00
00016 #define     D1          0x01
00017 #define     D2          0x02
00018 #define     T_CONF      0x0A    
00019 #define     T_CONV      0x0B    
00020 #define     D1_CORR     0x21    
00021 #define     D2_CORR     0x22    
00022 #define     ADC0        0x23    
00023 #define     ADC1        0x24    
00024 #define     ADC2        0x25    
00025 #define     ADC3        0x26    
00026 #define     ADC4        0x27    
00027 #define     ADC5        0x28    
00028 #define     ADC6        0x29    
00029 #define     ADC7        0x2A    
00030 #define     ADC8        0x2B    
00031 #define     ADC9        0x2C
00032 #define     ADC10       0x2D    
00033 #define     ADC11       0x2E    
00034 #define     ADC12       0x2F    
00035 #define     ADC13       0x30    
00036 #define     ADC14       0x31    
00037 #define     ADC15       0x32    
00038 #define     DAC0        0x33    
00039 #define     DAC1        0x34    
00040 #define     DAC2        0x35    
00041 #define     DAC3        0x36    
00042 #define     DAC4        0x37    
00043 #define     DAC5        0x38    
00044 #define     DAC6        0x39    
00045 #define     DAC7        0x3A    
00046 #define     DAC8        0x3B    
00047 #define     DAC9        0x3C    
00048 #define     DAC10       0x3D    
00049 #define     DAC11       0x3E    
00050 #define     DAC0_CLR    0x3F    
00051 #define     DAC1_CLR    0x40    
00052 #define     DAC2_CLR    0x41    
00053 #define     DAC3_CLR    0x42    
00054 #define     DAC4_CLR    0x43    
00055 #define     DAC5_CLR    0x44    
00056 #define     DAC6_CLR    0x45    
00057 #define     DAC7_CLR    0x46    
00058 #define     DAC8_CLR    0x47    
00059 #define     DAC9_CLR    0x48    
00060 #define     DAC10_CLR   0x49    
00061 #define     DAC11_CLR   0x4A    
00062 #define     GPIO        0x4B    
00063 #define     CONF0       0x4C    
00064 #define     CONF1       0x4D    
00065 #define     ALARM       0x4E    
00066 #define     STATUS      0x4F    
00067 #define     ADC_CH0     0x50    
00068 #define     ADC_CH1     0x51    
00069 #define     ADC_GAIN        0x52    
00070 #define     AUTO_DAC_CLR    0x53    
00071 #define     AUTO_DAC_CLR_EN 0x54    
00072 #define     SW_DAC_CLR      0x55    
00073 #define     HW_DAC_CLR0     0x56    
00074 #define     HW_DAC_CLR1     0x57    
00075 #define     DAC_CONF        0x58    
00076 #define     DAC_GAIN        0x59    
00077 #define     IN0_HIGH_TH     0x5A    
00078 #define     IN0_LOW_TH      0x5B    
00079 #define     IN1_HIGH_TH     0x5C    
00080 #define     IN1_LOW_TH      0x5D    
00081 #define     IN2_HIGH_TH     0x5E    
00082 #define     IN2_LOW_TH      0x5F    
00083 #define     IN3_HIGH_TH     0x60    
00084 #define     IN3_LOW_TH      0x61    
00085 #define     LT_HIGH_TH      0x62    
00086 #define     LT_LOW_TH       0x63    
00087 #define     D1_HIGH_TH      0x64    
00088 #define     D1_LOW_TH       0x65    
00089 #define     D2_HIGH_TH      0x66    
00090 #define     D2_LOW_TH       0x67    
00091 #define     HYST0           0x68    
00092 #define     HYST1           0x69    
00093 #define     HYST2           0x6A    
00094 #define     PWR_DOWN        0x6B    
00095 #define     ID              0x6C    
00096 #define     SW_RESET        0x7C        
00097 
00098 //OLD FUNCTIONS
00099 //They are not used anymore - New functions inside main.cpp are more efficient
00100 
00101 /*
00102 void AMC_write(SPI spi, DigitalOut cs, uint8_t reg,uint8_t* data);
00103 
00104 void AMC_read(SPI spi, DigitalOut cs, uint8_t reg,uint8_t* data);
00105 
00106 void AMC_read_fast(SPI spi, DigitalOut cs, uint8_t reg,uint8_t* data);
00107 
00108 void AMC_my_read(SPI spi, DigitalOut cs, uint8_t reg,uint8_t* data);
00109 */