MSP430F5529 ADC12_A初始化参考
[复制链接]
typedef struct ADC_MemMap
{
union
{
uint16_t CTL0;
struct
{
uint16_t SC :1; /* ADC12 Start Conversion */
uint16_t ENC :1; /* ADC12 Enable Conversion */
uint16_t TOVIE :1; /* ADC12 Timer Overflow interrupt enable */
uint16_t OVIE :1; /* ADC12 Overflow interrupt enable */
uint16_t ON :1; /* ADC12 On/enable */
uint16_t ADCREFON :1; /* ADC12 Reference on */
uint16_t REF2_5V :1; /* ADC12 Ref 0:1.5V / 1:2.5V */
uint16_t MSC :1; /* ADC12 Multiple SampleConversion */
uint16_t SHT0 :4; /* ADC12 Sample Hold 0 Select */
uint16_t SHT1 :4; /* ADC12 Sample Hold 1 Select */
};
};
union
{
uint16_t CTL1;
struct
{
uint16_t ADBUSY :1; /* ADC12 Busy */
uint16_t CONSEQ :2; /* ADC12 Conversion Sequence Select */
uint16_t SSEL :2; /* ADC12 Clock Source Select */
uint16_t DIV :3; /* ADC12 Clock Divider Select */
uint16_t ISSH :1; /* ADC12 Invert Sample Hold Signal */
uint16_t SHP :1; /* ADC12 Sample/Hold Pulse Mode */
uint16_t SHS :2; /* ADC12 Sample/Hold Source */
uint16_t CSTARTADD :4; /* ADC12 Conversion Start Address */
};
};
union
{
uint16_t CTL2;
struct
{
uint16_t REFBURST :1; /* ADC12+ Reference Burst */
uint16_t ADCREFOUT :1; /* ADC12+ Reference Out */
uint16_t SR :1; /* ADC12+ Sampling Rate */
uint16_t DF :1; /* ADC12+ Data Format */
uint16_t RES :2; /* ADC12+ Resolution */
uint16_t TCOFF :1; /* ADC12+ Temperature Sensor Off */
uint16_t PDIV :1; /* ADC12+ predivider 0:/1 1:/4 */
};
};
uint16_t RESERVED_1[2];
uint16_t IFG;
uint16_t IE;
uint16_t IV;
struct
{
uint8_t INCH :4; /* ADC12 Input Channel Select*/
uint8_t REF :3; /* ADC12 Select Reference */
uint8_t EOS :1; /* ADC12 End of Sequence */
}MCTL[16];
uint16_t MEM[16];
}volatile * ADC_MemMapPtr;
#define ADC12_SSEL_ADC12OSC 0
#define ADC12_SSEL_ACLK 1
#define ADC12_SSEL_MCLK 2
#define ADC12_SSEL_SMCLK 3
#define ADC12_SREF_0 0
#define ADC12_SREF_1 1
#define ADC12_SREF_2 2
#define ADC12_SREF_3 3
#define ADC12_SREF_4 4
#define ADC12_SREF_5 5
#define ADC12_SREF_6 6
#define ADC12_SREF_7 7
#define ADC_BASE_PTR ((ADC_MemMapPtr)__MSP430_BASEADDRESS_ADC12_PLUS__)
|