text
stringlengths 0
234
|
|---|
end Status;
|
------------------
|
-- Clear_Status --
|
------------------
|
procedure Clear_Status
|
(This : in out Digital_To_Analog_Converter;
|
Flag : DAC_Status_Flag)
|
is
|
begin
|
case Flag is
|
when DMA_Underrun_Channel_1 =>
|
This.SR.DMAUDR1 := True; -- set to 1 to clear
|
when DMA_Underrun_Channel_2 =>
|
This.SR.DMAUDR2 := True; -- set to 1 to clear
|
end case;
|
end Clear_Status;
|
-----------------------
|
-- Enable_Interrupts --
|
-----------------------
|
procedure Enable_Interrupts
|
(This : in out Digital_To_Analog_Converter;
|
Source : DAC_Interrupts)
|
is
|
begin
|
case Source is
|
when DMA_Underrun_Channel_1 =>
|
This.CR.DMAUDRIE1 := True;
|
when DMA_Underrun_Channel_2 =>
|
This.CR.DMAUDRIE2 := True;
|
end case;
|
end Enable_Interrupts;
|
------------------------
|
-- Disable_Interrupts --
|
------------------------
|
procedure Disable_Interrupts
|
(This : in out Digital_To_Analog_Converter;
|
Source : DAC_Interrupts)
|
is
|
begin
|
case Source is
|
when DMA_Underrun_Channel_1 =>
|
This.CR.DMAUDRIE1 := False;
|
when DMA_Underrun_Channel_2 =>
|
This.CR.DMAUDRIE2 := False;
|
end case;
|
end Disable_Interrupts;
|
-----------------------
|
-- Interrupt_Enabled --
|
-----------------------
|
function Interrupt_Enabled
|
(This : Digital_To_Analog_Converter;
|
Source : DAC_Interrupts)
|
return Boolean
|
is
|
begin
|
case Source is
|
when DMA_Underrun_Channel_1 =>
|
return This.CR.DMAUDRIE1;
|
when DMA_Underrun_Channel_2 =>
|
return This.CR.DMAUDRIE2;
|
end case;
|
end Interrupt_Enabled;
|
----------------------
|
-- Interrupt_Source --
|
----------------------
|
function Interrupt_Source
|
(This : Digital_To_Analog_Converter)
|
return DAC_Interrupts
|
is
|
begin
|
if This.CR.DMAUDRIE1 then
|
return DMA_Underrun_Channel_1;
|
else
|
return DMA_Underrun_Channel_2;
|
end if;
|
end Interrupt_Source;
|
-----------------------------
|
-- Clear_Interrupt_Pending --
|
-----------------------------
|
procedure Clear_Interrupt_Pending
|
(This : in out Digital_To_Analog_Converter;
|
Channel : DAC_Channel)
|
is
|
begin
|
case Channel is
|
when Channel_1 =>
|
This.SR.DMAUDR1 := False;
|
when Channel_2 =>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.