![]()  | 
  
    PS_Fgen_FW
    4da88f4073c1cc65ea45c3a652a2751e495e50db
    
   Firmware for an Power Supply and Function Generator build from an ATX power supply 
   | 
 
Containing the functions to control the MCP492x DACs. More...
Go to the source code of this file.
Macros | |
| #define | MCP492X_DACB 7 | 
| Position of the DACA or DACB Select bit in the write command register.  | |
| #define | MCP492X_BUFFERED 6 | 
| Position of the VREF Input Buffer Control bit in the write command register.  | |
| #define | MCP492X_GAIN_SELECT_SINGLE 5 | 
| Position of the Output Gain Select bit in the write command register.  | |
| #define | MCP492X_SHDN 4 | 
| Position of the Output Power Down Control bit in the write command register.  | |
| #define | SELECT_MCP4922 SPI_SELECT_DDS | 
| Select the MCP4922 DAC by pulling the DDS_CS pin low.  | |
| #define | DESELECT_MCP4922 SPI_DESELECT_DDS | 
| Deselect the MCP4922 DAC by pulling the DDS_CS pin high.  | |
| #define | SELECT_MCP4921 SPI_SELECT_PS | 
| Select the MCP4921 DAC by pulling the PS_CS pin low.  | |
| #define | DESELECT_MCP4921 SPI_DESELECT_PS | 
| Deselect the MCP4921 DAC by pulling the PS_CS pin high.  | |
Functions | |
| void | MCP4921_DAC_Set (uint16_t dac_data) | 
| Set the DAC data value of the MCP4921 device.   | |
| void | MCP4921_Voltage_Set (float voltage) | 
| Set the voltage of the MCP4921 device.   | |
| void | MCP4922_DAC_Set (uint16_t dac_data, char channel_A_B) | 
| Set the DAC data value of the MCP4922 device.   | |
| void | MCP4922_Voltage_Set (float voltage, char channel_A_B) | 
| Set the voltage of the MCP4922 device.   | |
Containing the functions to control the MCP492x DACs.
| void MCP4921_DAC_Set | ( | uint16_t | dac_data | ) | 
Set the DAC data value of the MCP4921 device.
| dac_data | DAC data that is written to the write command registers. Only the lower 12 bits are used. | 
| void MCP4921_Voltage_Set | ( | float | voltage | ) | 
Set the voltage of the MCP4921 device.
The voltage is converted to the DAC data using the calibrated reference voltage of the device.
| voltage | Set the MCP4921 device to this voltage. | 
| void MCP4922_DAC_Set | ( | uint16_t | dac_data, | 
| char | channel_A_B ) | 
Set the DAC data value of the MCP4922 device.
| dac_data | DAC data that is written to the write command registers. Only the lower 12 bits are used. | 
| channel_A_B | Set this to 'B' to set the value of the second channel (B). All other characters set the value of the first channel (A). | 
| void MCP4922_Voltage_Set | ( | float | voltage, | 
| char | channel_A_B ) | 
Set the voltage of the MCP4922 device.
The voltage is converted to the DAC data using the calibrated reference voltage of the device.
| voltage | Set the MCP4922 device to this voltage. | 
| channel_A_B | Set this to 'B' to set the value of the second channel (B). All other characters set the value of the first channel (A). |