text
stringlengths 0
234
|
|---|
----------------------------
|
-- Converted_Output_Value --
|
----------------------------
|
function Converted_Output_Value
|
(This : Digital_To_Analog_Converter;
|
Channel : DAC_Channel)
|
return UInt32
|
is
|
begin
|
case Channel is
|
when Channel_1 =>
|
return UInt32 (This.DOR1.DACC1DOR);
|
when Channel_2 =>
|
return UInt32 (This.DOR2.DACC2DOR);
|
end case;
|
end Converted_Output_Value;
|
------------------------------
|
-- Set_Dual_Output_Voltages --
|
------------------------------
|
procedure Set_Dual_Output_Voltages
|
(This : in out Digital_To_Analog_Converter;
|
Channel_1_Value : UInt32;
|
Channel_2_Value : UInt32;
|
Resolution : DAC_Resolution;
|
Alignment : Data_Alignment)
|
is
|
begin
|
case Resolution is
|
when DAC_Resolution_12_Bits =>
|
case Alignment is
|
when Left_Aligned =>
|
This.DHR12LD.DACC1DHR :=
|
UInt12 (Channel_1_Value and Max_12bit_Resolution);
|
This.DHR12LD.DACC2DHR :=
|
UInt12 (Channel_2_Value and Max_12bit_Resolution);
|
when Right_Aligned =>
|
This.DHR12RD.DACC1DHR :=
|
UInt12 (Channel_1_Value and Max_12bit_Resolution);
|
This.DHR12RD.DACC2DHR :=
|
UInt12 (Channel_2_Value and Max_12bit_Resolution);
|
end case;
|
when DAC_Resolution_8_Bits =>
|
This.DHR8RD.DACC1DHR :=
|
UInt8 (Channel_1_Value and Max_8bit_Resolution);
|
This.DHR8RD.DACC2DHR :=
|
UInt8 (Channel_2_Value and Max_8bit_Resolution);
|
end case;
|
end Set_Dual_Output_Voltages;
|
---------------------------------
|
-- Converted_Dual_Output_Value --
|
---------------------------------
|
function Converted_Dual_Output_Value (This : Digital_To_Analog_Converter)
|
return Dual_Channel_Output
|
is
|
Result : Dual_Channel_Output;
|
begin
|
Result.Channel_1_Data := UInt16 (This.DOR1.DACC1DOR);
|
Result.Channel_2_Data := UInt16 (This.DOR2.DACC2DOR);
|
return Result;
|
end Converted_Dual_Output_Value;
|
--------------------------
|
-- Enable_Output_Buffer --
|
--------------------------
|
procedure Enable_Output_Buffer
|
(This : in out Digital_To_Analog_Converter;
|
Channel : DAC_Channel)
|
is
|
begin
|
case Channel is
|
when Channel_1 =>
|
This.CR.BOFF1 := True;
|
when Channel_2 =>
|
This.CR.BOFF2 := True;
|
end case;
|
end Enable_Output_Buffer;
|
---------------------------
|
-- Disable_Output_Buffer --
|
---------------------------
|
procedure Disable_Output_Buffer
|
(This : in out Digital_To_Analog_Converter;
|
Channel : DAC_Channel)
|
is
|
begin
|
case Channel is
|
when Channel_1 =>
|
This.CR.BOFF1 := False;
|
when Channel_2 =>
|
This.CR.BOFF2 := False;
|
end case;
|
end Disable_Output_Buffer;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.