text stringlengths 0 234 |
|---|
raise Unknown_Device; |
end if; |
end Reset; |
------------------------------ |
-- System_Clock_Frequencies -- |
------------------------------ |
function System_Clock_Frequencies return RCC_System_Clocks |
is |
Source : constant UInt2 := RCC_Periph.CFGR.SWS; |
Result : RCC_System_Clocks; |
begin |
Result.I2SCLK := 0; |
case Source is |
when 0 => |
-- HSI as source |
Result.SYSCLK := HSI_VALUE; |
when 1 => |
-- HSE as source |
Result.SYSCLK := HSE_VALUE; |
when 2 => |
-- PLL as source |
declare |
HSE_Source : constant Boolean := RCC_Periph.PLLCFGR.PLLSRC; |
Pllm : constant UInt32 := |
UInt32 (RCC_Periph.PLLCFGR.PLLM); |
Plln : constant UInt32 := |
UInt32 (RCC_Periph.PLLCFGR.PLLN); |
Pllp : constant UInt32 := |
(UInt32 (RCC_Periph.PLLCFGR.PLLP) + 1) * 2; |
Pllvco : UInt32; |
begin |
if not HSE_Source then |
Pllvco := HSI_VALUE; |
else |
Pllvco := HSE_VALUE; |
end if; |
Pllvco := Pllvco / Pllm; |
Result.I2SCLK := Pllvco; |
Pllvco := Pllvco * Plln; |
Result.SYSCLK := Pllvco / Pllp; |
Function Definition: procedure Reset_All_ADC_Units is |
Function Body: begin |
RCC_Periph.APB2RSTR.ADCRST := True; |
RCC_Periph.APB2RSTR.ADCRST := False; |
end Reset_All_ADC_Units; |
------------------ |
-- Enable_Clock -- |
------------------ |
procedure Enable_Clock (This : aliased in out Digital_To_Analog_Converter) |
is |
pragma Unreferenced (This); |
begin |
RCC_Periph.APB1ENR.DACEN := True; |
end Enable_Clock; |
----------- |
-- Reset -- |
----------- |
procedure Reset (This : aliased in out Digital_To_Analog_Converter) is |
pragma Unreferenced (This); |
begin |
RCC_Periph.APB1RSTR.DACRST := True; |
RCC_Periph.APB1RSTR.DACRST := False; |
end Reset; |
------------------ |
-- Enable_Clock -- |
------------------ |
-- procedure Enable_Clock (This : aliased in out USART) is |
-- begin |
-- if This'Address = USART1_Base then |
-- RCC_Periph.APB2ENR.USART1EN := True; |
-- elsif This'Address = USART2_Base then |
-- RCC_Periph.APB1ENR.USART2EN := True; |
-- elsif This'Address = USART3_Base then |
-- RCC_Periph.APB1ENR.USART3EN := True; |
-- elsif This'Address = UART4_Base then |
-- RCC_Periph.APB1ENR.UART4EN := True; |
-- elsif This'Address = UART5_Base then |
-- RCC_Periph.APB1ENR.UART5EN := True; |
-- elsif This'Address = USART6_Base then |
-- RCC_Periph.APB2ENR.USART6EN := True; |
-- elsif This'Address = UART7_Base then |
-- RCC_Periph.APB1ENR.UART7ENR := True; |
-- elsif This'Address = UART8_Base then |
-- RCC_Periph.APB1ENR.UART8ENR := True; |
-- else |
-- raise Unknown_Device; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.