ACDC Senior Project v1.0.0
Senior Project for Textron Aviation
Loading...
Searching...
No Matches
ACDC_LTC1451_DAC.c File Reference

Implementation of the external 12-bit LTC1451 Digital to Analog Converter (DAC) More...

#include "ACDC_LTC1451_DAC.h"
#include "ACDC_SPI.h"

Macros

#define MAX_CLOCK_SPEED   12500000UL
 

Functions

LTC1451_t LTCDAC_InitCS (SPI_TypeDef *SPIx, GPIO_TypeDef *GPIOx, uint16_t GPIO_PIN)
 Initiliazes SPIx and the external LTC1451 DAC. Also sets up the sofware CS pin for SPIx.
 
void LTCDAC_SetOutputCS (LTC1451_t LTC_DAC, uint16_t outputVal)
 Sets the DAC's ouptut voltage (0-4.095v)
 

Detailed Description

Implementation of the external 12-bit LTC1451 Digital to Analog Converter (DAC)

Author
Devin Marx
Version
0.1
Date
2024-03-21

Macro Definition Documentation

◆ MAX_CLOCK_SPEED

#define MAX_CLOCK_SPEED   12500000UL

Function Documentation

◆ LTCDAC_InitCS()

LTC1451_t LTCDAC_InitCS ( SPI_TypeDef * SPIx,
GPIO_TypeDef * GPIOx,
uint16_t GPIO_PIN )

Initiliazes SPIx and the external LTC1451 DAC. Also sets up the sofware CS pin for SPIx.

Parameters
SPIxSPI Peripheral (Ex. SPI1 or SPI2)
GPIOxGPIO Port for the chip select pin (Ex. GPIOA, GPIOB, ...)
GPIO_PINDesired chip select pin on port GPIOx (Ex. GPIO_PIN_0, GPIO_PIN_1, ...)
Returns
Struct containing all necessary data for the DAC

◆ LTCDAC_SetOutputCS()

void LTCDAC_SetOutputCS ( LTC1451_t LTC_DAC,
uint16_t outputVal )

Sets the DAC's ouptut voltage (0-4.095v)

Parameters
LTC_DACStruct containing configuration data for the DAC
outputValVoltage to set on the output pin of the DAC