text
stringlengths 0
234
|
|---|
begin
|
return This.DR.DATA;
|
end Conversion_Value;
|
---------------------------
|
-- Data_Register_Address --
|
---------------------------
|
function Data_Register_Address
|
(This : Analog_To_Digital_Converter)
|
return System.Address
|
is
|
(This.DR'Address);
|
-------------------------------
|
-- Injected_Conversion_Value --
|
-------------------------------
|
function Injected_Conversion_Value
|
(This : Analog_To_Digital_Converter;
|
Rank : Injected_Channel_Rank)
|
return UInt16
|
is
|
begin
|
case Rank is
|
when 1 =>
|
return This.JDR1.JDATA;
|
when 2 =>
|
return This.JDR2.JDATA;
|
when 3 =>
|
return This.JDR3.JDATA;
|
when 4 =>
|
return This.JDR4.JDATA;
|
end case;
|
end Injected_Conversion_Value;
|
--------------------------------
|
-- Multimode_Conversion_Value --
|
--------------------------------
|
function Multimode_Conversion_Value return UInt32 is
|
(C_ADC_Periph.CDR.Val);
|
--------------------
|
-- Configure_Unit --
|
--------------------
|
procedure Configure_Unit
|
(This : in out Analog_To_Digital_Converter;
|
Resolution : ADC_Resolution;
|
Alignment : Data_Alignment)
|
is
|
begin
|
This.CR1.RES := ADC_Resolution'Enum_Rep (Resolution);
|
This.CR2.ALIGN := Alignment = Left_Aligned;
|
end Configure_Unit;
|
------------------------
|
-- Current_Resolution --
|
------------------------
|
function Current_Resolution
|
(This : Analog_To_Digital_Converter)
|
return ADC_Resolution
|
is (ADC_Resolution'Val (This.CR1.RES));
|
-----------------------
|
-- Current_Alignment --
|
-----------------------
|
function Current_Alignment
|
(This : Analog_To_Digital_Converter)
|
return Data_Alignment
|
is ((if This.CR2.ALIGN then Left_Aligned else Right_Aligned));
|
---------------------------------
|
-- Configure_Common_Properties --
|
---------------------------------
|
procedure Configure_Common_Properties
|
(Mode : Multi_ADC_Mode_Selections;
|
Prescalar : ADC_Prescalars;
|
DMA_Mode : Multi_ADC_DMA_Modes;
|
Sampling_Delay : Sampling_Delay_Selections)
|
is
|
begin
|
C_ADC_Periph.CCR.MULT := Multi_ADC_Mode_Selections'Enum_Rep (Mode);
|
C_ADC_Periph.CCR.DELAY_k :=
|
Sampling_Delay_Selections'Enum_Rep (Sampling_Delay);
|
C_ADC_Periph.CCR.DMA := Multi_ADC_DMA_Modes'Enum_Rep (DMA_Mode);
|
C_ADC_Periph.CCR.ADCPRE := ADC_Prescalars'Enum_Rep (Prescalar);
|
end Configure_Common_Properties;
|
-----------------------------------
|
-- Configure_Regular_Conversions --
|
-----------------------------------
|
procedure Configure_Regular_Conversions
|
(This : in out Analog_To_Digital_Converter;
|
Continuous : Boolean;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.