text stringlengths 0 234 |
|---|
----------- |
-- Reset -- |
----------- |
procedure Reset (This : I2C_Port_Id) is |
begin |
case This is |
when I2C_Id_1 => |
RCC_Periph.APB1RSTR.I2C1RST := True; |
RCC_Periph.APB1RSTR.I2C1RST := False; |
when I2C_Id_2 => |
RCC_Periph.APB1RSTR.I2C2RST := True; |
RCC_Periph.APB1RSTR.I2C2RST := False; |
when I2C_Id_3 => |
RCC_Periph.APB1RSTR.I2C3RST := True; |
RCC_Periph.APB1RSTR.I2C3RST := False; |
when I2C_Id_4 => |
RCC_Periph.APB1RSTR.I2C4RST := True; |
RCC_Periph.APB1RSTR.I2C4RST := False; |
end case; |
end Reset; |
------------------ |
-- Enable_Clock -- |
------------------ |
procedure Enable_Clock (This : SPI_Port'Class) is |
begin |
if This.Periph.all'Address = SPI1_Base then |
RCC_Periph.APB2ENR.SPI1EN := True; |
elsif This.Periph.all'Address = SPI2_Base then |
RCC_Periph.APB1ENR.SPI2EN := True; |
elsif This.Periph.all'Address = SPI3_Base then |
RCC_Periph.APB1ENR.SPI3EN := True; |
elsif This.Periph.all'Address = SPI4_Base then |
RCC_Periph.APB2ENR.SPI4ENR := True; |
elsif This.Periph.all'Address = SPI5_Base then |
RCC_Periph.APB2ENR.SPI5ENR := True; |
elsif This.Periph.all'Address = SPI6_Base then |
RCC_Periph.APB2ENR.SPI6ENR := True; |
else |
raise Unknown_Device; |
end if; |
end Enable_Clock; |
----------- |
-- Reset -- |
----------- |
procedure Reset (This : SPI_Port'Class) is |
begin |
if This.Periph.all'Address = SPI1_Base then |
RCC_Periph.APB2RSTR.SPI1RST := True; |
RCC_Periph.APB2RSTR.SPI1RST := False; |
elsif This.Periph.all'Address = SPI2_Base then |
RCC_Periph.APB1RSTR.SPI2RST := True; |
RCC_Periph.APB1RSTR.SPI2RST := False; |
elsif This.Periph.all'Address = SPI3_Base then |
RCC_Periph.APB1RSTR.SPI3RST := True; |
RCC_Periph.APB1RSTR.SPI3RST := False; |
elsif This.Periph.all'Address = SPI4_Base then |
RCC_Periph.APB2RSTR.SPI4RST := True; |
RCC_Periph.APB2RSTR.SPI4RST := False; |
elsif This.Periph.all'Address = SPI5_Base then |
RCC_Periph.APB2RSTR.SPI5RST := True; |
RCC_Periph.APB2RSTR.SPI5RST := False; |
elsif This.Periph.all'Address = SPI6_Base then |
RCC_Periph.APB2RSTR.SPI6RST := True; |
RCC_Periph.APB2RSTR.SPI6RST := False; |
else |
raise Unknown_Device; |
end if; |
end Reset; |
------------------ |
-- Enable_Clock -- |
------------------ |
procedure Enable_Clock (This : I2S_Port) is |
begin |
if This.Periph.all'Address = SPI1_Base then |
RCC_Periph.APB2ENR.SPI1EN := True; |
elsif This.Periph.all'Address = SPI2_Base then |
RCC_Periph.APB1ENR.SPI2EN := True; |
elsif This.Periph.all'Address = SPI3_Base then |
RCC_Periph.APB1ENR.SPI3EN := True; |
elsif This.Periph.all'Address = SPI4_Base then |
RCC_Periph.APB2ENR.SPI5ENR := True; |
elsif This.Periph.all'Address = SPI5_Base then |
RCC_Periph.APB2ENR.SPI5ENR := True; |
elsif This.Periph.all'Address = SPI6_Base then |
RCC_Periph.APB2ENR.SPI6ENR := True; |
else |
raise Unknown_Device; |
end if; |
end Enable_Clock; |
----------- |
-- Reset -- |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.