ACDC Senior Project v1.0.0
Senior Project for Textron Aviation
|
Implementation of the external 12-bit LTC1298 Analog to Digital Converter (ADC) More...
Macros | |
#define | ADC_TRANSMISSON_START 0b1000 /** Tells the ADC that a transmisson has started */ |
#define | ADC_MUX_MODE_SINGLE_ENDED 0b0100 /** Sets the ADC into SINGLE-ENDED Mode */ |
#define | ADC_MUX_MODE_DIFFERENTIAL 0b0000 /** Sets the ADC into DIFFERENTIAL Mode */ |
#define | ADC_MUX_CHANNEL_0 0b0000 /** Enables Recieving data from Channel 0 */ |
#define | ADC_MUX_CHANNEL_1 0b0010 /** Enables Recieving data from Channel 1 */ |
#define | ADC_MUX_MSBFIRST 0b0001 /** Sets the Recieved data format to MSB First */ |
#define | ADC_MUX_LSBFIRST 0b0000 /** Sets the Recieved data format to LSB First */ |
#define | MAX_CLOCK_SPEED 200000 /** ADC MAX Clock Freq = 200kHz {See LTC1298-14} */ |
Functions | |
LTC1298_t | LTCADC_InitCS (SPI_TypeDef *SPIx, GPIO_TypeDef *GPIOx, uint16_t GPIO_PIN) |
Initiliazes SPIx and the external LTC1298IS8 ADC. Also sets up the software CS pin for SPIx. | |
uint16_t | LTCADC_ReadCH0CS (LTC1298_t LTC_ADC) |
Reads the current ADC value on channel 0 (Software CS) | |
uint16_t | LTCADC_ReadCH1CS (LTC1298_t LTC_ADC) |
Reads the current ADC value on channel 1 (SoftwareCS) | |
Implementation of the external 12-bit LTC1298 Analog to Digital Converter (ADC)
#define ADC_MUX_CHANNEL_0 0b0000 /** Enables Recieving data from Channel 0 */ |
#define ADC_MUX_CHANNEL_1 0b0010 /** Enables Recieving data from Channel 1 */ |
#define ADC_MUX_LSBFIRST 0b0000 /** Sets the Recieved data format to LSB First */ |
#define ADC_MUX_MODE_DIFFERENTIAL 0b0000 /** Sets the ADC into DIFFERENTIAL Mode */ |
#define ADC_MUX_MODE_SINGLE_ENDED 0b0100 /** Sets the ADC into SINGLE-ENDED Mode */ |
#define ADC_MUX_MSBFIRST 0b0001 /** Sets the Recieved data format to MSB First */ |
#define ADC_TRANSMISSON_START 0b1000 /** Tells the ADC that a transmisson has started */ |
#define MAX_CLOCK_SPEED 200000 /** ADC MAX Clock Freq = 200kHz {See LTC1298-14} */ |
Initiliazes SPIx and the external LTC1298IS8 ADC. Also sets up the software CS pin for SPIx.
SPIx | SPI Peripheral (Ex. SPI1 or SPI2) |
GPIOx | GPIO Port for the chip select pin (Ex. GPIOA, GPIOB, ...) |
GPIO_PIN | Desired chip select pin on port GPIOx (Ex. GPIO_PIN_0, GPIO_PIN_1, ...) |
Reads the current ADC value on channel 0 (Software CS)
LTC_ADC | Struct containing configuration data for the ADC |