added mx Project for the machine
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
mx
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>stm32mp157d-vrpmdv-mon-mx</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCURootProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mpu.MPUEmbeddedMCUProjectNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
66BE74F758C12D739921AEA421D593D3=0
|
||||||
|
eclipse.preferences.version=1
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>VRPMDV-Mon_CA7</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MxURichOSCapableProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mpu.MPUEmbeddedMCUProjectNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
+1182
File diff suppressed because it is too large
Load Diff
+717
@@ -0,0 +1,717 @@
|
|||||||
|
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2024, STMicroelectronics - All Rights Reserved
|
||||||
|
* Author: STM32CubeMX code generation for STMicroelectronics.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* For more information on Device Tree configuration, please refer to
|
||||||
|
* https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration
|
||||||
|
*/
|
||||||
|
|
||||||
|
/dts-v1/;
|
||||||
|
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
|
||||||
|
#include <dt-bindings/clock/stm32mp1-clksrc.h>
|
||||||
|
#include <dt-bindings/soc/stm32mp15-etzpc.h>
|
||||||
|
|
||||||
|
#include "stm32mp157.dtsi"
|
||||||
|
#include "stm32mp15xd.dtsi"
|
||||||
|
#include "stm32mp15xxac-pinctrl.dtsi"
|
||||||
|
|
||||||
|
/* USER CODE BEGIN includes */
|
||||||
|
#include <dt-bindings/gpio/stm32mp_gpio.h>
|
||||||
|
#include <dt-bindings/power/stm32mp1-power.h>
|
||||||
|
#include <dt-bindings/mfd/st,stpmic1.h>
|
||||||
|
/* USER CODE END includes */
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "STMicroelectronics STM32MP157D-DK1 STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mp1-v23.06.21";
|
||||||
|
compatible = "st,stm32mp157d-vrpmdv-mon-mx", "st,stm32mp157d-dk1", "st,stm32mp157";
|
||||||
|
|
||||||
|
memory@c0000000 {
|
||||||
|
device_type = "memory";
|
||||||
|
reg = <0xc0000000 0x20000000>;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN memory */
|
||||||
|
/* USER CODE END memory */
|
||||||
|
};
|
||||||
|
|
||||||
|
reserved-memory {
|
||||||
|
#address-cells = <1>;
|
||||||
|
#size-cells = <1>;
|
||||||
|
ranges;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN reserved-memory */
|
||||||
|
|
||||||
|
mcuram2:mcuram2@10000000{
|
||||||
|
compatible = "shared-dma-pool";
|
||||||
|
reg = <0x10000000 0x40000>;
|
||||||
|
no-map;
|
||||||
|
};
|
||||||
|
|
||||||
|
vdev0vring0:vdev0vring0@10040000{
|
||||||
|
compatible = "shared-dma-pool";
|
||||||
|
reg = <0x10040000 0x1000>;
|
||||||
|
no-map;
|
||||||
|
};
|
||||||
|
|
||||||
|
vdev0vring1:vdev0vring1@10041000{
|
||||||
|
compatible = "shared-dma-pool";
|
||||||
|
reg = <0x10041000 0x1000>;
|
||||||
|
no-map;
|
||||||
|
};
|
||||||
|
|
||||||
|
vdev0buffer:vdev0buffer@10042000{
|
||||||
|
compatible = "shared-dma-pool";
|
||||||
|
reg = <0x10042000 0x4000>;
|
||||||
|
no-map;
|
||||||
|
};
|
||||||
|
|
||||||
|
mcuram:mcuram@30000000{
|
||||||
|
compatible = "shared-dma-pool";
|
||||||
|
reg = <0x30000000 0x40000>;
|
||||||
|
no-map;
|
||||||
|
};
|
||||||
|
|
||||||
|
retram:retram@38000000{
|
||||||
|
compatible = "shared-dma-pool";
|
||||||
|
reg = <0x38000000 0x10000>;
|
||||||
|
no-map;
|
||||||
|
};
|
||||||
|
|
||||||
|
gpu_reserved:gpu@d4000000{
|
||||||
|
reg = <0xd4000000 0x4000000>;
|
||||||
|
no-map;
|
||||||
|
};
|
||||||
|
/* USER CODE END reserved-memory */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* USER CODE BEGIN root */
|
||||||
|
|
||||||
|
aliases{
|
||||||
|
serial0 = &uart4;
|
||||||
|
serial1 = &usart3;
|
||||||
|
serial2 = &uart7;
|
||||||
|
};
|
||||||
|
|
||||||
|
led{
|
||||||
|
compatible = "gpio-leds";
|
||||||
|
|
||||||
|
led-blue{
|
||||||
|
label = "heartbeat";
|
||||||
|
gpios = <&gpiod 11 GPIO_ACTIVE_HIGH>;
|
||||||
|
linux,default-trigger = "heartbeat";
|
||||||
|
default-state = "off";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vin:vin{
|
||||||
|
compatible = "regulator-fixed";
|
||||||
|
regulator-name = "vin";
|
||||||
|
regulator-min-microvolt = <5000000>;
|
||||||
|
regulator-max-microvolt = <5000000>;
|
||||||
|
regulator-always-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
chosen{
|
||||||
|
stdout-path = "serial0:115200n8";
|
||||||
|
};
|
||||||
|
/* USER CODE END root */
|
||||||
|
|
||||||
|
clocks {
|
||||||
|
/* USER CODE BEGIN clocks */
|
||||||
|
/* USER CODE END clocks */
|
||||||
|
|
||||||
|
clk_hsi: clk-hsi {
|
||||||
|
clock-frequency = <64000000>;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN clk_hsi */
|
||||||
|
/* USER CODE END clk_hsi */
|
||||||
|
};
|
||||||
|
clk_lse: clk-lse {
|
||||||
|
clock-frequency = <32768>;
|
||||||
|
st,drive = < LSEDRV_MEDIUM_HIGH >;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN clk_lse */
|
||||||
|
/* USER CODE END clk_lse */
|
||||||
|
};
|
||||||
|
clk_hse: clk-hse {
|
||||||
|
clock-frequency = <24000000>;
|
||||||
|
st,digbypass;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN clk_hse */
|
||||||
|
/* USER CODE END clk_hse */
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}; /*root*/
|
||||||
|
|
||||||
|
/*Warning: the configuration of the secured GPIOs should be added in (addons) User Section*/
|
||||||
|
&pinctrl {
|
||||||
|
/* USER CODE BEGIN pinctrl */
|
||||||
|
|
||||||
|
uart4_pins_mx: uart4_mx-0 {
|
||||||
|
pins1 {
|
||||||
|
pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
|
||||||
|
bias-disable;
|
||||||
|
};
|
||||||
|
pins2 {
|
||||||
|
pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX */
|
||||||
|
bias-disable;
|
||||||
|
drive-push-pull;
|
||||||
|
slew-rate = <0>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/* USER CODE END pinctrl */
|
||||||
|
};
|
||||||
|
|
||||||
|
&pinctrl_z {
|
||||||
|
i2c4_pins_z_mx: i2c4_mx-0 {
|
||||||
|
pins {
|
||||||
|
pinmux = <STM32_PINMUX('Z', 4, AF6)>, /* I2C4_SCL */
|
||||||
|
<STM32_PINMUX('Z', 5, AF6)>; /* I2C4_SDA */
|
||||||
|
bias-disable;
|
||||||
|
drive-open-drain;
|
||||||
|
slew-rate = <0>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* USER CODE BEGIN pinctrl_z */
|
||||||
|
/* USER CODE END pinctrl_z */
|
||||||
|
};
|
||||||
|
|
||||||
|
&bsec{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN bsec */
|
||||||
|
|
||||||
|
board_id:board_id@ec{
|
||||||
|
reg = <0xec 0x4>;
|
||||||
|
st,non-secure-otp;
|
||||||
|
};
|
||||||
|
|
||||||
|
huk_otp:huk-otp@f0{
|
||||||
|
reg = <0xf0 0x10>;
|
||||||
|
};
|
||||||
|
/* USER CODE END bsec */
|
||||||
|
};
|
||||||
|
|
||||||
|
&etzpc{
|
||||||
|
status = "okay";
|
||||||
|
st,decprot = <
|
||||||
|
/*"Non Secured" peripherals*/
|
||||||
|
DECPROT(STM32MP1_ETZPC_ADC_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_DMA1_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_DMA2_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_DMAMUX_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_ETH_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_HASH1_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_CEC_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_I2C1_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_I2C4_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_SPI2_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_SAI2_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_UART4_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_OTG_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_VREFBUF_ID, DECPROT_NS_RW, DECPROT_UNLOCK)
|
||||||
|
/*"NS_R S_W" peripherals*/
|
||||||
|
DECPROT(STM32MP1_ETZPC_DDRCTRL_ID, DECPROT_NS_R_S_W, DECPROT_LOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_DDRPHYC_ID, DECPROT_NS_R_S_W, DECPROT_LOCK)
|
||||||
|
/*"Secured" peripherals*/
|
||||||
|
DECPROT(STM32MP1_ETZPC_IWDG1_ID, DECPROT_S_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_RNG1_ID, DECPROT_S_RW, DECPROT_UNLOCK)
|
||||||
|
DECPROT(STM32MP1_ETZPC_STGENC_ID, DECPROT_S_RW, DECPROT_UNLOCK)
|
||||||
|
|
||||||
|
/*Restriction: following IDs are not managed - please to use User-Section if needed:
|
||||||
|
STM32MP1_ETZPC_SRAMx_ID STM32MP1_ETZPC_RETRAM_ID STM32MP1_ETZPC_BKPSRAM_ID*/
|
||||||
|
|
||||||
|
/* USER CODE BEGIN etzpc_decprot */
|
||||||
|
/*STM32CubeMX generates a basic and standard configuration for ETZPC.
|
||||||
|
Additional device configurations can be added here if needed.
|
||||||
|
"etzpc" node could be also overloaded in "addons" User-Section.*/
|
||||||
|
/* USER CODE END etzpc_decprot */
|
||||||
|
>;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN etzpc */
|
||||||
|
/* USER CODE END etzpc */
|
||||||
|
};
|
||||||
|
|
||||||
|
&i2c4{
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&i2c4_pins_z_mx>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN i2c4 */
|
||||||
|
compatible = "st,stm32mp15-i2c-non-secure";
|
||||||
|
i2c-scl-rising-time-ns = <185>;
|
||||||
|
i2c-scl-falling-time-ns = <20>;
|
||||||
|
clock-frequency = <400000>;
|
||||||
|
/delete-property/ dmas;
|
||||||
|
/delete-property/ dma-names;
|
||||||
|
|
||||||
|
pmic:stpmic@33{
|
||||||
|
compatible = "st,stpmic1";
|
||||||
|
reg = <0x33>;
|
||||||
|
interrupts-extended = <&gpioa 0 IRQ_TYPE_EDGE_FALLING>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
regulators{
|
||||||
|
compatible = "st,stpmic1-regulators";
|
||||||
|
buck1-supply = <&vin>;
|
||||||
|
buck2-supply = <&vin>;
|
||||||
|
buck3-supply = <&vin>;
|
||||||
|
buck4-supply = <&vin>;
|
||||||
|
ldo1-supply = <&v3v3>;
|
||||||
|
ldo2-supply = <&vin>;
|
||||||
|
ldo3-supply = <&vdd_ddr>;
|
||||||
|
ldo4-supply = <&vin>;
|
||||||
|
ldo5-supply = <&vin>;
|
||||||
|
ldo6-supply = <&v3v3>;
|
||||||
|
vref_ddr-supply = <&vin>;
|
||||||
|
boost-supply = <&vin>;
|
||||||
|
pwr_sw1-supply = <&bst_out>;
|
||||||
|
pwr_sw2-supply = <&bst_out>;
|
||||||
|
|
||||||
|
vddcore:buck1{
|
||||||
|
regulator-name = "vddcore";
|
||||||
|
regulator-min-microvolt = <1200000>;
|
||||||
|
regulator-max-microvolt = <1350000>;
|
||||||
|
regulator-always-on;
|
||||||
|
regulator-initial-mode = <0>;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
|
||||||
|
lp-stop{
|
||||||
|
regulator-on-in-suspend;
|
||||||
|
regulator-suspend-microvolt = <1200000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vdd_ddr:buck2{
|
||||||
|
regulator-name = "vdd_ddr";
|
||||||
|
regulator-min-microvolt = <1350000>;
|
||||||
|
regulator-max-microvolt = <1350000>;
|
||||||
|
regulator-always-on;
|
||||||
|
regulator-initial-mode = <0>;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
|
||||||
|
lp-stop{
|
||||||
|
regulator-suspend-microvolt = <1350000>;
|
||||||
|
regulator-on-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-suspend-microvolt = <1350000>;
|
||||||
|
regulator-on-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vdd:buck3{
|
||||||
|
regulator-name = "vdd";
|
||||||
|
regulator-min-microvolt = <3300000>;
|
||||||
|
regulator-max-microvolt = <3300000>;
|
||||||
|
regulator-always-on;
|
||||||
|
st,mask-reset;
|
||||||
|
regulator-initial-mode = <0>;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
|
||||||
|
lp-stop{
|
||||||
|
regulator-suspend-microvolt = <3300000>;
|
||||||
|
regulator-on-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-suspend-microvolt = <3300000>;
|
||||||
|
regulator-on-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-suspend-microvolt = <3300000>;
|
||||||
|
regulator-on-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
v3v3:buck4{
|
||||||
|
regulator-name = "v3v3";
|
||||||
|
regulator-min-microvolt = <3300000>;
|
||||||
|
regulator-max-microvolt = <3300000>;
|
||||||
|
regulator-always-on;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
regulator-initial-mode = <0>;
|
||||||
|
|
||||||
|
lp-stop{
|
||||||
|
regulator-suspend-microvolt = <3300000>;
|
||||||
|
regulator-on-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
v1v8_audio:ldo1{
|
||||||
|
regulator-name = "v1v8_audio";
|
||||||
|
regulator-min-microvolt = <1800000>;
|
||||||
|
regulator-max-microvolt = <1800000>;
|
||||||
|
regulator-always-on;
|
||||||
|
interrupts = <IT_CURLIM_LDO1 0>;
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
v3v3_hdmi:ldo2{
|
||||||
|
regulator-name = "v3v3_hdmi";
|
||||||
|
regulator-min-microvolt = <3300000>;
|
||||||
|
regulator-max-microvolt = <3300000>;
|
||||||
|
regulator-always-on;
|
||||||
|
interrupts = <IT_CURLIM_LDO2 0>;
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vtt_ddr:ldo3{
|
||||||
|
regulator-name = "vtt_ddr";
|
||||||
|
regulator-always-on;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
st,regulator-sink-source;
|
||||||
|
|
||||||
|
lp-stop{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vdd_usb:ldo4{
|
||||||
|
regulator-name = "vdd_usb";
|
||||||
|
interrupts = <IT_CURLIM_LDO4 0>;
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vdda:ldo5{
|
||||||
|
regulator-name = "vdda";
|
||||||
|
regulator-min-microvolt = <2900000>;
|
||||||
|
regulator-max-microvolt = <2900000>;
|
||||||
|
interrupts = <IT_CURLIM_LDO5 0>;
|
||||||
|
regulator-boot-on;
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
v1v2_hdmi:ldo6{
|
||||||
|
regulator-name = "v1v2_hdmi";
|
||||||
|
regulator-min-microvolt = <1200000>;
|
||||||
|
regulator-max-microvolt = <1200000>;
|
||||||
|
regulator-always-on;
|
||||||
|
interrupts = <IT_CURLIM_LDO6 0>;
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
vref_ddr:vref_ddr{
|
||||||
|
regulator-name = "vref_ddr";
|
||||||
|
regulator-always-on;
|
||||||
|
|
||||||
|
lp-stop{
|
||||||
|
regulator-on-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-sr{
|
||||||
|
regulator-on-in-suspend;
|
||||||
|
};
|
||||||
|
|
||||||
|
standby-ddr-off{
|
||||||
|
regulator-off-in-suspend;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
bst_out:boost{
|
||||||
|
regulator-name = "bst_out";
|
||||||
|
interrupts = <IT_OCP_BOOST 0>;
|
||||||
|
};
|
||||||
|
|
||||||
|
vbus_otg:pwr_sw1{
|
||||||
|
regulator-name = "vbus_otg";
|
||||||
|
interrupts = <IT_OCP_OTG 0>;
|
||||||
|
};
|
||||||
|
|
||||||
|
vbus_sw:pwr_sw2{
|
||||||
|
regulator-name = "vbus_sw";
|
||||||
|
interrupts = <IT_OCP_SWOUT 0>;
|
||||||
|
regulator-active-discharge = <1>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/* USER CODE END i2c4 */
|
||||||
|
};
|
||||||
|
|
||||||
|
&iwdg1{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN iwdg1 */
|
||||||
|
timeout-sec = <32>;
|
||||||
|
/* USER CODE END iwdg1 */
|
||||||
|
};
|
||||||
|
|
||||||
|
&pwr_regulators{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN pwr_regulators */
|
||||||
|
system_suspend_supported_soc_modes = <
|
||||||
|
STM32_PM_CSLEEP_RUN
|
||||||
|
STM32_PM_CSTOP_ALLOW_LP_STOP
|
||||||
|
STM32_PM_CSTOP_ALLOW_STANDBY_DDR_SR
|
||||||
|
>;
|
||||||
|
system_off_soc_mode = <STM32_PM_CSTOP_ALLOW_STANDBY_DDR_OFF>;
|
||||||
|
vdd-supply = <&vdd>;
|
||||||
|
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||||
|
/* USER CODE END pwr_regulators */
|
||||||
|
};
|
||||||
|
|
||||||
|
&rcc{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN rcc */
|
||||||
|
/* USER CODE END rcc */
|
||||||
|
|
||||||
|
st,clksrc = <
|
||||||
|
CLK_CKPER_HSE
|
||||||
|
CLK_ETH_PLL4P
|
||||||
|
CLK_SDMMC12_PLL4P
|
||||||
|
CLK_STGEN_HSE
|
||||||
|
CLK_SPI2S23_PLL3Q
|
||||||
|
CLK_I2C46_HSI
|
||||||
|
CLK_USBO_USBPHY
|
||||||
|
CLK_ADC_CKPER
|
||||||
|
CLK_CEC_LSE
|
||||||
|
CLK_I2C12_HSI
|
||||||
|
CLK_UART24_HSI
|
||||||
|
CLK_SAI2_PLL3Q
|
||||||
|
CLK_RNG1_CSI
|
||||||
|
CLK_MPU_PLL1P
|
||||||
|
CLK_AXI_PLL2P
|
||||||
|
CLK_MCU_PLL3P
|
||||||
|
CLK_RTC_LSE
|
||||||
|
CLK_MCO1_DISABLED
|
||||||
|
CLK_MCO2_DISABLED
|
||||||
|
>;
|
||||||
|
st,clkdiv = <
|
||||||
|
DIV(DIV_MPU, 1)
|
||||||
|
DIV(DIV_AXI, 0)
|
||||||
|
DIV(DIV_MCU, 0)
|
||||||
|
DIV(DIV_APB1, 1)
|
||||||
|
DIV(DIV_APB2, 1)
|
||||||
|
DIV(DIV_APB3, 1)
|
||||||
|
DIV(DIV_APB4, 1)
|
||||||
|
DIV(DIV_APB5, 2)
|
||||||
|
DIV(DIV_RTC, 23)
|
||||||
|
DIV(DIV_MCO1, 0)
|
||||||
|
DIV(DIV_MCO2, 0)
|
||||||
|
>;
|
||||||
|
st,pll_vco {
|
||||||
|
pll2_vco_1066Mhz: pll2-vco-1066Mhz {
|
||||||
|
src = < CLK_PLL12_HSE >;
|
||||||
|
divmn = < 2 65 >;
|
||||||
|
frac = < 0x1400 >;
|
||||||
|
};
|
||||||
|
pll3_vco_417Mhz: pll3-vco-417Mhz {
|
||||||
|
src = < CLK_PLL3_HSE >;
|
||||||
|
divmn = < 1 33 >;
|
||||||
|
frac = < 0x1a04 >;
|
||||||
|
};
|
||||||
|
pll4_vco_594Mhz: pll4-vco-594Mhz {
|
||||||
|
src = < CLK_PLL4_HSE >;
|
||||||
|
divmn = < 3 98 >;
|
||||||
|
};
|
||||||
|
/* USER CODE BEGIN rcc_st-pll_vco */
|
||||||
|
|
||||||
|
pll4_vco_600Mhz:pll2-vco-600Mhz{
|
||||||
|
src = <CLK_PLL4_HSE>;
|
||||||
|
divmn = <3 98>;
|
||||||
|
};
|
||||||
|
/* USER CODE END rcc_st-pll_vco */
|
||||||
|
};
|
||||||
|
|
||||||
|
pll2:st,pll@1 {
|
||||||
|
compatible = "st,stm32mp1-pll";
|
||||||
|
reg = <1>;
|
||||||
|
|
||||||
|
st,pll = < &pll2_cfg1 >;
|
||||||
|
|
||||||
|
pll2_cfg1: pll2_cfg1 {
|
||||||
|
st,pll_vco = < &pll2_vco_1066Mhz >;
|
||||||
|
st,pll_div_pqr = < 1 0 0 >;
|
||||||
|
};
|
||||||
|
/* USER CODE BEGIN pll2 */
|
||||||
|
/* USER CODE END pll2 */
|
||||||
|
};
|
||||||
|
|
||||||
|
pll3:st,pll@2 {
|
||||||
|
compatible = "st,stm32mp1-pll";
|
||||||
|
reg = <2>;
|
||||||
|
|
||||||
|
st,pll = < &pll3_cfg1 >;
|
||||||
|
|
||||||
|
pll3_cfg1: pll3_cfg1 {
|
||||||
|
st,pll_vco = < &pll3_vco_417Mhz >;
|
||||||
|
st,pll_div_pqr = < 1 16 36 >;
|
||||||
|
};
|
||||||
|
/* USER CODE BEGIN pll3 */
|
||||||
|
/* USER CODE END pll3 */
|
||||||
|
};
|
||||||
|
|
||||||
|
pll4:st,pll@3 {
|
||||||
|
compatible = "st,stm32mp1-pll";
|
||||||
|
reg = <3>;
|
||||||
|
|
||||||
|
st,pll = < &pll4_cfg1 >;
|
||||||
|
|
||||||
|
pll4_cfg1: pll4_cfg1 {
|
||||||
|
st,pll_vco = < &pll4_vco_594Mhz >;
|
||||||
|
st,pll_div_pqr = < 5 7 7 >;
|
||||||
|
};
|
||||||
|
/* USER CODE BEGIN pll4 */
|
||||||
|
/* USER CODE END pll4 */
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
&rng1{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN rng1 */
|
||||||
|
/* USER CODE END rng1 */
|
||||||
|
};
|
||||||
|
|
||||||
|
&rtc{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN rtc */
|
||||||
|
/* USER CODE END rtc */
|
||||||
|
};
|
||||||
|
|
||||||
|
&tamp{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN tamp */
|
||||||
|
/* USER CODE END tamp */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* USER CODE BEGIN addons */
|
||||||
|
|
||||||
|
&gpu{
|
||||||
|
contiguous-area = <&gpu_reserved>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&cpu0{
|
||||||
|
cpu-supply = <&vddcore>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&cpu1{
|
||||||
|
cpu-supply = <&vddcore>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&osc_calibration{
|
||||||
|
|
||||||
|
csi-calibration{
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
hsi-calibration{
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&timers15{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
counter{
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&usbphyc_port0{
|
||||||
|
phy-supply = <&vdd_usb>;
|
||||||
|
st,tune-hs-dc-level = <2>;
|
||||||
|
st,enable-fs-rftime-tuning;
|
||||||
|
st,enable-hs-rftime-reduction;
|
||||||
|
st,trim-hs-current = <15>;
|
||||||
|
st,trim-hs-impedance = <1>;
|
||||||
|
st,tune-squelch-level = <3>;
|
||||||
|
st,tune-hs-rx-offset = <2>;
|
||||||
|
st,no-lsfs-sc;
|
||||||
|
};
|
||||||
|
|
||||||
|
&usbphyc_port1{
|
||||||
|
phy-supply = <&vdd_usb>;
|
||||||
|
st,tune-hs-dc-level = <2>;
|
||||||
|
st,enable-fs-rftime-tuning;
|
||||||
|
st,enable-hs-rftime-reduction;
|
||||||
|
st,trim-hs-current = <15>;
|
||||||
|
st,trim-hs-impedance = <1>;
|
||||||
|
st,tune-squelch-level = <3>;
|
||||||
|
st,tune-hs-rx-offset = <2>;
|
||||||
|
st,no-lsfs-sc;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
&uart4{
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&uart4_pins_mx>;
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
/* USER CODE END addons */
|
||||||
|
|
||||||
+107
@@ -0,0 +1,107 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2015-2018, STMicroelectronics - All Rights Reserved
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: GPL-2.0-or-later BSD-3-Clause
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File generated by STMicroelectronics STM32CubeMX DDR Tool for MPUs
|
||||||
|
* DDR type: DDR3 / DDR3L
|
||||||
|
* DDR width: 16bits
|
||||||
|
* DDR density: 4Gb
|
||||||
|
* System frequency: 533000kHz
|
||||||
|
* Relaxed Timing Mode: false
|
||||||
|
* Address mapping type: RBC
|
||||||
|
*
|
||||||
|
* Save Date: 2024.04.29, save Time: 15:10:59
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DDR_MEM_NAME "DDR3-DDR3L 16bits 533000kHz"
|
||||||
|
#define DDR_MEM_SPEED 533000
|
||||||
|
#define DDR_MEM_SIZE 0x20000000
|
||||||
|
|
||||||
|
#define DDR_MSTR 0x00041401
|
||||||
|
#define DDR_MRCTRL0 0x00000010
|
||||||
|
#define DDR_MRCTRL1 0x00000000
|
||||||
|
#define DDR_DERATEEN 0x00000000
|
||||||
|
#define DDR_DERATEINT 0x00800000
|
||||||
|
#define DDR_PWRCTL 0x00000000
|
||||||
|
#define DDR_PWRTMG 0x00400010
|
||||||
|
#define DDR_HWLPCTL 0x00000000
|
||||||
|
#define DDR_RFSHCTL0 0x00210000
|
||||||
|
#define DDR_RFSHCTL3 0x00000000
|
||||||
|
#define DDR_RFSHTMG 0x0081008B
|
||||||
|
#define DDR_CRCPARCTL0 0x00000000
|
||||||
|
#define DDR_DRAMTMG0 0x0F101B0F
|
||||||
|
#define DDR_DRAMTMG1 0x000A041C
|
||||||
|
#define DDR_DRAMTMG2 0x0608090F
|
||||||
|
#define DDR_DRAMTMG3 0x0050400C
|
||||||
|
#define DDR_DRAMTMG4 0x08040608
|
||||||
|
#define DDR_DRAMTMG5 0x06060403
|
||||||
|
#define DDR_DRAMTMG6 0x02020002
|
||||||
|
#define DDR_DRAMTMG7 0x00000202
|
||||||
|
#define DDR_DRAMTMG8 0x00001005
|
||||||
|
#define DDR_DRAMTMG14 0x000000A0
|
||||||
|
#define DDR_ZQCTL0 0xC2000040
|
||||||
|
#define DDR_DFITMG0 0x02060105
|
||||||
|
#define DDR_DFITMG1 0x00000202
|
||||||
|
#define DDR_DFILPCFG0 0x07000000
|
||||||
|
#define DDR_DFIUPD0 0xC0400003
|
||||||
|
#define DDR_DFIUPD1 0x00000000
|
||||||
|
#define DDR_DFIUPD2 0x00000000
|
||||||
|
#define DDR_DFIPHYMSTR 0x00000000
|
||||||
|
#define DDR_ODTCFG 0x06000600
|
||||||
|
#define DDR_ODTMAP 0x00000001
|
||||||
|
#define DDR_SCHED 0x00000C01
|
||||||
|
#define DDR_SCHED1 0x00000000
|
||||||
|
#define DDR_PERFHPR1 0x01000001
|
||||||
|
#define DDR_PERFLPR1 0x08000200
|
||||||
|
#define DDR_PERFWR1 0x08000400
|
||||||
|
#define DDR_DBG0 0x00000000
|
||||||
|
#define DDR_DBG1 0x00000000
|
||||||
|
#define DDR_DBGCMD 0x00000000
|
||||||
|
#define DDR_POISONCFG 0x00000000
|
||||||
|
#define DDR_PCCFG 0x00000010
|
||||||
|
#define DDR_PCFGR_0 0x00010000
|
||||||
|
#define DDR_PCFGW_0 0x00000000
|
||||||
|
#define DDR_PCFGQOS0_0 0x02100C03
|
||||||
|
#define DDR_PCFGQOS1_0 0x00800100
|
||||||
|
#define DDR_PCFGWQOS0_0 0x01100C03
|
||||||
|
#define DDR_PCFGWQOS1_0 0x01000200
|
||||||
|
#define DDR_PCFGR_1 0x00010000
|
||||||
|
#define DDR_PCFGW_1 0x00000000
|
||||||
|
#define DDR_PCFGQOS0_1 0x02100C03
|
||||||
|
#define DDR_PCFGQOS1_1 0x00800040
|
||||||
|
#define DDR_PCFGWQOS0_1 0x01100C03
|
||||||
|
#define DDR_PCFGWQOS1_1 0x01000200
|
||||||
|
#define DDR_ADDRMAP1 0x00070707
|
||||||
|
#define DDR_ADDRMAP2 0x00000000
|
||||||
|
#define DDR_ADDRMAP3 0x1F000000
|
||||||
|
#define DDR_ADDRMAP4 0x00001F1F
|
||||||
|
#define DDR_ADDRMAP5 0x06060606
|
||||||
|
#define DDR_ADDRMAP6 0x0F060606
|
||||||
|
#define DDR_ADDRMAP9 0x00000000
|
||||||
|
#define DDR_ADDRMAP10 0x00000000
|
||||||
|
#define DDR_ADDRMAP11 0x00000000
|
||||||
|
#define DDR_PGCR 0x01442E02
|
||||||
|
#define DDR_PTR0 0x0022AA5B
|
||||||
|
#define DDR_PTR1 0x04841104
|
||||||
|
#define DDR_PTR2 0x042DA068
|
||||||
|
#define DDR_ACIOCR 0x10400812
|
||||||
|
#define DDR_DXCCR 0x00000C40
|
||||||
|
#define DDR_DSGCR 0xF200011F
|
||||||
|
#define DDR_DCR 0x0000000B
|
||||||
|
#define DDR_DTPR0 0x38D488D0
|
||||||
|
#define DDR_DTPR1 0x098B00D8
|
||||||
|
#define DDR_DTPR2 0x10023600
|
||||||
|
#define DDR_MR0 0x00000840
|
||||||
|
#define DDR_MR1 0x00000000
|
||||||
|
#define DDR_MR2 0x00000208
|
||||||
|
#define DDR_MR3 0x00000000
|
||||||
|
#define DDR_ODTCR 0x00010000
|
||||||
|
#define DDR_ZQ0CR1 0x00000038
|
||||||
|
#define DDR_DX0GCR 0x0000CE81
|
||||||
|
#define DDR_DX1GCR 0x0000CE81
|
||||||
|
#define DDR_DX2GCR 0x0000CE80
|
||||||
|
#define DDR_DX3GCR 0x0000CE80
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2024, STMicroelectronics - All Rights Reserved
|
||||||
|
* Author: STM32CubeMX code generation for STMicroelectronics.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* For more information on Device Tree configuration, please refer to
|
||||||
|
* https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define DDR_SIZE 0x20000000 /* 512MB */
|
||||||
|
#include "stm32mp15-fw-config.dtsi"
|
||||||
+480
@@ -0,0 +1,480 @@
|
|||||||
|
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2024, STMicroelectronics - All Rights Reserved
|
||||||
|
* Author: STM32CubeMX code generation for STMicroelectronics.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* For more information on Device Tree configuration, please refer to
|
||||||
|
* https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration
|
||||||
|
*/
|
||||||
|
|
||||||
|
/dts-v1/;
|
||||||
|
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
|
||||||
|
#include <dt-bindings/clock/stm32mp1-clksrc.h>
|
||||||
|
#include "stm32mp15-mx.dtsi"
|
||||||
|
|
||||||
|
#include "stm32mp157.dtsi"
|
||||||
|
#include "stm32mp15xd.dtsi"
|
||||||
|
#include "stm32mp15-pinctrl.dtsi"
|
||||||
|
#include "stm32mp15xxac-pinctrl.dtsi"
|
||||||
|
#include "stm32mp15-ddr.dtsi"
|
||||||
|
|
||||||
|
/* USER CODE BEGIN includes */
|
||||||
|
/* USER CODE END includes */
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "STMicroelectronics STM32MP157D-DK1 STM32CubeMX board - openstlinux-6.1-yocto-mickledore-mp1-v23.06.21";
|
||||||
|
compatible = "st,stm32mp157d-vrpmdv-mon-mx", "st,stm32mp157d-dk1", "st,stm32mp157";
|
||||||
|
|
||||||
|
memory@c0000000 {
|
||||||
|
device_type = "memory";
|
||||||
|
reg = <0xc0000000 0x20000000>;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN memory */
|
||||||
|
/* USER CODE END memory */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* USER CODE BEGIN root */
|
||||||
|
|
||||||
|
vin:vin{
|
||||||
|
compatible = "regulator-fixed";
|
||||||
|
regulator-name = "vin";
|
||||||
|
regulator-min-microvolt = <5000000>;
|
||||||
|
regulator-max-microvolt = <5000000>;
|
||||||
|
regulator-always-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
aliases{
|
||||||
|
serial0 = &uart4;
|
||||||
|
serial1 = &usart3;
|
||||||
|
serial2 = &uart7;
|
||||||
|
};
|
||||||
|
|
||||||
|
chosen{
|
||||||
|
stdout-path = "serial0:115200n8";
|
||||||
|
};
|
||||||
|
/* USER CODE END root */
|
||||||
|
|
||||||
|
clocks {
|
||||||
|
/* USER CODE BEGIN clocks */
|
||||||
|
/* USER CODE END clocks */
|
||||||
|
|
||||||
|
clk_hsi: clk-hsi {
|
||||||
|
clock-frequency = <64000000>;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN clk_hsi */
|
||||||
|
/* USER CODE END clk_hsi */
|
||||||
|
};
|
||||||
|
clk_lse: clk-lse {
|
||||||
|
clock-frequency = <32768>;
|
||||||
|
st,drive = < LSEDRV_MEDIUM_HIGH >;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN clk_lse */
|
||||||
|
/* USER CODE END clk_lse */
|
||||||
|
};
|
||||||
|
clk_hse: clk-hse {
|
||||||
|
clock-frequency = <24000000>;
|
||||||
|
st,digbypass;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN clk_hse */
|
||||||
|
/* USER CODE END clk_hse */
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}; /*root*/
|
||||||
|
|
||||||
|
&pinctrl {
|
||||||
|
sdmmc1_pins_mx: sdmmc1_mx-0 {
|
||||||
|
pins1 {
|
||||||
|
pinmux = <STM32_PINMUX('C', 8, AF12)>, /* SDMMC1_D0 */
|
||||||
|
<STM32_PINMUX('C', 9, AF12)>, /* SDMMC1_D1 */
|
||||||
|
<STM32_PINMUX('C', 10, AF12)>, /* SDMMC1_D2 */
|
||||||
|
<STM32_PINMUX('C', 11, AF12)>, /* SDMMC1_D3 */
|
||||||
|
<STM32_PINMUX('D', 2, AF12)>; /* SDMMC1_CMD */
|
||||||
|
bias-disable;
|
||||||
|
drive-push-pull;
|
||||||
|
slew-rate = <1>;
|
||||||
|
};
|
||||||
|
pins2 {
|
||||||
|
pinmux = <STM32_PINMUX('C', 12, AF12)>; /* SDMMC1_CK */
|
||||||
|
bias-disable;
|
||||||
|
drive-push-pull;
|
||||||
|
slew-rate = <2>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
uart4_pins_mx: uart4_mx-0 {
|
||||||
|
pins1 {
|
||||||
|
pinmux = <STM32_PINMUX('B', 2, AF8)>; /* UART4_RX */
|
||||||
|
bias-disable;
|
||||||
|
};
|
||||||
|
pins2 {
|
||||||
|
pinmux = <STM32_PINMUX('G', 11, AF6)>; /* UART4_TX */
|
||||||
|
bias-disable;
|
||||||
|
drive-push-pull;
|
||||||
|
slew-rate = <0>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* USER CODE BEGIN pinctrl */
|
||||||
|
/* USER CODE END pinctrl */
|
||||||
|
};
|
||||||
|
|
||||||
|
&pinctrl_z {
|
||||||
|
i2c4_pins_z_mx: i2c4_mx-0 {
|
||||||
|
pins {
|
||||||
|
pinmux = <STM32_PINMUX('Z', 4, AF6)>, /* I2C4_SCL */
|
||||||
|
<STM32_PINMUX('Z', 5, AF6)>; /* I2C4_SDA */
|
||||||
|
bias-disable;
|
||||||
|
drive-open-drain;
|
||||||
|
slew-rate = <0>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
/* USER CODE BEGIN pinctrl_z */
|
||||||
|
/* USER CODE END pinctrl_z */
|
||||||
|
};
|
||||||
|
|
||||||
|
&hash1{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN hash1 */
|
||||||
|
/* USER CODE END hash1 */
|
||||||
|
};
|
||||||
|
|
||||||
|
&i2c4{
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&i2c4_pins_z_mx>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN i2c4 */
|
||||||
|
i2c-scl-rising-time-ns = <185>;
|
||||||
|
i2c-scl-falling-time-ns = <20>;
|
||||||
|
clock-frequency = <400000>;
|
||||||
|
|
||||||
|
pmic:stpmic@33{
|
||||||
|
compatible = "st,stpmic1";
|
||||||
|
reg = <0x33>;
|
||||||
|
interrupts-extended = <&exti_pwr 55 IRQ_TYPE_EDGE_FALLING>;
|
||||||
|
interrupt-controller;
|
||||||
|
#interrupt-cells = <2>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
regulators{
|
||||||
|
compatible = "st,stpmic1-regulators";
|
||||||
|
buck1-supply = <&vin>;
|
||||||
|
buck2-supply = <&vin>;
|
||||||
|
buck3-supply = <&vin>;
|
||||||
|
buck4-supply = <&vin>;
|
||||||
|
ldo1-supply = <&v3v3>;
|
||||||
|
ldo2-supply = <&vin>;
|
||||||
|
ldo3-supply = <&vdd_ddr>;
|
||||||
|
ldo4-supply = <&vin>;
|
||||||
|
ldo5-supply = <&vin>;
|
||||||
|
ldo6-supply = <&v3v3>;
|
||||||
|
vref_ddr-supply = <&vin>;
|
||||||
|
boost-supply = <&vin>;
|
||||||
|
pwr_sw1-supply = <&bst_out>;
|
||||||
|
pwr_sw2-supply = <&bst_out>;
|
||||||
|
|
||||||
|
vddcore:buck1{
|
||||||
|
regulator-name = "vddcore";
|
||||||
|
regulator-min-microvolt = <1200000>;
|
||||||
|
regulator-max-microvolt = <1350000>;
|
||||||
|
regulator-always-on;
|
||||||
|
regulator-initial-mode = <0>;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
};
|
||||||
|
|
||||||
|
vdd_ddr:buck2{
|
||||||
|
regulator-name = "vdd_ddr";
|
||||||
|
regulator-min-microvolt = <1350000>;
|
||||||
|
regulator-max-microvolt = <1350000>;
|
||||||
|
regulator-always-on;
|
||||||
|
regulator-initial-mode = <0>;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
};
|
||||||
|
|
||||||
|
vdd:buck3{
|
||||||
|
regulator-name = "vdd";
|
||||||
|
regulator-min-microvolt = <3300000>;
|
||||||
|
regulator-max-microvolt = <3300000>;
|
||||||
|
regulator-always-on;
|
||||||
|
st,mask-reset;
|
||||||
|
regulator-initial-mode = <0>;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
};
|
||||||
|
|
||||||
|
v3v3:buck4{
|
||||||
|
regulator-name = "v3v3";
|
||||||
|
regulator-min-microvolt = <3300000>;
|
||||||
|
regulator-max-microvolt = <3300000>;
|
||||||
|
regulator-always-on;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
regulator-initial-mode = <0>;
|
||||||
|
};
|
||||||
|
|
||||||
|
v1v8_audio:ldo1{
|
||||||
|
regulator-name = "v1v8_audio";
|
||||||
|
regulator-min-microvolt = <1800000>;
|
||||||
|
regulator-max-microvolt = <1800000>;
|
||||||
|
regulator-always-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
v3v3_hdmi:ldo2{
|
||||||
|
regulator-name = "v3v3_hdmi";
|
||||||
|
regulator-min-microvolt = <3300000>;
|
||||||
|
regulator-max-microvolt = <3300000>;
|
||||||
|
regulator-always-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
vtt_ddr:ldo3{
|
||||||
|
regulator-name = "vtt_ddr";
|
||||||
|
regulator-always-on;
|
||||||
|
regulator-over-current-protection;
|
||||||
|
st,regulator-sink-source;
|
||||||
|
};
|
||||||
|
|
||||||
|
vdd_usb:ldo4{
|
||||||
|
regulator-name = "vdd_usb";
|
||||||
|
regulator-min-microvolt = <3300000>;
|
||||||
|
regulator-max-microvolt = <3300000>;
|
||||||
|
};
|
||||||
|
|
||||||
|
vdda:ldo5{
|
||||||
|
regulator-name = "vdda";
|
||||||
|
regulator-min-microvolt = <2900000>;
|
||||||
|
regulator-max-microvolt = <2900000>;
|
||||||
|
regulator-boot-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
v1v2_hdmi:ldo6{
|
||||||
|
regulator-name = "v1v2_hdmi";
|
||||||
|
regulator-min-microvolt = <1200000>;
|
||||||
|
regulator-max-microvolt = <1200000>;
|
||||||
|
regulator-always-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
vref_ddr:vref_ddr{
|
||||||
|
regulator-name = "vref_ddr";
|
||||||
|
regulator-always-on;
|
||||||
|
};
|
||||||
|
|
||||||
|
bst_out:boost{
|
||||||
|
regulator-name = "bst_out";
|
||||||
|
};
|
||||||
|
|
||||||
|
vbus_otg:pwr_sw1{
|
||||||
|
regulator-name = "vbus_otg";
|
||||||
|
};
|
||||||
|
|
||||||
|
vbus_sw:pwr_sw2{
|
||||||
|
regulator-name = "vbus_sw";
|
||||||
|
regulator-active-discharge = <1>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/* USER CODE END i2c4 */
|
||||||
|
};
|
||||||
|
|
||||||
|
&iwdg1{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN iwdg1 */
|
||||||
|
timeout-sec = <32>;
|
||||||
|
/* USER CODE END iwdg1 */
|
||||||
|
};
|
||||||
|
|
||||||
|
&rcc{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN rcc */
|
||||||
|
compatible = "st,stm32mp1-rcc-secure", "st,stm32mp1-rcc", "syscon";
|
||||||
|
/* USER CODE END rcc */
|
||||||
|
|
||||||
|
st,clksrc = <
|
||||||
|
CLK_CKPER_HSE
|
||||||
|
CLK_SDMMC12_PLL4P
|
||||||
|
CLK_STGEN_HSE
|
||||||
|
CLK_I2C46_HSI
|
||||||
|
CLK_USBO_USBPHY
|
||||||
|
CLK_UART24_HSI
|
||||||
|
CLK_MPU_PLL1P
|
||||||
|
CLK_AXI_PLL2P
|
||||||
|
CLK_MCU_PLL3P
|
||||||
|
>;
|
||||||
|
st,clkdiv = <
|
||||||
|
DIV(DIV_MPU, 1)
|
||||||
|
DIV(DIV_AXI, 0)
|
||||||
|
DIV(DIV_MCU, 0)
|
||||||
|
DIV(DIV_APB1, 1)
|
||||||
|
DIV(DIV_APB2, 1)
|
||||||
|
DIV(DIV_APB3, 1)
|
||||||
|
DIV(DIV_APB4, 1)
|
||||||
|
DIV(DIV_APB5, 2)
|
||||||
|
DIV(DIV_RTC, 23)
|
||||||
|
DIV(DIV_MCO1, 0)
|
||||||
|
DIV(DIV_MCO2, 0)
|
||||||
|
>;
|
||||||
|
st,pll_vco {
|
||||||
|
pll2_vco_1066Mhz: pll2-vco-1066Mhz {
|
||||||
|
src = < CLK_PLL12_HSE >;
|
||||||
|
divmn = < 2 65 >;
|
||||||
|
frac = < 0x1400 >;
|
||||||
|
};
|
||||||
|
pll3_vco_417Mhz: pll3-vco-417Mhz {
|
||||||
|
src = < CLK_PLL3_HSE >;
|
||||||
|
divmn = < 1 33 >;
|
||||||
|
frac = < 0x1a04 >;
|
||||||
|
};
|
||||||
|
pll4_vco_594Mhz: pll4-vco-594Mhz {
|
||||||
|
src = < CLK_PLL4_HSE >;
|
||||||
|
divmn = < 3 98 >;
|
||||||
|
};
|
||||||
|
/* USER CODE BEGIN rcc_st-pll_vco */
|
||||||
|
|
||||||
|
pll1_vco_1300Mhz:pll1-vco-1300Mhz{
|
||||||
|
src = < CLK_PLL12_HSE >;
|
||||||
|
divmn = < 2 80 >;
|
||||||
|
frac = < 0x800 >;
|
||||||
|
};
|
||||||
|
|
||||||
|
pll3_vco_417_8Mhz:pll3-vco-417_8Mhz{
|
||||||
|
src = < CLK_PLL3_HSE >;
|
||||||
|
divmn = < 1 33 >;
|
||||||
|
frac = < 0x1a04 >;
|
||||||
|
};
|
||||||
|
/* USER CODE END rcc_st-pll_vco */
|
||||||
|
};
|
||||||
|
|
||||||
|
pll2:st,pll@1 {
|
||||||
|
compatible = "st,stm32mp1-pll";
|
||||||
|
reg = <1>;
|
||||||
|
|
||||||
|
st,pll = < &pll2_cfg1 >;
|
||||||
|
|
||||||
|
pll2_cfg1: pll2_cfg1 {
|
||||||
|
st,pll_vco = < &pll2_vco_1066Mhz >;
|
||||||
|
st,pll_div_pqr = < 1 0 0 >;
|
||||||
|
};
|
||||||
|
/* USER CODE BEGIN pll2 */
|
||||||
|
/* USER CODE END pll2 */
|
||||||
|
};
|
||||||
|
|
||||||
|
pll3:st,pll@2 {
|
||||||
|
compatible = "st,stm32mp1-pll";
|
||||||
|
reg = <2>;
|
||||||
|
|
||||||
|
st,pll = < &pll3_cfg1 >;
|
||||||
|
|
||||||
|
pll3_cfg1: pll3_cfg1 {
|
||||||
|
st,pll_vco = < &pll3_vco_417Mhz >;
|
||||||
|
st,pll_div_pqr = < 1 16 36 >;
|
||||||
|
};
|
||||||
|
/* USER CODE BEGIN pll3 */
|
||||||
|
/* USER CODE END pll3 */
|
||||||
|
};
|
||||||
|
|
||||||
|
pll4:st,pll@3 {
|
||||||
|
compatible = "st,stm32mp1-pll";
|
||||||
|
reg = <3>;
|
||||||
|
|
||||||
|
st,pll = < &pll4_cfg1 >;
|
||||||
|
|
||||||
|
pll4_cfg1: pll4_cfg1 {
|
||||||
|
st,pll_vco = < &pll4_vco_594Mhz >;
|
||||||
|
st,pll_div_pqr = < 5 7 7 >;
|
||||||
|
};
|
||||||
|
/* USER CODE BEGIN pll4 */
|
||||||
|
/* USER CODE END pll4 */
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
&sdmmc1{
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&sdmmc1_pins_mx>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN sdmmc1 */
|
||||||
|
disable-wp;
|
||||||
|
st,neg-edge;
|
||||||
|
bus-width = <4>;
|
||||||
|
vmmc-supply = <&v3v3>;
|
||||||
|
/* USER CODE END sdmmc1 */
|
||||||
|
};
|
||||||
|
|
||||||
|
&uart4{
|
||||||
|
pinctrl-names = "default";
|
||||||
|
pinctrl-0 = <&uart4_pins_mx>;
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN uart4 */
|
||||||
|
/* USER CODE END uart4 */
|
||||||
|
};
|
||||||
|
|
||||||
|
&usbotg_hs{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN usbotg_hs */
|
||||||
|
phys = <&usbphyc_port1 0>;
|
||||||
|
phy-names = "usb2-phy";
|
||||||
|
usb-role-switch;
|
||||||
|
/* USER CODE END usbotg_hs */
|
||||||
|
};
|
||||||
|
|
||||||
|
&usbphyc{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN usbphyc */
|
||||||
|
/* USER CODE END usbphyc */
|
||||||
|
};
|
||||||
|
|
||||||
|
&usbphyc_port0{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN usbphyc_port0 */
|
||||||
|
phy-supply = <&vdd_usb>;
|
||||||
|
/* USER CODE END usbphyc_port0 */
|
||||||
|
};
|
||||||
|
|
||||||
|
&usbphyc_port1{
|
||||||
|
status = "okay";
|
||||||
|
|
||||||
|
/* USER CODE BEGIN usbphyc_port1 */
|
||||||
|
phy-supply = <&vdd_usb>;
|
||||||
|
/* USER CODE END usbphyc_port1 */
|
||||||
|
};
|
||||||
|
|
||||||
|
/* USER CODE BEGIN addons */
|
||||||
|
|
||||||
|
&bsec{
|
||||||
|
|
||||||
|
board_id:board_id@ec{
|
||||||
|
reg = <0xec 0x4>;
|
||||||
|
st,non-secure-otp;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&cpu0{
|
||||||
|
cpu-supply = <&vddcore>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&cpu1{
|
||||||
|
cpu-supply = <&vddcore>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&pwr_regulators{
|
||||||
|
vdd-supply = <&vdd>;
|
||||||
|
vdd_3v3_usbfs-supply = <&vdd_usb>;
|
||||||
|
};
|
||||||
|
|
||||||
|
&rng1{
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
|
||||||
|
&rtc{
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
/* USER CODE END addons */
|
||||||
|
|
||||||
+68
@@ -0,0 +1,68 @@
|
|||||||
|
// SPDX-License-Identifier: (GPL-2.0-or-later OR BSD-3-Clause)
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2024, STMicroelectronics - All Rights Reserved
|
||||||
|
* Author: STM32CubeMX code generation for STMicroelectronics.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* For more information on Device Tree configuration, please refer to
|
||||||
|
* https://wiki.st.com/stm32mpu/wiki/Category:Device_tree_configuration
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* USER CODE BEGIN includes */
|
||||||
|
#include "stm32mp15-scmi-u-boot.dtsi"
|
||||||
|
/* USER CODE END includes */
|
||||||
|
|
||||||
|
/ {
|
||||||
|
|
||||||
|
/* USER CODE BEGIN root */
|
||||||
|
|
||||||
|
aliases{
|
||||||
|
i2c3 = &i2c4;
|
||||||
|
usb0 = &usbotg_hs;
|
||||||
|
};
|
||||||
|
|
||||||
|
config{
|
||||||
|
u-boot,boot-led = "heartbeat";
|
||||||
|
u-boot,error-led = "error";
|
||||||
|
u-boot,mmc-env-partition = "u-boot-env";
|
||||||
|
st,adc_usb_pd = <&adc1 18>, <&adc1 19>;
|
||||||
|
st,fastboot-gpios = <&gpioa 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
|
||||||
|
st,stm32prog-gpios = <&gpioa 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
|
||||||
|
};
|
||||||
|
|
||||||
|
led{
|
||||||
|
|
||||||
|
led-red{
|
||||||
|
label = "error";
|
||||||
|
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
|
||||||
|
default-state = "off";
|
||||||
|
status = "okay";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/* USER CODE END root */
|
||||||
|
|
||||||
|
}; /*root*/
|
||||||
|
|
||||||
|
/* USER CODE BEGIN addons */
|
||||||
|
|
||||||
|
&uart4{
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
};
|
||||||
|
|
||||||
|
&usbotg_hs{
|
||||||
|
u-boot,force-b-session-valid;
|
||||||
|
};
|
||||||
|
|
||||||
|
&uart4_pins_mx {
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
pins1 { /* UART4_RX */
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
/* pull-up on rx to avoid floating level */
|
||||||
|
bias-pull-up;
|
||||||
|
};
|
||||||
|
pins2 {
|
||||||
|
u-boot,dm-pre-reloc;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/* USER CODE END addons */
|
||||||
|
|
||||||
+1182
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
|||||||
|
MANIFEST_VERSION = openstlinux-6.1-yocto-mickledore-mp1-v23.06.21
|
||||||
|
KERNEL_DT = ./DeviceTree/VRPMDV-Mon/kernel
|
||||||
|
OPTEE_DT = ./DeviceTree/VRPMDV-Mon/optee-os
|
||||||
|
UBOOT_DT = ./DeviceTree/VRPMDV-Mon/u-boot
|
||||||
|
TFA_DT = ./DeviceTree/VRPMDV-Mon/tf-a
|
||||||
@@ -0,0 +1,248 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
|
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.101619484">
|
||||||
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.101619484" moduleId="org.eclipse.cdt.core.settings" name="Debug">
|
||||||
|
<externalSettings/>
|
||||||
|
<extensions>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
</extensions>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.101619484" name="Debug" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug">
|
||||||
|
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.101619484." name="/" resourcePath="">
|
||||||
|
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug.1971418972" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.debug">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1275454945" name="MCU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32MP157DACx" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1041210185" name="CPU" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.1805879888" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.1407578751" name="Floating-point unit" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.146778795" name="Floating-point ABI" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.435451745" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="STM32MP157D-DK1" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1935711431" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32MP157D-DK1 || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../OPENAMP | ../Core/Inc | ../../Middlewares/Third_Party/OpenAMP/open-amp/lib/include | ../../Middlewares/Third_Party/OpenAMP/libmetal/lib/include | ../../Drivers/STM32MP1xx_HAL_Driver/Inc | ../../Drivers/STM32MP1xx_HAL_Driver/Inc/Legacy | ../../Drivers/CMSIS/Device/ST/STM32MP1xx/Include | ../../Middlewares/Third_Party/OpenAMP/virtual_driver | ../../Drivers/CMSIS/Include || || || CORE_CM4 | NO_ATOMIC_64_SUPPORT | METAL_INTERNAL | METAL_MAX_DEVICE_REGIONS=2 | VIRTIO_SLAVE_ONLY | USE_HAL_DRIVER | STM32MP157Dxx || || Drivers | Core/Src | OPENAMP | Core/Startup | Middlewares | Common || || || ${workspace_loc:/${ProjName}/STM32MP157DACX_RAM.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.412507814" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="-0" valueType="string"/>
|
||||||
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1356863537" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||||
|
<builder buildPath="${workspace_loc:/VRPMDV-Mon_CM4}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.90856846" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.2063819044" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1813734459" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.1285563223" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1831419262" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.545498736" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.1443319808" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.568115107" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.141667105" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||||
|
<listOptionValue builtIn="false" value="CORE_CM4"/>
|
||||||
|
<listOptionValue builtIn="false" value="NO_ATOMIC_64_SUPPORT"/>
|
||||||
|
<listOptionValue builtIn="false" value="METAL_INTERNAL"/>
|
||||||
|
<listOptionValue builtIn="false" value="METAL_MAX_DEVICE_REGIONS=2"/>
|
||||||
|
<listOptionValue builtIn="false" value="VIRTIO_SLAVE_ONLY"/>
|
||||||
|
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||||
|
<listOptionValue builtIn="false" value="STM32MP157Dxx"/>
|
||||||
|
</option>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.1408122752" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value="../OPENAMP"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/open-amp/lib/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/libmetal/lib/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/STM32MP1xx_HAL_Driver/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/STM32MP1xx_HAL_Driver/Inc/Legacy"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/CMSIS/Device/ST/STM32MP1xx/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/virtual_driver"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/CMSIS/Include"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.559940550" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.820794500" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.1989798630" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g3" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1792314072" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.423839258" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="DEBUG"/>
|
||||||
|
<listOptionValue builtIn="false" value="CORE_CM4"/>
|
||||||
|
<listOptionValue builtIn="false" value="NO_ATOMIC_64_SUPPORT"/>
|
||||||
|
<listOptionValue builtIn="false" value="METAL_INTERNAL"/>
|
||||||
|
<listOptionValue builtIn="false" value="METAL_MAX_DEVICE_REGIONS=2"/>
|
||||||
|
<listOptionValue builtIn="false" value="VIRTIO_SLAVE_ONLY"/>
|
||||||
|
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||||
|
<listOptionValue builtIn="false" value="STM32MP157Dxx"/>
|
||||||
|
</option>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.1436769567" name="Include paths (-I)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value="../OPENAMP"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/open-amp/lib/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/libmetal/lib/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/STM32MP1xx_HAL_Driver/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/STM32MP1xx_HAL_Driver/Inc/Legacy"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/CMSIS/Device/ST/STM32MP1xx/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/virtual_driver"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/CMSIS/Include"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp.410951341" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1507694356" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.2087626384" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.option.script.2102914731" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.option.script" value="${workspace_loc:/${ProjName}/STM32MP157DACX_RAM.ld}" valueType="string"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.input.214841323" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.1830724113" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.10864750" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.521517330" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.522852764" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.1100922164" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.259250454" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.1489017167" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1717514267" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
<sourceEntries>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Common"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="OPENAMP"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
||||||
|
</sourceEntries>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
|
</cconfiguration>
|
||||||
|
<cconfiguration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.2032471115">
|
||||||
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.2032471115" moduleId="org.eclipse.cdt.core.settings" name="Release">
|
||||||
|
<externalSettings/>
|
||||||
|
<extensions>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
</extensions>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<configuration artifactExtension="elf" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.2032471115" name="Release" parent="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release">
|
||||||
|
<folderInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.2032471115." name="/" resourcePath="">
|
||||||
|
<toolChain id="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release.764398281" name="MCU ARM GCC" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.toolchain.exe.release">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.990953209" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" useByScannerDiscovery="true" value="STM32MP157DACx" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1688450668" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.2058160196" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.1105786407" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.fpu.value.fpv4-sp-d16" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.1927296208" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi" useByScannerDiscovery="true" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.floatabi.value.hard" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.956775630" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="STM32MP157D-DK1" valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1364790368" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Release || false || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32MP157D-DK1 || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../OPENAMP | ../Core/Inc | ../../Middlewares/Third_Party/OpenAMP/open-amp/lib/include | ../../Middlewares/Third_Party/OpenAMP/libmetal/lib/include | ../../Drivers/STM32MP1xx_HAL_Driver/Inc | ../../Drivers/STM32MP1xx_HAL_Driver/Inc/Legacy | ../../Drivers/CMSIS/Device/ST/STM32MP1xx/Include | ../../Middlewares/Third_Party/OpenAMP/virtual_driver | ../../Drivers/CMSIS/Include || || || CORE_CM4 | NO_ATOMIC_64_SUPPORT | METAL_INTERNAL | METAL_MAX_DEVICE_REGIONS=2 | VIRTIO_SLAVE_ONLY | USE_HAL_DRIVER | STM32MP157Dxx || || Drivers | Core/Src | OPENAMP | Core/Startup | Middlewares | Common || || || ${workspace_loc:/${ProjName}/STM32MP157DACX_RAM.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.2114867350" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" value="-0" valueType="string"/>
|
||||||
|
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1171001619" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
|
||||||
|
<builder buildPath="${workspace_loc:/VRPMDV-Mon_CM4}/Release" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1277271573" managedBuildOn="true" name="Gnu Make Builder.Release" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.1947147731" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.204372767" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g0" valueType="enumerated"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.776560139" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1676924105" name="MCU GCC Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.1589419695" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.1650559819" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.1895674911" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="CORE_CM4"/>
|
||||||
|
<listOptionValue builtIn="false" value="NO_ATOMIC_64_SUPPORT"/>
|
||||||
|
<listOptionValue builtIn="false" value="METAL_INTERNAL"/>
|
||||||
|
<listOptionValue builtIn="false" value="METAL_MAX_DEVICE_REGIONS=2"/>
|
||||||
|
<listOptionValue builtIn="false" value="VIRTIO_SLAVE_ONLY"/>
|
||||||
|
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||||
|
<listOptionValue builtIn="false" value="STM32MP157Dxx"/>
|
||||||
|
</option>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths.249097971" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value="../OPENAMP"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/open-amp/lib/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/libmetal/lib/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/STM32MP1xx_HAL_Driver/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/STM32MP1xx_HAL_Driver/Inc/Legacy"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/CMSIS/Device/ST/STM32MP1xx/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/virtual_driver"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/CMSIS/Include"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1342312967" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.367222157" name="MCU G++ Compiler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.467285903" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.debuglevel.value.g0" valueType="enumerated"/>
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.1570284815" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.value.os" valueType="enumerated"/>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols.1748662848" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||||
|
<listOptionValue builtIn="false" value="CORE_CM4"/>
|
||||||
|
<listOptionValue builtIn="false" value="NO_ATOMIC_64_SUPPORT"/>
|
||||||
|
<listOptionValue builtIn="false" value="METAL_INTERNAL"/>
|
||||||
|
<listOptionValue builtIn="false" value="METAL_MAX_DEVICE_REGIONS=2"/>
|
||||||
|
<listOptionValue builtIn="false" value="VIRTIO_SLAVE_ONLY"/>
|
||||||
|
<listOptionValue builtIn="false" value="USE_HAL_DRIVER"/>
|
||||||
|
<listOptionValue builtIn="false" value="STM32MP157Dxx"/>
|
||||||
|
</option>
|
||||||
|
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths.290234559" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.includepaths" useByScannerDiscovery="false" valueType="includePath">
|
||||||
|
<listOptionValue builtIn="false" value="../OPENAMP"/>
|
||||||
|
<listOptionValue builtIn="false" value="../Core/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/open-amp/lib/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/libmetal/lib/include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/STM32MP1xx_HAL_Driver/Inc"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/STM32MP1xx_HAL_Driver/Inc/Legacy"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/CMSIS/Device/ST/STM32MP1xx/Include"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Middlewares/Third_Party/OpenAMP/virtual_driver"/>
|
||||||
|
<listOptionValue builtIn="false" value="../../Drivers/CMSIS/Include"/>
|
||||||
|
</option>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp.1241814848" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp"/>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.1869857134" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.1843499896" name="MCU G++ Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker">
|
||||||
|
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.option.script.1095557286" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.option.script" value="${workspace_loc:/${ProjName}/STM32MP157DACX_RAM.ld}" valueType="string"/>
|
||||||
|
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.input.761432289" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.linker.input">
|
||||||
|
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||||
|
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
|
||||||
|
</inputType>
|
||||||
|
</tool>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver.1351719435" name="MCU GCC Archiver" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.archiver"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size.91153772" name="MCU Size" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.size"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile.433396278" name="MCU Output Converter list file" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objdump.listfile"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex.1448058878" name="MCU Output Converter Hex" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.hex"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary.388736530" name="MCU Output Converter Binary" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.binary"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog.1612019427" name="MCU Output Converter Verilog" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.verilog"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec.1177559330" name="MCU Output Converter Motorola S-rec" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.srec"/>
|
||||||
|
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1466663623" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
|
||||||
|
</toolChain>
|
||||||
|
</folderInfo>
|
||||||
|
<sourceEntries>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Common"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="OPENAMP"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Middlewares"/>
|
||||||
|
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
|
||||||
|
</sourceEntries>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||||
|
</cconfiguration>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.pathentry"/>
|
||||||
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
|
<project id="VRPMDV-Mon_CM4.null.1983482588" name="VRPMDV-Mon_CM4"/>
|
||||||
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||||
|
<storageModule moduleId="scannerConfiguration">
|
||||||
|
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.2032471115;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.2032471115.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.1676924105;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1342312967">
|
||||||
|
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.101619484;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.101619484.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.545498736;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.559940550">
|
||||||
|
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.2032471115;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.2032471115.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.367222157;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp.1241814848">
|
||||||
|
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
<scannerConfigBuildInfo instanceId="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.101619484;com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.101619484.;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.820794500;com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.input.cpp.410951341">
|
||||||
|
<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId=""/>
|
||||||
|
</scannerConfigBuildInfo>
|
||||||
|
</storageModule>
|
||||||
|
</cproject>
|
||||||
@@ -0,0 +1,210 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>VRPMDV-Mon_CM4</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
|
||||||
|
<triggers>clean,full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
|
||||||
|
<triggers>full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.cnature</nature>
|
||||||
|
<nature>org.eclipse.cdt.core.ccnature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUCubeProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature</nature>
|
||||||
|
<nature>com.st.stm32cube.ide.mpu.MPUEmbeddedMCUProjectNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
|
||||||
|
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||||
|
</natures>
|
||||||
|
<linkedResources>
|
||||||
|
<link>
|
||||||
|
<name>Common</name>
|
||||||
|
<type>2</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Common</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_cortex.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_cortex.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_dma.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_dma.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_dma_ex.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_dma_ex.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_exti.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_exti.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_gpio.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_gpio.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_hsem.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_hsem.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_ipcc.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_ipcc.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_mdma.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_mdma.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_pwr.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_pwr.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_pwr_ex.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_pwr_ex.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_rcc.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_rcc.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_rcc_ex.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_rcc_ex.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_tim.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_tim.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Drivers/STM32MP1xx_HAL_Driver/stm32mp1xx_hal_tim_ex.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Drivers/STM32MP1xx_HAL_Driver/Src/stm32mp1xx_hal_tim_ex.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/CMakeLists.txt</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/open-amp/lib/rpmsg/CMakeLists.txt</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/condition.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/system/generic/condition.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/device.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/device.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/generic_device.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/system/generic/generic_device.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/generic_init.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/system/generic/generic_init.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/generic_io.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/system/generic/generic_io.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/generic_shmem.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/system/generic/generic_shmem.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/init.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/init.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/io.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/io.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/log.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/log.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/remoteproc_virtio.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/open-amp/lib/remoteproc/remoteproc_virtio.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/rpmsg.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/open-amp/lib/rpmsg/rpmsg.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/rpmsg_virtio.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/open-amp/lib/rpmsg/rpmsg_virtio.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/shmem.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/shmem.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/sys.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/system/generic/template/sys.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/time.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/libmetal/lib/system/generic/time.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/virt_uart.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/virtual_driver/virt_uart.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/virtio.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/open-amp/lib/virtio/virtio.c</locationURI>
|
||||||
|
</link>
|
||||||
|
<link>
|
||||||
|
<name>Middlewares/Third_Party/OpenAMP/virtqueue.c</name>
|
||||||
|
<type>1</type>
|
||||||
|
<locationURI>PARENT-1-PROJECT_LOC/Middlewares/Third_Party/OpenAMP/open-amp/lib/virtio/virtqueue.c</locationURI>
|
||||||
|
</link>
|
||||||
|
</linkedResources>
|
||||||
|
</projectDescription>
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<project>
|
||||||
|
<configuration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.101619484" name="Debug">
|
||||||
|
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||||
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
|
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1842797020343377770" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
|
</provider>
|
||||||
|
</extension>
|
||||||
|
</configuration>
|
||||||
|
<configuration id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.release.2032471115" name="Release">
|
||||||
|
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
|
||||||
|
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||||
|
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
|
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||||
|
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1842797020343377770" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||||
|
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||||
|
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||||
|
</provider>
|
||||||
|
</extension>
|
||||||
|
</configuration>
|
||||||
|
</project>
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
||||||
+2
@@ -0,0 +1,2 @@
|
|||||||
|
635E684B79701B039C64EA45C3F84D30=D63C9FDADCDE706A76E57204BEC27B2C
|
||||||
|
eclipse.preferences.version=1
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file : main.h
|
||||||
|
* @brief : Header for main.c file.
|
||||||
|
* This file contains the common defines of the application.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __MAIN_H
|
||||||
|
#define __MAIN_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal.h"
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN ET */
|
||||||
|
|
||||||
|
/* USER CODE END ET */
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EC */
|
||||||
|
|
||||||
|
/* USER CODE END EC */
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EM */
|
||||||
|
|
||||||
|
/* USER CODE END EM */
|
||||||
|
|
||||||
|
/* Exported functions prototypes ---------------------------------------------*/
|
||||||
|
void Error_Handler(void);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
|
/* USER CODE END EFP */
|
||||||
|
|
||||||
|
/* Private defines -----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* USER CODE BEGIN Private defines */
|
||||||
|
|
||||||
|
/* USER CODE END Private defines */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __MAIN_H */
|
||||||
+348
@@ -0,0 +1,348 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_conf.h
|
||||||
|
* @brief HAL configuration file.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_HAL_CONF_H
|
||||||
|
#define STM32MP1xx_HAL_CONF_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* ########################## Module Selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief This is the list of modules to be used in the HAL driver
|
||||||
|
*/
|
||||||
|
#define HAL_MODULE_ENABLED
|
||||||
|
/*#define HAL_ADC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_CEC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_CRC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_CRYP_MODULE_ENABLED */
|
||||||
|
/*#define HAL_DAC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_DCMI_MODULE_ENABLED */
|
||||||
|
/*#define HAL_DFSDM_MODULE_ENABLED */
|
||||||
|
/*#define HAL_FDCAN_MODULE_ENABLED */
|
||||||
|
/*#define HAL_HASH_MODULE_ENABLED */
|
||||||
|
#define HAL_HSEM_MODULE_ENABLED
|
||||||
|
/*#define HAL_I2C_MODULE_ENABLED */
|
||||||
|
/*#define HAL_I2S_MODULE_ENABLED */
|
||||||
|
#define HAL_IPCC_MODULE_ENABLED
|
||||||
|
/*#define HAL_LPTIM_MODULE_ENABLED */
|
||||||
|
/*#define HAL_QSPI_MODULE_ENABLED */
|
||||||
|
/*#define HAL_RNG_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SAI_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SD_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SMARTCARD_MODULE_ENABLED */
|
||||||
|
/*#define HAL_RTC_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SMBUS_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SPDIFRX_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SPI_MODULE_ENABLED */
|
||||||
|
/*#define HAL_SRAM_MODULE_ENABLED */
|
||||||
|
/*#define HAL_TIM_MODULE_ENABLED */
|
||||||
|
/*#define HAL_UART_MODULE_ENABLED */
|
||||||
|
/*#define HAL_USART_MODULE_ENABLED */
|
||||||
|
/*#define HAL_WWDG_MODULE_ENABLED */
|
||||||
|
#define HAL_GPIO_MODULE_ENABLED
|
||||||
|
#define HAL_EXTI_MODULE_ENABLED
|
||||||
|
#define HAL_DMA_MODULE_ENABLED
|
||||||
|
#define HAL_MDMA_MODULE_ENABLED
|
||||||
|
#define HAL_RCC_MODULE_ENABLED
|
||||||
|
#define HAL_PWR_MODULE_ENABLED
|
||||||
|
#define HAL_CORTEX_MODULE_ENABLED
|
||||||
|
|
||||||
|
/* ########################## Register Callbacks selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief This is the list of modules where register callback can be used
|
||||||
|
*/
|
||||||
|
#define USE_HAL_ADC_REGISTER_CALLBACKS 0u
|
||||||
|
#define USE_HAL_CEC_REGISTER_CALLBACKS 0u
|
||||||
|
#define USE_HAL_DAC_REGISTER_CALLBACKS 0u
|
||||||
|
#define USE_HAL_I2C_REGISTER_CALLBACKS 0u
|
||||||
|
#define USE_HAL_RNG_REGISTER_CALLBACKS 0u
|
||||||
|
#define USE_HAL_SPI_REGISTER_CALLBACKS 0u
|
||||||
|
#define USE_HAL_UART_REGISTER_CALLBACKS 0u
|
||||||
|
#define USE_HAL_USART_REGISTER_CALLBACKS 0u
|
||||||
|
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u
|
||||||
|
|
||||||
|
/* ########################## Oscillator Values adaptation ####################*/
|
||||||
|
/**
|
||||||
|
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
|
||||||
|
* This value is used by the RCC HAL module to compute the system frequency
|
||||||
|
* (when HSE is used as system clock source, directly or through the PLL).
|
||||||
|
*/
|
||||||
|
#if !defined (HSE_VALUE)
|
||||||
|
#define HSE_VALUE (24000000U) /*!< Value of the External oscillator in Hz : FPGA case fixed to 60MHZ */
|
||||||
|
#endif /* HSE_VALUE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief In the following line adjust the External High Speed oscillator (HSE) Startup
|
||||||
|
* Timeout value
|
||||||
|
*/
|
||||||
|
#if !defined (HSE_STARTUP_TIMEOUT)
|
||||||
|
#define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */
|
||||||
|
#endif /* HSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Internal High Speed oscillator (HSI) value.
|
||||||
|
* This value is used by the RCC HAL module to compute the system frequency
|
||||||
|
* (when HSI is used as system clock source, directly or through the PLL).
|
||||||
|
*/
|
||||||
|
#if !defined (HSI_VALUE)
|
||||||
|
#define HSI_VALUE (64000000U) /*!< Value of the Internal oscillator in Hz*/
|
||||||
|
#endif /* HSI_VALUE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup
|
||||||
|
* Timeout value
|
||||||
|
*/
|
||||||
|
#if !defined (HSI_STARTUP_TIMEOUT)
|
||||||
|
#define HSI_STARTUP_TIMEOUT 5000U /*!< Time out for HSI start up */
|
||||||
|
#endif /* HSI_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Internal Low Speed oscillator (LSI) value.
|
||||||
|
*/
|
||||||
|
#if !defined (LSI_VALUE)
|
||||||
|
#define LSI_VALUE 32000U
|
||||||
|
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
|
||||||
|
The real value may vary depending on the variations
|
||||||
|
in voltage and temperature. */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief External Low Speed oscillator (LSE) value.
|
||||||
|
* This value is used by the UART, RTC HAL module to compute the system frequency
|
||||||
|
*/
|
||||||
|
#if !defined (LSE_VALUE)
|
||||||
|
#define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/
|
||||||
|
#endif /* LSE_VALUE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Time out for LSE start up value in ms.
|
||||||
|
*/
|
||||||
|
#if !defined (LSE_STARTUP_TIMEOUT)
|
||||||
|
#define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */
|
||||||
|
#endif /* LSE_STARTUP_TIMEOUT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Internal oscillator (CSI) default value.
|
||||||
|
* This value is the default CSI value after Reset.
|
||||||
|
*/
|
||||||
|
#if !defined (CSI_VALUE)
|
||||||
|
#define CSI_VALUE 4000000U /*!< Value of the Internal oscillator in Hz*/
|
||||||
|
#endif /* CSI_VALUE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief External clock source for I2S peripheral
|
||||||
|
* This value is used by the I2S HAL module to compute the I2S clock source
|
||||||
|
* frequency, this source is inserted directly through I2S_CKIN pad.
|
||||||
|
*/
|
||||||
|
#if !defined (EXTERNAL_CLOCK_VALUE)
|
||||||
|
#define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/
|
||||||
|
#endif /* EXTERNAL_CLOCK_VALUE */
|
||||||
|
|
||||||
|
/* Tip: To avoid modifying this file each time you need to use different HSE,
|
||||||
|
=== you can define the HSE value in your toolchain compiler preprocessor. */
|
||||||
|
|
||||||
|
/* ########################### System Configuration ######################### */
|
||||||
|
/**
|
||||||
|
* @brief This is the HAL system configuration section
|
||||||
|
*/
|
||||||
|
#define VDD_VALUE 3300U /*!< Value of VDD in mv */
|
||||||
|
#define TICK_INT_PRIORITY 1U /*!< tick interrupt priority (lowest by default) */
|
||||||
|
/* Warning: Must be set to higher priority for HAL_Delay() */
|
||||||
|
/* and HAL_GetTick() usage under interrupt context */
|
||||||
|
#define USE_RTOS 0U
|
||||||
|
#define PREFETCH_ENABLE 0U
|
||||||
|
#define INSTRUCTION_CACHE_ENABLE 0U
|
||||||
|
#define DATA_CACHE_ENABLE 0U
|
||||||
|
|
||||||
|
/* ########################## Assert Selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief Uncomment the line below to expanse the "assert_param" macro in the
|
||||||
|
* HAL drivers code
|
||||||
|
*/
|
||||||
|
/* #define USE_FULL_ASSERT 1U */
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
/**
|
||||||
|
* @brief Include module's header file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAL_RCC_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_rcc.h"
|
||||||
|
#endif /* HAL_RCC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_EXTI_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_exti.h"
|
||||||
|
#endif /* HAL_EXTI_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_GPIO_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_gpio.h"
|
||||||
|
#endif /* HAL_GPIO_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_HSEM_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_hsem.h"
|
||||||
|
#endif /* HAL_HSEM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_DMA_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_dma.h"
|
||||||
|
#endif /* HAL_DMA_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_MDMA_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_mdma.h"
|
||||||
|
#endif /* HAL_MDMA_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CORTEX_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_cortex.h"
|
||||||
|
#endif /* HAL_CORTEX_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_ADC_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_adc.h"
|
||||||
|
#endif /* HAL_ADC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CEC_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_cec.h"
|
||||||
|
#endif /* HAL_CEC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CRC_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_crc.h"
|
||||||
|
#endif /* HAL_CRC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_CRYP_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_cryp.h"
|
||||||
|
#endif /* HAL_CRYP_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_DAC_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_dac.h"
|
||||||
|
#endif /* HAL_DAC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_DCMI_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_dcmi.h"
|
||||||
|
#endif /* HAL_DCMI_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_DFSDM_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_dfsdm.h"
|
||||||
|
#endif /* HAL_DFSDM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_FDCAN_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_fdcan.h"
|
||||||
|
#endif /* HAL_FDCAN_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_HASH_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_hash.h"
|
||||||
|
#endif /* HAL_HASH_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_I2C_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_i2c.h"
|
||||||
|
#endif /* HAL_I2C_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_IPCC_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_ipcc.h"
|
||||||
|
#endif /* HAL_IPCC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_LPTIM_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_lptim.h"
|
||||||
|
#endif /* HAL_LPTIM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_PWR_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_pwr.h"
|
||||||
|
#endif /* HAL_PWR_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_QSPI_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_qspi.h"
|
||||||
|
#endif /* HAL_QSPI_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_RNG_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_rng.h"
|
||||||
|
#endif /* HAL_RNG_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_RTC_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_rtc.h"
|
||||||
|
#endif /* HAL_RTC_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SAI_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_sai.h"
|
||||||
|
#endif /* HAL_SAI_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SD_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_sd.h"
|
||||||
|
#endif /* HAL_SD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SMARTCARD_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_smartcard.h"
|
||||||
|
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SMBUS_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_smbus.h"
|
||||||
|
#endif /* HAL_SMBUS_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SPDIFRX_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_spdifrx.h"
|
||||||
|
#endif /* HAL_SPDIFRX_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SPI_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_spi.h"
|
||||||
|
#endif /* HAL_SPI_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_SRAM_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_sram.h"
|
||||||
|
#endif /* HAL_SRAM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_TIM_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_tim.h"
|
||||||
|
#endif /* HAL_TIM_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_UART_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_uart.h"
|
||||||
|
#endif /* HAL_UART_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_USART_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_usart.h"
|
||||||
|
#endif /* HAL_USART_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef HAL_WWDG_MODULE_ENABLED
|
||||||
|
#include "stm32mp1xx_hal_wwdg.h"
|
||||||
|
#endif /* HAL_WWDG_MODULE_ENABLED */
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
#ifdef USE_FULL_ASSERT
|
||||||
|
/**
|
||||||
|
* @brief The assert_param macro is used for function's parameters check.
|
||||||
|
* @param expr: If expr is false, it calls assert_failed function
|
||||||
|
* which reports the name of the source file and the source
|
||||||
|
* line number of the call that failed.
|
||||||
|
* If expr is true, it returns no value.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
|
||||||
|
/* Exported functions ------------------------------------------------------- */
|
||||||
|
void assert_failed(uint8_t* file, uint32_t line);
|
||||||
|
#else
|
||||||
|
#define assert_param(expr) ((void)0U)
|
||||||
|
#endif /* USE_FULL_ASSERT */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_HAL_CONF_H */
|
||||||
|
|
||||||
+69
@@ -0,0 +1,69 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_it.h
|
||||||
|
* @brief This file contains the headers of the interrupt handlers.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32MP1xx_IT_H
|
||||||
|
#define __STM32MP1xx_IT_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN ET */
|
||||||
|
|
||||||
|
/* USER CODE END ET */
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EC */
|
||||||
|
|
||||||
|
/* USER CODE END EC */
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EM */
|
||||||
|
|
||||||
|
/* USER CODE END EM */
|
||||||
|
|
||||||
|
/* Exported functions prototypes ---------------------------------------------*/
|
||||||
|
void NMI_Handler(void);
|
||||||
|
void HardFault_Handler(void);
|
||||||
|
void MemManage_Handler(void);
|
||||||
|
void BusFault_Handler(void);
|
||||||
|
void UsageFault_Handler(void);
|
||||||
|
void SVC_Handler(void);
|
||||||
|
void DebugMon_Handler(void);
|
||||||
|
void PendSV_Handler(void);
|
||||||
|
void SysTick_Handler(void);
|
||||||
|
void IPCC_RX1_IRQHandler(void);
|
||||||
|
void IPCC_TX1_IRQHandler(void);
|
||||||
|
void RCC_WAKEUP_IRQHandler(void);
|
||||||
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
|
/* USER CODE END EFP */
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_IT_H */
|
||||||
@@ -0,0 +1,319 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file : main.c
|
||||||
|
* @brief : Main program body
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "main.h"
|
||||||
|
#include "openamp.h"
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PTD */
|
||||||
|
|
||||||
|
/* USER CODE END PTD */
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PD */
|
||||||
|
|
||||||
|
/* USER CODE END PD */
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PM */
|
||||||
|
|
||||||
|
/* USER CODE END PM */
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
IPCC_HandleTypeDef hipcc;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PV */
|
||||||
|
|
||||||
|
/* USER CODE END PV */
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
void SystemClock_Config(void);
|
||||||
|
void PeriphCommonClock_Config(void);
|
||||||
|
static void MX_GPIO_Init(void);
|
||||||
|
static void MX_DMA_Init(void);
|
||||||
|
static void MX_IPCC_Init(void);
|
||||||
|
int MX_OPENAMP_Init(int RPMsgRole, rpmsg_ns_bind_cb ns_bind_cb);
|
||||||
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
|
/* USER CODE END PFP */
|
||||||
|
|
||||||
|
/* Private user code ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The application entry point.
|
||||||
|
* @retval int
|
||||||
|
*/
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
|
/* USER CODE END 1 */
|
||||||
|
|
||||||
|
/* MCU Configuration--------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
|
||||||
|
HAL_Init();
|
||||||
|
|
||||||
|
/* USER CODE BEGIN Init */
|
||||||
|
|
||||||
|
/* USER CODE END Init */
|
||||||
|
|
||||||
|
if(IS_ENGINEERING_BOOT_MODE())
|
||||||
|
{
|
||||||
|
/* Configure the system clock */
|
||||||
|
SystemClock_Config();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(IS_ENGINEERING_BOOT_MODE())
|
||||||
|
{
|
||||||
|
/* Configure the peripherals common clocks */
|
||||||
|
PeriphCommonClock_Config();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* IPCC initialisation */
|
||||||
|
MX_IPCC_Init();
|
||||||
|
/* OpenAmp initialisation ---------------------------------*/
|
||||||
|
MX_OPENAMP_Init(RPMSG_REMOTE, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN SysInit */
|
||||||
|
|
||||||
|
/* USER CODE END SysInit */
|
||||||
|
|
||||||
|
/* Initialize all configured peripherals */
|
||||||
|
MX_GPIO_Init();
|
||||||
|
MX_DMA_Init();
|
||||||
|
/* USER CODE BEGIN 2 */
|
||||||
|
|
||||||
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
|
/* Infinite loop */
|
||||||
|
/* USER CODE BEGIN WHILE */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE END WHILE */
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 3 */
|
||||||
|
}
|
||||||
|
/* USER CODE END 3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief System Clock Configuration
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void SystemClock_Config(void)
|
||||||
|
{
|
||||||
|
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
|
||||||
|
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
|
||||||
|
|
||||||
|
/** Configure LSE Drive Capability
|
||||||
|
*/
|
||||||
|
HAL_PWR_EnableBkUpAccess();
|
||||||
|
__HAL_RCC_LSEDRIVE_CONFIG(RCC_LSEDRIVE_MEDIUMHIGH);
|
||||||
|
|
||||||
|
/** Initializes the RCC Oscillators according to the specified parameters
|
||||||
|
* in the RCC_OscInitTypeDef structure.
|
||||||
|
*/
|
||||||
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_CSI|RCC_OSCILLATORTYPE_HSI
|
||||||
|
|RCC_OSCILLATORTYPE_HSE|RCC_OSCILLATORTYPE_LSE;
|
||||||
|
RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS_DIG;
|
||||||
|
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
|
||||||
|
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
|
||||||
|
RCC_OscInitStruct.HSIDivValue = RCC_HSI_DIV1;
|
||||||
|
RCC_OscInitStruct.CSIState = RCC_CSI_ON;
|
||||||
|
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||||
|
RCC_OscInitStruct.PLL2.PLLState = RCC_PLL_ON;
|
||||||
|
RCC_OscInitStruct.PLL2.PLLSource = RCC_PLL12SOURCE_HSE;
|
||||||
|
RCC_OscInitStruct.PLL2.PLLM = 3;
|
||||||
|
RCC_OscInitStruct.PLL2.PLLN = 66;
|
||||||
|
RCC_OscInitStruct.PLL2.PLLP = 2;
|
||||||
|
RCC_OscInitStruct.PLL2.PLLQ = 1;
|
||||||
|
RCC_OscInitStruct.PLL2.PLLR = 1;
|
||||||
|
RCC_OscInitStruct.PLL2.PLLFRACV = 0x1400;
|
||||||
|
RCC_OscInitStruct.PLL2.PLLMODE = RCC_PLL_FRACTIONAL;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLState = RCC_PLL_ON;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLSource = RCC_PLL3SOURCE_HSE;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLM = 2;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLN = 34;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLP = 2;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLQ = 17;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLR = 37;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLRGE = RCC_PLL3IFRANGE_1;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLFRACV = 6660;
|
||||||
|
RCC_OscInitStruct.PLL3.PLLMODE = RCC_PLL_FRACTIONAL;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLState = RCC_PLL_ON;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLSource = RCC_PLL4SOURCE_HSE;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLM = 4;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLN = 99;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLP = 6;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLQ = 8;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLR = 8;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLRGE = RCC_PLL4IFRANGE_0;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLFRACV = 0;
|
||||||
|
RCC_OscInitStruct.PLL4.PLLMODE = RCC_PLL_INTEGER;
|
||||||
|
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** RCC Clock Config
|
||||||
|
*/
|
||||||
|
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_ACLK
|
||||||
|
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2
|
||||||
|
|RCC_CLOCKTYPE_PCLK3|RCC_CLOCKTYPE_PCLK4
|
||||||
|
|RCC_CLOCKTYPE_PCLK5;
|
||||||
|
RCC_ClkInitStruct.AXISSInit.AXI_Clock = RCC_AXISSOURCE_PLL2;
|
||||||
|
RCC_ClkInitStruct.AXISSInit.AXI_Div = RCC_AXI_DIV1;
|
||||||
|
RCC_ClkInitStruct.MCUInit.MCU_Clock = RCC_MCUSSOURCE_PLL3;
|
||||||
|
RCC_ClkInitStruct.MCUInit.MCU_Div = RCC_MCU_DIV1;
|
||||||
|
RCC_ClkInitStruct.APB4_Div = RCC_APB4_DIV2;
|
||||||
|
RCC_ClkInitStruct.APB5_Div = RCC_APB5_DIV4;
|
||||||
|
RCC_ClkInitStruct.APB1_Div = RCC_APB1_DIV2;
|
||||||
|
RCC_ClkInitStruct.APB2_Div = RCC_APB2_DIV2;
|
||||||
|
RCC_ClkInitStruct.APB3_Div = RCC_APB3_DIV2;
|
||||||
|
|
||||||
|
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the HSE division factor for RTC clock
|
||||||
|
*/
|
||||||
|
__HAL_RCC_RTC_HSEDIV(24);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Peripherals Common Clock Configuration
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void PeriphCommonClock_Config(void)
|
||||||
|
{
|
||||||
|
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
|
||||||
|
|
||||||
|
/** Initializes the common periph clock
|
||||||
|
*/
|
||||||
|
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_CKPER;
|
||||||
|
PeriphClkInit.CkperClockSelection = RCC_CKPERCLKSOURCE_HSE;
|
||||||
|
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief IPCC Initialization Function
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
static void MX_IPCC_Init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* USER CODE BEGIN IPCC_Init 0 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_Init 0 */
|
||||||
|
|
||||||
|
/* USER CODE BEGIN IPCC_Init 1 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_Init 1 */
|
||||||
|
hipcc.Instance = IPCC;
|
||||||
|
if (HAL_IPCC_Init(&hipcc) != HAL_OK)
|
||||||
|
{
|
||||||
|
Error_Handler();
|
||||||
|
}
|
||||||
|
/* USER CODE BEGIN IPCC_Init 2 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_Init 2 */
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable DMA controller clock
|
||||||
|
*/
|
||||||
|
static void MX_DMA_Init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* DMA controller clock enable */
|
||||||
|
__HAL_RCC_DMAMUX_CLK_ENABLE();
|
||||||
|
__HAL_RCC_DMA1_CLK_ENABLE();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GPIO Initialization Function
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
static void MX_GPIO_Init(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN MX_GPIO_Init_1 */
|
||||||
|
/* USER CODE END MX_GPIO_Init_1 */
|
||||||
|
|
||||||
|
/* GPIO Ports Clock Enable */
|
||||||
|
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||||
|
__HAL_RCC_GPIOH_CLK_ENABLE();
|
||||||
|
|
||||||
|
/* USER CODE BEGIN MX_GPIO_Init_2 */
|
||||||
|
/* USER CODE END MX_GPIO_Init_2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 4 */
|
||||||
|
|
||||||
|
/* USER CODE END 4 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function is executed in case of error occurrence.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void Error_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN Error_Handler_Debug */
|
||||||
|
/* User can add his own implementation to report the HAL error return state */
|
||||||
|
__disable_irq();
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
/* USER CODE END Error_Handler_Debug */
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef USE_FULL_ASSERT
|
||||||
|
/**
|
||||||
|
* @brief Reports the name of the source file and the source line number
|
||||||
|
* where the assert_param error has occurred.
|
||||||
|
* @param file: pointer to the source file name
|
||||||
|
* @param line: assert_param error line source number
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void assert_failed(uint8_t *file, uint32_t line)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN 6 */
|
||||||
|
/* User can add his own implementation to report the file name and line number,
|
||||||
|
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
||||||
|
/* USER CODE END 6 */
|
||||||
|
}
|
||||||
|
#endif /* USE_FULL_ASSERT */
|
||||||
+151
@@ -0,0 +1,151 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_msp.c
|
||||||
|
* @brief This file provides code for the MSP Initialization
|
||||||
|
* and de-Initialization codes.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN TD */
|
||||||
|
|
||||||
|
/* USER CODE END TD */
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Define */
|
||||||
|
|
||||||
|
/* USER CODE END Define */
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Macro */
|
||||||
|
|
||||||
|
/* USER CODE END Macro */
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PV */
|
||||||
|
|
||||||
|
/* USER CODE END PV */
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
|
/* USER CODE END PFP */
|
||||||
|
|
||||||
|
/* External functions --------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN ExternalFunctions */
|
||||||
|
|
||||||
|
/* USER CODE END ExternalFunctions */
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
|
/* USER CODE END 0 */
|
||||||
|
/**
|
||||||
|
* Initializes the Global MSP.
|
||||||
|
*/
|
||||||
|
void HAL_MspInit(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END MspInit 0 */
|
||||||
|
|
||||||
|
__HAL_RCC_HSEM_CLK_ENABLE();
|
||||||
|
|
||||||
|
/* System interrupt init*/
|
||||||
|
/* MemoryManagement_IRQn interrupt configuration */
|
||||||
|
HAL_NVIC_SetPriority(MemoryManagement_IRQn, 1, 0);
|
||||||
|
/* BusFault_IRQn interrupt configuration */
|
||||||
|
HAL_NVIC_SetPriority(BusFault_IRQn, 1, 0);
|
||||||
|
/* UsageFault_IRQn interrupt configuration */
|
||||||
|
HAL_NVIC_SetPriority(UsageFault_IRQn, 1, 0);
|
||||||
|
/* SVCall_IRQn interrupt configuration */
|
||||||
|
HAL_NVIC_SetPriority(SVCall_IRQn, 1, 0);
|
||||||
|
/* DebugMonitor_IRQn interrupt configuration */
|
||||||
|
HAL_NVIC_SetPriority(DebugMonitor_IRQn, 1, 0);
|
||||||
|
/* PendSV_IRQn interrupt configuration */
|
||||||
|
HAL_NVIC_SetPriority(PendSV_IRQn, 1, 0);
|
||||||
|
|
||||||
|
/* Peripheral interrupt init */
|
||||||
|
/* RCC_WAKEUP_IRQn interrupt configuration */
|
||||||
|
HAL_NVIC_SetPriority(RCC_WAKEUP_IRQn, 0, 0);
|
||||||
|
HAL_NVIC_EnableIRQ(RCC_WAKEUP_IRQn);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END MspInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief IPCC MSP Initialization
|
||||||
|
* This function configures the hardware resources used in this example
|
||||||
|
* @param hipcc: IPCC handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_IPCC_MspInit(IPCC_HandleTypeDef* hipcc)
|
||||||
|
{
|
||||||
|
if(hipcc->Instance==IPCC)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN IPCC_MspInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_MspInit 0 */
|
||||||
|
/* Peripheral clock enable */
|
||||||
|
__HAL_RCC_IPCC_CLK_ENABLE();
|
||||||
|
/* IPCC interrupt Init */
|
||||||
|
HAL_NVIC_SetPriority(IPCC_RX1_IRQn, 1, 0);
|
||||||
|
HAL_NVIC_EnableIRQ(IPCC_RX1_IRQn);
|
||||||
|
HAL_NVIC_SetPriority(IPCC_TX1_IRQn, 1, 0);
|
||||||
|
HAL_NVIC_EnableIRQ(IPCC_TX1_IRQn);
|
||||||
|
/* USER CODE BEGIN IPCC_MspInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_MspInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief IPCC MSP De-Initialization
|
||||||
|
* This function freeze the hardware resources used in this example
|
||||||
|
* @param hipcc: IPCC handle pointer
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void HAL_IPCC_MspDeInit(IPCC_HandleTypeDef* hipcc)
|
||||||
|
{
|
||||||
|
if(hipcc->Instance==IPCC)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN IPCC_MspDeInit 0 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_MspDeInit 0 */
|
||||||
|
/* Peripheral clock disable */
|
||||||
|
__HAL_RCC_IPCC_CLK_DISABLE();
|
||||||
|
|
||||||
|
/* IPCC interrupt DeInit */
|
||||||
|
HAL_NVIC_DisableIRQ(IPCC_RX1_IRQn);
|
||||||
|
HAL_NVIC_DisableIRQ(IPCC_TX1_IRQn);
|
||||||
|
/* USER CODE BEGIN IPCC_MspDeInit 1 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_MspDeInit 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
|
/* USER CODE END 1 */
|
||||||
+245
@@ -0,0 +1,245 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_it.c
|
||||||
|
* @brief Interrupt Service Routines.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "main.h"
|
||||||
|
#include "stm32mp1xx_it.h"
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Private typedef -----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN TD */
|
||||||
|
|
||||||
|
/* USER CODE END TD */
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PD */
|
||||||
|
|
||||||
|
/* USER CODE END PD */
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PM */
|
||||||
|
|
||||||
|
/* USER CODE END PM */
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PV */
|
||||||
|
|
||||||
|
/* USER CODE END PV */
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
|
/* USER CODE END PFP */
|
||||||
|
|
||||||
|
/* Private user code ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
|
/* USER CODE END 0 */
|
||||||
|
|
||||||
|
/* External variables --------------------------------------------------------*/
|
||||||
|
extern IPCC_HandleTypeDef hipcc;
|
||||||
|
/* USER CODE BEGIN EV */
|
||||||
|
|
||||||
|
/* USER CODE END EV */
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* Cortex-M4 Processor Interruption and Exception Handlers */
|
||||||
|
/******************************************************************************/
|
||||||
|
/**
|
||||||
|
* @brief This function handles Non maskable interrupt.
|
||||||
|
*/
|
||||||
|
void NMI_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN NonMaskableInt_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END NonMaskableInt_IRQn 0 */
|
||||||
|
/* USER CODE BEGIN NonMaskableInt_IRQn 1 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
/* USER CODE END NonMaskableInt_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Hard fault interrupt.
|
||||||
|
*/
|
||||||
|
void HardFault_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN HardFault_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END HardFault_IRQn 0 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN W1_HardFault_IRQn 0 */
|
||||||
|
/* USER CODE END W1_HardFault_IRQn 0 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Memory management fault.
|
||||||
|
*/
|
||||||
|
void MemManage_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN MemoryManagement_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END MemoryManagement_IRQn 0 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
|
||||||
|
/* USER CODE END W1_MemoryManagement_IRQn 0 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Pre-fetch fault, memory access fault.
|
||||||
|
*/
|
||||||
|
void BusFault_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN BusFault_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END BusFault_IRQn 0 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN W1_BusFault_IRQn 0 */
|
||||||
|
/* USER CODE END W1_BusFault_IRQn 0 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Undefined instruction or illegal state.
|
||||||
|
*/
|
||||||
|
void UsageFault_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN UsageFault_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END UsageFault_IRQn 0 */
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN W1_UsageFault_IRQn 0 */
|
||||||
|
/* USER CODE END W1_UsageFault_IRQn 0 */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles System service call via SWI instruction.
|
||||||
|
*/
|
||||||
|
void SVC_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN SVCall_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END SVCall_IRQn 0 */
|
||||||
|
/* USER CODE BEGIN SVCall_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END SVCall_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Debug monitor.
|
||||||
|
*/
|
||||||
|
void DebugMon_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN DebugMonitor_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END DebugMonitor_IRQn 0 */
|
||||||
|
/* USER CODE BEGIN DebugMonitor_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END DebugMonitor_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles Pendable request for system service.
|
||||||
|
*/
|
||||||
|
void PendSV_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN PendSV_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END PendSV_IRQn 0 */
|
||||||
|
/* USER CODE BEGIN PendSV_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END PendSV_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles System tick timer.
|
||||||
|
*/
|
||||||
|
void SysTick_Handler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN SysTick_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END SysTick_IRQn 0 */
|
||||||
|
HAL_IncTick();
|
||||||
|
/* USER CODE BEGIN SysTick_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END SysTick_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/******************************************************************************/
|
||||||
|
/* STM32MP1xx Peripheral Interrupt Handlers */
|
||||||
|
/* Add here the Interrupt Handlers for the used peripherals. */
|
||||||
|
/* For the available peripheral interrupt handler names, */
|
||||||
|
/* please refer to the startup file (startup_stm32mp1xx.s). */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles IPCC RX1 occupied interrupt.
|
||||||
|
*/
|
||||||
|
void IPCC_RX1_IRQHandler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN IPCC_RX1_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_RX1_IRQn 0 */
|
||||||
|
HAL_IPCC_RX_IRQHandler(&hipcc);
|
||||||
|
/* USER CODE BEGIN IPCC_RX1_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_RX1_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles IPCC TX1 free interrupt.
|
||||||
|
*/
|
||||||
|
void IPCC_TX1_IRQHandler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN IPCC_TX1_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_TX1_IRQn 0 */
|
||||||
|
HAL_IPCC_TX_IRQHandler(&hipcc);
|
||||||
|
/* USER CODE BEGIN IPCC_TX1_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END IPCC_TX1_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This function handles RCC wake-up interrupt.
|
||||||
|
*/
|
||||||
|
void RCC_WAKEUP_IRQHandler(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN RCC_WAKEUP_IRQn 0 */
|
||||||
|
|
||||||
|
/* USER CODE END RCC_WAKEUP_IRQn 0 */
|
||||||
|
HAL_RCC_WAKEUP_IRQHandler();
|
||||||
|
/* USER CODE BEGIN RCC_WAKEUP_IRQn 1 */
|
||||||
|
|
||||||
|
/* USER CODE END RCC_WAKEUP_IRQn 1 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
|
/* USER CODE END 1 */
|
||||||
@@ -0,0 +1,176 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file syscalls.c
|
||||||
|
* @author Auto-generated by STM32CubeIDE
|
||||||
|
* @brief STM32CubeIDE Minimal System calls file
|
||||||
|
*
|
||||||
|
* For more information about which c-functions
|
||||||
|
* need which of these lowlevel functions
|
||||||
|
* please consult the Newlib libc-manual
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020-2022 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes */
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/times.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Variables */
|
||||||
|
extern int __io_putchar(int ch) __attribute__((weak));
|
||||||
|
extern int __io_getchar(void) __attribute__((weak));
|
||||||
|
|
||||||
|
|
||||||
|
char *__env[1] = { 0 };
|
||||||
|
char **environ = __env;
|
||||||
|
|
||||||
|
|
||||||
|
/* Functions */
|
||||||
|
void initialise_monitor_handles()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int _getpid(void)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _kill(int pid, int sig)
|
||||||
|
{
|
||||||
|
(void)pid;
|
||||||
|
(void)sig;
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _exit (int status)
|
||||||
|
{
|
||||||
|
_kill(status, -1);
|
||||||
|
while (1) {} /* Make sure we hang here */
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) int _read(int file, char *ptr, int len)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
int DataIdx;
|
||||||
|
|
||||||
|
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||||
|
{
|
||||||
|
*ptr++ = __io_getchar();
|
||||||
|
}
|
||||||
|
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) int _write(int file, char *ptr, int len)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
int DataIdx;
|
||||||
|
|
||||||
|
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||||
|
{
|
||||||
|
__io_putchar(*ptr++);
|
||||||
|
}
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _close(int file)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int _fstat(int file, struct stat *st)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
st->st_mode = S_IFCHR;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _isatty(int file)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _lseek(int file, int ptr, int dir)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
(void)ptr;
|
||||||
|
(void)dir;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _open(char *path, int flags, ...)
|
||||||
|
{
|
||||||
|
(void)path;
|
||||||
|
(void)flags;
|
||||||
|
/* Pretend like we always fail */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _wait(int *status)
|
||||||
|
{
|
||||||
|
(void)status;
|
||||||
|
errno = ECHILD;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _unlink(char *name)
|
||||||
|
{
|
||||||
|
(void)name;
|
||||||
|
errno = ENOENT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _times(struct tms *buf)
|
||||||
|
{
|
||||||
|
(void)buf;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _stat(char *file, struct stat *st)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
st->st_mode = S_IFCHR;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _link(char *old, char *new)
|
||||||
|
{
|
||||||
|
(void)old;
|
||||||
|
(void)new;
|
||||||
|
errno = EMLINK;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _fork(void)
|
||||||
|
{
|
||||||
|
errno = EAGAIN;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _execve(char *name, char **argv, char **env)
|
||||||
|
{
|
||||||
|
(void)name;
|
||||||
|
(void)argv;
|
||||||
|
(void)env;
|
||||||
|
errno = ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file sysmem.c
|
||||||
|
* @author Generated by STM32CubeIDE
|
||||||
|
* @brief STM32CubeIDE System Memory calls file
|
||||||
|
*
|
||||||
|
* For more information about which C functions
|
||||||
|
* need which of these lowlevel functions
|
||||||
|
* please consult the newlib libc manual
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2022 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes */
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pointer to the current high watermark of the heap usage
|
||||||
|
*/
|
||||||
|
static uint8_t *__sbrk_heap_end = NULL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief _sbrk() allocates memory to the newlib heap and is used by malloc
|
||||||
|
* and others from the C library
|
||||||
|
*
|
||||||
|
* @verbatim
|
||||||
|
* ############################################################################
|
||||||
|
* # .data # .bss # newlib heap # MSP stack #
|
||||||
|
* # # # # Reserved by _Min_Stack_Size #
|
||||||
|
* ############################################################################
|
||||||
|
* ^-- RAM start ^-- _end _estack, RAM end --^
|
||||||
|
* @endverbatim
|
||||||
|
*
|
||||||
|
* This implementation starts allocating at the '_end' linker symbol
|
||||||
|
* The '_Min_Stack_Size' linker symbol reserves a memory for the MSP stack
|
||||||
|
* The implementation considers '_estack' linker symbol to be RAM end
|
||||||
|
* NOTE: If the MSP stack, at any point during execution, grows larger than the
|
||||||
|
* reserved size, please increase the '_Min_Stack_Size'.
|
||||||
|
*
|
||||||
|
* @param incr Memory size
|
||||||
|
* @return Pointer to allocated memory
|
||||||
|
*/
|
||||||
|
void *_sbrk(ptrdiff_t incr)
|
||||||
|
{
|
||||||
|
extern uint8_t _end; /* Symbol defined in the linker script */
|
||||||
|
extern uint8_t _estack; /* Symbol defined in the linker script */
|
||||||
|
extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */
|
||||||
|
const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
|
||||||
|
const uint8_t *max_heap = (uint8_t *)stack_limit;
|
||||||
|
uint8_t *prev_heap_end;
|
||||||
|
|
||||||
|
/* Initialize heap end at first call */
|
||||||
|
if (NULL == __sbrk_heap_end)
|
||||||
|
{
|
||||||
|
__sbrk_heap_end = &_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Protect heap from growing into the reserved MSP stack */
|
||||||
|
if (__sbrk_heap_end + incr > max_heap)
|
||||||
|
{
|
||||||
|
errno = ENOMEM;
|
||||||
|
return (void *)-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
prev_heap_end = __sbrk_heap_end;
|
||||||
|
__sbrk_heap_end += incr;
|
||||||
|
|
||||||
|
return (void *)prev_heap_end;
|
||||||
|
}
|
||||||
+789
@@ -0,0 +1,789 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file startup_stm32mp15xx.s
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief STM32MP15xx Devices vector table for GCC based toolchain.
|
||||||
|
* This module performs:
|
||||||
|
* - Set the initial SP
|
||||||
|
* - Set the initial PC == Reset_Handler,
|
||||||
|
* - Set the vector table entries with the exceptions ISR address
|
||||||
|
* - Branches to main in the C library (which eventually
|
||||||
|
* calls main()).
|
||||||
|
* After Reset the Cortex-M processor is in Thread mode,
|
||||||
|
* priority is Privileged, and the Stack is set to Main.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
.cpu cortex-m4
|
||||||
|
.fpu softvfp
|
||||||
|
.thumb
|
||||||
|
|
||||||
|
.global g_pfnVectors
|
||||||
|
.global Default_Handler
|
||||||
|
|
||||||
|
/* start address for the initialization values of the .data section.
|
||||||
|
defined in linker script */
|
||||||
|
.word _sidata
|
||||||
|
/* start address for the .data section. defined in linker script */
|
||||||
|
.word _sdata
|
||||||
|
/* end address for the .data section. defined in linker script */
|
||||||
|
.word _edata
|
||||||
|
/* start address for the .bss section. defined in linker script */
|
||||||
|
.word _sbss
|
||||||
|
/* end address for the .bss section. defined in linker script */
|
||||||
|
.word _ebss
|
||||||
|
|
||||||
|
.section .startup_copro_fw.Reset_Handler,"ax"
|
||||||
|
.weak Reset_Handler
|
||||||
|
.type Reset_Handler, %function
|
||||||
|
Reset_Handler:
|
||||||
|
ldr sp, =_estack /* set stack pointer */
|
||||||
|
|
||||||
|
/* Loop to copy data from read only memory to RAM. The ranges
|
||||||
|
* of copy from/to are specified by following symbols evaluated in
|
||||||
|
* linker script.
|
||||||
|
* _sidata: End of code section, i.e., begin of data sections to copy from.
|
||||||
|
* _sdata/_edata: RAM address range that data should be
|
||||||
|
* copied to. Both must be aligned to 4 bytes boundary. */
|
||||||
|
movs r1, #0
|
||||||
|
b LoopCopyDataInit
|
||||||
|
|
||||||
|
CopyDataInit:
|
||||||
|
ldr r3, =_sidata
|
||||||
|
ldr r3, [r3, r1]
|
||||||
|
str r3, [r0, r1]
|
||||||
|
adds r1, r1, #4
|
||||||
|
|
||||||
|
LoopCopyDataInit:
|
||||||
|
ldr r0, =_sdata
|
||||||
|
ldr r3, =_edata
|
||||||
|
adds r2, r0, r1
|
||||||
|
cmp r2, r3
|
||||||
|
bcc CopyDataInit
|
||||||
|
ldr r2, =_sbss
|
||||||
|
b LoopFillZerobss
|
||||||
|
|
||||||
|
/* Zero fill the bss segment. */
|
||||||
|
FillZerobss:
|
||||||
|
movs r3, #0
|
||||||
|
str r3, [r2], #4
|
||||||
|
|
||||||
|
LoopFillZerobss:
|
||||||
|
ldr r3, = _ebss
|
||||||
|
cmp r2, r3
|
||||||
|
bcc FillZerobss
|
||||||
|
|
||||||
|
/* Call the clock system intitialization function.*/
|
||||||
|
|
||||||
|
bl SystemInit
|
||||||
|
// ldr r0, =SystemInit
|
||||||
|
// blx r0
|
||||||
|
/* Call static constructors */
|
||||||
|
bl __libc_init_array
|
||||||
|
// ldr r0, =__libc_init_array
|
||||||
|
// blx r0
|
||||||
|
/* Call the application's entry point.*/
|
||||||
|
bl main
|
||||||
|
//ldr r0, =main
|
||||||
|
//blx r0
|
||||||
|
|
||||||
|
LoopForever:
|
||||||
|
b LoopForever
|
||||||
|
|
||||||
|
|
||||||
|
.size Reset_Handler, .-Reset_Handler
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This is the code that gets called when the processor receives an
|
||||||
|
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||||
|
* the system state for examination by a debugger.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
.section .text.Default_Handler,"ax",%progbits
|
||||||
|
Default_Handler:
|
||||||
|
Infinite_Loop:
|
||||||
|
b Infinite_Loop
|
||||||
|
.size Default_Handler, .-Default_Handler
|
||||||
|
/******************************************************************************
|
||||||
|
*
|
||||||
|
* The minimal vector table for a Cortex M4. Note that the proper constructs
|
||||||
|
* must be placed on this to ensure that it ends up at physical address
|
||||||
|
* 0x0000.0000.
|
||||||
|
*
|
||||||
|
******************************************************************************/
|
||||||
|
.section .isr_vector,"a",%progbits
|
||||||
|
.type g_pfnVectors, %object
|
||||||
|
.size g_pfnVectors, .-g_pfnVectors
|
||||||
|
|
||||||
|
|
||||||
|
g_pfnVectors:
|
||||||
|
.word _estack // Top of Stack
|
||||||
|
.word Reset_Handler // Reset Handler
|
||||||
|
.word NMI_Handler // NMI Handler
|
||||||
|
.word HardFault_Handler // Hard Fault Handler
|
||||||
|
.word MemManage_Handler // MPU Fault Handler
|
||||||
|
.word BusFault_Handler // Bus Fault Handler
|
||||||
|
.word UsageFault_Handler // Usage Fault Handler
|
||||||
|
.word 0 // Reserved
|
||||||
|
.word 0 // Reserved
|
||||||
|
.word 0 // Reserved
|
||||||
|
.word 0 // Reserved
|
||||||
|
.word SVC_Handler // SVCall Handler
|
||||||
|
.word DebugMon_Handler // Debug Monitor Handler
|
||||||
|
.word 0 // Reserved
|
||||||
|
.word PendSV_Handler // PendSV Handler
|
||||||
|
.word SysTick_Handler // SysTick Handler
|
||||||
|
|
||||||
|
// External Interrupts
|
||||||
|
.word WWDG1_IRQHandler // Window WatchDog 1
|
||||||
|
.word PVD_AVD_IRQHandler // PVD and AVD through EXTI Line detection
|
||||||
|
.word TAMP_IRQHandler // Tamper and TimeStamps through the EXTI line
|
||||||
|
.word RTC_WKUP_ALARM_IRQHandler // RTC Wakeup and Alarm through the EXTI line
|
||||||
|
.word RESERVED4_IRQHandler // Reserved
|
||||||
|
.word RCC_IRQHandler // RCC
|
||||||
|
.word EXTI0_IRQHandler // EXTI Line0
|
||||||
|
.word EXTI1_IRQHandler // EXTI Line1
|
||||||
|
.word EXTI2_IRQHandler // EXTI Line2
|
||||||
|
.word EXTI3_IRQHandler // EXTI Line3
|
||||||
|
.word EXTI4_IRQHandler // EXTI Line4
|
||||||
|
.word DMA1_Stream0_IRQHandler // DMA1 Stream 0
|
||||||
|
.word DMA1_Stream1_IRQHandler // DMA1 Stream 1
|
||||||
|
.word DMA1_Stream2_IRQHandler // DMA1 Stream 2
|
||||||
|
.word DMA1_Stream3_IRQHandler // DMA1 Stream 3
|
||||||
|
.word DMA1_Stream4_IRQHandler // DMA1 Stream 4
|
||||||
|
.word DMA1_Stream5_IRQHandler // DMA1 Stream 5
|
||||||
|
.word DMA1_Stream6_IRQHandler // DMA1 Stream 6
|
||||||
|
.word ADC1_IRQHandler // ADC1
|
||||||
|
.word FDCAN1_IT0_IRQHandler // FDCAN1 Interrupt line 0
|
||||||
|
.word FDCAN2_IT0_IRQHandler // FDCAN2 Interrupt line 0
|
||||||
|
.word FDCAN1_IT1_IRQHandler // FDCAN1 Interrupt line 1
|
||||||
|
.word FDCAN2_IT1_IRQHandler // FDCAN2 Interrupt line 1
|
||||||
|
.word EXTI5_IRQHandler // External Line5 interrupts through AIEC
|
||||||
|
.word TIM1_BRK_IRQHandler // TIM1 Break interrupt
|
||||||
|
.word TIM1_UP_IRQHandler // TIM1 Update Interrupt
|
||||||
|
.word TIM1_TRG_COM_IRQHandler // TIM1 Trigger and Commutation Interrupt
|
||||||
|
.word TIM1_CC_IRQHandler // TIM1 Capture Compare
|
||||||
|
.word TIM2_IRQHandler // TIM2
|
||||||
|
.word TIM3_IRQHandler // TIM3
|
||||||
|
.word TIM4_IRQHandler // TIM4
|
||||||
|
.word I2C1_EV_IRQHandler // I2C1 Event
|
||||||
|
.word I2C1_ER_IRQHandler // I2C1 Error
|
||||||
|
.word I2C2_EV_IRQHandler // I2C2 Event
|
||||||
|
.word I2C2_ER_IRQHandler // I2C2 Error
|
||||||
|
.word SPI1_IRQHandler // SPI1
|
||||||
|
.word SPI2_IRQHandler // SPI2
|
||||||
|
.word USART1_IRQHandler // USART1
|
||||||
|
.word USART2_IRQHandler // USART2
|
||||||
|
.word USART3_IRQHandler // USART3
|
||||||
|
.word EXTI10_IRQHandler // External Line10 interrupts through AIEC
|
||||||
|
.word RTC_TIMESTAMP_IRQHandler // RTC TimeStamp through EXTI Line
|
||||||
|
.word EXTI11_IRQHandler // External Line11 interrupts through AIEC
|
||||||
|
.word TIM8_BRK_IRQHandler // TIM8 Break Interrupt
|
||||||
|
.word TIM8_UP_IRQHandler // TIM8 Update Interrupt
|
||||||
|
.word TIM8_TRG_COM_IRQHandler // TIM8 Trigger and Commutation Interrupt
|
||||||
|
.word TIM8_CC_IRQHandler // TIM8 Capture Compare Interrupt
|
||||||
|
.word DMA1_Stream7_IRQHandler // DMA1 Stream7
|
||||||
|
.word FMC_IRQHandler // FMC
|
||||||
|
.word SDMMC1_IRQHandler // SDMMC1
|
||||||
|
.word TIM5_IRQHandler // TIM5
|
||||||
|
.word SPI3_IRQHandler // SPI3
|
||||||
|
.word UART4_IRQHandler // UART4
|
||||||
|
.word UART5_IRQHandler // UART5
|
||||||
|
.word TIM6_IRQHandler // TIM6
|
||||||
|
.word TIM7_IRQHandler // TIM7
|
||||||
|
.word DMA2_Stream0_IRQHandler // DMA2 Stream 0
|
||||||
|
.word DMA2_Stream1_IRQHandler // DMA2 Stream 1
|
||||||
|
.word DMA2_Stream2_IRQHandler // DMA2 Stream 2
|
||||||
|
.word DMA2_Stream3_IRQHandler // DMA2 Stream 3
|
||||||
|
.word DMA2_Stream4_IRQHandler // DMA2 Stream 4
|
||||||
|
.word ETH1_IRQHandler // Ethernet
|
||||||
|
.word ETH1_WKUP_IRQHandler // Ethernet Wakeup through EXTI line
|
||||||
|
.word FDCAN_CAL_IRQHandler // FDCAN Calibration
|
||||||
|
.word EXTI6_IRQHandler // EXTI Line6 interrupts through AIEC
|
||||||
|
.word EXTI7_IRQHandler // EXTI Line7 interrupts through AIEC
|
||||||
|
.word EXTI8_IRQHandler // EXTI Line8 interrupts through AIEC
|
||||||
|
.word EXTI9_IRQHandler // EXTI Line9 interrupts through AIEC
|
||||||
|
.word DMA2_Stream5_IRQHandler // DMA2 Stream 5
|
||||||
|
.word DMA2_Stream6_IRQHandler // DMA2 Stream 6
|
||||||
|
.word DMA2_Stream7_IRQHandler // DMA2 Stream 7
|
||||||
|
.word USART6_IRQHandler // USART6
|
||||||
|
.word I2C3_EV_IRQHandler // I2C3 event
|
||||||
|
.word I2C3_ER_IRQHandler // I2C3 error
|
||||||
|
.word USBH_OHCI_IRQHandler // USB Host OHCI
|
||||||
|
.word USBH_EHCI_IRQHandler // USB Host EHCI
|
||||||
|
.word EXTI12_IRQHandler // EXTI Line12 interrupts through AIEC
|
||||||
|
.word EXTI13_IRQHandler // EXTI Line13 interrupts through AIEC
|
||||||
|
.word DCMI_IRQHandler // DCMI
|
||||||
|
.word CRYP1_IRQHandler // Crypto1 global interrupt
|
||||||
|
.word HASH1_IRQHandler // Crypto Hash1 interrupt
|
||||||
|
.word FPU_IRQHandler // FPU
|
||||||
|
.word UART7_IRQHandler // UART7
|
||||||
|
.word UART8_IRQHandler // UART8
|
||||||
|
.word SPI4_IRQHandler // SPI4
|
||||||
|
.word SPI5_IRQHandler // SPI5
|
||||||
|
.word SPI6_IRQHandler // SPI6
|
||||||
|
.word SAI1_IRQHandler // SAI1
|
||||||
|
.word LTDC_IRQHandler // LTDC
|
||||||
|
.word LTDC_ER_IRQHandler // LTDC error
|
||||||
|
.word ADC2_IRQHandler // ADC2
|
||||||
|
.word SAI2_IRQHandler // SAI2
|
||||||
|
.word QUADSPI_IRQHandler // QUADSPI
|
||||||
|
.word LPTIM1_IRQHandler // LPTIM1 global interrupt
|
||||||
|
.word CEC_IRQHandler // HDMI_CEC
|
||||||
|
.word I2C4_EV_IRQHandler // I2C4 Event
|
||||||
|
.word I2C4_ER_IRQHandler // I2C4 Error
|
||||||
|
.word SPDIF_RX_IRQHandler // SPDIF_RX
|
||||||
|
.word OTG_IRQHandler // USB On The Go HS global interrupt
|
||||||
|
.word RESERVED99_IRQHandler // Reserved
|
||||||
|
.word IPCC_RX0_IRQHandler // Mailbox RX0 Free interrupt
|
||||||
|
.word IPCC_TX0_IRQHandler // Mailbox TX0 Free interrupt
|
||||||
|
.word DMAMUX1_OVR_IRQHandler // DMAMUX1 Overrun interrupt
|
||||||
|
.word IPCC_RX1_IRQHandler // Mailbox RX1 Free interrupt
|
||||||
|
.word IPCC_TX1_IRQHandler // Mailbox TX1 Free interrupt
|
||||||
|
.word CRYP2_IRQHandler // Crypto2 global interrupt
|
||||||
|
.word HASH2_IRQHandler // Crypto Hash2 interrupt
|
||||||
|
.word I2C5_EV_IRQHandler // I2C5 Event Interrupt
|
||||||
|
.word I2C5_ER_IRQHandler // I2C5 Error Interrupt
|
||||||
|
.word GPU_IRQHandler // GPU Global Interrupt
|
||||||
|
.word DFSDM1_FLT0_IRQHandler // DFSDM Filter0 Interrupt
|
||||||
|
.word DFSDM1_FLT1_IRQHandler // DFSDM Filter1 Interrupt
|
||||||
|
.word DFSDM1_FLT2_IRQHandler // DFSDM Filter2 Interrupt
|
||||||
|
.word DFSDM1_FLT3_IRQHandler // DFSDM Filter3 Interrupt
|
||||||
|
.word SAI3_IRQHandler // SAI3 global Interrupt
|
||||||
|
.word DFSDM1_FLT4_IRQHandler // DFSDM Filter4 Interrupt
|
||||||
|
.word TIM15_IRQHandler // TIM15 global Interrupt
|
||||||
|
.word TIM16_IRQHandler // TIM16 global Interrupt
|
||||||
|
.word TIM17_IRQHandler // TIM17 global Interrupt
|
||||||
|
.word TIM12_IRQHandler // TIM12 global Interrupt
|
||||||
|
.word MDIOS_IRQHandler // MDIOS global Interrupt
|
||||||
|
.word EXTI14_IRQHandler // EXTI Line14 interrupts through AIEC
|
||||||
|
.word MDMA_IRQHandler // MDMA global Interrupt
|
||||||
|
.word DSI_IRQHandler // DSI global Interrupt
|
||||||
|
.word SDMMC2_IRQHandler // SDMMC2 global Interrupt
|
||||||
|
.word HSEM_IT2_IRQHandler // HSEM global Interrupt
|
||||||
|
.word DFSDM1_FLT5_IRQHandler // DFSDM Filter5 Interrupt
|
||||||
|
.word EXTI15_IRQHandler // EXTI Line15 interrupts through AIEC
|
||||||
|
.word nCTIIRQ1_IRQHandler // Cortex-M4 CTI interrupt 1
|
||||||
|
.word nCTIIRQ2_IRQHandler // Cortex-M4 CTI interrupt 2
|
||||||
|
.word TIM13_IRQHandler // TIM13 global interrupt
|
||||||
|
.word TIM14_IRQHandler // TIM14 global interrupt
|
||||||
|
.word DAC_IRQHandler // DAC1 and DAC2 underrun error interrupts
|
||||||
|
.word RNG1_IRQHandler // RNG1 interrupt
|
||||||
|
.word RNG2_IRQHandler // RNG2 interrupt
|
||||||
|
.word I2C6_EV_IRQHandler // I2C6 Event Interrupt
|
||||||
|
.word I2C6_ER_IRQHandler // I2C6 Error Interrupt
|
||||||
|
.word SDMMC3_IRQHandler // SDMMC3 global Interrupt
|
||||||
|
.word LPTIM2_IRQHandler // LPTIM2 global interrupt
|
||||||
|
.word LPTIM3_IRQHandler // LPTIM3 global interrupt
|
||||||
|
.word LPTIM4_IRQHandler // LPTIM4 global interrupt
|
||||||
|
.word LPTIM5_IRQHandler // LPTIM5 global interrupt
|
||||||
|
.word ETH1_LPI_IRQHandler // ETH1_LPI interrupt
|
||||||
|
.word RESERVED143_IRQHandler // Reserved
|
||||||
|
.word MPU_SEV_IRQHandler // MPU Send Event through AIEC
|
||||||
|
.word RCC_WAKEUP_IRQHandler // RCC Wake up interrupt
|
||||||
|
.word SAI4_IRQHandler // SAI4 global interrupt
|
||||||
|
.word DTS_IRQHandler // Temperature sensor interrupt
|
||||||
|
.word RESERVED148_IRQHandler // Reserved
|
||||||
|
.word WAKEUP_PIN_IRQHandler // Interrupt for all 6 wake-up pins
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* Provide weak aliases for each Exception handler to the Default_Handler.
|
||||||
|
* As they are weak aliases, any function with the same name will override
|
||||||
|
* this definition.
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
|
||||||
|
.weak NMI_Handler
|
||||||
|
.thumb_set NMI_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak HardFault_Handler
|
||||||
|
.thumb_set HardFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak MemManage_Handler
|
||||||
|
.thumb_set MemManage_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak BusFault_Handler
|
||||||
|
.thumb_set BusFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak UsageFault_Handler
|
||||||
|
.thumb_set UsageFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SVC_Handler
|
||||||
|
.thumb_set SVC_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak DebugMon_Handler
|
||||||
|
.thumb_set DebugMon_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak PendSV_Handler
|
||||||
|
.thumb_set PendSV_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SysTick_Handler
|
||||||
|
.thumb_set SysTick_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak RESERVED4_IRQHandler
|
||||||
|
.thumb_set RESERVED4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RESERVED99_IRQHandler
|
||||||
|
.thumb_set RESERVED99_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ETH1_LPI_IRQHandler
|
||||||
|
.thumb_set ETH1_LPI_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RESERVED143_IRQHandler
|
||||||
|
.thumb_set RESERVED143_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak WWDG1_IRQHandler
|
||||||
|
.thumb_set WWDG1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak PVD_AVD_IRQHandler
|
||||||
|
.thumb_set PVD_AVD_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TAMP_IRQHandler
|
||||||
|
.thumb_set TAMP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_WKUP_ALARM_IRQHandler
|
||||||
|
.thumb_set RTC_WKUP_ALARM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RCC_IRQHandler
|
||||||
|
.thumb_set RCC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI0_IRQHandler
|
||||||
|
.thumb_set EXTI0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI1_IRQHandler
|
||||||
|
.thumb_set EXTI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI2_IRQHandler
|
||||||
|
.thumb_set EXTI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI3_IRQHandler
|
||||||
|
.thumb_set EXTI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI4_IRQHandler
|
||||||
|
.thumb_set EXTI4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream0_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream1_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream2_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream3_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream4_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream5_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream6_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC1_IRQHandler
|
||||||
|
.thumb_set ADC1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC2_IRQHandler
|
||||||
|
.thumb_set ADC2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN1_IT0_IRQHandler
|
||||||
|
.thumb_set FDCAN1_IT0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN2_IT0_IRQHandler
|
||||||
|
.thumb_set FDCAN2_IT0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN1_IT1_IRQHandler
|
||||||
|
.thumb_set FDCAN1_IT1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN2_IT1_IRQHandler
|
||||||
|
.thumb_set FDCAN2_IT1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FDCAN_CAL_IRQHandler
|
||||||
|
.thumb_set FDCAN_CAL_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI5_IRQHandler
|
||||||
|
.thumb_set EXTI5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_BRK_IRQHandler
|
||||||
|
.thumb_set TIM1_BRK_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_UP_IRQHandler
|
||||||
|
.thumb_set TIM1_UP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_TRG_COM_IRQHandler
|
||||||
|
.thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_CC_IRQHandler
|
||||||
|
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM2_IRQHandler
|
||||||
|
.thumb_set TIM2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM3_IRQHandler
|
||||||
|
.thumb_set TIM3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM4_IRQHandler
|
||||||
|
.thumb_set TIM4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_EV_IRQHandler
|
||||||
|
.thumb_set I2C1_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_ER_IRQHandler
|
||||||
|
.thumb_set I2C1_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_EV_IRQHandler
|
||||||
|
.thumb_set I2C2_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_ER_IRQHandler
|
||||||
|
.thumb_set I2C2_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI1_IRQHandler
|
||||||
|
.thumb_set SPI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI2_IRQHandler
|
||||||
|
.thumb_set SPI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART1_IRQHandler
|
||||||
|
.thumb_set USART1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART2_IRQHandler
|
||||||
|
.thumb_set USART2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART3_IRQHandler
|
||||||
|
.thumb_set USART3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI10_IRQHandler
|
||||||
|
.thumb_set EXTI10_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_TIMESTAMP_IRQHandler
|
||||||
|
.thumb_set RTC_TIMESTAMP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI11_IRQHandler
|
||||||
|
.thumb_set EXTI11_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_BRK_IRQHandler
|
||||||
|
.thumb_set TIM8_BRK_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_UP_IRQHandler
|
||||||
|
.thumb_set TIM8_UP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_TRG_COM_IRQHandler
|
||||||
|
.thumb_set TIM8_TRG_COM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_CC_IRQHandler
|
||||||
|
.thumb_set TIM8_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream7_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FMC_IRQHandler
|
||||||
|
.thumb_set FMC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SDMMC1_IRQHandler
|
||||||
|
.thumb_set SDMMC1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM5_IRQHandler
|
||||||
|
.thumb_set TIM5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI3_IRQHandler
|
||||||
|
.thumb_set SPI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART4_IRQHandler
|
||||||
|
.thumb_set UART4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART5_IRQHandler
|
||||||
|
.thumb_set UART5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM6_IRQHandler
|
||||||
|
.thumb_set TIM6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM7_IRQHandler
|
||||||
|
.thumb_set TIM7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream0_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream1_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream2_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream3_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream4_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ETH1_IRQHandler
|
||||||
|
.thumb_set ETH1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ETH1_WKUP_IRQHandler
|
||||||
|
.thumb_set ETH1_WKUP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ETH1_LPI_IRQHandler
|
||||||
|
.thumb_set ETH1_LPI_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI6_IRQHandler
|
||||||
|
.thumb_set EXTI6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI7_IRQHandler
|
||||||
|
.thumb_set EXTI7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI8_IRQHandler
|
||||||
|
.thumb_set EXTI8_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI9_IRQHandler
|
||||||
|
.thumb_set EXTI9_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream5_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream6_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream7_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART6_IRQHandler
|
||||||
|
.thumb_set USART6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C3_EV_IRQHandler
|
||||||
|
.thumb_set I2C3_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C3_ER_IRQHandler
|
||||||
|
.thumb_set I2C3_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USBH_OHCI_IRQHandler
|
||||||
|
.thumb_set USBH_OHCI_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USBH_EHCI_IRQHandler
|
||||||
|
.thumb_set USBH_EHCI_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI12_IRQHandler
|
||||||
|
.thumb_set EXTI12_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI13_IRQHandler
|
||||||
|
.thumb_set EXTI13_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DCMI_IRQHandler
|
||||||
|
.thumb_set DCMI_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CRYP1_IRQHandler
|
||||||
|
.thumb_set CRYP1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak HASH1_IRQHandler
|
||||||
|
.thumb_set HASH1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FPU_IRQHandler
|
||||||
|
.thumb_set FPU_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART7_IRQHandler
|
||||||
|
.thumb_set UART7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART8_IRQHandler
|
||||||
|
.thumb_set UART8_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI4_IRQHandler
|
||||||
|
.thumb_set SPI4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI5_IRQHandler
|
||||||
|
.thumb_set SPI5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI6_IRQHandler
|
||||||
|
.thumb_set SPI6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SAI1_IRQHandler
|
||||||
|
.thumb_set SAI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LTDC_IRQHandler
|
||||||
|
.thumb_set LTDC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LTDC_ER_IRQHandler
|
||||||
|
.thumb_set LTDC_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SAI2_IRQHandler
|
||||||
|
.thumb_set SAI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak QUADSPI_IRQHandler
|
||||||
|
.thumb_set QUADSPI_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPTIM1_IRQHandler
|
||||||
|
.thumb_set LPTIM1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CEC_IRQHandler
|
||||||
|
.thumb_set CEC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C4_EV_IRQHandler
|
||||||
|
.thumb_set I2C4_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C4_ER_IRQHandler
|
||||||
|
.thumb_set I2C4_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPDIF_RX_IRQHandler
|
||||||
|
.thumb_set SPDIF_RX_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak OTG_IRQHandler
|
||||||
|
.thumb_set OTG_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak IPCC_RX0_IRQHandler
|
||||||
|
.thumb_set IPCC_RX0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak IPCC_TX0_IRQHandler
|
||||||
|
.thumb_set IPCC_TX0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMAMUX1_OVR_IRQHandler
|
||||||
|
.thumb_set DMAMUX1_OVR_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak IPCC_RX1_IRQHandler
|
||||||
|
.thumb_set IPCC_RX1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak IPCC_TX1_IRQHandler
|
||||||
|
.thumb_set IPCC_TX1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CRYP2_IRQHandler
|
||||||
|
.thumb_set CRYP2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak HASH2_IRQHandler
|
||||||
|
.thumb_set HASH2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C5_EV_IRQHandler
|
||||||
|
.thumb_set I2C5_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C5_ER_IRQHandler
|
||||||
|
.thumb_set I2C5_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak GPU_IRQHandler
|
||||||
|
.thumb_set GPU_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DFSDM1_FLT0_IRQHandler
|
||||||
|
.thumb_set DFSDM1_FLT0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DFSDM1_FLT1_IRQHandler
|
||||||
|
.thumb_set DFSDM1_FLT1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DFSDM1_FLT2_IRQHandler
|
||||||
|
.thumb_set DFSDM1_FLT2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DFSDM1_FLT3_IRQHandler
|
||||||
|
.thumb_set DFSDM1_FLT3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SAI3_IRQHandler
|
||||||
|
.thumb_set SAI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DFSDM1_FLT4_IRQHandler
|
||||||
|
.thumb_set DFSDM1_FLT4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM15_IRQHandler
|
||||||
|
.thumb_set TIM15_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM16_IRQHandler
|
||||||
|
.thumb_set TIM16_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM17_IRQHandler
|
||||||
|
.thumb_set TIM17_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM12_IRQHandler
|
||||||
|
.thumb_set TIM12_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak MDIOS_IRQHandler
|
||||||
|
.thumb_set MDIOS_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI14_IRQHandler
|
||||||
|
.thumb_set EXTI14_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak MDMA_IRQHandler
|
||||||
|
.thumb_set MDMA_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DSI_IRQHandler
|
||||||
|
.thumb_set DSI_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SDMMC2_IRQHandler
|
||||||
|
.thumb_set SDMMC2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak HSEM_IT2_IRQHandler
|
||||||
|
.thumb_set HSEM_IT2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DFSDM1_FLT5_IRQHandler
|
||||||
|
.thumb_set DFSDM1_FLT5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI15_IRQHandler
|
||||||
|
.thumb_set EXTI15_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak nCTIIRQ1_IRQHandler
|
||||||
|
.thumb_set nCTIIRQ1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak nCTIIRQ2_IRQHandler
|
||||||
|
.thumb_set nCTIIRQ2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM13_IRQHandler
|
||||||
|
.thumb_set TIM13_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM14_IRQHandler
|
||||||
|
.thumb_set TIM14_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DAC_IRQHandler
|
||||||
|
.thumb_set DAC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RNG1_IRQHandler
|
||||||
|
.thumb_set RNG1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RNG2_IRQHandler
|
||||||
|
.thumb_set RNG2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C6_EV_IRQHandler
|
||||||
|
.thumb_set I2C6_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C6_ER_IRQHandler
|
||||||
|
.thumb_set I2C6_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SDMMC3_IRQHandler
|
||||||
|
.thumb_set SDMMC3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPTIM2_IRQHandler
|
||||||
|
.thumb_set LPTIM2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPTIM3_IRQHandler
|
||||||
|
.thumb_set LPTIM3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPTIM4_IRQHandler
|
||||||
|
.thumb_set LPTIM4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPTIM5_IRQHandler
|
||||||
|
.thumb_set LPTIM5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak MPU_SEV_IRQHandler
|
||||||
|
.thumb_set MPU_SEV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RCC_WAKEUP_IRQHandler
|
||||||
|
.thumb_set RCC_WAKEUP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SAI4_IRQHandler
|
||||||
|
.thumb_set SAI4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DTS_IRQHandler
|
||||||
|
.thumb_set DTS_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RESERVED148_IRQHandler
|
||||||
|
.thumb_set RESERVED148_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak WAKEUP_PIN_IRQHandler
|
||||||
|
.thumb_set WAKEUP_PIN_IRQHandler,Default_Handler
|
||||||
|
|
||||||
@@ -0,0 +1,239 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file mbox_ipcc.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief This file provides code for the configuration
|
||||||
|
* of the mailbox_ipcc_if.c MiddleWare.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
/*
|
||||||
|
* Channel direction and usage:
|
||||||
|
*
|
||||||
|
* ======== <-- new msg ---=============--------<------ =======
|
||||||
|
* || || || CHANNEL 1 || || ||
|
||||||
|
* || A7 || ------->-------=============--- buf free--> || M4 ||
|
||||||
|
* || || || ||
|
||||||
|
* ||master|| <-- buf free---=============--------<------ ||slave||
|
||||||
|
* || || || CHANNEL 2 || || ||
|
||||||
|
* ======== ------->-------=============----new msg --> =======
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "openamp/open_amp.h"
|
||||||
|
#include "stm32mp1xx_hal.h"
|
||||||
|
#include "openamp_conf.h"
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Define */
|
||||||
|
|
||||||
|
/* USER CODE END Define */
|
||||||
|
#define MASTER_CPU_ID 0
|
||||||
|
#define REMOTE_CPU_ID 1
|
||||||
|
#define IPCC_CPU_A7 MASTER_CPU_ID
|
||||||
|
#define IPCC_CPU_M4 REMOTE_CPU_ID
|
||||||
|
#define MBOX_NO_MSG 0
|
||||||
|
#define MBOX_NEW_MSG 1
|
||||||
|
#define MBOX_BUF_FREE 2
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
|
/* USER CODE END PFP */
|
||||||
|
|
||||||
|
extern IPCC_HandleTypeDef hipcc;
|
||||||
|
int msg_received_ch1 = MBOX_NO_MSG;
|
||||||
|
int msg_received_ch2 = MBOX_NO_MSG;
|
||||||
|
uint32_t vring0_id = 0; /* used for channel 1 */
|
||||||
|
uint32_t vring1_id = 1; /* used for channel 2 */
|
||||||
|
|
||||||
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
|
/* USER CODE END PFP */
|
||||||
|
|
||||||
|
void IPCC_channel1_callback(IPCC_HandleTypeDef * hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir);
|
||||||
|
void IPCC_channel2_callback(IPCC_HandleTypeDef * hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize MAILBOX with IPCC peripheral
|
||||||
|
* @param None
|
||||||
|
* @retval : Operation result
|
||||||
|
*/
|
||||||
|
int MAILBOX_Init(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PRE_MAILBOX_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_MAILBOX_INIT */
|
||||||
|
|
||||||
|
if (HAL_IPCC_ActivateNotification(&hipcc, IPCC_CHANNEL_1, IPCC_CHANNEL_DIR_RX,
|
||||||
|
IPCC_channel1_callback) != HAL_OK) {
|
||||||
|
OPENAMP_log_err("%s: ch_1 RX fail\n", __func__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (HAL_IPCC_ActivateNotification(&hipcc, IPCC_CHANNEL_2, IPCC_CHANNEL_DIR_RX,
|
||||||
|
IPCC_channel2_callback) != HAL_OK) {
|
||||||
|
OPENAMP_log_err("%s: ch_2 RX fail\n", __func__);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_MAILBOX_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_MAILBOX_INIT */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize MAILBOX with IPCC peripheral
|
||||||
|
* @param virtio device
|
||||||
|
* @retval : Operation result
|
||||||
|
*/
|
||||||
|
int MAILBOX_Poll(struct virtio_device *vdev)
|
||||||
|
{
|
||||||
|
/* If we got an interrupt, ask for the corresponding virtqueue processing */
|
||||||
|
int ret = -1;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PRE_MAILBOX_POLL */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_MAILBOX_POLL */
|
||||||
|
|
||||||
|
if (msg_received_ch1 == MBOX_BUF_FREE) {
|
||||||
|
|
||||||
|
/* USER CODE BEGIN MSG_CHANNEL1 */
|
||||||
|
|
||||||
|
/* USER CODE END MSG_CHANNEL1 */
|
||||||
|
|
||||||
|
OPENAMP_log_dbg("Running virt0 (ch_1 buf free)\r\n");
|
||||||
|
rproc_virtio_notified(vdev, VRING0_ID);
|
||||||
|
ret = 0;
|
||||||
|
msg_received_ch1 = MBOX_NO_MSG;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msg_received_ch2 == MBOX_NEW_MSG) {
|
||||||
|
|
||||||
|
/* USER CODE BEGIN MSG_CHANNEL2 */
|
||||||
|
|
||||||
|
/* USER CODE END MSG_CHANNEL2 */
|
||||||
|
|
||||||
|
OPENAMP_log_dbg("Running virt1 (ch_2 new msg)\r\n");
|
||||||
|
rproc_virtio_notified(vdev, VRING1_ID);
|
||||||
|
msg_received_ch2 = MBOX_NO_MSG;
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_MAILBOX_POLL */
|
||||||
|
|
||||||
|
/* USER CODE END POST_MAILBOX_POLL */
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Callback function called by OpenAMP MW to notify message processing
|
||||||
|
* @param VRING id
|
||||||
|
* @retval Operation result
|
||||||
|
*/
|
||||||
|
int MAILBOX_Notify(void *priv, uint32_t id)
|
||||||
|
{
|
||||||
|
uint32_t channel;
|
||||||
|
(void)priv;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PRE_MAILBOX_NOTIFY */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_MAILBOX_NOTIFY */
|
||||||
|
|
||||||
|
/* Called after virtqueue processing: time to inform the remote */
|
||||||
|
if (id == VRING0_ID) {
|
||||||
|
channel = IPCC_CHANNEL_1;
|
||||||
|
OPENAMP_log_dbg("Send msg on ch_1\r\n");
|
||||||
|
}
|
||||||
|
else if (id == VRING1_ID) {
|
||||||
|
/* Note: the OpenAMP framework never notifies this */
|
||||||
|
channel = IPCC_CHANNEL_2;
|
||||||
|
OPENAMP_log_dbg("Send 'buff free' on ch_2\r\n");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
OPENAMP_log_err("invalid vring (%d)\r\n", (int)id);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check that the channel is free (otherwise wait until it is) */
|
||||||
|
if (HAL_IPCC_GetChannelStatus(&hipcc, channel, IPCC_CHANNEL_DIR_TX) == IPCC_CHANNEL_STATUS_OCCUPIED) {
|
||||||
|
OPENAMP_log_dbg("Waiting for channel to be freed\r\n");
|
||||||
|
while (HAL_IPCC_GetChannelStatus(&hipcc, channel, IPCC_CHANNEL_DIR_TX) == IPCC_CHANNEL_STATUS_OCCUPIED)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Inform A7 (either new message, or buf free) */
|
||||||
|
HAL_IPCC_NotifyCPU(&hipcc, channel, IPCC_CHANNEL_DIR_TX);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_MAILBOX_NOTIFY */
|
||||||
|
|
||||||
|
/* USER CODE END POST_MAILBOX_NOTIFY */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Private function ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
|
/* USER CODE END 0 */
|
||||||
|
/* Callback from IPCC Interrupt Handler: Master Processor informs that there are some free buffers */
|
||||||
|
void IPCC_channel1_callback(IPCC_HandleTypeDef * hipcc,
|
||||||
|
uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PRE_MAILBOX_CHANNEL1_CALLBACK */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_MAILBOX_CHANNEL1_CALLBACK */
|
||||||
|
|
||||||
|
if (msg_received_ch1 != MBOX_NO_MSG)
|
||||||
|
OPENAMP_log_dbg("IPCC_channel1_callback: previous IRQ not treated (status = %d)\r\n", msg_received_ch1);
|
||||||
|
|
||||||
|
msg_received_ch1 = MBOX_BUF_FREE;
|
||||||
|
|
||||||
|
/* Inform A7 that we have received the 'buff free' msg */
|
||||||
|
OPENAMP_log_dbg("Ack 'buff free' message on ch1\r\n");
|
||||||
|
HAL_IPCC_NotifyCPU(hipcc, ChannelIndex, IPCC_CHANNEL_DIR_RX);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_MAILBOX_CHANNEL1_CALLBACK */
|
||||||
|
|
||||||
|
/* USER CODE END POST_MAILBOX_CHANNEL1_CALLBACK */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Callback from IPCC Interrupt Handler: new message received from Master Processor */
|
||||||
|
void IPCC_channel2_callback(IPCC_HandleTypeDef * hipcc,
|
||||||
|
uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir)
|
||||||
|
{
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PRE_MAILBOX_CHANNEL2_CALLBACK */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_MAILBOX_CHANNEL2_CALLBACK */
|
||||||
|
|
||||||
|
if (msg_received_ch2 != MBOX_NO_MSG)
|
||||||
|
OPENAMP_log_dbg("IPCC_channel2_callback: previous IRQ not treated (status = %d)\r\n", msg_received_ch2);
|
||||||
|
|
||||||
|
msg_received_ch2 = MBOX_NEW_MSG;
|
||||||
|
|
||||||
|
/* Inform A7 that we have received the new msg */
|
||||||
|
OPENAMP_log_dbg("Ack new message on ch2\r\n");
|
||||||
|
HAL_IPCC_NotifyCPU(hipcc, ChannelIndex, IPCC_CHANNEL_DIR_RX);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_MAILBOX_CHANNEL2_CALLBACK */
|
||||||
|
|
||||||
|
/* USER CODE END POST_MAILBOX_CHANNEL2_CALLBACK */
|
||||||
|
}
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file mbox_ipcc.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header for mbox_ipcc.c module
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
#ifndef MBOX_IPCC_H_
|
||||||
|
#define MBOX_IPCC_H_
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN ET */
|
||||||
|
|
||||||
|
/* USER CODE END ET */
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EC */
|
||||||
|
|
||||||
|
/* USER CODE END EC */
|
||||||
|
|
||||||
|
/* Private defines -----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Private defines */
|
||||||
|
|
||||||
|
/* USER CODE END Private defines */
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EM */
|
||||||
|
|
||||||
|
/* USER CODE END EM */
|
||||||
|
|
||||||
|
/* Exported functions prototypes ---------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
|
/* USER CODE END EFP */
|
||||||
|
|
||||||
|
int MAILBOX_Notify(void *priv, uint32_t id);
|
||||||
|
int MAILBOX_Init(void);
|
||||||
|
int MAILBOX_Poll(struct virtio_device *vdev);
|
||||||
|
|
||||||
|
#endif /* MBOX_IPCC_H_ */
|
||||||
@@ -0,0 +1,270 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file openamp.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Code for openamp applications
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
#include "openamp.h"
|
||||||
|
#include "rsc_table.h"
|
||||||
|
#include "metal/sys.h"
|
||||||
|
#include "metal/device.h"
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Private define ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Define */
|
||||||
|
|
||||||
|
/* USER CODE END Define */
|
||||||
|
|
||||||
|
#define SHM_DEVICE_NAME "STM32_SHM"
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PM */
|
||||||
|
|
||||||
|
/* USER CODE END PM */
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PV */
|
||||||
|
|
||||||
|
/* USER CODE END PV */
|
||||||
|
|
||||||
|
static struct metal_io_region *shm_io;
|
||||||
|
static struct metal_io_region *rsc_io;
|
||||||
|
static struct shared_resource_table *rsc_table;
|
||||||
|
static struct rpmsg_virtio_shm_pool shpool;
|
||||||
|
static struct rpmsg_virtio_device rvdev;
|
||||||
|
|
||||||
|
static metal_phys_addr_t shm_physmap;
|
||||||
|
|
||||||
|
struct metal_device shm_device = {
|
||||||
|
.name = SHM_DEVICE_NAME,
|
||||||
|
.num_regions = 2,
|
||||||
|
.regions = {
|
||||||
|
{.virt = NULL}, /* shared memory */
|
||||||
|
{.virt = NULL}, /* rsc_table memory */
|
||||||
|
},
|
||||||
|
.node = { NULL },
|
||||||
|
.irq_num = 0,
|
||||||
|
.irq_info = NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN PFP */
|
||||||
|
|
||||||
|
/* USER CODE END PFP */
|
||||||
|
|
||||||
|
static int OPENAMP_shmem_init(int RPMsgRole)
|
||||||
|
{
|
||||||
|
int status = 0;
|
||||||
|
struct metal_device *device = NULL;
|
||||||
|
struct metal_init_params metal_params = METAL_INIT_DEFAULTS;
|
||||||
|
void* rsc_tab_addr = NULL;
|
||||||
|
int rsc_size = 0;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PRE_LIB_METAL_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_LIB_METAL_INIT */
|
||||||
|
metal_init(&metal_params);
|
||||||
|
|
||||||
|
status = metal_register_generic_device(&shm_device);
|
||||||
|
if (status != 0) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = metal_device_open("generic", SHM_DEVICE_NAME, &device);
|
||||||
|
if (status != 0) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
shm_physmap = SHM_START_ADDRESS;
|
||||||
|
metal_io_init(&device->regions[0], (void *)SHM_START_ADDRESS, &shm_physmap,
|
||||||
|
SHM_SIZE, (unsigned int)-1, 0, NULL);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PRE_SHM_IO_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_SHM_IO_INIT */
|
||||||
|
shm_io = metal_device_io_region(device, 0);
|
||||||
|
if (shm_io == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_SHM_IO_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_SHM_IO_INIT */
|
||||||
|
|
||||||
|
/* Initialize resources table variables */
|
||||||
|
resource_table_init(RPMsgRole, &rsc_tab_addr, &rsc_size);
|
||||||
|
rsc_table = (struct shared_resource_table *)rsc_tab_addr;
|
||||||
|
if (!rsc_table)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_RSC_TABLE_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_RSC_TABLE_INIT */
|
||||||
|
|
||||||
|
metal_io_init(&device->regions[1], rsc_table,
|
||||||
|
(metal_phys_addr_t *)rsc_table, rsc_size, -1U, 0, NULL);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_METAL_IO_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_METAL_IO_INIT */
|
||||||
|
rsc_io = metal_device_io_region(device, 1);
|
||||||
|
if (rsc_io == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_RSC_IO_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_RSC_IO_INIT */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MX_OPENAMP_Init(int RPMsgRole, rpmsg_ns_bind_cb ns_bind_cb)
|
||||||
|
{
|
||||||
|
struct fw_rsc_vdev_vring *vring_rsc = NULL;
|
||||||
|
struct virtio_device *vdev = NULL;
|
||||||
|
int status = 0;
|
||||||
|
|
||||||
|
/* USER CODE BEGIN MAILBOX_Init */
|
||||||
|
|
||||||
|
/* USER CODE END MAIL_BOX_Init */
|
||||||
|
|
||||||
|
MAILBOX_Init();
|
||||||
|
|
||||||
|
/* Libmetal Initilalization */
|
||||||
|
status = OPENAMP_shmem_init(RPMsgRole);
|
||||||
|
if(status)
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PRE_VIRTIO_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_VIRTIO_INIT */
|
||||||
|
vdev = rproc_virtio_create_vdev(RPMsgRole, VDEV_ID, &rsc_table->vdev,
|
||||||
|
rsc_io, NULL, MAILBOX_Notify, NULL);
|
||||||
|
if (vdev == NULL)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
rproc_virtio_wait_remote_ready(vdev);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_VIRTIO_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_VIRTIO_INIT */
|
||||||
|
vring_rsc = &rsc_table->vring0;
|
||||||
|
status = rproc_virtio_init_vring(vdev, 0, vring_rsc->notifyid,
|
||||||
|
(void *)vring_rsc->da, shm_io,
|
||||||
|
vring_rsc->num, vring_rsc->align);
|
||||||
|
if (status != 0)
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_VRING0_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_VRING0_INIT */
|
||||||
|
vring_rsc = &rsc_table->vring1;
|
||||||
|
status = rproc_virtio_init_vring(vdev, 1, vring_rsc->notifyid,
|
||||||
|
(void *)vring_rsc->da, shm_io,
|
||||||
|
vring_rsc->num, vring_rsc->align);
|
||||||
|
if (status != 0)
|
||||||
|
{
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_VRING1_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_VRING1_INIT */
|
||||||
|
|
||||||
|
rpmsg_virtio_init_shm_pool(&shpool, (void *)VRING_BUFF_ADDRESS,
|
||||||
|
(size_t)SHM_SIZE);
|
||||||
|
rpmsg_init_vdev(&rvdev, vdev, ns_bind_cb, shm_io, &shpool);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_RPMSG_INIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_RPMSG_INIT */
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPENAMP_DeInit()
|
||||||
|
{
|
||||||
|
|
||||||
|
/* USER CODE BEGIN PRE_OPENAMP_DEINIT */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_OPENAMP_DEINIT */
|
||||||
|
|
||||||
|
rpmsg_deinit_vdev(&rvdev);
|
||||||
|
|
||||||
|
metal_finish();
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_OPENAMP_DEINIT */
|
||||||
|
|
||||||
|
/* USER CODE END POST_OPENAMP_DEINIT */
|
||||||
|
}
|
||||||
|
|
||||||
|
int OPENAMP_create_endpoint(struct rpmsg_endpoint *ept, const char *name,
|
||||||
|
uint32_t dest, rpmsg_ept_cb cb,
|
||||||
|
rpmsg_ns_unbind_cb unbind_cb)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
/* USER CODE BEGIN PRE_EP_CREATE */
|
||||||
|
|
||||||
|
/* USER CODE END PRE_EP_CREATE */
|
||||||
|
|
||||||
|
ret = rpmsg_create_ept(ept, &rvdev.rdev, name, RPMSG_ADDR_ANY, dest, cb,
|
||||||
|
unbind_cb);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN POST_EP_CREATE */
|
||||||
|
|
||||||
|
/* USER CODE END POST_EP_CREATE */
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPENAMP_check_for_message(void)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN MSG_CHECK */
|
||||||
|
|
||||||
|
/* USER CODE END MSG_CHECK */
|
||||||
|
MAILBOX_Poll(rvdev.vdev);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OPENAMP_Wait_EndPointready(struct rpmsg_endpoint *rp_ept)
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN EP_READY */
|
||||||
|
|
||||||
|
/* USER CODE END EP_READY */
|
||||||
|
|
||||||
|
while(!is_rpmsg_ept_ready(rp_ept))
|
||||||
|
{
|
||||||
|
/* USER CODE BEGIN 0 */
|
||||||
|
|
||||||
|
/* USER CODE END 0 */
|
||||||
|
MAILBOX_Poll(rvdev.vdev);
|
||||||
|
|
||||||
|
/* USER CODE BEGIN 1 */
|
||||||
|
|
||||||
|
/* USER CODE END 1 */
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file openamp.h
|
||||||
|
* @brief Header for openamp applications
|
||||||
|
* @author MCD Application Team
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __openamp_H
|
||||||
|
#define __openamp_H
|
||||||
|
|
||||||
|
#include "openamp/open_amp.h"
|
||||||
|
#include "openamp_conf.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN ET */
|
||||||
|
|
||||||
|
/* USER CODE END ET */
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EC */
|
||||||
|
|
||||||
|
/* USER CODE END EC */
|
||||||
|
|
||||||
|
/* Private defines -----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Private defines */
|
||||||
|
|
||||||
|
/* USER CODE END Private defines */
|
||||||
|
|
||||||
|
#define OPENAMP_send rpmsg_send
|
||||||
|
#define OPENAMP_destroy_ept rpmsg_destroy_ept
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EM */
|
||||||
|
|
||||||
|
/* USER CODE END EM */
|
||||||
|
|
||||||
|
/* Exported functions prototypes ---------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
|
/* USER CODE END EFP */
|
||||||
|
|
||||||
|
/* Initialize the openamp framework*/
|
||||||
|
int MX_OPENAMP_Init(int RPMsgRole, rpmsg_ns_bind_cb ns_bind_cb);
|
||||||
|
|
||||||
|
/* Deinitialize the openamp framework*/
|
||||||
|
void OPENAMP_DeInit(void);
|
||||||
|
|
||||||
|
/* Create and register the endpoint */
|
||||||
|
int OPENAMP_create_endpoint(struct rpmsg_endpoint *ept, const char *name,
|
||||||
|
uint32_t dest, rpmsg_ept_cb cb,
|
||||||
|
rpmsg_ns_unbind_cb unbind_cb);
|
||||||
|
|
||||||
|
/* Check for new rpmsg reception */
|
||||||
|
void OPENAMP_check_for_message(void);
|
||||||
|
|
||||||
|
/* Wait loop on endpoint ready ( message dest address is know)*/
|
||||||
|
void OPENAMP_Wait_EndPointready(struct rpmsg_endpoint *rp_ept);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif /*__openamp_H */
|
||||||
+242
@@ -0,0 +1,242 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file openamp_conf.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Configuration file for OpenAMP MW
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __OPENAMP_CONF__H__
|
||||||
|
#define __OPENAMP_CONF__H__
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#if defined (__LOG_TRACE_IO_) || defined(__LOG_UART_IO_)
|
||||||
|
#include "openamp_log.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ########################## Mailbox Interface Selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief This is the list of Mailbox interface to be used in the OpenAMP MW
|
||||||
|
* Please note that not all interfaces are supported by a STM32 device
|
||||||
|
*/
|
||||||
|
#define MAILBOX_IPCC_IF_ENABLED
|
||||||
|
//#define MAILBOX_HSEM_IF_ENABLED
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
/**
|
||||||
|
* @brief Include Mailbox interface header file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef MAILBOX_IPCC_IF_ENABLED
|
||||||
|
#include "mbox_ipcc.h"
|
||||||
|
#endif /* MAILBOX_IPCC_IF_ENABLED */
|
||||||
|
|
||||||
|
#ifdef MAILBOX_HSEM_IF_ENABLED
|
||||||
|
#include "mbox_hsem.h"
|
||||||
|
#endif /* MAILBOX_HSEM_IF_ENABLED */
|
||||||
|
|
||||||
|
/* ########################## Virtual Diver Module Selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief This is the list of modules to be used in the OpenAMP Virtual driver module
|
||||||
|
* Please note that virtual driver are not supported on all stm32 families
|
||||||
|
*/
|
||||||
|
//#define VIRTUAL_UART_MODULE_ENABLED
|
||||||
|
//#define VIRTUAL_I2C_MODULE_ENABLED
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
/**
|
||||||
|
* @brief Include Virtual Driver module's header file
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef VIRTUAL_UART_MODULE_ENABLED
|
||||||
|
#include "virt_uart.h"
|
||||||
|
#endif /* VIRTUAL_UART_MODULE_ENABLED */
|
||||||
|
|
||||||
|
#ifdef VIRTUAL_I2C_MODULE_ENABLED
|
||||||
|
#include "virt_i2c.h"
|
||||||
|
#endif /* VIRTUAL_I2C_MODULE_ENABLED */
|
||||||
|
|
||||||
|
/* ########################## Linux Master Selection ############################## */
|
||||||
|
/**
|
||||||
|
* @brief Due to Linux compatibility, it's important to distinguish if the MASTER is Linux or not.
|
||||||
|
* In that case, the LINUX_RPROC_MASTER define is required
|
||||||
|
*/
|
||||||
|
#define LINUX_RPROC_MASTER
|
||||||
|
|
||||||
|
/* USER CODE BEGIN INCLUDE */
|
||||||
|
|
||||||
|
/* USER CODE END INCLUDE */
|
||||||
|
|
||||||
|
/** @addtogroup OPENAMP_MW
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup OPENAMP_CONF OPENAMP_CONF
|
||||||
|
* @brief Configuration file for Openamp mw
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup OPENAMP_CONF_Exported_Variables OPENAMP_CONF_Exported_Variables
|
||||||
|
* @brief Public variables.
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup OPENAMP_CONF_Exported_Defines OPENAMP_CONF_Exported_Defines
|
||||||
|
* @brief Defines for configuration of the Openamp mw
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined (__ICCARM__)
|
||||||
|
/*
|
||||||
|
* For IAR, the .icf file should contain the following lines:
|
||||||
|
* define symbol __OPENAMP_region_start__ = BASE_ADDRESS; (0x38000400 for example)
|
||||||
|
* define symbol __OPENAMP_region_size__ = MEM_SIZE; (0xB000 as example)
|
||||||
|
*
|
||||||
|
* export symbol __OPENAMP_region_start__;
|
||||||
|
* export symbol __OPENAMP_region_size__;
|
||||||
|
*/
|
||||||
|
extern const uint32_t __OPENAMP_region_start__;
|
||||||
|
extern const uint8_t __OPENAMP_region_size__;
|
||||||
|
#define SHM_START_ADDRESS ((metal_phys_addr_t)&__OPENAMP_region_start__)
|
||||||
|
#define SHM_SIZE ((size_t)&__OPENAMP_region_size__)
|
||||||
|
|
||||||
|
#elif defined(__CC_ARM)
|
||||||
|
/*
|
||||||
|
* For MDK-ARM, the scatter file .sct should contain the following line:
|
||||||
|
* LR_IROM1 .... {
|
||||||
|
* ...
|
||||||
|
* __OpenAMP_SHMEM__ 0x38000400 EMPTY 0x0000B000 {} ; Shared Memory area used by OpenAMP
|
||||||
|
* }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
extern unsigned int Image$$__OpenAMP_SHMEM__$$Base;
|
||||||
|
extern unsigned int Image$$__OpenAMP_SHMEM__$$ZI$$Length;
|
||||||
|
#define SHM_START_ADDRESS (unsigned int)&Image$$__OpenAMP_SHMEM__$$Base
|
||||||
|
#define SHM_SIZE ((size_t)&Image$$__OpenAMP_SHMEM__$$ZI$$Length)
|
||||||
|
|
||||||
|
#else
|
||||||
|
/*
|
||||||
|
* for GCC add the following content to the .ld file:
|
||||||
|
* MEMORY
|
||||||
|
* {
|
||||||
|
* ...
|
||||||
|
* OPEN_AMP_SHMEM (xrw) : ORIGIN = 0x38000400, LENGTH = 63K
|
||||||
|
* }
|
||||||
|
* __OPENAMP_region_start__ = ORIGIN(OPEN_AMP_SHMEM);
|
||||||
|
* __OPENAMP_region_end__ = ORIGIN(OPEN_AMP_SHMEM) + LENGTH(OPEN_AMP_SHMEM);
|
||||||
|
*
|
||||||
|
* using the LENGTH(OPEN_AMP_SHMEM) to set the SHM_SIZE lead to a crash thus we
|
||||||
|
* use the start and end address.
|
||||||
|
*/
|
||||||
|
|
||||||
|
extern int __OPENAMP_region_start__[]; /* defined by linker script */
|
||||||
|
extern int __OPENAMP_region_end__[]; /* defined by linker script */
|
||||||
|
|
||||||
|
#define SHM_START_ADDRESS ((metal_phys_addr_t)__OPENAMP_region_start__)
|
||||||
|
#define SHM_SIZE (size_t)((void *)__OPENAMP_region_end__ - (void *) __OPENAMP_region_start__)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined LINUX_RPROC_MASTER
|
||||||
|
#define VRING_RX_ADDRESS ((unsigned int)-1) /* allocated by Master processor: CA7 */
|
||||||
|
#define VRING_TX_ADDRESS ((unsigned int)-1) /* allocated by Master processor: CA7 */
|
||||||
|
#define VRING_BUFF_ADDRESS ((unsigned int)-1) /* allocated by Master processor: CA7 */
|
||||||
|
#define VRING_ALIGNMENT 16 /* fixed to match with linux constraint */
|
||||||
|
#define VRING_NUM_BUFFS 16 /* number of rpmsg buffer */
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define VRING_RX_ADDRESS 0x10040000 /* allocated by Master processor: CA7 */
|
||||||
|
#define VRING_TX_ADDRESS 0x10040400 /* allocated by Master processor: CA7 */
|
||||||
|
#define VRING_BUFF_ADDRESS 0x10040800 /* allocated by Master processor: CA7 */
|
||||||
|
#define VRING_ALIGNMENT 4 /* fixed to match with 4k page alignment requested by linux */
|
||||||
|
#define VRING_NUM_BUFFS 4 /* number of rpmsg buffer */
|
||||||
|
#endif
|
||||||
|
/* Fixed parameter */
|
||||||
|
#define NUM_RESOURCE_ENTRIES 2
|
||||||
|
#define VRING_COUNT 2
|
||||||
|
#define VDEV_ID 0xFF
|
||||||
|
#define VRING0_ID 0 /* VRING0 ID (master to remote) fixed to 0 for linux compatibility*/
|
||||||
|
#define VRING1_ID 1 /* VRING1 ID (remote to master) fixed to 1 for linux compatibility */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup OPENAMP_CONF_Exported_Macros OPENAMP_CONF_Exported_Macros
|
||||||
|
* @brief Aliases.
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* DEBUG macros */
|
||||||
|
|
||||||
|
#if defined (__LOG_TRACE_IO_) || defined(__LOG_UART_IO_)
|
||||||
|
#define OPENAMP_log_dbg log_dbg
|
||||||
|
#define OPENAMP_log_info log_info
|
||||||
|
#define OPENAMP_log_warn log_warn
|
||||||
|
#define OPENAMP_log_err log_err
|
||||||
|
#else
|
||||||
|
#define OPENAMP_log_dbg(...)
|
||||||
|
#define OPENAMP_log_info(...)
|
||||||
|
#define OPENAMP_log_warn(...)
|
||||||
|
#define OPENAMP_log_err(...)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup OPENAMP_CONF_Exported_Types OPENAMP_CONF_Exported_Types
|
||||||
|
* @brief Types.
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup OPENAMP_CONF_Exported_FunctionsPrototype OPENAMP_CONF_Exported_FunctionsPrototype
|
||||||
|
* @brief Declaration of public functions for OpenAMP mw.
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported functions -------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __OPENAMP_CONF__H__ */
|
||||||
|
|
||||||
+100
@@ -0,0 +1,100 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file log.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Resource table
|
||||||
|
*
|
||||||
|
* This file provides services for logging
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/** @addtogroup LOG
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_log
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_Log_Private_Includes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#include "openamp_log.h"
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_Log_Private_TypesDefinitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_Log_Private_Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined (__LOG_TRACE_IO_)
|
||||||
|
char system_log_buf[SYSTEM_TRACE_BUF_SZ];
|
||||||
|
|
||||||
|
__weak void log_buff(int ch)
|
||||||
|
{
|
||||||
|
/* Place your implementation of fputc here */
|
||||||
|
/* e.g. write a character to the USART1 and Loop until the end of transmission */
|
||||||
|
static int offset = 0;
|
||||||
|
|
||||||
|
if (offset + 1 >= SYSTEM_TRACE_BUF_SZ)
|
||||||
|
offset = 0;
|
||||||
|
|
||||||
|
system_log_buf[offset] = ch;
|
||||||
|
system_log_buf[offset++ + 1] = '\0';
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined ( __CC_ARM) || (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||||
|
#define PUTCHAR_PROTOTYPE int stdout_putchar(int ch)
|
||||||
|
#elif __GNUC__
|
||||||
|
/* With GCC/RAISONANCE, small log_info (option LD Linker->Libraries->Small log_info
|
||||||
|
set to 'Yes') calls __io_putchar() */
|
||||||
|
#define PUTCHAR_PROTOTYPE int __attribute__(( weak )) __io_putchar(int ch)
|
||||||
|
#else
|
||||||
|
#define PUTCHAR_PROTOTYPE int __attribute__(( weak )) fputc(int ch, FILE *f)
|
||||||
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
|
#if defined (__LOG_UART_IO_) || defined (__LOG_TRACE_IO_)
|
||||||
|
PUTCHAR_PROTOTYPE
|
||||||
|
{
|
||||||
|
/* Place your implementation of fputc here */
|
||||||
|
/* e.g. write a character to the USART1 and Loop until the end of transmission */
|
||||||
|
#if defined (__LOG_UART_IO_)
|
||||||
|
extern UART_HandleTypeDef huart;
|
||||||
|
HAL_UART_Transmit(&huart, (uint8_t *)&ch, 1, HAL_MAX_DELAY);
|
||||||
|
#endif
|
||||||
|
#if defined (__LOG_TRACE_IO_)
|
||||||
|
log_buff(ch);
|
||||||
|
#endif
|
||||||
|
return ch;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
/* No printf output */
|
||||||
|
#endif
|
||||||
+134
@@ -0,0 +1,134 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file log.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief logging services
|
||||||
|
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/** @addtogroup LOG
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup stm32mp1xx_Log
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Define to prevent recursive inclusion
|
||||||
|
*/
|
||||||
|
#ifndef __LOG_STM32MP1XX_H
|
||||||
|
#define __LOG_STM32MP1XX_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_Log_Includes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#include "stm32mp1xx_hal.h"
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_Log_Exported_Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#if defined (__LOG_TRACE_IO_)
|
||||||
|
#define SYSTEM_TRACE_BUF_SZ 2048
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define LOGQUIET 0
|
||||||
|
#define LOGERR 1
|
||||||
|
#define LOGWARN 2
|
||||||
|
#define LOGINFO 3
|
||||||
|
#define LOGDBG 4
|
||||||
|
|
||||||
|
#ifndef LOGLEVEL
|
||||||
|
#define LOGLEVEL LOGINFO
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_Log_Exported_types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#if defined (__LOG_TRACE_IO_)
|
||||||
|
extern char system_log_buf[SYSTEM_TRACE_BUF_SZ]; /*!< buffer for debug traces */
|
||||||
|
#endif /* __LOG_TRACE_IO_ */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_Log_Exported_Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#if defined (__LOG_TRACE_IO_) || defined(__LOG_UART_IO_)
|
||||||
|
#if LOGLEVEL >= LOGDBG
|
||||||
|
#define log_dbg(fmt, ...) printf("[%05ld.%03ld][DBG ]" fmt, HAL_GetTick()/1000, HAL_GetTick() % 1000, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define log_dbg(fmt, ...)
|
||||||
|
#endif
|
||||||
|
#if LOGLEVEL >= LOGINFO
|
||||||
|
#define log_info(fmt, ...) printf("[%05ld.%03ld][INFO ]" fmt, HAL_GetTick()/1000, HAL_GetTick() % 1000, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define log_info(fmt, ...)
|
||||||
|
#endif
|
||||||
|
#if LOGLEVEL >= LOGWARN
|
||||||
|
#define log_warn(fmt, ...) printf("[%05ld.%03ld][WARN ]" fmt, HAL_GetTick()/1000, HAL_GetTick() % 1000, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define log_warn(fmt, ...)
|
||||||
|
#endif
|
||||||
|
#if LOGLEVEL >= LOGERR
|
||||||
|
#define log_err(fmt, ...) printf("[%05ld.%03ld][ERR ]" fmt, HAL_GetTick()/1000, HAL_GetTick() % 1000, ##__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
#define log_err(fmt, ...)
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define log_dbg(fmt, ...)
|
||||||
|
#define log_info(fmt, ...)
|
||||||
|
#define log_warn(fmt, ...)
|
||||||
|
#define log_err(fmt, ...)
|
||||||
|
#endif /* __LOG_TRACE_IO_ */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_Log_Exported_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*__LOG_STM32MP1XX_H */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file rsc_table.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Resource table
|
||||||
|
*
|
||||||
|
* This file provides a default resource table requested by remote proc to
|
||||||
|
* load the elf file. It also allows to add debug trace using a shared buffer.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
/** @addtogroup RSC_TABLE
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup resource_table
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup resource_table_Private_Includes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(__ICCARM__) || defined (__CC_ARM)
|
||||||
|
#include <stddef.h> /* needed for offsetof definition*/
|
||||||
|
#endif
|
||||||
|
#include "rsc_table.h"
|
||||||
|
#include "openamp/open_amp.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup resource_table_Private_TypesDefinitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup resource_table_Private_Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Place resource table in special ELF section */
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#define __section_t(S) __attribute__((__section__(#S)))
|
||||||
|
#define __resource __section_t(.resource_table)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined (LINUX_RPROC_MASTER)
|
||||||
|
#ifdef VIRTIO_MASTER_ONLY
|
||||||
|
#define CONST
|
||||||
|
#else
|
||||||
|
#define CONST const
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define CONST
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define RPMSG_IPU_C0_FEATURES 1
|
||||||
|
#define VRING_COUNT 2
|
||||||
|
|
||||||
|
/* VirtIO rpmsg device id */
|
||||||
|
#define VIRTIO_ID_RPMSG_ 7
|
||||||
|
|
||||||
|
#if defined (__LOG_TRACE_IO_)
|
||||||
|
extern char system_log_buf[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__GNUC__)
|
||||||
|
#if !defined (__CC_ARM) && !defined (LINUX_RPROC_MASTER)
|
||||||
|
|
||||||
|
/* Since GCC is not initializing the resource_table at startup, it is declared as volatile to avoid compiler optimization
|
||||||
|
* for the CM4 (see resource_table_init() below)
|
||||||
|
*/
|
||||||
|
volatile struct shared_resource_table __resource __attribute__((used)) resource_table;
|
||||||
|
#else
|
||||||
|
CONST struct shared_resource_table __resource __attribute__((used)) resource_table = {
|
||||||
|
#endif
|
||||||
|
#elif defined(__ICCARM__)
|
||||||
|
__root CONST struct shared_resource_table resource_table @ ".resource_table" = {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__ICCARM__) || defined (__CC_ARM) || defined (LINUX_RPROC_MASTER)
|
||||||
|
.version = 1,
|
||||||
|
#if defined (__LOG_TRACE_IO_)
|
||||||
|
.num = 2,
|
||||||
|
#else
|
||||||
|
.num = 1,
|
||||||
|
#endif
|
||||||
|
.reserved = {0, 0},
|
||||||
|
.offset = {
|
||||||
|
offsetof(struct shared_resource_table, vdev),
|
||||||
|
offsetof(struct shared_resource_table, cm_trace),
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Virtio device entry */
|
||||||
|
.vdev= {
|
||||||
|
RSC_VDEV, VIRTIO_ID_RPMSG_, 0, RPMSG_IPU_C0_FEATURES, 0, 0, 0,
|
||||||
|
VRING_COUNT, {0, 0},
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Vring rsc entry - part of vdev rsc entry */
|
||||||
|
.vring0 = {VRING_TX_ADDRESS, VRING_ALIGNMENT, VRING_NUM_BUFFS, VRING0_ID, 0},
|
||||||
|
.vring1 = {VRING_RX_ADDRESS, VRING_ALIGNMENT, VRING_NUM_BUFFS, VRING1_ID, 0},
|
||||||
|
|
||||||
|
#if defined (__LOG_TRACE_IO_)
|
||||||
|
.cm_trace = {
|
||||||
|
RSC_TRACE,
|
||||||
|
(uint32_t)system_log_buf, SYSTEM_TRACE_BUF_SZ, 0, "cm4_log",
|
||||||
|
},
|
||||||
|
#endif
|
||||||
|
} ;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void resource_table_init(int RPMsgRole, void **table_ptr, int *length)
|
||||||
|
{
|
||||||
|
|
||||||
|
#if !defined (LINUX_RPROC_MASTER)
|
||||||
|
#if defined (__GNUC__) && ! defined (__CC_ARM)
|
||||||
|
#ifdef VIRTIO_MASTER_ONLY
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Currently the GCC linker doesn't initialize the resource_table global variable at startup
|
||||||
|
* it is done here by the master application.
|
||||||
|
*/
|
||||||
|
memset(&resource_table, '\0', sizeof(struct shared_resource_table));
|
||||||
|
resource_table.num = 1;
|
||||||
|
resource_table.version = 1;
|
||||||
|
resource_table.offset[0] = offsetof(struct shared_resource_table, vdev);
|
||||||
|
|
||||||
|
resource_table.vring0.da = VRING_TX_ADDRESS;
|
||||||
|
resource_table.vring0.align = VRING_ALIGNMENT;
|
||||||
|
resource_table.vring0.num = VRING_NUM_BUFFS;
|
||||||
|
resource_table.vring0.notifyid = VRING0_ID;
|
||||||
|
|
||||||
|
resource_table.vring1.da = VRING_RX_ADDRESS;
|
||||||
|
resource_table.vring1.align = VRING_ALIGNMENT;
|
||||||
|
resource_table.vring1.num = VRING_NUM_BUFFS;
|
||||||
|
resource_table.vring1.notifyid = VRING1_ID;
|
||||||
|
|
||||||
|
resource_table.vdev.type = RSC_VDEV;
|
||||||
|
resource_table.vdev.id = VIRTIO_ID_RPMSG_;
|
||||||
|
resource_table.vdev.num_of_vrings=VRING_COUNT;
|
||||||
|
resource_table.vdev.dfeatures = RPMSG_IPU_C0_FEATURES;
|
||||||
|
#else
|
||||||
|
|
||||||
|
/* For the slave application let's wait until the resource_table is correctly initialized */
|
||||||
|
while(resource_table.vring1.da != VRING_RX_ADDRESS)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
(void)RPMsgRole;
|
||||||
|
*length = sizeof(resource_table);
|
||||||
|
*table_ptr = (void *)&resource_table;
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
/* USER CODE BEGIN Header */
|
||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* This file populates resource table for BM remote
|
||||||
|
* for use by the Linux Master */
|
||||||
|
/* USER CODE END Header */
|
||||||
|
|
||||||
|
#ifndef RSC_TABLE_H_
|
||||||
|
#define RSC_TABLE_H_
|
||||||
|
|
||||||
|
#include "openamp/open_amp.h"
|
||||||
|
#include "openamp_conf.h"
|
||||||
|
|
||||||
|
/* Private includes ----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Includes */
|
||||||
|
|
||||||
|
/* USER CODE END Includes */
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN ET */
|
||||||
|
|
||||||
|
/* Resource table for the given remote */
|
||||||
|
struct shared_resource_table {
|
||||||
|
unsigned int version;
|
||||||
|
unsigned int num;
|
||||||
|
unsigned int reserved[2];
|
||||||
|
unsigned int offset[NUM_RESOURCE_ENTRIES];
|
||||||
|
/* text carveout entry */
|
||||||
|
|
||||||
|
/* rpmsg vdev entry */
|
||||||
|
struct fw_rsc_vdev vdev;
|
||||||
|
struct fw_rsc_vdev_vring vring0;
|
||||||
|
struct fw_rsc_vdev_vring vring1;
|
||||||
|
struct fw_rsc_trace cm_trace;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* USER CODE END ET */
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EC */
|
||||||
|
|
||||||
|
/* USER CODE END EC */
|
||||||
|
|
||||||
|
/* Private defines -----------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN Private defines */
|
||||||
|
|
||||||
|
/* USER CODE END Private defines */
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EM */
|
||||||
|
|
||||||
|
/* USER CODE END EM */
|
||||||
|
|
||||||
|
/* Exported functions prototypes ---------------------------------------------*/
|
||||||
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
|
/* USER CODE END EFP */
|
||||||
|
|
||||||
|
void resource_table_init(int RPMsgRole, void **table_ptr, int *length);
|
||||||
|
|
||||||
|
#endif /* RSC_TABLE_H_ */
|
||||||
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
|
||||||
|
This is a new Cortex-M project created from STM32CubeIDE.
|
||||||
|
Its purpose is only to give the framework.
|
||||||
|
It does not use any resources, only starting the co-processor:
|
||||||
|
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
int i=0;
|
||||||
|
|
||||||
|
for(i=0;i<100;i++);
|
||||||
|
|
||||||
|
while(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
To load it run :
|
||||||
|
./fw_cortex_m4.sh start
|
||||||
|
|
||||||
|
|
||||||
|
To stop it :
|
||||||
|
./fw_cortex_m4.sh stop
|
||||||
|
|
||||||
|
|
||||||
|
It can be enriched and debugged from the IDE ;-)
|
||||||
|
Have fun!
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
rproc_class_dir="/sys/class/remoteproc/remoteproc0"
|
||||||
|
fmw_dir="/lib/firmware"
|
||||||
|
fmw_name="VRPMDV-Mon_CM4.elf"
|
||||||
|
|
||||||
|
cd $(/usr/bin/dirname $(/usr/bin/readlink -f $0))
|
||||||
|
|
||||||
|
if [ $1 == "start" ]
|
||||||
|
then
|
||||||
|
# Start the firmware
|
||||||
|
if [ -f /lib/firmware/$fmw_name ]; then
|
||||||
|
/bin/rm -f /lib/firmware/$fmw_name
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
/bin/ln -s $PWD/lib/firmware/$fmw_name $fmw_dir
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
/bin/echo -n "$fmw_name" > $rproc_class_dir/firmware
|
||||||
|
/bin/echo -n start > $rproc_class_dir/state
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $1 == "stop" ]
|
||||||
|
then
|
||||||
|
# Stop the firmware
|
||||||
|
/bin/echo -n stop > $rproc_class_dir/state
|
||||||
|
fi
|
||||||
+204
@@ -0,0 +1,204 @@
|
|||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
** @file : stm32mp157x_ram_cm4.ld
|
||||||
|
**
|
||||||
|
** @author : STM32CubeIDE
|
||||||
|
**
|
||||||
|
** Abstract : Linker script for STM32MP157x Device from STM32MP1 series
|
||||||
|
** 64 Kbytes RETRAM
|
||||||
|
** 128 Kbytes SRAM1
|
||||||
|
** 128 Kbytes SRAM2
|
||||||
|
** 64 Kbytes SRAM3
|
||||||
|
** 64 Kbytes SRAM4
|
||||||
|
**
|
||||||
|
** Set heap size, stack size and stack location according
|
||||||
|
** to application requirements.
|
||||||
|
**
|
||||||
|
** Set memory bank area and size if external memory is used
|
||||||
|
**
|
||||||
|
** Target : STMicroelectronics STM32
|
||||||
|
**
|
||||||
|
** Distribution: The file is distributed as is, without any warranty
|
||||||
|
** of any kind.
|
||||||
|
**
|
||||||
|
******************************************************************************
|
||||||
|
** @attention
|
||||||
|
**
|
||||||
|
** Copyright (c) 2022 STMicroelectronics.
|
||||||
|
** All rights reserved.
|
||||||
|
**
|
||||||
|
** This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
** in the root directory of this software component.
|
||||||
|
** If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
**
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Entry Point */
|
||||||
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
/* Highest address of the user mode stack */
|
||||||
|
_estack = ORIGIN(SRAM2_data) + LENGTH(SRAM2_data); /* end of "SRAM2_data" Ram type memory */
|
||||||
|
|
||||||
|
_Min_Heap_Size = 0x200; /* required amount of heap */
|
||||||
|
_Min_Stack_Size = 0x400; /* required amount of stack */
|
||||||
|
|
||||||
|
/* Memories definition */
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
RETRAM_interrupts (xrw) : ORIGIN = 0x00000000, LENGTH = 0x00000600
|
||||||
|
SRAM1_text (xrw) : ORIGIN = 0x10000000, LENGTH = 128K
|
||||||
|
SRAM2_data (xrw) : ORIGIN = 0x10020000, LENGTH = 128K
|
||||||
|
SRAM3_ipc_shm (xrw) : ORIGIN = 0x10040000, LENGTH = 64K
|
||||||
|
SRAM4 (xrw) : ORIGIN = 0x10050000, LENGTH = 64K
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Symbols needed for OpenAMP to enable rpmsg */
|
||||||
|
__OPENAMP_region_start__ = ORIGIN(SRAM3_ipc_shm);
|
||||||
|
__OPENAMP_region_end__ = ORIGIN(SRAM3_ipc_shm) + LENGTH(SRAM3_ipc_shm);
|
||||||
|
|
||||||
|
/* Sections */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* The startup code into "RETRAM_interrupts" Ram type memory */
|
||||||
|
.isr_vector :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP(*(.isr_vector)) /* Startup code */
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >RETRAM_interrupts
|
||||||
|
|
||||||
|
/* The program code and other data into "SRAM1_text" Ram type memory */
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.text) /* .text sections (code) */
|
||||||
|
*(.text*) /* .text* sections (code) */
|
||||||
|
*(.glue_7) /* glue arm to thumb code */
|
||||||
|
*(.glue_7t) /* glue thumb to arm code */
|
||||||
|
*(.eh_frame)
|
||||||
|
|
||||||
|
KEEP (*(.init))
|
||||||
|
KEEP (*(.fini))
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_etext = .; /* define a global symbols at end of code */
|
||||||
|
} >SRAM1_text
|
||||||
|
|
||||||
|
/* Constant data into "SRAM1_text" Ram type memory */
|
||||||
|
.rodata :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||||
|
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >SRAM1_text
|
||||||
|
|
||||||
|
.ARM.extab : {
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >SRAM1_text
|
||||||
|
|
||||||
|
.ARM : {
|
||||||
|
. = ALIGN(4);
|
||||||
|
__exidx_start = .;
|
||||||
|
*(.ARM.exidx*)
|
||||||
|
__exidx_end = .;
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >SRAM1_text
|
||||||
|
|
||||||
|
.preinit_array :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||||
|
KEEP (*(.preinit_array*))
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >SRAM1_text
|
||||||
|
|
||||||
|
.init_array :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
PROVIDE_HIDDEN (__init_array_start = .);
|
||||||
|
KEEP (*(SORT(.init_array.*)))
|
||||||
|
KEEP (*(.init_array*))
|
||||||
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >SRAM1_text
|
||||||
|
|
||||||
|
.fini_array :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
|
KEEP (*(.fini_array*))
|
||||||
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >SRAM1_text
|
||||||
|
|
||||||
|
/* Used by the startup to initialize data */
|
||||||
|
__DATA_ROM = .;
|
||||||
|
_sidata = LOADADDR(.data);
|
||||||
|
|
||||||
|
/* Initialized data sections into "SRAM2_data" Ram type memory */
|
||||||
|
.data : AT(__DATA_ROM)
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
_sdata = .; /* create a global symbol at data start */
|
||||||
|
*(.data) /* .data sections */
|
||||||
|
*(.data*) /* .data* sections */
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_edata = .; /* define a global symbol at data end */
|
||||||
|
} >SRAM2_data
|
||||||
|
|
||||||
|
__DATA_END = __DATA_ROM + (_edata - _sdata);
|
||||||
|
text_end = ORIGIN(SRAM1_text) + LENGTH(SRAM1_text);
|
||||||
|
ASSERT(__DATA_END <= text_end, "region SRAM1_text overflowed with text and data")
|
||||||
|
|
||||||
|
|
||||||
|
.resource_table :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP (*(.resource_table*))
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >SRAM2_data
|
||||||
|
|
||||||
|
/* Uninitialized data section into "SRAM2_data" Ram type memory */
|
||||||
|
. = ALIGN(4);
|
||||||
|
.bss :
|
||||||
|
{
|
||||||
|
/* This is used by the startup in order to initialize the .bss secion */
|
||||||
|
_sbss = .; /* define a global symbol at bss start */
|
||||||
|
__bss_start__ = _sbss;
|
||||||
|
*(.bss)
|
||||||
|
*(.bss*)
|
||||||
|
*(COMMON)
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_ebss = .; /* define a global symbol at bss end */
|
||||||
|
__bss_end__ = _ebss;
|
||||||
|
} >SRAM2_data
|
||||||
|
|
||||||
|
/* User_heap_stack section, used to check that there is enough "SRAM2_data" Ram type memory left */
|
||||||
|
._user_heap_stack :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
PROVIDE ( end = . );
|
||||||
|
PROVIDE ( _end = . );
|
||||||
|
. = . + _Min_Heap_Size;
|
||||||
|
. = . + _Min_Stack_Size;
|
||||||
|
. = ALIGN(8);
|
||||||
|
} >SRAM2_data
|
||||||
|
|
||||||
|
/* Remove information from the compiler libraries */
|
||||||
|
/DISCARD/ :
|
||||||
|
{
|
||||||
|
libc.a ( * )
|
||||||
|
libm.a ( * )
|
||||||
|
libgcc.a ( * )
|
||||||
|
}
|
||||||
|
|
||||||
|
.ARM.attributes 0 : { *(.ARM.attributes) }
|
||||||
|
}
|
||||||
+286
@@ -0,0 +1,286 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file system_stm32mp1xx.c
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief CMSIS Cortex Device Peripheral Access Layer System Source File.
|
||||||
|
*
|
||||||
|
* This file provides two functions and one global variable to be called from
|
||||||
|
* user application:
|
||||||
|
* - SystemInit(): This function is called at startup just after reset and
|
||||||
|
* before branch to main program. This call is made inside
|
||||||
|
* the "startup_stm32mp1xx.s" file.
|
||||||
|
*
|
||||||
|
* - SystemCoreClock variable: Contains the core clock frequency, it can
|
||||||
|
* be used by the user application to setup
|
||||||
|
* the SysTick timer or configure other
|
||||||
|
* parameters.
|
||||||
|
*
|
||||||
|
* - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
|
||||||
|
* be called whenever the core clock is changed
|
||||||
|
* during program execution.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CMSIS
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup stm32mp1xx_system
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Private_Includes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "stm32mp1xx.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Private_TypesDefinitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Private_Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/************************* Miscellaneous Configuration ************************/
|
||||||
|
/*!< Uncomment the following line if you need to use external SRAM mounted
|
||||||
|
on EVAL board as data memory */
|
||||||
|
/* #define DATA_IN_ExtSRAM */
|
||||||
|
|
||||||
|
/*!< Uncomment the following line if you need to relocate your vector Table in
|
||||||
|
Internal SRAM. */
|
||||||
|
/* #define VECT_TAB_SRAM */
|
||||||
|
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
|
||||||
|
This value must be a multiple of 0x400. */
|
||||||
|
/******************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Private_Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Private_Variables
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* This variable is updated in three ways:
|
||||||
|
1) by calling CMSIS function SystemCoreClockUpdate()
|
||||||
|
2) each time HAL_RCC_ClockConfig() is called to configure the system clock
|
||||||
|
frequency
|
||||||
|
Note: If you use this function to configure the system clock;
|
||||||
|
then there is no need to call the first functions listed above,
|
||||||
|
since SystemCoreClock variable is updated automatically.
|
||||||
|
*/
|
||||||
|
uint32_t SystemCoreClock = HSI_VALUE;
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Private_FunctionPrototypes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined (DATA_IN_ExtSRAM)
|
||||||
|
static void SystemInit_ExtMemCtl(void);
|
||||||
|
#endif /* DATA_IN_ExtSRAM */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Private_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Setup the microcontroller system
|
||||||
|
* Initialize the FPU setting, vector table location and External memory
|
||||||
|
* configuration.
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void SystemInit (void)
|
||||||
|
{
|
||||||
|
/* FPU settings ------------------------------------------------------------*/
|
||||||
|
#if defined (CORE_CM4)
|
||||||
|
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
|
||||||
|
SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Configure the Vector Table location add offset address ------------------*/
|
||||||
|
#if defined (VECT_TAB_SRAM)
|
||||||
|
SCB->VTOR = MCU_AHB_SRAM | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
|
||||||
|
#endif
|
||||||
|
/* Disable all interrupts and events */
|
||||||
|
CLEAR_REG(EXTI_C2->IMR1);
|
||||||
|
CLEAR_REG(EXTI_C2->IMR2);
|
||||||
|
CLEAR_REG(EXTI_C2->IMR3);
|
||||||
|
CLEAR_REG(EXTI_C2->EMR1);
|
||||||
|
CLEAR_REG(EXTI_C2->EMR2);
|
||||||
|
CLEAR_REG(EXTI_C2->EMR3);
|
||||||
|
#else
|
||||||
|
#error Please #define CORE_CM4
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Update SystemCoreClock variable according to Clock Register Values.
|
||||||
|
* The SystemCoreClock variable contains the core clock frequency (Hz),
|
||||||
|
* it can be used by the user application to setup the SysTick timer or
|
||||||
|
* configure other parameters.
|
||||||
|
*
|
||||||
|
* @note Each time the core clock changes, this function must be called to
|
||||||
|
* update SystemCoreClock variable value. Otherwise, any configuration
|
||||||
|
* based on this variable will be incorrect.
|
||||||
|
*
|
||||||
|
* @note - The system frequency computed by this function is not the real
|
||||||
|
* frequency in the chip. It is calculated based on the predefined
|
||||||
|
* constant and the selected clock source:
|
||||||
|
*
|
||||||
|
* - If SYSCLK source is HSI, SystemCoreClock will contain the
|
||||||
|
* HSI_VALUE(*)
|
||||||
|
*
|
||||||
|
* - If SYSCLK source is HSE, SystemCoreClock will contain the
|
||||||
|
* HSE_VALUE(**)
|
||||||
|
*
|
||||||
|
* - If SYSCLK source is CSI, SystemCoreClock will contain the
|
||||||
|
* CSI_VALUE(***)
|
||||||
|
*
|
||||||
|
* - If SYSCLK source is PLL3_P, SystemCoreClock will contain the
|
||||||
|
* HSI_VALUE(*) or the HSE_VALUE(*) or the CSI_VALUE(***)
|
||||||
|
* multiplied/divided by the PLL3 factors.
|
||||||
|
*
|
||||||
|
* (*) HSI_VALUE is a constant defined in stm32mp1xx_hal_conf.h file
|
||||||
|
* (default value 64 MHz) but the real value may vary depending
|
||||||
|
* on the variations in voltage and temperature.
|
||||||
|
*
|
||||||
|
* (**) HSE_VALUE is a constant defined in stm32mp1xx_hal_conf.h file
|
||||||
|
* (default value 24 MHz), user has to ensure that HSE_VALUE is
|
||||||
|
* same as the real frequency of the crystal used. Otherwise, this
|
||||||
|
* function may have wrong result.
|
||||||
|
*
|
||||||
|
* (***) CSI_VALUE is a constant defined in stm32mp1xx_hal_conf.h file
|
||||||
|
* (default value 4 MHz)but the real value may vary depending
|
||||||
|
* on the variations in voltage and temperature.
|
||||||
|
*
|
||||||
|
* - The result of this function could be not correct when using
|
||||||
|
* fractional value for HSE crystal.
|
||||||
|
*
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void SystemCoreClockUpdate (void)
|
||||||
|
{
|
||||||
|
uint32_t pllsource, pll3m, pll3fracen;
|
||||||
|
float fracn1, pll3vco;
|
||||||
|
|
||||||
|
switch (RCC->MSSCKSELR & RCC_MSSCKSELR_MCUSSRC)
|
||||||
|
{
|
||||||
|
case 0x00: /* HSI used as system clock source */
|
||||||
|
SystemCoreClock = (HSI_VALUE >> (RCC->HSICFGR & RCC_HSICFGR_HSIDIV));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x01: /* HSE used as system clock source */
|
||||||
|
SystemCoreClock = HSE_VALUE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x02: /* CSI used as system clock source */
|
||||||
|
SystemCoreClock = CSI_VALUE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x03: /* PLL3_P used as system clock source */
|
||||||
|
pllsource = (RCC->RCK3SELR & RCC_RCK3SELR_PLL3SRC);
|
||||||
|
pll3m = ((RCC->PLL3CFGR1 & RCC_PLL3CFGR1_DIVM3) >> RCC_PLL3CFGR1_DIVM3_Pos) + 1U;
|
||||||
|
pll3fracen = (RCC->PLL3FRACR & RCC_PLL3FRACR_FRACLE) >> 16U;
|
||||||
|
fracn1 = (float)(pll3fracen * ((RCC->PLL3FRACR & RCC_PLL3FRACR_FRACV) >> 3U));
|
||||||
|
pll3vco = (float)((float)((RCC->PLL3CFGR1 & RCC_PLL3CFGR1_DIVN) + 1U) + (fracn1 / (float) 0x1FFF));
|
||||||
|
|
||||||
|
if (pll3m != 0U)
|
||||||
|
{
|
||||||
|
switch (pllsource)
|
||||||
|
{
|
||||||
|
case 0x00: /* HSI used as PLL clock source */
|
||||||
|
pll3vco *= (float)((HSI_VALUE >> (RCC->HSICFGR & RCC_HSICFGR_HSIDIV)) / pll3m);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x01: /* HSE used as PLL clock source */
|
||||||
|
pll3vco *= (float)(HSE_VALUE / pll3m);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x02: /* CSI used as PLL clock source */
|
||||||
|
pll3vco *= (float)(CSI_VALUE / pll3m);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0x03: /* No clock source for PLL */
|
||||||
|
pll3vco = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
SystemCoreClock = (uint32_t)(pll3vco/ ((float)((RCC->PLL3CFGR2 & RCC_PLL3CFGR2_DIVP) + 1U)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SystemCoreClock = 0U;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Compute mcu_ck */
|
||||||
|
SystemCoreClock = SystemCoreClock >> (RCC->MCUDIVR & RCC_MCUDIVR_MCUDIV);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef DATA_IN_ExtSRAM
|
||||||
|
/**
|
||||||
|
* @brief Setup the external memory controller.
|
||||||
|
* Called in startup_stm32mp15xx.s before jump to main.
|
||||||
|
* This function configures the external SRAM mounted on Eval boards
|
||||||
|
* This SRAM will be used as program data memory (including heap and stack).
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
void SystemInit_ExtMemCtl(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif /* DATA_IN_ExtSRAM */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
+39315
File diff suppressed because it is too large
Load Diff
+222
@@ -0,0 +1,222 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief CMSIS STM32MP1xx Device Peripheral Access Layer Header File.
|
||||||
|
*
|
||||||
|
* The file is the unique include file that the application programmer
|
||||||
|
* is using in the C source code, usually in main.c. This file contains:
|
||||||
|
* - Configuration section that allows to select:
|
||||||
|
* - The STM32MP1xx device used in the target application
|
||||||
|
* - To use or not the peripheral’s drivers in application code(i.e.
|
||||||
|
* code will be based on direct access to peripheral’s registers
|
||||||
|
* rather than drivers API), this option is controlled by
|
||||||
|
* "#define USE_HAL_DRIVER"
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CMSIS
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup stm32mp1xx
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __STM32MP1xx_H
|
||||||
|
#define __STM32MP1xx_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
/** @addtogroup Library_configuration_section
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Uncomment the line below according to the target STM32MP1 device used in your
|
||||||
|
application
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if !defined (STM32MP1)
|
||||||
|
#define STM32MP1
|
||||||
|
#endif /* STM32MP1 */
|
||||||
|
|
||||||
|
/* Tip: To avoid modifying this file each time you need to switch between these
|
||||||
|
devices, you can define the device in your toolchain compiler preprocessor.
|
||||||
|
*/
|
||||||
|
#if !defined (USE_HAL_DRIVER)
|
||||||
|
/**
|
||||||
|
* @brief Comment the line below if you will not use the peripherals drivers.
|
||||||
|
In this case, these drivers will not be included and the application code will
|
||||||
|
be based on direct access to peripherals registers
|
||||||
|
*/
|
||||||
|
/*#define USE_HAL_DRIVER */
|
||||||
|
#endif /* USE_HAL_DRIVER */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief CMSIS Device version number
|
||||||
|
*/
|
||||||
|
#define __STM32MP1xx_CMSIS_VERSION_MAIN (0x01U) /*!< [31:24] main version */
|
||||||
|
#define __STM32MP1xx_CMSIS_VERSION_SUB1 (0x06U) /*!< [23:16] sub1 version */
|
||||||
|
#define __STM32MP1xx_CMSIS_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
|
||||||
|
#define __STM32MP1xx_CMSIS_VERSION_RC (0x00U) /*!< [7:0] release candidate */
|
||||||
|
#define __STM32MP1xx_CMSIS_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
|
||||||
|
|(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
|
||||||
|
|(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
|
||||||
|
|(__CMSIS_DEVICE_HAL_VERSION_RC))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup Device_Included
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#if defined(CORE_CM4)
|
||||||
|
#if defined(STM32MP15xx) /* keep for backward compatibility STM32MP15xx = STM32MP157Cxx */
|
||||||
|
#include "stm32mp157cxx_cm4.h"
|
||||||
|
#elif defined(STM32MP157Axx)
|
||||||
|
#include "stm32mp157axx_cm4.h"
|
||||||
|
#elif defined(STM32MP157Cxx)
|
||||||
|
#include "stm32mp157cxx_cm4.h"
|
||||||
|
#elif defined(STM32MP157Dxx)
|
||||||
|
#include "stm32mp157dxx_cm4.h"
|
||||||
|
#elif defined(STM32MP157Fxx)
|
||||||
|
#include "stm32mp157fxx_cm4.h"
|
||||||
|
#elif defined(STM32MP153Axx)
|
||||||
|
#include "stm32mp153axx_cm4.h"
|
||||||
|
#elif defined(STM32MP153Cxx)
|
||||||
|
#include "stm32mp153cxx_cm4.h"
|
||||||
|
#elif defined(STM32MP153Dxx)
|
||||||
|
#include "stm32mp153dxx_cm4.h"
|
||||||
|
#elif defined(STM32MP153Fxx)
|
||||||
|
#include "stm32mp153fxx_cm4.h"
|
||||||
|
#elif defined(STM32MP151Axx)
|
||||||
|
#include "stm32mp151axx_cm4.h"
|
||||||
|
#elif defined(STM32MP151Cxx)
|
||||||
|
#include "stm32mp151cxx_cm4.h"
|
||||||
|
#elif defined(STM32MP151Dxx)
|
||||||
|
#include "stm32mp151dxx_cm4.h"
|
||||||
|
#elif defined(STM32MP151Fxx)
|
||||||
|
#include "stm32mp151fxx_cm4.h"
|
||||||
|
#else
|
||||||
|
#error "Please select first the target STM32MP1xx device used in your application (in stm32mp1xx.h file)"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CORE_CA7)
|
||||||
|
#if defined(STM32MP15xx) /* keep for backward compatibility STM32MP15xx = STM32MP157Cxx */
|
||||||
|
#include "stm32mp157cxx_ca7.h"
|
||||||
|
#elif defined(STM32MP157Axx)
|
||||||
|
#include "stm32mp157axx_ca7.h"
|
||||||
|
#elif defined(STM32MP157Cxx)
|
||||||
|
#include "stm32mp157cxx_ca7.h"
|
||||||
|
#elif defined(STM32MP157Dxx)
|
||||||
|
#include "stm32mp157dxx_ca7.h"
|
||||||
|
#elif defined(STM32MP157Fxx)
|
||||||
|
#include "stm32mp157fxx_ca7.h"
|
||||||
|
#elif defined(STM32MP153Axx)
|
||||||
|
#include "stm32mp153axx_ca7.h"
|
||||||
|
#elif defined(STM32MP153Cxx)
|
||||||
|
#include "stm32mp153cxx_ca7.h"
|
||||||
|
#elif defined(STM32MP153Dxx)
|
||||||
|
#include "stm32mp153dxx_ca7.h"
|
||||||
|
#elif defined(STM32MP153Fxx)
|
||||||
|
#include "stm32mp153fxx_ca7.h"
|
||||||
|
#elif defined(STM32MP151Axx)
|
||||||
|
#include "stm32mp151axx_ca7.h"
|
||||||
|
#elif defined(STM32MP151Cxx)
|
||||||
|
#include "stm32mp151cxx_ca7.h"
|
||||||
|
#elif defined(STM32MP151Dxx)
|
||||||
|
#include "stm32mp151dxx_ca7.h"
|
||||||
|
#elif defined(STM32MP151Fxx)
|
||||||
|
#include "stm32mp151fxx_ca7.h"
|
||||||
|
#else
|
||||||
|
#error "Please select first the target STM32MP1xx device used in your application (in stm32mp1xx.h file)"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup Exported_types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
RESET = 0,
|
||||||
|
SET = !RESET
|
||||||
|
} FlagStatus, ITStatus;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
DISABLE = 0,
|
||||||
|
ENABLE = !DISABLE
|
||||||
|
} FunctionalState;
|
||||||
|
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
ERROR = 0,
|
||||||
|
SUCCESS = !ERROR
|
||||||
|
} ErrorStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** @addtogroup Exported_macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define SET_BIT(REG, BIT) ((REG) |= (BIT))
|
||||||
|
|
||||||
|
#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
|
||||||
|
|
||||||
|
#define READ_BIT(REG, BIT) ((REG) & (BIT))
|
||||||
|
|
||||||
|
#define CLEAR_REG(REG) ((REG) = (0x0))
|
||||||
|
|
||||||
|
#define WRITE_REG(REG, VAL) ((REG) = (VAL))
|
||||||
|
|
||||||
|
#define READ_REG(REG) ((REG))
|
||||||
|
|
||||||
|
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
|
||||||
|
|
||||||
|
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined (USE_HAL_DRIVER)
|
||||||
|
#include "stm32mp1xx_hal.h"
|
||||||
|
#endif /* USE_HAL_DRIVER */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_H */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
+104
@@ -0,0 +1,104 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file system_stm32mp1xx.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief CMSIS Cortex-Mx Device System Source File for STM32MP1xx devices.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CMSIS
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup stm32mp1xx_system
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Define to prevent recursive inclusion
|
||||||
|
*/
|
||||||
|
#ifndef __SYSTEM_STM32MP1XX_H
|
||||||
|
#define __SYSTEM_STM32MP1XX_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Includes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Exported_types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* This variable is updated in three ways:
|
||||||
|
1) by calling CMSIS function SystemCoreClockUpdate()
|
||||||
|
2) by calling HAL API function HAL_RCC_GetSysClockFreq()
|
||||||
|
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
|
||||||
|
Note: If you use this function to configure the system clock; then there
|
||||||
|
is no need to call the 2 first functions listed above, since SystemCoreClock
|
||||||
|
variable is updated automatically.
|
||||||
|
*/
|
||||||
|
extern uint32_t SystemCoreClock; /*!< System Core1 Clock Frequency */
|
||||||
|
extern uint32_t SystemCore1Clock; /*!< System Core1 Clock Frequency */
|
||||||
|
extern uint32_t SystemCore2Clock; /*!< System Core2 Clock Frequency */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Exported_Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Exported_Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_System_Exported_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
extern void SystemInit(void);
|
||||||
|
extern void SystemCoreClockUpdate(void);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*__SYSTEM_STM32MP1XX_H */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
This software component is provided to you as part of a software package and
|
||||||
|
applicable license terms are in the Package_license file. If you received this
|
||||||
|
software component outside of a package or without applicable license terms,
|
||||||
|
the terms of the Apache-2.0 license shall apply.
|
||||||
|
You may obtain a copy of the Apache-2.0 at:
|
||||||
|
https://opensource.org/licenses/Apache-2.0
|
||||||
+894
@@ -0,0 +1,894 @@
|
|||||||
|
/**************************************************************************//**
|
||||||
|
* @file cmsis_armcc.h
|
||||||
|
* @brief CMSIS compiler ARMCC (Arm Compiler 5) header file
|
||||||
|
* @version V5.1.0
|
||||||
|
* @date 08. May 2019
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __CMSIS_ARMCC_H
|
||||||
|
#define __CMSIS_ARMCC_H
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677)
|
||||||
|
#error "Please use Arm Compiler Toolchain V4.0.677 or later!"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* CMSIS compiler control architecture macros */
|
||||||
|
#if ((defined (__TARGET_ARCH_6_M ) && (__TARGET_ARCH_6_M == 1)) || \
|
||||||
|
(defined (__TARGET_ARCH_6S_M ) && (__TARGET_ARCH_6S_M == 1)) )
|
||||||
|
#define __ARM_ARCH_6M__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M == 1))
|
||||||
|
#define __ARM_ARCH_7M__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1))
|
||||||
|
#define __ARM_ARCH_7EM__ 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* __ARM_ARCH_8M_BASE__ not applicable */
|
||||||
|
/* __ARM_ARCH_8M_MAIN__ not applicable */
|
||||||
|
|
||||||
|
/* CMSIS compiler control DSP macros */
|
||||||
|
#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
|
||||||
|
#define __ARM_FEATURE_DSP 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* CMSIS compiler specific defines */
|
||||||
|
#ifndef __ASM
|
||||||
|
#define __ASM __asm
|
||||||
|
#endif
|
||||||
|
#ifndef __INLINE
|
||||||
|
#define __INLINE __inline
|
||||||
|
#endif
|
||||||
|
#ifndef __STATIC_INLINE
|
||||||
|
#define __STATIC_INLINE static __inline
|
||||||
|
#endif
|
||||||
|
#ifndef __STATIC_FORCEINLINE
|
||||||
|
#define __STATIC_FORCEINLINE static __forceinline
|
||||||
|
#endif
|
||||||
|
#ifndef __NO_RETURN
|
||||||
|
#define __NO_RETURN __declspec(noreturn)
|
||||||
|
#endif
|
||||||
|
#ifndef __USED
|
||||||
|
#define __USED __attribute__((used))
|
||||||
|
#endif
|
||||||
|
#ifndef __WEAK
|
||||||
|
#define __WEAK __attribute__((weak))
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED
|
||||||
|
#define __PACKED __attribute__((packed))
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED_STRUCT
|
||||||
|
#define __PACKED_STRUCT __packed struct
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED_UNION
|
||||||
|
#define __PACKED_UNION __packed union
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||||
|
#define __UNALIGNED_UINT32(x) (*((__packed uint32_t *)(x)))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT16_WRITE
|
||||||
|
#define __UNALIGNED_UINT16_WRITE(addr, val) ((*((__packed uint16_t *)(addr))) = (val))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT16_READ
|
||||||
|
#define __UNALIGNED_UINT16_READ(addr) (*((const __packed uint16_t *)(addr)))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32_WRITE
|
||||||
|
#define __UNALIGNED_UINT32_WRITE(addr, val) ((*((__packed uint32_t *)(addr))) = (val))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32_READ
|
||||||
|
#define __UNALIGNED_UINT32_READ(addr) (*((const __packed uint32_t *)(addr)))
|
||||||
|
#endif
|
||||||
|
#ifndef __ALIGNED
|
||||||
|
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||||
|
#endif
|
||||||
|
#ifndef __RESTRICT
|
||||||
|
#define __RESTRICT __restrict
|
||||||
|
#endif
|
||||||
|
#ifndef __COMPILER_BARRIER
|
||||||
|
#define __COMPILER_BARRIER() __memory_changed()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ######################### Startup and Lowlevel Init ######################## */
|
||||||
|
|
||||||
|
#ifndef __PROGRAM_START
|
||||||
|
#define __PROGRAM_START __main
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __INITIAL_SP
|
||||||
|
#define __INITIAL_SP Image$$ARM_LIB_STACK$$ZI$$Limit
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __STACK_LIMIT
|
||||||
|
#define __STACK_LIMIT Image$$ARM_LIB_STACK$$ZI$$Base
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __VECTOR_TABLE
|
||||||
|
#define __VECTOR_TABLE __Vectors
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __VECTOR_TABLE_ATTRIBUTE
|
||||||
|
#define __VECTOR_TABLE_ATTRIBUTE __attribute((used, section("RESET")))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* ########################### Core Function Access ########################### */
|
||||||
|
/** \ingroup CMSIS_Core_FunctionInterface
|
||||||
|
\defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Enable IRQ Interrupts
|
||||||
|
\details Enables IRQ interrupts by clearing the I-bit in the CPSR.
|
||||||
|
Can only be executed in Privileged modes.
|
||||||
|
*/
|
||||||
|
/* intrinsic void __enable_irq(); */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Disable IRQ Interrupts
|
||||||
|
\details Disables IRQ interrupts by setting the I-bit in the CPSR.
|
||||||
|
Can only be executed in Privileged modes.
|
||||||
|
*/
|
||||||
|
/* intrinsic void __disable_irq(); */
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Control Register
|
||||||
|
\details Returns the content of the Control Register.
|
||||||
|
\return Control Register value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_CONTROL(void)
|
||||||
|
{
|
||||||
|
register uint32_t __regControl __ASM("control");
|
||||||
|
return(__regControl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Control Register
|
||||||
|
\details Writes the given value to the Control Register.
|
||||||
|
\param [in] control Control Register value to set
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __set_CONTROL(uint32_t control)
|
||||||
|
{
|
||||||
|
register uint32_t __regControl __ASM("control");
|
||||||
|
__regControl = control;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get IPSR Register
|
||||||
|
\details Returns the content of the IPSR Register.
|
||||||
|
\return IPSR Register value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_IPSR(void)
|
||||||
|
{
|
||||||
|
register uint32_t __regIPSR __ASM("ipsr");
|
||||||
|
return(__regIPSR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get APSR Register
|
||||||
|
\details Returns the content of the APSR Register.
|
||||||
|
\return APSR Register value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_APSR(void)
|
||||||
|
{
|
||||||
|
register uint32_t __regAPSR __ASM("apsr");
|
||||||
|
return(__regAPSR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get xPSR Register
|
||||||
|
\details Returns the content of the xPSR Register.
|
||||||
|
\return xPSR Register value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_xPSR(void)
|
||||||
|
{
|
||||||
|
register uint32_t __regXPSR __ASM("xpsr");
|
||||||
|
return(__regXPSR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Process Stack Pointer
|
||||||
|
\details Returns the current value of the Process Stack Pointer (PSP).
|
||||||
|
\return PSP Register value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_PSP(void)
|
||||||
|
{
|
||||||
|
register uint32_t __regProcessStackPointer __ASM("psp");
|
||||||
|
return(__regProcessStackPointer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Process Stack Pointer
|
||||||
|
\details Assigns the given value to the Process Stack Pointer (PSP).
|
||||||
|
\param [in] topOfProcStack Process Stack Pointer value to set
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack)
|
||||||
|
{
|
||||||
|
register uint32_t __regProcessStackPointer __ASM("psp");
|
||||||
|
__regProcessStackPointer = topOfProcStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Main Stack Pointer
|
||||||
|
\details Returns the current value of the Main Stack Pointer (MSP).
|
||||||
|
\return MSP Register value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_MSP(void)
|
||||||
|
{
|
||||||
|
register uint32_t __regMainStackPointer __ASM("msp");
|
||||||
|
return(__regMainStackPointer);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Main Stack Pointer
|
||||||
|
\details Assigns the given value to the Main Stack Pointer (MSP).
|
||||||
|
\param [in] topOfMainStack Main Stack Pointer value to set
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
|
||||||
|
{
|
||||||
|
register uint32_t __regMainStackPointer __ASM("msp");
|
||||||
|
__regMainStackPointer = topOfMainStack;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Priority Mask
|
||||||
|
\details Returns the current state of the priority mask bit from the Priority Mask Register.
|
||||||
|
\return Priority Mask value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_PRIMASK(void)
|
||||||
|
{
|
||||||
|
register uint32_t __regPriMask __ASM("primask");
|
||||||
|
return(__regPriMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Priority Mask
|
||||||
|
\details Assigns the given value to the Priority Mask Register.
|
||||||
|
\param [in] priMask Priority Mask
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __set_PRIMASK(uint32_t priMask)
|
||||||
|
{
|
||||||
|
register uint32_t __regPriMask __ASM("primask");
|
||||||
|
__regPriMask = (priMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||||
|
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Enable FIQ
|
||||||
|
\details Enables FIQ interrupts by clearing the F-bit in the CPSR.
|
||||||
|
Can only be executed in Privileged modes.
|
||||||
|
*/
|
||||||
|
#define __enable_fault_irq __enable_fiq
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Disable FIQ
|
||||||
|
\details Disables FIQ interrupts by setting the F-bit in the CPSR.
|
||||||
|
Can only be executed in Privileged modes.
|
||||||
|
*/
|
||||||
|
#define __disable_fault_irq __disable_fiq
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Base Priority
|
||||||
|
\details Returns the current value of the Base Priority register.
|
||||||
|
\return Base Priority register value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_BASEPRI(void)
|
||||||
|
{
|
||||||
|
register uint32_t __regBasePri __ASM("basepri");
|
||||||
|
return(__regBasePri);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Base Priority
|
||||||
|
\details Assigns the given value to the Base Priority register.
|
||||||
|
\param [in] basePri Base Priority value to set
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __set_BASEPRI(uint32_t basePri)
|
||||||
|
{
|
||||||
|
register uint32_t __regBasePri __ASM("basepri");
|
||||||
|
__regBasePri = (basePri & 0xFFU);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Base Priority with condition
|
||||||
|
\details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled,
|
||||||
|
or the new value increases the BASEPRI priority level.
|
||||||
|
\param [in] basePri Base Priority value to set
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri)
|
||||||
|
{
|
||||||
|
register uint32_t __regBasePriMax __ASM("basepri_max");
|
||||||
|
__regBasePriMax = (basePri & 0xFFU);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Fault Mask
|
||||||
|
\details Returns the current value of the Fault Mask register.
|
||||||
|
\return Fault Mask register value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_FAULTMASK(void)
|
||||||
|
{
|
||||||
|
register uint32_t __regFaultMask __ASM("faultmask");
|
||||||
|
return(__regFaultMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Fault Mask
|
||||||
|
\details Assigns the given value to the Fault Mask register.
|
||||||
|
\param [in] faultMask Fault Mask value to set
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask)
|
||||||
|
{
|
||||||
|
register uint32_t __regFaultMask __ASM("faultmask");
|
||||||
|
__regFaultMask = (faultMask & (uint32_t)1U);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||||
|
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get FPSCR
|
||||||
|
\details Returns the current value of the Floating Point Status/Control register.
|
||||||
|
\return Floating Point Status/Control register value
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __get_FPSCR(void)
|
||||||
|
{
|
||||||
|
#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||||
|
(defined (__FPU_USED ) && (__FPU_USED == 1U)) )
|
||||||
|
register uint32_t __regfpscr __ASM("fpscr");
|
||||||
|
return(__regfpscr);
|
||||||
|
#else
|
||||||
|
return(0U);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set FPSCR
|
||||||
|
\details Assigns the given value to the Floating Point Status/Control register.
|
||||||
|
\param [in] fpscr Floating Point Status/Control value to set
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __set_FPSCR(uint32_t fpscr)
|
||||||
|
{
|
||||||
|
#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||||
|
(defined (__FPU_USED ) && (__FPU_USED == 1U)) )
|
||||||
|
register uint32_t __regfpscr __ASM("fpscr");
|
||||||
|
__regfpscr = (fpscr);
|
||||||
|
#else
|
||||||
|
(void)fpscr;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*@} end of CMSIS_Core_RegAccFunctions */
|
||||||
|
|
||||||
|
|
||||||
|
/* ########################## Core Instruction Access ######################### */
|
||||||
|
/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
|
||||||
|
Access to dedicated instructions
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief No Operation
|
||||||
|
\details No Operation does nothing. This instruction can be used for code alignment purposes.
|
||||||
|
*/
|
||||||
|
#define __NOP __nop
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Wait For Interrupt
|
||||||
|
\details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs.
|
||||||
|
*/
|
||||||
|
#define __WFI __wfi
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Wait For Event
|
||||||
|
\details Wait For Event is a hint instruction that permits the processor to enter
|
||||||
|
a low-power state until one of a number of events occurs.
|
||||||
|
*/
|
||||||
|
#define __WFE __wfe
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Send Event
|
||||||
|
\details Send Event is a hint instruction. It causes an event to be signaled to the CPU.
|
||||||
|
*/
|
||||||
|
#define __SEV __sev
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Instruction Synchronization Barrier
|
||||||
|
\details Instruction Synchronization Barrier flushes the pipeline in the processor,
|
||||||
|
so that all instructions following the ISB are fetched from cache or memory,
|
||||||
|
after the instruction has been completed.
|
||||||
|
*/
|
||||||
|
#define __ISB() do {\
|
||||||
|
__schedule_barrier();\
|
||||||
|
__isb(0xF);\
|
||||||
|
__schedule_barrier();\
|
||||||
|
} while (0U)
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Data Synchronization Barrier
|
||||||
|
\details Acts as a special kind of Data Memory Barrier.
|
||||||
|
It completes when all explicit memory accesses before this instruction complete.
|
||||||
|
*/
|
||||||
|
#define __DSB() do {\
|
||||||
|
__schedule_barrier();\
|
||||||
|
__dsb(0xF);\
|
||||||
|
__schedule_barrier();\
|
||||||
|
} while (0U)
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Data Memory Barrier
|
||||||
|
\details Ensures the apparent order of the explicit memory operations before
|
||||||
|
and after the instruction, without ensuring their completion.
|
||||||
|
*/
|
||||||
|
#define __DMB() do {\
|
||||||
|
__schedule_barrier();\
|
||||||
|
__dmb(0xF);\
|
||||||
|
__schedule_barrier();\
|
||||||
|
} while (0U)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Reverse byte order (32 bit)
|
||||||
|
\details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412.
|
||||||
|
\param [in] value Value to reverse
|
||||||
|
\return Reversed value
|
||||||
|
*/
|
||||||
|
#define __REV __rev
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Reverse byte order (16 bit)
|
||||||
|
\details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856.
|
||||||
|
\param [in] value Value to reverse
|
||||||
|
\return Reversed value
|
||||||
|
*/
|
||||||
|
#ifndef __NO_EMBEDDED_ASM
|
||||||
|
__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value)
|
||||||
|
{
|
||||||
|
rev16 r0, r0
|
||||||
|
bx lr
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Reverse byte order (16 bit)
|
||||||
|
\details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000.
|
||||||
|
\param [in] value Value to reverse
|
||||||
|
\return Reversed value
|
||||||
|
*/
|
||||||
|
#ifndef __NO_EMBEDDED_ASM
|
||||||
|
__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value)
|
||||||
|
{
|
||||||
|
revsh r0, r0
|
||||||
|
bx lr
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Rotate Right in unsigned value (32 bit)
|
||||||
|
\details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits.
|
||||||
|
\param [in] op1 Value to rotate
|
||||||
|
\param [in] op2 Number of Bits to rotate
|
||||||
|
\return Rotated value
|
||||||
|
*/
|
||||||
|
#define __ROR __ror
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Breakpoint
|
||||||
|
\details Causes the processor to enter Debug state.
|
||||||
|
Debug tools can use this to investigate system state when the instruction at a particular address is reached.
|
||||||
|
\param [in] value is ignored by the processor.
|
||||||
|
If required, a debugger can use it to store additional information about the breakpoint.
|
||||||
|
*/
|
||||||
|
#define __BKPT(value) __breakpoint(value)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Reverse bit order of value
|
||||||
|
\details Reverses the bit order of the given value.
|
||||||
|
\param [in] value Value to reverse
|
||||||
|
\return Reversed value
|
||||||
|
*/
|
||||||
|
#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||||
|
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
|
||||||
|
#define __RBIT __rbit
|
||||||
|
#else
|
||||||
|
__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value)
|
||||||
|
{
|
||||||
|
uint32_t result;
|
||||||
|
uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */
|
||||||
|
|
||||||
|
result = value; /* r will be reversed bits of v; first get LSB of v */
|
||||||
|
for (value >>= 1U; value != 0U; value >>= 1U)
|
||||||
|
{
|
||||||
|
result <<= 1U;
|
||||||
|
result |= value & 1U;
|
||||||
|
s--;
|
||||||
|
}
|
||||||
|
result <<= s; /* shift when v's highest bits are zero */
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Count leading zeros
|
||||||
|
\details Counts the number of leading zeros of a data value.
|
||||||
|
\param [in] value Value to count the leading zeros
|
||||||
|
\return number of leading zeros in value
|
||||||
|
*/
|
||||||
|
#define __CLZ __clz
|
||||||
|
|
||||||
|
|
||||||
|
#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||||
|
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief LDR Exclusive (8 bit)
|
||||||
|
\details Executes a exclusive LDR instruction for 8 bit value.
|
||||||
|
\param [in] ptr Pointer to data
|
||||||
|
\return value of type uint8_t at (*ptr)
|
||||||
|
*/
|
||||||
|
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||||
|
#define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr))
|
||||||
|
#else
|
||||||
|
#define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief LDR Exclusive (16 bit)
|
||||||
|
\details Executes a exclusive LDR instruction for 16 bit values.
|
||||||
|
\param [in] ptr Pointer to data
|
||||||
|
\return value of type uint16_t at (*ptr)
|
||||||
|
*/
|
||||||
|
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||||
|
#define __LDREXH(ptr) ((uint16_t) __ldrex(ptr))
|
||||||
|
#else
|
||||||
|
#define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief LDR Exclusive (32 bit)
|
||||||
|
\details Executes a exclusive LDR instruction for 32 bit values.
|
||||||
|
\param [in] ptr Pointer to data
|
||||||
|
\return value of type uint32_t at (*ptr)
|
||||||
|
*/
|
||||||
|
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||||
|
#define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr))
|
||||||
|
#else
|
||||||
|
#define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief STR Exclusive (8 bit)
|
||||||
|
\details Executes a exclusive STR instruction for 8 bit values.
|
||||||
|
\param [in] value Value to store
|
||||||
|
\param [in] ptr Pointer to location
|
||||||
|
\return 0 Function succeeded
|
||||||
|
\return 1 Function failed
|
||||||
|
*/
|
||||||
|
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||||
|
#define __STREXB(value, ptr) __strex(value, ptr)
|
||||||
|
#else
|
||||||
|
#define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief STR Exclusive (16 bit)
|
||||||
|
\details Executes a exclusive STR instruction for 16 bit values.
|
||||||
|
\param [in] value Value to store
|
||||||
|
\param [in] ptr Pointer to location
|
||||||
|
\return 0 Function succeeded
|
||||||
|
\return 1 Function failed
|
||||||
|
*/
|
||||||
|
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||||
|
#define __STREXH(value, ptr) __strex(value, ptr)
|
||||||
|
#else
|
||||||
|
#define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief STR Exclusive (32 bit)
|
||||||
|
\details Executes a exclusive STR instruction for 32 bit values.
|
||||||
|
\param [in] value Value to store
|
||||||
|
\param [in] ptr Pointer to location
|
||||||
|
\return 0 Function succeeded
|
||||||
|
\return 1 Function failed
|
||||||
|
*/
|
||||||
|
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020)
|
||||||
|
#define __STREXW(value, ptr) __strex(value, ptr)
|
||||||
|
#else
|
||||||
|
#define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Remove the exclusive lock
|
||||||
|
\details Removes the exclusive lock which is created by LDREX.
|
||||||
|
*/
|
||||||
|
#define __CLREX __clrex
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Signed Saturate
|
||||||
|
\details Saturates a signed value.
|
||||||
|
\param [in] value Value to be saturated
|
||||||
|
\param [in] sat Bit position to saturate to (1..32)
|
||||||
|
\return Saturated value
|
||||||
|
*/
|
||||||
|
#define __SSAT __ssat
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Unsigned Saturate
|
||||||
|
\details Saturates an unsigned value.
|
||||||
|
\param [in] value Value to be saturated
|
||||||
|
\param [in] sat Bit position to saturate to (0..31)
|
||||||
|
\return Saturated value
|
||||||
|
*/
|
||||||
|
#define __USAT __usat
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Rotate Right with Extend (32 bit)
|
||||||
|
\details Moves each bit of a bitstring right by one bit.
|
||||||
|
The carry input is shifted in at the left end of the bitstring.
|
||||||
|
\param [in] value Value to rotate
|
||||||
|
\return Rotated value
|
||||||
|
*/
|
||||||
|
#ifndef __NO_EMBEDDED_ASM
|
||||||
|
__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value)
|
||||||
|
{
|
||||||
|
rrx r0, r0
|
||||||
|
bx lr
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief LDRT Unprivileged (8 bit)
|
||||||
|
\details Executes a Unprivileged LDRT instruction for 8 bit value.
|
||||||
|
\param [in] ptr Pointer to data
|
||||||
|
\return value of type uint8_t at (*ptr)
|
||||||
|
*/
|
||||||
|
#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr))
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief LDRT Unprivileged (16 bit)
|
||||||
|
\details Executes a Unprivileged LDRT instruction for 16 bit values.
|
||||||
|
\param [in] ptr Pointer to data
|
||||||
|
\return value of type uint16_t at (*ptr)
|
||||||
|
*/
|
||||||
|
#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr))
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief LDRT Unprivileged (32 bit)
|
||||||
|
\details Executes a Unprivileged LDRT instruction for 32 bit values.
|
||||||
|
\param [in] ptr Pointer to data
|
||||||
|
\return value of type uint32_t at (*ptr)
|
||||||
|
*/
|
||||||
|
#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr))
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief STRT Unprivileged (8 bit)
|
||||||
|
\details Executes a Unprivileged STRT instruction for 8 bit values.
|
||||||
|
\param [in] value Value to store
|
||||||
|
\param [in] ptr Pointer to location
|
||||||
|
*/
|
||||||
|
#define __STRBT(value, ptr) __strt(value, ptr)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief STRT Unprivileged (16 bit)
|
||||||
|
\details Executes a Unprivileged STRT instruction for 16 bit values.
|
||||||
|
\param [in] value Value to store
|
||||||
|
\param [in] ptr Pointer to location
|
||||||
|
*/
|
||||||
|
#define __STRHT(value, ptr) __strt(value, ptr)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief STRT Unprivileged (32 bit)
|
||||||
|
\details Executes a Unprivileged STRT instruction for 32 bit values.
|
||||||
|
\param [in] value Value to store
|
||||||
|
\param [in] ptr Pointer to location
|
||||||
|
*/
|
||||||
|
#define __STRT(value, ptr) __strt(value, ptr)
|
||||||
|
|
||||||
|
#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||||
|
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Signed Saturate
|
||||||
|
\details Saturates a signed value.
|
||||||
|
\param [in] value Value to be saturated
|
||||||
|
\param [in] sat Bit position to saturate to (1..32)
|
||||||
|
\return Saturated value
|
||||||
|
*/
|
||||||
|
__attribute__((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat)
|
||||||
|
{
|
||||||
|
if ((sat >= 1U) && (sat <= 32U))
|
||||||
|
{
|
||||||
|
const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
|
||||||
|
const int32_t min = -1 - max ;
|
||||||
|
if (val > max)
|
||||||
|
{
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
else if (val < min)
|
||||||
|
{
|
||||||
|
return min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Unsigned Saturate
|
||||||
|
\details Saturates an unsigned value.
|
||||||
|
\param [in] value Value to be saturated
|
||||||
|
\param [in] sat Bit position to saturate to (0..31)
|
||||||
|
\return Saturated value
|
||||||
|
*/
|
||||||
|
__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat)
|
||||||
|
{
|
||||||
|
if (sat <= 31U)
|
||||||
|
{
|
||||||
|
const uint32_t max = ((1U << sat) - 1U);
|
||||||
|
if (val > (int32_t)max)
|
||||||
|
{
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
else if (val < 0)
|
||||||
|
{
|
||||||
|
return 0U;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (uint32_t)val;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \
|
||||||
|
(defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */
|
||||||
|
|
||||||
|
/*@}*/ /* end of group CMSIS_Core_InstructionInterface */
|
||||||
|
|
||||||
|
|
||||||
|
/* ################### Compiler specific Intrinsics ########################### */
|
||||||
|
/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
|
||||||
|
Access to dedicated SIMD instructions
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) )
|
||||||
|
|
||||||
|
#define __SADD8 __sadd8
|
||||||
|
#define __QADD8 __qadd8
|
||||||
|
#define __SHADD8 __shadd8
|
||||||
|
#define __UADD8 __uadd8
|
||||||
|
#define __UQADD8 __uqadd8
|
||||||
|
#define __UHADD8 __uhadd8
|
||||||
|
#define __SSUB8 __ssub8
|
||||||
|
#define __QSUB8 __qsub8
|
||||||
|
#define __SHSUB8 __shsub8
|
||||||
|
#define __USUB8 __usub8
|
||||||
|
#define __UQSUB8 __uqsub8
|
||||||
|
#define __UHSUB8 __uhsub8
|
||||||
|
#define __SADD16 __sadd16
|
||||||
|
#define __QADD16 __qadd16
|
||||||
|
#define __SHADD16 __shadd16
|
||||||
|
#define __UADD16 __uadd16
|
||||||
|
#define __UQADD16 __uqadd16
|
||||||
|
#define __UHADD16 __uhadd16
|
||||||
|
#define __SSUB16 __ssub16
|
||||||
|
#define __QSUB16 __qsub16
|
||||||
|
#define __SHSUB16 __shsub16
|
||||||
|
#define __USUB16 __usub16
|
||||||
|
#define __UQSUB16 __uqsub16
|
||||||
|
#define __UHSUB16 __uhsub16
|
||||||
|
#define __SASX __sasx
|
||||||
|
#define __QASX __qasx
|
||||||
|
#define __SHASX __shasx
|
||||||
|
#define __UASX __uasx
|
||||||
|
#define __UQASX __uqasx
|
||||||
|
#define __UHASX __uhasx
|
||||||
|
#define __SSAX __ssax
|
||||||
|
#define __QSAX __qsax
|
||||||
|
#define __SHSAX __shsax
|
||||||
|
#define __USAX __usax
|
||||||
|
#define __UQSAX __uqsax
|
||||||
|
#define __UHSAX __uhsax
|
||||||
|
#define __USAD8 __usad8
|
||||||
|
#define __USADA8 __usada8
|
||||||
|
#define __SSAT16 __ssat16
|
||||||
|
#define __USAT16 __usat16
|
||||||
|
#define __UXTB16 __uxtb16
|
||||||
|
#define __UXTAB16 __uxtab16
|
||||||
|
#define __SXTB16 __sxtb16
|
||||||
|
#define __SXTAB16 __sxtab16
|
||||||
|
#define __SMUAD __smuad
|
||||||
|
#define __SMUADX __smuadx
|
||||||
|
#define __SMLAD __smlad
|
||||||
|
#define __SMLADX __smladx
|
||||||
|
#define __SMLALD __smlald
|
||||||
|
#define __SMLALDX __smlaldx
|
||||||
|
#define __SMUSD __smusd
|
||||||
|
#define __SMUSDX __smusdx
|
||||||
|
#define __SMLSD __smlsd
|
||||||
|
#define __SMLSDX __smlsdx
|
||||||
|
#define __SMLSLD __smlsld
|
||||||
|
#define __SMLSLDX __smlsldx
|
||||||
|
#define __SEL __sel
|
||||||
|
#define __QADD __qadd
|
||||||
|
#define __QSUB __qsub
|
||||||
|
|
||||||
|
#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \
|
||||||
|
((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) )
|
||||||
|
|
||||||
|
#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \
|
||||||
|
((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) )
|
||||||
|
|
||||||
|
#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \
|
||||||
|
((int64_t)(ARG3) << 32U) ) >> 32U))
|
||||||
|
|
||||||
|
#endif /* ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */
|
||||||
|
/*@} end of group CMSIS_SIMD_intrinsics */
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __CMSIS_ARMCC_H */
|
||||||
+1444
File diff suppressed because it is too large
Load Diff
+1891
File diff suppressed because it is too large
Load Diff
+283
@@ -0,0 +1,283 @@
|
|||||||
|
/**************************************************************************//**
|
||||||
|
* @file cmsis_compiler.h
|
||||||
|
* @brief CMSIS compiler generic header file
|
||||||
|
* @version V5.1.0
|
||||||
|
* @date 09. October 2018
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __CMSIS_COMPILER_H
|
||||||
|
#define __CMSIS_COMPILER_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Arm Compiler 4/5
|
||||||
|
*/
|
||||||
|
#if defined ( __CC_ARM )
|
||||||
|
#include "cmsis_armcc.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Arm Compiler 6.6 LTM (armclang)
|
||||||
|
*/
|
||||||
|
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100)
|
||||||
|
#include "cmsis_armclang_ltm.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Arm Compiler above 6.10.1 (armclang)
|
||||||
|
*/
|
||||||
|
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100)
|
||||||
|
#include "cmsis_armclang.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* GNU Compiler
|
||||||
|
*/
|
||||||
|
#elif defined ( __GNUC__ )
|
||||||
|
#include "cmsis_gcc.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IAR Compiler
|
||||||
|
*/
|
||||||
|
#elif defined ( __ICCARM__ )
|
||||||
|
#include <cmsis_iccarm.h>
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TI Arm Compiler
|
||||||
|
*/
|
||||||
|
#elif defined ( __TI_ARM__ )
|
||||||
|
#include <cmsis_ccs.h>
|
||||||
|
|
||||||
|
#ifndef __ASM
|
||||||
|
#define __ASM __asm
|
||||||
|
#endif
|
||||||
|
#ifndef __INLINE
|
||||||
|
#define __INLINE inline
|
||||||
|
#endif
|
||||||
|
#ifndef __STATIC_INLINE
|
||||||
|
#define __STATIC_INLINE static inline
|
||||||
|
#endif
|
||||||
|
#ifndef __STATIC_FORCEINLINE
|
||||||
|
#define __STATIC_FORCEINLINE __STATIC_INLINE
|
||||||
|
#endif
|
||||||
|
#ifndef __NO_RETURN
|
||||||
|
#define __NO_RETURN __attribute__((noreturn))
|
||||||
|
#endif
|
||||||
|
#ifndef __USED
|
||||||
|
#define __USED __attribute__((used))
|
||||||
|
#endif
|
||||||
|
#ifndef __WEAK
|
||||||
|
#define __WEAK __attribute__((weak))
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED
|
||||||
|
#define __PACKED __attribute__((packed))
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED_STRUCT
|
||||||
|
#define __PACKED_STRUCT struct __attribute__((packed))
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED_UNION
|
||||||
|
#define __PACKED_UNION union __attribute__((packed))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||||
|
struct __attribute__((packed)) T_UINT32 { uint32_t v; };
|
||||||
|
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT16_WRITE
|
||||||
|
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
|
||||||
|
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT16_READ
|
||||||
|
__PACKED_STRUCT T_UINT16_READ { uint16_t v; };
|
||||||
|
#define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32_WRITE
|
||||||
|
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
|
||||||
|
#define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32_READ
|
||||||
|
__PACKED_STRUCT T_UINT32_READ { uint32_t v; };
|
||||||
|
#define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
|
||||||
|
#endif
|
||||||
|
#ifndef __ALIGNED
|
||||||
|
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||||
|
#endif
|
||||||
|
#ifndef __RESTRICT
|
||||||
|
#define __RESTRICT __restrict
|
||||||
|
#endif
|
||||||
|
#ifndef __COMPILER_BARRIER
|
||||||
|
#warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored.
|
||||||
|
#define __COMPILER_BARRIER() (void)0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* TASKING Compiler
|
||||||
|
*/
|
||||||
|
#elif defined ( __TASKING__ )
|
||||||
|
/*
|
||||||
|
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||||
|
* Please use "carm -?i" to get an up to date list of all intrinsics,
|
||||||
|
* Including the CMSIS ones.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __ASM
|
||||||
|
#define __ASM __asm
|
||||||
|
#endif
|
||||||
|
#ifndef __INLINE
|
||||||
|
#define __INLINE inline
|
||||||
|
#endif
|
||||||
|
#ifndef __STATIC_INLINE
|
||||||
|
#define __STATIC_INLINE static inline
|
||||||
|
#endif
|
||||||
|
#ifndef __STATIC_FORCEINLINE
|
||||||
|
#define __STATIC_FORCEINLINE __STATIC_INLINE
|
||||||
|
#endif
|
||||||
|
#ifndef __NO_RETURN
|
||||||
|
#define __NO_RETURN __attribute__((noreturn))
|
||||||
|
#endif
|
||||||
|
#ifndef __USED
|
||||||
|
#define __USED __attribute__((used))
|
||||||
|
#endif
|
||||||
|
#ifndef __WEAK
|
||||||
|
#define __WEAK __attribute__((weak))
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED
|
||||||
|
#define __PACKED __packed__
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED_STRUCT
|
||||||
|
#define __PACKED_STRUCT struct __packed__
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED_UNION
|
||||||
|
#define __PACKED_UNION union __packed__
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||||
|
struct __packed__ T_UINT32 { uint32_t v; };
|
||||||
|
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT16_WRITE
|
||||||
|
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
|
||||||
|
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT16_READ
|
||||||
|
__PACKED_STRUCT T_UINT16_READ { uint16_t v; };
|
||||||
|
#define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32_WRITE
|
||||||
|
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
|
||||||
|
#define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32_READ
|
||||||
|
__PACKED_STRUCT T_UINT32_READ { uint32_t v; };
|
||||||
|
#define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
|
||||||
|
#endif
|
||||||
|
#ifndef __ALIGNED
|
||||||
|
#define __ALIGNED(x) __align(x)
|
||||||
|
#endif
|
||||||
|
#ifndef __RESTRICT
|
||||||
|
#warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
|
||||||
|
#define __RESTRICT
|
||||||
|
#endif
|
||||||
|
#ifndef __COMPILER_BARRIER
|
||||||
|
#warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored.
|
||||||
|
#define __COMPILER_BARRIER() (void)0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* COSMIC Compiler
|
||||||
|
*/
|
||||||
|
#elif defined ( __CSMC__ )
|
||||||
|
#include <cmsis_csm.h>
|
||||||
|
|
||||||
|
#ifndef __ASM
|
||||||
|
#define __ASM _asm
|
||||||
|
#endif
|
||||||
|
#ifndef __INLINE
|
||||||
|
#define __INLINE inline
|
||||||
|
#endif
|
||||||
|
#ifndef __STATIC_INLINE
|
||||||
|
#define __STATIC_INLINE static inline
|
||||||
|
#endif
|
||||||
|
#ifndef __STATIC_FORCEINLINE
|
||||||
|
#define __STATIC_FORCEINLINE __STATIC_INLINE
|
||||||
|
#endif
|
||||||
|
#ifndef __NO_RETURN
|
||||||
|
// NO RETURN is automatically detected hence no warning here
|
||||||
|
#define __NO_RETURN
|
||||||
|
#endif
|
||||||
|
#ifndef __USED
|
||||||
|
#warning No compiler specific solution for __USED. __USED is ignored.
|
||||||
|
#define __USED
|
||||||
|
#endif
|
||||||
|
#ifndef __WEAK
|
||||||
|
#define __WEAK __weak
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED
|
||||||
|
#define __PACKED @packed
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED_STRUCT
|
||||||
|
#define __PACKED_STRUCT @packed struct
|
||||||
|
#endif
|
||||||
|
#ifndef __PACKED_UNION
|
||||||
|
#define __PACKED_UNION @packed union
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||||
|
@packed struct T_UINT32 { uint32_t v; };
|
||||||
|
#define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v)
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT16_WRITE
|
||||||
|
__PACKED_STRUCT T_UINT16_WRITE { uint16_t v; };
|
||||||
|
#define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT16_READ
|
||||||
|
__PACKED_STRUCT T_UINT16_READ { uint16_t v; };
|
||||||
|
#define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v)
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32_WRITE
|
||||||
|
__PACKED_STRUCT T_UINT32_WRITE { uint32_t v; };
|
||||||
|
#define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val))
|
||||||
|
#endif
|
||||||
|
#ifndef __UNALIGNED_UINT32_READ
|
||||||
|
__PACKED_STRUCT T_UINT32_READ { uint32_t v; };
|
||||||
|
#define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v)
|
||||||
|
#endif
|
||||||
|
#ifndef __ALIGNED
|
||||||
|
#warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored.
|
||||||
|
#define __ALIGNED(x)
|
||||||
|
#endif
|
||||||
|
#ifndef __RESTRICT
|
||||||
|
#warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored.
|
||||||
|
#define __RESTRICT
|
||||||
|
#endif
|
||||||
|
#ifndef __COMPILER_BARRIER
|
||||||
|
#warning No compiler specific solution for __COMPILER_BARRIER. __COMPILER_BARRIER is ignored.
|
||||||
|
#define __COMPILER_BARRIER() (void)0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#else
|
||||||
|
#error Unknown compiler.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __CMSIS_COMPILER_H */
|
||||||
|
|
||||||
+2168
File diff suppressed because it is too large
Load Diff
+964
@@ -0,0 +1,964 @@
|
|||||||
|
/**************************************************************************//**
|
||||||
|
* @file cmsis_iccarm.h
|
||||||
|
* @brief CMSIS compiler ICCARM (IAR Compiler for Arm) header file
|
||||||
|
* @version V5.1.0
|
||||||
|
* @date 08. May 2019
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// Copyright (c) 2017-2019 IAR Systems
|
||||||
|
// Copyright (c) 2017-2019 Arm Limited. All rights reserved.
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License")
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
//
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __CMSIS_ICCARM_H__
|
||||||
|
#define __CMSIS_ICCARM_H__
|
||||||
|
|
||||||
|
#ifndef __ICCARM__
|
||||||
|
#error This file should only be compiled by ICCARM
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#pragma system_include
|
||||||
|
|
||||||
|
#define __IAR_FT _Pragma("inline=forced") __intrinsic
|
||||||
|
|
||||||
|
#if (__VER__ >= 8000000)
|
||||||
|
#define __ICCARM_V8 1
|
||||||
|
#else
|
||||||
|
#define __ICCARM_V8 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ALIGNED
|
||||||
|
#if __ICCARM_V8
|
||||||
|
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||||
|
#elif (__VER__ >= 7080000)
|
||||||
|
/* Needs IAR language extensions */
|
||||||
|
#define __ALIGNED(x) __attribute__((aligned(x)))
|
||||||
|
#else
|
||||||
|
#warning No compiler specific solution for __ALIGNED.__ALIGNED is ignored.
|
||||||
|
#define __ALIGNED(x)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Define compiler macros for CPU architecture, used in CMSIS 5.
|
||||||
|
*/
|
||||||
|
#if __ARM_ARCH_6M__ || __ARM_ARCH_7M__ || __ARM_ARCH_7EM__ || __ARM_ARCH_8M_BASE__ || __ARM_ARCH_8M_MAIN__
|
||||||
|
/* Macros already defined */
|
||||||
|
#else
|
||||||
|
#if defined(__ARM8M_MAINLINE__) || defined(__ARM8EM_MAINLINE__)
|
||||||
|
#define __ARM_ARCH_8M_MAIN__ 1
|
||||||
|
#elif defined(__ARM8M_BASELINE__)
|
||||||
|
#define __ARM_ARCH_8M_BASE__ 1
|
||||||
|
#elif defined(__ARM_ARCH_PROFILE) && __ARM_ARCH_PROFILE == 'M'
|
||||||
|
#if __ARM_ARCH == 6
|
||||||
|
#define __ARM_ARCH_6M__ 1
|
||||||
|
#elif __ARM_ARCH == 7
|
||||||
|
#if __ARM_FEATURE_DSP
|
||||||
|
#define __ARM_ARCH_7EM__ 1
|
||||||
|
#else
|
||||||
|
#define __ARM_ARCH_7M__ 1
|
||||||
|
#endif
|
||||||
|
#endif /* __ARM_ARCH */
|
||||||
|
#endif /* __ARM_ARCH_PROFILE == 'M' */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Alternativ core deduction for older ICCARM's */
|
||||||
|
#if !defined(__ARM_ARCH_6M__) && !defined(__ARM_ARCH_7M__) && !defined(__ARM_ARCH_7EM__) && \
|
||||||
|
!defined(__ARM_ARCH_8M_BASE__) && !defined(__ARM_ARCH_8M_MAIN__)
|
||||||
|
#if defined(__ARM6M__) && (__CORE__ == __ARM6M__)
|
||||||
|
#define __ARM_ARCH_6M__ 1
|
||||||
|
#elif defined(__ARM7M__) && (__CORE__ == __ARM7M__)
|
||||||
|
#define __ARM_ARCH_7M__ 1
|
||||||
|
#elif defined(__ARM7EM__) && (__CORE__ == __ARM7EM__)
|
||||||
|
#define __ARM_ARCH_7EM__ 1
|
||||||
|
#elif defined(__ARM8M_BASELINE__) && (__CORE == __ARM8M_BASELINE__)
|
||||||
|
#define __ARM_ARCH_8M_BASE__ 1
|
||||||
|
#elif defined(__ARM8M_MAINLINE__) && (__CORE == __ARM8M_MAINLINE__)
|
||||||
|
#define __ARM_ARCH_8M_MAIN__ 1
|
||||||
|
#elif defined(__ARM8EM_MAINLINE__) && (__CORE == __ARM8EM_MAINLINE__)
|
||||||
|
#define __ARM_ARCH_8M_MAIN__ 1
|
||||||
|
#else
|
||||||
|
#error "Unknown target."
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(__ARM_ARCH_6M__) && __ARM_ARCH_6M__==1
|
||||||
|
#define __IAR_M0_FAMILY 1
|
||||||
|
#elif defined(__ARM_ARCH_8M_BASE__) && __ARM_ARCH_8M_BASE__==1
|
||||||
|
#define __IAR_M0_FAMILY 1
|
||||||
|
#else
|
||||||
|
#define __IAR_M0_FAMILY 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __ASM
|
||||||
|
#define __ASM __asm
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __COMPILER_BARRIER
|
||||||
|
#define __COMPILER_BARRIER() __ASM volatile("":::"memory")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __INLINE
|
||||||
|
#define __INLINE inline
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __NO_RETURN
|
||||||
|
#if __ICCARM_V8
|
||||||
|
#define __NO_RETURN __attribute__((__noreturn__))
|
||||||
|
#else
|
||||||
|
#define __NO_RETURN _Pragma("object_attribute=__noreturn")
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PACKED
|
||||||
|
#if __ICCARM_V8
|
||||||
|
#define __PACKED __attribute__((packed, aligned(1)))
|
||||||
|
#else
|
||||||
|
/* Needs IAR language extensions */
|
||||||
|
#define __PACKED __packed
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PACKED_STRUCT
|
||||||
|
#if __ICCARM_V8
|
||||||
|
#define __PACKED_STRUCT struct __attribute__((packed, aligned(1)))
|
||||||
|
#else
|
||||||
|
/* Needs IAR language extensions */
|
||||||
|
#define __PACKED_STRUCT __packed struct
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PACKED_UNION
|
||||||
|
#if __ICCARM_V8
|
||||||
|
#define __PACKED_UNION union __attribute__((packed, aligned(1)))
|
||||||
|
#else
|
||||||
|
/* Needs IAR language extensions */
|
||||||
|
#define __PACKED_UNION __packed union
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __RESTRICT
|
||||||
|
#if __ICCARM_V8
|
||||||
|
#define __RESTRICT __restrict
|
||||||
|
#else
|
||||||
|
/* Needs IAR language extensions */
|
||||||
|
#define __RESTRICT restrict
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __STATIC_INLINE
|
||||||
|
#define __STATIC_INLINE static inline
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __FORCEINLINE
|
||||||
|
#define __FORCEINLINE _Pragma("inline=forced")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __STATIC_FORCEINLINE
|
||||||
|
#define __STATIC_FORCEINLINE __FORCEINLINE __STATIC_INLINE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __UNALIGNED_UINT16_READ
|
||||||
|
#pragma language=save
|
||||||
|
#pragma language=extended
|
||||||
|
__IAR_FT uint16_t __iar_uint16_read(void const *ptr)
|
||||||
|
{
|
||||||
|
return *(__packed uint16_t*)(ptr);
|
||||||
|
}
|
||||||
|
#pragma language=restore
|
||||||
|
#define __UNALIGNED_UINT16_READ(PTR) __iar_uint16_read(PTR)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __UNALIGNED_UINT16_WRITE
|
||||||
|
#pragma language=save
|
||||||
|
#pragma language=extended
|
||||||
|
__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val)
|
||||||
|
{
|
||||||
|
*(__packed uint16_t*)(ptr) = val;;
|
||||||
|
}
|
||||||
|
#pragma language=restore
|
||||||
|
#define __UNALIGNED_UINT16_WRITE(PTR,VAL) __iar_uint16_write(PTR,VAL)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __UNALIGNED_UINT32_READ
|
||||||
|
#pragma language=save
|
||||||
|
#pragma language=extended
|
||||||
|
__IAR_FT uint32_t __iar_uint32_read(void const *ptr)
|
||||||
|
{
|
||||||
|
return *(__packed uint32_t*)(ptr);
|
||||||
|
}
|
||||||
|
#pragma language=restore
|
||||||
|
#define __UNALIGNED_UINT32_READ(PTR) __iar_uint32_read(PTR)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __UNALIGNED_UINT32_WRITE
|
||||||
|
#pragma language=save
|
||||||
|
#pragma language=extended
|
||||||
|
__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val)
|
||||||
|
{
|
||||||
|
*(__packed uint32_t*)(ptr) = val;;
|
||||||
|
}
|
||||||
|
#pragma language=restore
|
||||||
|
#define __UNALIGNED_UINT32_WRITE(PTR,VAL) __iar_uint32_write(PTR,VAL)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __UNALIGNED_UINT32 /* deprecated */
|
||||||
|
#pragma language=save
|
||||||
|
#pragma language=extended
|
||||||
|
__packed struct __iar_u32 { uint32_t v; };
|
||||||
|
#pragma language=restore
|
||||||
|
#define __UNALIGNED_UINT32(PTR) (((struct __iar_u32 *)(PTR))->v)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __USED
|
||||||
|
#if __ICCARM_V8
|
||||||
|
#define __USED __attribute__((used))
|
||||||
|
#else
|
||||||
|
#define __USED _Pragma("__root")
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __WEAK
|
||||||
|
#if __ICCARM_V8
|
||||||
|
#define __WEAK __attribute__((weak))
|
||||||
|
#else
|
||||||
|
#define __WEAK _Pragma("__weak")
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PROGRAM_START
|
||||||
|
#define __PROGRAM_START __iar_program_start
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __INITIAL_SP
|
||||||
|
#define __INITIAL_SP CSTACK$$Limit
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __STACK_LIMIT
|
||||||
|
#define __STACK_LIMIT CSTACK$$Base
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __VECTOR_TABLE
|
||||||
|
#define __VECTOR_TABLE __vector_table
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __VECTOR_TABLE_ATTRIBUTE
|
||||||
|
#define __VECTOR_TABLE_ATTRIBUTE @".intvec"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ICCARM_INTRINSICS_VERSION__
|
||||||
|
#define __ICCARM_INTRINSICS_VERSION__ 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if __ICCARM_INTRINSICS_VERSION__ == 2
|
||||||
|
|
||||||
|
#if defined(__CLZ)
|
||||||
|
#undef __CLZ
|
||||||
|
#endif
|
||||||
|
#if defined(__REVSH)
|
||||||
|
#undef __REVSH
|
||||||
|
#endif
|
||||||
|
#if defined(__RBIT)
|
||||||
|
#undef __RBIT
|
||||||
|
#endif
|
||||||
|
#if defined(__SSAT)
|
||||||
|
#undef __SSAT
|
||||||
|
#endif
|
||||||
|
#if defined(__USAT)
|
||||||
|
#undef __USAT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "iccarm_builtin.h"
|
||||||
|
|
||||||
|
#define __disable_fault_irq __iar_builtin_disable_fiq
|
||||||
|
#define __disable_irq __iar_builtin_disable_interrupt
|
||||||
|
#define __enable_fault_irq __iar_builtin_enable_fiq
|
||||||
|
#define __enable_irq __iar_builtin_enable_interrupt
|
||||||
|
#define __arm_rsr __iar_builtin_rsr
|
||||||
|
#define __arm_wsr __iar_builtin_wsr
|
||||||
|
|
||||||
|
|
||||||
|
#define __get_APSR() (__arm_rsr("APSR"))
|
||||||
|
#define __get_BASEPRI() (__arm_rsr("BASEPRI"))
|
||||||
|
#define __get_CONTROL() (__arm_rsr("CONTROL"))
|
||||||
|
#define __get_FAULTMASK() (__arm_rsr("FAULTMASK"))
|
||||||
|
|
||||||
|
#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||||
|
(defined (__FPU_USED ) && (__FPU_USED == 1U)) )
|
||||||
|
#define __get_FPSCR() (__arm_rsr("FPSCR"))
|
||||||
|
#define __set_FPSCR(VALUE) (__arm_wsr("FPSCR", (VALUE)))
|
||||||
|
#else
|
||||||
|
#define __get_FPSCR() ( 0 )
|
||||||
|
#define __set_FPSCR(VALUE) ((void)VALUE)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __get_IPSR() (__arm_rsr("IPSR"))
|
||||||
|
#define __get_MSP() (__arm_rsr("MSP"))
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure MSPLIM is RAZ/WI
|
||||||
|
#define __get_MSPLIM() (0U)
|
||||||
|
#else
|
||||||
|
#define __get_MSPLIM() (__arm_rsr("MSPLIM"))
|
||||||
|
#endif
|
||||||
|
#define __get_PRIMASK() (__arm_rsr("PRIMASK"))
|
||||||
|
#define __get_PSP() (__arm_rsr("PSP"))
|
||||||
|
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||||
|
#define __get_PSPLIM() (0U)
|
||||||
|
#else
|
||||||
|
#define __get_PSPLIM() (__arm_rsr("PSPLIM"))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __get_xPSR() (__arm_rsr("xPSR"))
|
||||||
|
|
||||||
|
#define __set_BASEPRI(VALUE) (__arm_wsr("BASEPRI", (VALUE)))
|
||||||
|
#define __set_BASEPRI_MAX(VALUE) (__arm_wsr("BASEPRI_MAX", (VALUE)))
|
||||||
|
#define __set_CONTROL(VALUE) (__arm_wsr("CONTROL", (VALUE)))
|
||||||
|
#define __set_FAULTMASK(VALUE) (__arm_wsr("FAULTMASK", (VALUE)))
|
||||||
|
#define __set_MSP(VALUE) (__arm_wsr("MSP", (VALUE)))
|
||||||
|
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure MSPLIM is RAZ/WI
|
||||||
|
#define __set_MSPLIM(VALUE) ((void)(VALUE))
|
||||||
|
#else
|
||||||
|
#define __set_MSPLIM(VALUE) (__arm_wsr("MSPLIM", (VALUE)))
|
||||||
|
#endif
|
||||||
|
#define __set_PRIMASK(VALUE) (__arm_wsr("PRIMASK", (VALUE)))
|
||||||
|
#define __set_PSP(VALUE) (__arm_wsr("PSP", (VALUE)))
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||||
|
#define __set_PSPLIM(VALUE) ((void)(VALUE))
|
||||||
|
#else
|
||||||
|
#define __set_PSPLIM(VALUE) (__arm_wsr("PSPLIM", (VALUE)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __TZ_get_CONTROL_NS() (__arm_rsr("CONTROL_NS"))
|
||||||
|
#define __TZ_set_CONTROL_NS(VALUE) (__arm_wsr("CONTROL_NS", (VALUE)))
|
||||||
|
#define __TZ_get_PSP_NS() (__arm_rsr("PSP_NS"))
|
||||||
|
#define __TZ_set_PSP_NS(VALUE) (__arm_wsr("PSP_NS", (VALUE)))
|
||||||
|
#define __TZ_get_MSP_NS() (__arm_rsr("MSP_NS"))
|
||||||
|
#define __TZ_set_MSP_NS(VALUE) (__arm_wsr("MSP_NS", (VALUE)))
|
||||||
|
#define __TZ_get_SP_NS() (__arm_rsr("SP_NS"))
|
||||||
|
#define __TZ_set_SP_NS(VALUE) (__arm_wsr("SP_NS", (VALUE)))
|
||||||
|
#define __TZ_get_PRIMASK_NS() (__arm_rsr("PRIMASK_NS"))
|
||||||
|
#define __TZ_set_PRIMASK_NS(VALUE) (__arm_wsr("PRIMASK_NS", (VALUE)))
|
||||||
|
#define __TZ_get_BASEPRI_NS() (__arm_rsr("BASEPRI_NS"))
|
||||||
|
#define __TZ_set_BASEPRI_NS(VALUE) (__arm_wsr("BASEPRI_NS", (VALUE)))
|
||||||
|
#define __TZ_get_FAULTMASK_NS() (__arm_rsr("FAULTMASK_NS"))
|
||||||
|
#define __TZ_set_FAULTMASK_NS(VALUE)(__arm_wsr("FAULTMASK_NS", (VALUE)))
|
||||||
|
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||||
|
#define __TZ_get_PSPLIM_NS() (0U)
|
||||||
|
#define __TZ_set_PSPLIM_NS(VALUE) ((void)(VALUE))
|
||||||
|
#else
|
||||||
|
#define __TZ_get_PSPLIM_NS() (__arm_rsr("PSPLIM_NS"))
|
||||||
|
#define __TZ_set_PSPLIM_NS(VALUE) (__arm_wsr("PSPLIM_NS", (VALUE)))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __TZ_get_MSPLIM_NS() (__arm_rsr("MSPLIM_NS"))
|
||||||
|
#define __TZ_set_MSPLIM_NS(VALUE) (__arm_wsr("MSPLIM_NS", (VALUE)))
|
||||||
|
|
||||||
|
#define __NOP __iar_builtin_no_operation
|
||||||
|
|
||||||
|
#define __CLZ __iar_builtin_CLZ
|
||||||
|
#define __CLREX __iar_builtin_CLREX
|
||||||
|
|
||||||
|
#define __DMB __iar_builtin_DMB
|
||||||
|
#define __DSB __iar_builtin_DSB
|
||||||
|
#define __ISB __iar_builtin_ISB
|
||||||
|
|
||||||
|
#define __LDREXB __iar_builtin_LDREXB
|
||||||
|
#define __LDREXH __iar_builtin_LDREXH
|
||||||
|
#define __LDREXW __iar_builtin_LDREX
|
||||||
|
|
||||||
|
#define __RBIT __iar_builtin_RBIT
|
||||||
|
#define __REV __iar_builtin_REV
|
||||||
|
#define __REV16 __iar_builtin_REV16
|
||||||
|
|
||||||
|
__IAR_FT int16_t __REVSH(int16_t val)
|
||||||
|
{
|
||||||
|
return (int16_t) __iar_builtin_REVSH(val);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define __ROR __iar_builtin_ROR
|
||||||
|
#define __RRX __iar_builtin_RRX
|
||||||
|
|
||||||
|
#define __SEV __iar_builtin_SEV
|
||||||
|
|
||||||
|
#if !__IAR_M0_FAMILY
|
||||||
|
#define __SSAT __iar_builtin_SSAT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __STREXB __iar_builtin_STREXB
|
||||||
|
#define __STREXH __iar_builtin_STREXH
|
||||||
|
#define __STREXW __iar_builtin_STREX
|
||||||
|
|
||||||
|
#if !__IAR_M0_FAMILY
|
||||||
|
#define __USAT __iar_builtin_USAT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __WFE __iar_builtin_WFE
|
||||||
|
#define __WFI __iar_builtin_WFI
|
||||||
|
|
||||||
|
#if __ARM_MEDIA__
|
||||||
|
#define __SADD8 __iar_builtin_SADD8
|
||||||
|
#define __QADD8 __iar_builtin_QADD8
|
||||||
|
#define __SHADD8 __iar_builtin_SHADD8
|
||||||
|
#define __UADD8 __iar_builtin_UADD8
|
||||||
|
#define __UQADD8 __iar_builtin_UQADD8
|
||||||
|
#define __UHADD8 __iar_builtin_UHADD8
|
||||||
|
#define __SSUB8 __iar_builtin_SSUB8
|
||||||
|
#define __QSUB8 __iar_builtin_QSUB8
|
||||||
|
#define __SHSUB8 __iar_builtin_SHSUB8
|
||||||
|
#define __USUB8 __iar_builtin_USUB8
|
||||||
|
#define __UQSUB8 __iar_builtin_UQSUB8
|
||||||
|
#define __UHSUB8 __iar_builtin_UHSUB8
|
||||||
|
#define __SADD16 __iar_builtin_SADD16
|
||||||
|
#define __QADD16 __iar_builtin_QADD16
|
||||||
|
#define __SHADD16 __iar_builtin_SHADD16
|
||||||
|
#define __UADD16 __iar_builtin_UADD16
|
||||||
|
#define __UQADD16 __iar_builtin_UQADD16
|
||||||
|
#define __UHADD16 __iar_builtin_UHADD16
|
||||||
|
#define __SSUB16 __iar_builtin_SSUB16
|
||||||
|
#define __QSUB16 __iar_builtin_QSUB16
|
||||||
|
#define __SHSUB16 __iar_builtin_SHSUB16
|
||||||
|
#define __USUB16 __iar_builtin_USUB16
|
||||||
|
#define __UQSUB16 __iar_builtin_UQSUB16
|
||||||
|
#define __UHSUB16 __iar_builtin_UHSUB16
|
||||||
|
#define __SASX __iar_builtin_SASX
|
||||||
|
#define __QASX __iar_builtin_QASX
|
||||||
|
#define __SHASX __iar_builtin_SHASX
|
||||||
|
#define __UASX __iar_builtin_UASX
|
||||||
|
#define __UQASX __iar_builtin_UQASX
|
||||||
|
#define __UHASX __iar_builtin_UHASX
|
||||||
|
#define __SSAX __iar_builtin_SSAX
|
||||||
|
#define __QSAX __iar_builtin_QSAX
|
||||||
|
#define __SHSAX __iar_builtin_SHSAX
|
||||||
|
#define __USAX __iar_builtin_USAX
|
||||||
|
#define __UQSAX __iar_builtin_UQSAX
|
||||||
|
#define __UHSAX __iar_builtin_UHSAX
|
||||||
|
#define __USAD8 __iar_builtin_USAD8
|
||||||
|
#define __USADA8 __iar_builtin_USADA8
|
||||||
|
#define __SSAT16 __iar_builtin_SSAT16
|
||||||
|
#define __USAT16 __iar_builtin_USAT16
|
||||||
|
#define __UXTB16 __iar_builtin_UXTB16
|
||||||
|
#define __UXTAB16 __iar_builtin_UXTAB16
|
||||||
|
#define __SXTB16 __iar_builtin_SXTB16
|
||||||
|
#define __SXTAB16 __iar_builtin_SXTAB16
|
||||||
|
#define __SMUAD __iar_builtin_SMUAD
|
||||||
|
#define __SMUADX __iar_builtin_SMUADX
|
||||||
|
#define __SMMLA __iar_builtin_SMMLA
|
||||||
|
#define __SMLAD __iar_builtin_SMLAD
|
||||||
|
#define __SMLADX __iar_builtin_SMLADX
|
||||||
|
#define __SMLALD __iar_builtin_SMLALD
|
||||||
|
#define __SMLALDX __iar_builtin_SMLALDX
|
||||||
|
#define __SMUSD __iar_builtin_SMUSD
|
||||||
|
#define __SMUSDX __iar_builtin_SMUSDX
|
||||||
|
#define __SMLSD __iar_builtin_SMLSD
|
||||||
|
#define __SMLSDX __iar_builtin_SMLSDX
|
||||||
|
#define __SMLSLD __iar_builtin_SMLSLD
|
||||||
|
#define __SMLSLDX __iar_builtin_SMLSLDX
|
||||||
|
#define __SEL __iar_builtin_SEL
|
||||||
|
#define __QADD __iar_builtin_QADD
|
||||||
|
#define __QSUB __iar_builtin_QSUB
|
||||||
|
#define __PKHBT __iar_builtin_PKHBT
|
||||||
|
#define __PKHTB __iar_builtin_PKHTB
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else /* __ICCARM_INTRINSICS_VERSION__ == 2 */
|
||||||
|
|
||||||
|
#if __IAR_M0_FAMILY
|
||||||
|
/* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */
|
||||||
|
#define __CLZ __cmsis_iar_clz_not_active
|
||||||
|
#define __SSAT __cmsis_iar_ssat_not_active
|
||||||
|
#define __USAT __cmsis_iar_usat_not_active
|
||||||
|
#define __RBIT __cmsis_iar_rbit_not_active
|
||||||
|
#define __get_APSR __cmsis_iar_get_APSR_not_active
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||||
|
(defined (__FPU_USED ) && (__FPU_USED == 1U)) ))
|
||||||
|
#define __get_FPSCR __cmsis_iar_get_FPSR_not_active
|
||||||
|
#define __set_FPSCR __cmsis_iar_set_FPSR_not_active
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __INTRINSICS_INCLUDED
|
||||||
|
#error intrinsics.h is already included previously!
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <intrinsics.h>
|
||||||
|
|
||||||
|
#if __IAR_M0_FAMILY
|
||||||
|
/* Avoid clash between intrinsics.h and arm_math.h when compiling for Cortex-M0. */
|
||||||
|
#undef __CLZ
|
||||||
|
#undef __SSAT
|
||||||
|
#undef __USAT
|
||||||
|
#undef __RBIT
|
||||||
|
#undef __get_APSR
|
||||||
|
|
||||||
|
__STATIC_INLINE uint8_t __CLZ(uint32_t data)
|
||||||
|
{
|
||||||
|
if (data == 0U) { return 32U; }
|
||||||
|
|
||||||
|
uint32_t count = 0U;
|
||||||
|
uint32_t mask = 0x80000000U;
|
||||||
|
|
||||||
|
while ((data & mask) == 0U)
|
||||||
|
{
|
||||||
|
count += 1U;
|
||||||
|
mask = mask >> 1U;
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
__STATIC_INLINE uint32_t __RBIT(uint32_t v)
|
||||||
|
{
|
||||||
|
uint8_t sc = 31U;
|
||||||
|
uint32_t r = v;
|
||||||
|
for (v >>= 1U; v; v >>= 1U)
|
||||||
|
{
|
||||||
|
r <<= 1U;
|
||||||
|
r |= v & 1U;
|
||||||
|
sc--;
|
||||||
|
}
|
||||||
|
return (r << sc);
|
||||||
|
}
|
||||||
|
|
||||||
|
__STATIC_INLINE uint32_t __get_APSR(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__asm("MRS %0,APSR" : "=r" (res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (!((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \
|
||||||
|
(defined (__FPU_USED ) && (__FPU_USED == 1U)) ))
|
||||||
|
#undef __get_FPSCR
|
||||||
|
#undef __set_FPSCR
|
||||||
|
#define __get_FPSCR() (0)
|
||||||
|
#define __set_FPSCR(VALUE) ((void)VALUE)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#pragma diag_suppress=Pe940
|
||||||
|
#pragma diag_suppress=Pe177
|
||||||
|
|
||||||
|
#define __enable_irq __enable_interrupt
|
||||||
|
#define __disable_irq __disable_interrupt
|
||||||
|
#define __NOP __no_operation
|
||||||
|
|
||||||
|
#define __get_xPSR __get_PSR
|
||||||
|
|
||||||
|
#if (!defined(__ARM_ARCH_6M__) || __ARM_ARCH_6M__==0)
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __LDREXW(uint32_t volatile *ptr)
|
||||||
|
{
|
||||||
|
return __LDREX((unsigned long *)ptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __STREXW(uint32_t value, uint32_t volatile *ptr)
|
||||||
|
{
|
||||||
|
return __STREX(value, (unsigned long *)ptr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */
|
||||||
|
#if (__CORTEX_M >= 0x03)
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __RRX(uint32_t value)
|
||||||
|
{
|
||||||
|
uint32_t result;
|
||||||
|
__ASM("RRX %0, %1" : "=r"(result) : "r" (value) : "cc");
|
||||||
|
return(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __set_BASEPRI_MAX(uint32_t value)
|
||||||
|
{
|
||||||
|
__asm volatile("MSR BASEPRI_MAX,%0"::"r" (value));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#define __enable_fault_irq __enable_fiq
|
||||||
|
#define __disable_fault_irq __disable_fiq
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* (__CORTEX_M >= 0x03) */
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __ROR(uint32_t op1, uint32_t op2)
|
||||||
|
{
|
||||||
|
return (op1 >> op2) | (op1 << ((sizeof(op1)*8)-op2));
|
||||||
|
}
|
||||||
|
|
||||||
|
#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
|
||||||
|
(defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __get_MSPLIM(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure MSPLIM is RAZ/WI
|
||||||
|
res = 0U;
|
||||||
|
#else
|
||||||
|
__asm volatile("MRS %0,MSPLIM" : "=r" (res));
|
||||||
|
#endif
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __set_MSPLIM(uint32_t value)
|
||||||
|
{
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure MSPLIM is RAZ/WI
|
||||||
|
(void)value;
|
||||||
|
#else
|
||||||
|
__asm volatile("MSR MSPLIM,%0" :: "r" (value));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __get_PSPLIM(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||||
|
res = 0U;
|
||||||
|
#else
|
||||||
|
__asm volatile("MRS %0,PSPLIM" : "=r" (res));
|
||||||
|
#endif
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __set_PSPLIM(uint32_t value)
|
||||||
|
{
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||||
|
(void)value;
|
||||||
|
#else
|
||||||
|
__asm volatile("MSR PSPLIM,%0" :: "r" (value));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __TZ_get_CONTROL_NS(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__asm volatile("MRS %0,CONTROL_NS" : "=r" (res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __TZ_set_CONTROL_NS(uint32_t value)
|
||||||
|
{
|
||||||
|
__asm volatile("MSR CONTROL_NS,%0" :: "r" (value));
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __TZ_get_PSP_NS(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__asm volatile("MRS %0,PSP_NS" : "=r" (res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __TZ_set_PSP_NS(uint32_t value)
|
||||||
|
{
|
||||||
|
__asm volatile("MSR PSP_NS,%0" :: "r" (value));
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __TZ_get_MSP_NS(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__asm volatile("MRS %0,MSP_NS" : "=r" (res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __TZ_set_MSP_NS(uint32_t value)
|
||||||
|
{
|
||||||
|
__asm volatile("MSR MSP_NS,%0" :: "r" (value));
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __TZ_get_SP_NS(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__asm volatile("MRS %0,SP_NS" : "=r" (res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
__IAR_FT void __TZ_set_SP_NS(uint32_t value)
|
||||||
|
{
|
||||||
|
__asm volatile("MSR SP_NS,%0" :: "r" (value));
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __TZ_get_PRIMASK_NS(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__asm volatile("MRS %0,PRIMASK_NS" : "=r" (res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __TZ_set_PRIMASK_NS(uint32_t value)
|
||||||
|
{
|
||||||
|
__asm volatile("MSR PRIMASK_NS,%0" :: "r" (value));
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __TZ_get_BASEPRI_NS(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__asm volatile("MRS %0,BASEPRI_NS" : "=r" (res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __TZ_set_BASEPRI_NS(uint32_t value)
|
||||||
|
{
|
||||||
|
__asm volatile("MSR BASEPRI_NS,%0" :: "r" (value));
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __TZ_get_FAULTMASK_NS(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__asm volatile("MRS %0,FAULTMASK_NS" : "=r" (res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __TZ_set_FAULTMASK_NS(uint32_t value)
|
||||||
|
{
|
||||||
|
__asm volatile("MSR FAULTMASK_NS,%0" :: "r" (value));
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __TZ_get_PSPLIM_NS(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||||
|
res = 0U;
|
||||||
|
#else
|
||||||
|
__asm volatile("MRS %0,PSPLIM_NS" : "=r" (res));
|
||||||
|
#endif
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __TZ_set_PSPLIM_NS(uint32_t value)
|
||||||
|
{
|
||||||
|
#if (!(defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) && \
|
||||||
|
(!defined (__ARM_FEATURE_CMSE ) || (__ARM_FEATURE_CMSE < 3)))
|
||||||
|
// without main extensions, the non-secure PSPLIM is RAZ/WI
|
||||||
|
(void)value;
|
||||||
|
#else
|
||||||
|
__asm volatile("MSR PSPLIM_NS,%0" :: "r" (value));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __TZ_get_MSPLIM_NS(void)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__asm volatile("MRS %0,MSPLIM_NS" : "=r" (res));
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __TZ_set_MSPLIM_NS(uint32_t value)
|
||||||
|
{
|
||||||
|
__asm volatile("MSR MSPLIM_NS,%0" :: "r" (value));
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */
|
||||||
|
|
||||||
|
#endif /* __ICCARM_INTRINSICS_VERSION__ == 2 */
|
||||||
|
|
||||||
|
#define __BKPT(value) __asm volatile ("BKPT %0" : : "i"(value))
|
||||||
|
|
||||||
|
#if __IAR_M0_FAMILY
|
||||||
|
__STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat)
|
||||||
|
{
|
||||||
|
if ((sat >= 1U) && (sat <= 32U))
|
||||||
|
{
|
||||||
|
const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U);
|
||||||
|
const int32_t min = -1 - max ;
|
||||||
|
if (val > max)
|
||||||
|
{
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
else if (val < min)
|
||||||
|
{
|
||||||
|
return min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
|
__STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat)
|
||||||
|
{
|
||||||
|
if (sat <= 31U)
|
||||||
|
{
|
||||||
|
const uint32_t max = ((1U << sat) - 1U);
|
||||||
|
if (val > (int32_t)max)
|
||||||
|
{
|
||||||
|
return max;
|
||||||
|
}
|
||||||
|
else if (val < 0)
|
||||||
|
{
|
||||||
|
return 0U;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return (uint32_t)val;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (__CORTEX_M >= 0x03) /* __CORTEX_M is defined in core_cm0.h, core_cm3.h and core_cm4.h. */
|
||||||
|
|
||||||
|
__IAR_FT uint8_t __LDRBT(volatile uint8_t *addr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM("LDRBT %0, [%1]" : "=r" (res) : "r" (addr) : "memory");
|
||||||
|
return ((uint8_t)res);
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint16_t __LDRHT(volatile uint16_t *addr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM("LDRHT %0, [%1]" : "=r" (res) : "r" (addr) : "memory");
|
||||||
|
return ((uint16_t)res);
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __LDRT(volatile uint32_t *addr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM("LDRT %0, [%1]" : "=r" (res) : "r" (addr) : "memory");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __STRBT(uint8_t value, volatile uint8_t *addr)
|
||||||
|
{
|
||||||
|
__ASM("STRBT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __STRHT(uint16_t value, volatile uint16_t *addr)
|
||||||
|
{
|
||||||
|
__ASM("STRHT %1, [%0]" : : "r" (addr), "r" ((uint32_t)value) : "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __STRT(uint32_t value, volatile uint32_t *addr)
|
||||||
|
{
|
||||||
|
__ASM("STRT %1, [%0]" : : "r" (addr), "r" (value) : "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* (__CORTEX_M >= 0x03) */
|
||||||
|
|
||||||
|
#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \
|
||||||
|
(defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) )
|
||||||
|
|
||||||
|
|
||||||
|
__IAR_FT uint8_t __LDAB(volatile uint8_t *ptr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM volatile ("LDAB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||||
|
return ((uint8_t)res);
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint16_t __LDAH(volatile uint16_t *ptr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM volatile ("LDAH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||||
|
return ((uint16_t)res);
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __LDA(volatile uint32_t *ptr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM volatile ("LDA %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __STLB(uint8_t value, volatile uint8_t *ptr)
|
||||||
|
{
|
||||||
|
__ASM volatile ("STLB %1, [%0]" :: "r" (ptr), "r" (value) : "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __STLH(uint16_t value, volatile uint16_t *ptr)
|
||||||
|
{
|
||||||
|
__ASM volatile ("STLH %1, [%0]" :: "r" (ptr), "r" (value) : "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT void __STL(uint32_t value, volatile uint32_t *ptr)
|
||||||
|
{
|
||||||
|
__ASM volatile ("STL %1, [%0]" :: "r" (ptr), "r" (value) : "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint8_t __LDAEXB(volatile uint8_t *ptr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM volatile ("LDAEXB %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||||
|
return ((uint8_t)res);
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint16_t __LDAEXH(volatile uint16_t *ptr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM volatile ("LDAEXH %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||||
|
return ((uint16_t)res);
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __LDAEX(volatile uint32_t *ptr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM volatile ("LDAEX %0, [%1]" : "=r" (res) : "r" (ptr) : "memory");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM volatile ("STLEXB %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM volatile ("STLEXH %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
__IAR_FT uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr)
|
||||||
|
{
|
||||||
|
uint32_t res;
|
||||||
|
__ASM volatile ("STLEX %0, %2, [%1]" : "=r" (res) : "r" (ptr), "r" (value) : "memory");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* __ARM_ARCH_8M_MAIN__ or __ARM_ARCH_8M_BASE__ */
|
||||||
|
|
||||||
|
#undef __IAR_FT
|
||||||
|
#undef __IAR_M0_FAMILY
|
||||||
|
#undef __ICCARM_V8
|
||||||
|
|
||||||
|
#pragma diag_default=Pe940
|
||||||
|
#pragma diag_default=Pe177
|
||||||
|
|
||||||
|
#endif /* __CMSIS_ICCARM_H__ */
|
||||||
+39
@@ -0,0 +1,39 @@
|
|||||||
|
/**************************************************************************//**
|
||||||
|
* @file cmsis_version.h
|
||||||
|
* @brief CMSIS Core(M) Version definitions
|
||||||
|
* @version V5.0.3
|
||||||
|
* @date 24. June 2019
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2019 ARM Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined ( __ICCARM__ )
|
||||||
|
#pragma system_include /* treat file as system include file for MISRA check */
|
||||||
|
#elif defined (__clang__)
|
||||||
|
#pragma clang system_header /* treat file as system include file */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CMSIS_VERSION_H
|
||||||
|
#define __CMSIS_VERSION_H
|
||||||
|
|
||||||
|
/* CMSIS Version definitions */
|
||||||
|
#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */
|
||||||
|
#define __CM_CMSIS_VERSION_SUB ( 3U) /*!< [15:0] CMSIS Core(M) sub version */
|
||||||
|
#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \
|
||||||
|
__CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */
|
||||||
|
#endif
|
||||||
+2968
File diff suppressed because it is too large
Load Diff
+1921
File diff suppressed because it is too large
Load Diff
+2835
File diff suppressed because it is too large
Load Diff
+952
@@ -0,0 +1,952 @@
|
|||||||
|
/**************************************************************************//**
|
||||||
|
* @file core_cm0.h
|
||||||
|
* @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File
|
||||||
|
* @version V5.0.6
|
||||||
|
* @date 13. March 2019
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2019 Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined ( __ICCARM__ )
|
||||||
|
#pragma system_include /* treat file as system include file for MISRA check */
|
||||||
|
#elif defined (__clang__)
|
||||||
|
#pragma clang system_header /* treat file as system include file */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CORE_CM0_H_GENERIC
|
||||||
|
#define __CORE_CM0_H_GENERIC
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
\page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
|
||||||
|
CMSIS violates the following MISRA-C:2004 rules:
|
||||||
|
|
||||||
|
\li Required Rule 8.5, object/function definition in header file.<br>
|
||||||
|
Function definitions in header files are used to allow 'inlining'.
|
||||||
|
|
||||||
|
\li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
|
||||||
|
Unions are used for effective representation of core registers.
|
||||||
|
|
||||||
|
\li Advisory Rule 19.7, Function-like macro defined.<br>
|
||||||
|
Function-like macros are used to allow more efficient code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* CMSIS definitions
|
||||||
|
******************************************************************************/
|
||||||
|
/**
|
||||||
|
\ingroup Cortex_M0
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "cmsis_version.h"
|
||||||
|
|
||||||
|
/* CMSIS CM0 definitions */
|
||||||
|
#define __CM0_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */
|
||||||
|
#define __CM0_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */
|
||||||
|
#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | \
|
||||||
|
__CM0_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */
|
||||||
|
|
||||||
|
#define __CORTEX_M (0U) /*!< Cortex-M Core */
|
||||||
|
|
||||||
|
/** __FPU_USED indicates whether an FPU is used or not.
|
||||||
|
This core does not support an FPU at all
|
||||||
|
*/
|
||||||
|
#define __FPU_USED 0U
|
||||||
|
|
||||||
|
#if defined ( __CC_ARM )
|
||||||
|
#if defined __TARGET_FPU_VFP
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||||
|
#if defined __ARM_FP
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __GNUC__ )
|
||||||
|
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __ICCARM__ )
|
||||||
|
#if defined __ARMVFP__
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __TI_ARM__ )
|
||||||
|
#if defined __TI_VFP_SUPPORT__
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __TASKING__ )
|
||||||
|
#if defined __FPU_VFP__
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __CSMC__ )
|
||||||
|
#if ( __CSMC__ & 0x400U)
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "cmsis_compiler.h" /* CMSIS compiler specific defines */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __CORE_CM0_H_GENERIC */
|
||||||
|
|
||||||
|
#ifndef __CMSIS_GENERIC
|
||||||
|
|
||||||
|
#ifndef __CORE_CM0_H_DEPENDANT
|
||||||
|
#define __CORE_CM0_H_DEPENDANT
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* check device defines and use defaults */
|
||||||
|
#if defined __CHECK_DEVICE_DEFINES
|
||||||
|
#ifndef __CM0_REV
|
||||||
|
#define __CM0_REV 0x0000U
|
||||||
|
#warning "__CM0_REV not defined in device header file; using default!"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __NVIC_PRIO_BITS
|
||||||
|
#define __NVIC_PRIO_BITS 2U
|
||||||
|
#warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __Vendor_SysTickConfig
|
||||||
|
#define __Vendor_SysTickConfig 0U
|
||||||
|
#warning "__Vendor_SysTickConfig not defined in device header file; using default!"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* IO definitions (access restrictions to peripheral registers) */
|
||||||
|
/**
|
||||||
|
\defgroup CMSIS_glob_defs CMSIS Global Defines
|
||||||
|
|
||||||
|
<strong>IO Type Qualifiers</strong> are used
|
||||||
|
\li to specify the access to peripheral variables.
|
||||||
|
\li for automatic generation of peripheral register debug information.
|
||||||
|
*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define __I volatile /*!< Defines 'read only' permissions */
|
||||||
|
#else
|
||||||
|
#define __I volatile const /*!< Defines 'read only' permissions */
|
||||||
|
#endif
|
||||||
|
#define __O volatile /*!< Defines 'write only' permissions */
|
||||||
|
#define __IO volatile /*!< Defines 'read / write' permissions */
|
||||||
|
|
||||||
|
/* following defines should be used for structure members */
|
||||||
|
#define __IM volatile const /*! Defines 'read only' structure member permissions */
|
||||||
|
#define __OM volatile /*! Defines 'write only' structure member permissions */
|
||||||
|
#define __IOM volatile /*! Defines 'read / write' structure member permissions */
|
||||||
|
|
||||||
|
/*@} end of group Cortex_M0 */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Register Abstraction
|
||||||
|
Core Register contain:
|
||||||
|
- Core Register
|
||||||
|
- Core NVIC Register
|
||||||
|
- Core SCB Register
|
||||||
|
- Core SysTick Register
|
||||||
|
******************************************************************************/
|
||||||
|
/**
|
||||||
|
\defgroup CMSIS_core_register Defines and Type Definitions
|
||||||
|
\brief Type definitions and defines for Cortex-M processor based devices.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_CORE Status and Control Registers
|
||||||
|
\brief Core Register type definitions.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Union type to access the Application Program Status Register (APSR).
|
||||||
|
*/
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */
|
||||||
|
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
|
||||||
|
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
|
||||||
|
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
|
||||||
|
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
|
||||||
|
} b; /*!< Structure used for bit access */
|
||||||
|
uint32_t w; /*!< Type used for word access */
|
||||||
|
} APSR_Type;
|
||||||
|
|
||||||
|
/* APSR Register Definitions */
|
||||||
|
#define APSR_N_Pos 31U /*!< APSR: N Position */
|
||||||
|
#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */
|
||||||
|
|
||||||
|
#define APSR_Z_Pos 30U /*!< APSR: Z Position */
|
||||||
|
#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */
|
||||||
|
|
||||||
|
#define APSR_C_Pos 29U /*!< APSR: C Position */
|
||||||
|
#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */
|
||||||
|
|
||||||
|
#define APSR_V_Pos 28U /*!< APSR: V Position */
|
||||||
|
#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Union type to access the Interrupt Program Status Register (IPSR).
|
||||||
|
*/
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
|
||||||
|
uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
|
||||||
|
} b; /*!< Structure used for bit access */
|
||||||
|
uint32_t w; /*!< Type used for word access */
|
||||||
|
} IPSR_Type;
|
||||||
|
|
||||||
|
/* IPSR Register Definitions */
|
||||||
|
#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */
|
||||||
|
#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Union type to access the Special-Purpose Program Status Registers (xPSR).
|
||||||
|
*/
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
|
||||||
|
uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
|
||||||
|
uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
|
||||||
|
uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */
|
||||||
|
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
|
||||||
|
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
|
||||||
|
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
|
||||||
|
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
|
||||||
|
} b; /*!< Structure used for bit access */
|
||||||
|
uint32_t w; /*!< Type used for word access */
|
||||||
|
} xPSR_Type;
|
||||||
|
|
||||||
|
/* xPSR Register Definitions */
|
||||||
|
#define xPSR_N_Pos 31U /*!< xPSR: N Position */
|
||||||
|
#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */
|
||||||
|
|
||||||
|
#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */
|
||||||
|
#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */
|
||||||
|
|
||||||
|
#define xPSR_C_Pos 29U /*!< xPSR: C Position */
|
||||||
|
#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */
|
||||||
|
|
||||||
|
#define xPSR_V_Pos 28U /*!< xPSR: V Position */
|
||||||
|
#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */
|
||||||
|
|
||||||
|
#define xPSR_T_Pos 24U /*!< xPSR: T Position */
|
||||||
|
#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */
|
||||||
|
|
||||||
|
#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */
|
||||||
|
#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Union type to access the Control Registers (CONTROL).
|
||||||
|
*/
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32_t _reserved0:1; /*!< bit: 0 Reserved */
|
||||||
|
uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
|
||||||
|
uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */
|
||||||
|
} b; /*!< Structure used for bit access */
|
||||||
|
uint32_t w; /*!< Type used for word access */
|
||||||
|
} CONTROL_Type;
|
||||||
|
|
||||||
|
/* CONTROL Register Definitions */
|
||||||
|
#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */
|
||||||
|
#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_CORE */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
|
||||||
|
\brief Type definitions for the NVIC Registers
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
__IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
|
||||||
|
uint32_t RESERVED0[31U];
|
||||||
|
__IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
|
||||||
|
uint32_t RESERVED1[31U];
|
||||||
|
__IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
|
||||||
|
uint32_t RESERVED2[31U];
|
||||||
|
__IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
|
||||||
|
uint32_t RESERVED3[31U];
|
||||||
|
uint32_t RESERVED4[64U];
|
||||||
|
__IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */
|
||||||
|
} NVIC_Type;
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_NVIC */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_SCB System Control Block (SCB)
|
||||||
|
\brief Type definitions for the System Control Block Registers
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Structure type to access the System Control Block (SCB).
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
__IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
|
||||||
|
__IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
|
||||||
|
uint32_t RESERVED0;
|
||||||
|
__IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
|
||||||
|
__IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
|
||||||
|
__IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
|
||||||
|
uint32_t RESERVED1;
|
||||||
|
__IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */
|
||||||
|
__IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
|
||||||
|
} SCB_Type;
|
||||||
|
|
||||||
|
/* SCB CPUID Register Definitions */
|
||||||
|
#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */
|
||||||
|
#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
|
||||||
|
|
||||||
|
#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */
|
||||||
|
#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
|
||||||
|
|
||||||
|
#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */
|
||||||
|
#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
|
||||||
|
|
||||||
|
#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */
|
||||||
|
#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
|
||||||
|
|
||||||
|
#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */
|
||||||
|
#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */
|
||||||
|
|
||||||
|
/* SCB Interrupt Control State Register Definitions */
|
||||||
|
#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */
|
||||||
|
#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */
|
||||||
|
#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */
|
||||||
|
#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */
|
||||||
|
#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */
|
||||||
|
#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */
|
||||||
|
#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */
|
||||||
|
#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */
|
||||||
|
#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */
|
||||||
|
#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */
|
||||||
|
|
||||||
|
/* SCB Application Interrupt and Reset Control Register Definitions */
|
||||||
|
#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */
|
||||||
|
#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
|
||||||
|
|
||||||
|
#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */
|
||||||
|
#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
|
||||||
|
|
||||||
|
#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */
|
||||||
|
#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
|
||||||
|
|
||||||
|
#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */
|
||||||
|
#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
|
||||||
|
|
||||||
|
#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */
|
||||||
|
#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
|
||||||
|
|
||||||
|
/* SCB System Control Register Definitions */
|
||||||
|
#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */
|
||||||
|
#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
|
||||||
|
|
||||||
|
#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */
|
||||||
|
#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
|
||||||
|
|
||||||
|
#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */
|
||||||
|
#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
|
||||||
|
|
||||||
|
/* SCB Configuration Control Register Definitions */
|
||||||
|
#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */
|
||||||
|
#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
|
||||||
|
|
||||||
|
#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */
|
||||||
|
#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
|
||||||
|
|
||||||
|
/* SCB System Handler Control and State Register Definitions */
|
||||||
|
#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */
|
||||||
|
#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_SCB */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_SysTick System Tick Timer (SysTick)
|
||||||
|
\brief Type definitions for the System Timer Registers.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Structure type to access the System Timer (SysTick).
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
__IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
|
||||||
|
__IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
|
||||||
|
__IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
|
||||||
|
__IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
|
||||||
|
} SysTick_Type;
|
||||||
|
|
||||||
|
/* SysTick Control / Status Register Definitions */
|
||||||
|
#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */
|
||||||
|
#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
|
||||||
|
|
||||||
|
#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */
|
||||||
|
#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
|
||||||
|
|
||||||
|
#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */
|
||||||
|
#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
|
||||||
|
|
||||||
|
#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */
|
||||||
|
#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */
|
||||||
|
|
||||||
|
/* SysTick Reload Register Definitions */
|
||||||
|
#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */
|
||||||
|
#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */
|
||||||
|
|
||||||
|
/* SysTick Current Register Definitions */
|
||||||
|
#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */
|
||||||
|
#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */
|
||||||
|
|
||||||
|
/* SysTick Calibration Register Definitions */
|
||||||
|
#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */
|
||||||
|
#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
|
||||||
|
|
||||||
|
#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */
|
||||||
|
#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
|
||||||
|
|
||||||
|
#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */
|
||||||
|
#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_SysTick */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
|
||||||
|
\brief Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor.
|
||||||
|
Therefore they are not covered by the Cortex-M0 header file.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
/*@} end of group CMSIS_CoreDebug */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_core_bitfield Core register bit field macros
|
||||||
|
\brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Mask and shift a bit field value for use in a register bit range.
|
||||||
|
\param[in] field Name of the register bit field.
|
||||||
|
\param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type.
|
||||||
|
\return Masked and shifted value.
|
||||||
|
*/
|
||||||
|
#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Mask and shift a register value to extract a bit filed value.
|
||||||
|
\param[in] field Name of the register bit field.
|
||||||
|
\param[in] value Value of register. This parameter is interpreted as an uint32_t type.
|
||||||
|
\return Masked and shifted bit field value.
|
||||||
|
*/
|
||||||
|
#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_core_bitfield */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_core_base Core Definitions
|
||||||
|
\brief Definitions for base addresses, unions, and structures.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Memory mapping of Core Hardware */
|
||||||
|
#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
|
||||||
|
#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
|
||||||
|
#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
|
||||||
|
#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
|
||||||
|
|
||||||
|
#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
|
||||||
|
#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
|
||||||
|
#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
|
||||||
|
|
||||||
|
|
||||||
|
/*@} */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Hardware Abstraction Layer
|
||||||
|
Core Function Interface contains:
|
||||||
|
- Core NVIC Functions
|
||||||
|
- Core SysTick Functions
|
||||||
|
- Core Register Access Functions
|
||||||
|
******************************************************************************/
|
||||||
|
/**
|
||||||
|
\defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ########################## NVIC functions #################################### */
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_Core_FunctionInterface
|
||||||
|
\defgroup CMSIS_Core_NVICFunctions NVIC Functions
|
||||||
|
\brief Functions that manage interrupts and exceptions via the NVIC.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CMSIS_NVIC_VIRTUAL
|
||||||
|
#ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
|
||||||
|
#define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
|
||||||
|
#endif
|
||||||
|
#include CMSIS_NVIC_VIRTUAL_HEADER_FILE
|
||||||
|
#else
|
||||||
|
#define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
|
||||||
|
#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
|
||||||
|
#define NVIC_EnableIRQ __NVIC_EnableIRQ
|
||||||
|
#define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
|
||||||
|
#define NVIC_DisableIRQ __NVIC_DisableIRQ
|
||||||
|
#define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
|
||||||
|
#define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
|
||||||
|
#define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
|
||||||
|
/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M0 */
|
||||||
|
#define NVIC_SetPriority __NVIC_SetPriority
|
||||||
|
#define NVIC_GetPriority __NVIC_GetPriority
|
||||||
|
#define NVIC_SystemReset __NVIC_SystemReset
|
||||||
|
#endif /* CMSIS_NVIC_VIRTUAL */
|
||||||
|
|
||||||
|
#ifdef CMSIS_VECTAB_VIRTUAL
|
||||||
|
#ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
|
||||||
|
#define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
|
||||||
|
#endif
|
||||||
|
#include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
|
||||||
|
#else
|
||||||
|
#define NVIC_SetVector __NVIC_SetVector
|
||||||
|
#define NVIC_GetVector __NVIC_GetVector
|
||||||
|
#endif /* (CMSIS_VECTAB_VIRTUAL) */
|
||||||
|
|
||||||
|
#define NVIC_USER_IRQ_OFFSET 16
|
||||||
|
|
||||||
|
|
||||||
|
/* The following EXC_RETURN values are saved the LR on exception entry */
|
||||||
|
#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */
|
||||||
|
#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */
|
||||||
|
#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */
|
||||||
|
|
||||||
|
|
||||||
|
/* Interrupt Priorities are WORD accessible only under Armv6-M */
|
||||||
|
/* The following MACROS handle generation of the register offset and byte masks */
|
||||||
|
#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL)
|
||||||
|
#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )
|
||||||
|
#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )
|
||||||
|
|
||||||
|
#define __NVIC_SetPriorityGrouping(X) (void)(X)
|
||||||
|
#define __NVIC_GetPriorityGrouping() (0U)
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Enable Interrupt
|
||||||
|
\details Enables a device specific interrupt in the NVIC interrupt controller.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
__COMPILER_BARRIER();
|
||||||
|
NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||||
|
__COMPILER_BARRIER();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Interrupt Enable status
|
||||||
|
\details Returns a device specific interrupt enable status from the NVIC interrupt controller.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\return 0 Interrupt is not enabled.
|
||||||
|
\return 1 Interrupt is enabled.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return(0U);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Disable Interrupt
|
||||||
|
\details Disables a device specific interrupt in the NVIC interrupt controller.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||||
|
__DSB();
|
||||||
|
__ISB();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Pending Interrupt
|
||||||
|
\details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\return 0 Interrupt status is not pending.
|
||||||
|
\return 1 Interrupt status is pending.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return(0U);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Pending Interrupt
|
||||||
|
\details Sets the pending bit of a device specific interrupt in the NVIC pending register.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Clear Pending Interrupt
|
||||||
|
\details Clears the pending bit of a device specific interrupt in the NVIC pending register.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Interrupt Priority
|
||||||
|
\details Sets the priority of a device specific interrupt or a processor exception.
|
||||||
|
The interrupt number can be positive to specify a device specific interrupt,
|
||||||
|
or negative to specify a processor exception.
|
||||||
|
\param [in] IRQn Interrupt number.
|
||||||
|
\param [in] priority Priority to set.
|
||||||
|
\note The priority cannot be set for every processor exception.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
|
||||||
|
(((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
|
||||||
|
(((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Interrupt Priority
|
||||||
|
\details Reads the priority of a device specific interrupt or a processor exception.
|
||||||
|
The interrupt number can be positive to specify a device specific interrupt,
|
||||||
|
or negative to specify a processor exception.
|
||||||
|
\param [in] IRQn Interrupt number.
|
||||||
|
\return Interrupt Priority.
|
||||||
|
Value is aligned automatically to the implemented priority bits of the microcontroller.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Encode Priority
|
||||||
|
\details Encodes the priority for an interrupt with the given priority group,
|
||||||
|
preemptive priority value, and subpriority value.
|
||||||
|
In case of a conflict between priority grouping and available
|
||||||
|
priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
|
||||||
|
\param [in] PriorityGroup Used priority group.
|
||||||
|
\param [in] PreemptPriority Preemptive priority value (starting from 0).
|
||||||
|
\param [in] SubPriority Subpriority value (starting from 0).
|
||||||
|
\return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
|
||||||
|
{
|
||||||
|
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
|
||||||
|
uint32_t PreemptPriorityBits;
|
||||||
|
uint32_t SubPriorityBits;
|
||||||
|
|
||||||
|
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
|
||||||
|
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
|
||||||
|
|
||||||
|
return (
|
||||||
|
((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
|
||||||
|
((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Decode Priority
|
||||||
|
\details Decodes an interrupt priority value with a given priority group to
|
||||||
|
preemptive priority value and subpriority value.
|
||||||
|
In case of a conflict between priority grouping and available
|
||||||
|
priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
|
||||||
|
\param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
|
||||||
|
\param [in] PriorityGroup Used priority group.
|
||||||
|
\param [out] pPreemptPriority Preemptive priority value (starting from 0).
|
||||||
|
\param [out] pSubPriority Subpriority value (starting from 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
|
||||||
|
{
|
||||||
|
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
|
||||||
|
uint32_t PreemptPriorityBits;
|
||||||
|
uint32_t SubPriorityBits;
|
||||||
|
|
||||||
|
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
|
||||||
|
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
|
||||||
|
|
||||||
|
*pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
|
||||||
|
*pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Interrupt Vector
|
||||||
|
\details Sets an interrupt vector in SRAM based interrupt vector table.
|
||||||
|
The interrupt number can be positive to specify a device specific interrupt,
|
||||||
|
or negative to specify a processor exception.
|
||||||
|
Address 0 must be mapped to SRAM.
|
||||||
|
\param [in] IRQn Interrupt number
|
||||||
|
\param [in] vector Address of interrupt handler function
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
|
||||||
|
{
|
||||||
|
uint32_t vectors = 0x0U;
|
||||||
|
(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector;
|
||||||
|
/* ARM Application Note 321 states that the M0 does not require the architectural barrier */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Interrupt Vector
|
||||||
|
\details Reads an interrupt vector from interrupt vector table.
|
||||||
|
The interrupt number can be positive to specify a device specific interrupt,
|
||||||
|
or negative to specify a processor exception.
|
||||||
|
\param [in] IRQn Interrupt number.
|
||||||
|
\return Address of interrupt handler function
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
uint32_t vectors = 0x0U;
|
||||||
|
return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief System Reset
|
||||||
|
\details Initiates a system reset request to reset the MCU.
|
||||||
|
*/
|
||||||
|
__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
|
||||||
|
{
|
||||||
|
__DSB(); /* Ensure all outstanding memory accesses included
|
||||||
|
buffered write are completed before reset */
|
||||||
|
SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
|
||||||
|
SCB_AIRCR_SYSRESETREQ_Msk);
|
||||||
|
__DSB(); /* Ensure completion of memory access */
|
||||||
|
|
||||||
|
for(;;) /* wait until reset */
|
||||||
|
{
|
||||||
|
__NOP();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*@} end of CMSIS_Core_NVICFunctions */
|
||||||
|
|
||||||
|
|
||||||
|
/* ########################## FPU functions #################################### */
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_Core_FunctionInterface
|
||||||
|
\defgroup CMSIS_Core_FpuFunctions FPU Functions
|
||||||
|
\brief Function that provides FPU type.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief get FPU type
|
||||||
|
\details returns the FPU type
|
||||||
|
\returns
|
||||||
|
- \b 0: No FPU
|
||||||
|
- \b 1: Single precision FPU
|
||||||
|
- \b 2: Double + Single precision FPU
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t SCB_GetFPUType(void)
|
||||||
|
{
|
||||||
|
return 0U; /* No FPU */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*@} end of CMSIS_Core_FpuFunctions */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ################################## SysTick function ############################################ */
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_Core_FunctionInterface
|
||||||
|
\defgroup CMSIS_Core_SysTickFunctions SysTick Functions
|
||||||
|
\brief Functions that configure the System.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief System Tick Configuration
|
||||||
|
\details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
|
||||||
|
Counter is in free running mode to generate periodic interrupts.
|
||||||
|
\param [in] ticks Number of ticks between two interrupts.
|
||||||
|
\return 0 Function succeeded.
|
||||||
|
\return 1 Function failed.
|
||||||
|
\note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
|
||||||
|
function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
|
||||||
|
must contain a vendor-specific implementation of this function.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
||||||
|
{
|
||||||
|
if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
|
||||||
|
{
|
||||||
|
return (1UL); /* Reload value impossible */
|
||||||
|
}
|
||||||
|
|
||||||
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
|
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
|
||||||
|
return (0UL); /* Function successful */
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*@} end of CMSIS_Core_SysTickFunctions */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __CORE_CM0_H_DEPENDANT */
|
||||||
|
|
||||||
|
#endif /* __CMSIS_GENERIC */
|
||||||
+1085
File diff suppressed because it is too large
Load Diff
+979
@@ -0,0 +1,979 @@
|
|||||||
|
/**************************************************************************//**
|
||||||
|
* @file core_cm1.h
|
||||||
|
* @brief CMSIS Cortex-M1 Core Peripheral Access Layer Header File
|
||||||
|
* @version V1.0.1
|
||||||
|
* @date 12. November 2018
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2009-2018 Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined ( __ICCARM__ )
|
||||||
|
#pragma system_include /* treat file as system include file for MISRA check */
|
||||||
|
#elif defined (__clang__)
|
||||||
|
#pragma clang system_header /* treat file as system include file */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __CORE_CM1_H_GENERIC
|
||||||
|
#define __CORE_CM1_H_GENERIC
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
\page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
|
||||||
|
CMSIS violates the following MISRA-C:2004 rules:
|
||||||
|
|
||||||
|
\li Required Rule 8.5, object/function definition in header file.<br>
|
||||||
|
Function definitions in header files are used to allow 'inlining'.
|
||||||
|
|
||||||
|
\li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
|
||||||
|
Unions are used for effective representation of core registers.
|
||||||
|
|
||||||
|
\li Advisory Rule 19.7, Function-like macro defined.<br>
|
||||||
|
Function-like macros are used to allow more efficient code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* CMSIS definitions
|
||||||
|
******************************************************************************/
|
||||||
|
/**
|
||||||
|
\ingroup Cortex_M1
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "cmsis_version.h"
|
||||||
|
|
||||||
|
/* CMSIS CM1 definitions */
|
||||||
|
#define __CM1_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */
|
||||||
|
#define __CM1_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */
|
||||||
|
#define __CM1_CMSIS_VERSION ((__CM1_CMSIS_VERSION_MAIN << 16U) | \
|
||||||
|
__CM1_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */
|
||||||
|
|
||||||
|
#define __CORTEX_M (1U) /*!< Cortex-M Core */
|
||||||
|
|
||||||
|
/** __FPU_USED indicates whether an FPU is used or not.
|
||||||
|
This core does not support an FPU at all
|
||||||
|
*/
|
||||||
|
#define __FPU_USED 0U
|
||||||
|
|
||||||
|
#if defined ( __CC_ARM )
|
||||||
|
#if defined __TARGET_FPU_VFP
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||||
|
#if defined __ARM_FP
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __GNUC__ )
|
||||||
|
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __ICCARM__ )
|
||||||
|
#if defined __ARMVFP__
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __TI_ARM__ )
|
||||||
|
#if defined __TI_VFP_SUPPORT__
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __TASKING__ )
|
||||||
|
#if defined __FPU_VFP__
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#elif defined ( __CSMC__ )
|
||||||
|
#if ( __CSMC__ & 0x400U)
|
||||||
|
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "cmsis_compiler.h" /* CMSIS compiler specific defines */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __CORE_CM1_H_GENERIC */
|
||||||
|
|
||||||
|
#ifndef __CMSIS_GENERIC
|
||||||
|
|
||||||
|
#ifndef __CORE_CM1_H_DEPENDANT
|
||||||
|
#define __CORE_CM1_H_DEPENDANT
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* check device defines and use defaults */
|
||||||
|
#if defined __CHECK_DEVICE_DEFINES
|
||||||
|
#ifndef __CM1_REV
|
||||||
|
#define __CM1_REV 0x0100U
|
||||||
|
#warning "__CM1_REV not defined in device header file; using default!"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __NVIC_PRIO_BITS
|
||||||
|
#define __NVIC_PRIO_BITS 2U
|
||||||
|
#warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __Vendor_SysTickConfig
|
||||||
|
#define __Vendor_SysTickConfig 0U
|
||||||
|
#warning "__Vendor_SysTickConfig not defined in device header file; using default!"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* IO definitions (access restrictions to peripheral registers) */
|
||||||
|
/**
|
||||||
|
\defgroup CMSIS_glob_defs CMSIS Global Defines
|
||||||
|
|
||||||
|
<strong>IO Type Qualifiers</strong> are used
|
||||||
|
\li to specify the access to peripheral variables.
|
||||||
|
\li for automatic generation of peripheral register debug information.
|
||||||
|
*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define __I volatile /*!< Defines 'read only' permissions */
|
||||||
|
#else
|
||||||
|
#define __I volatile const /*!< Defines 'read only' permissions */
|
||||||
|
#endif
|
||||||
|
#define __O volatile /*!< Defines 'write only' permissions */
|
||||||
|
#define __IO volatile /*!< Defines 'read / write' permissions */
|
||||||
|
|
||||||
|
/* following defines should be used for structure members */
|
||||||
|
#define __IM volatile const /*! Defines 'read only' structure member permissions */
|
||||||
|
#define __OM volatile /*! Defines 'write only' structure member permissions */
|
||||||
|
#define __IOM volatile /*! Defines 'read / write' structure member permissions */
|
||||||
|
|
||||||
|
/*@} end of group Cortex_M1 */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Register Abstraction
|
||||||
|
Core Register contain:
|
||||||
|
- Core Register
|
||||||
|
- Core NVIC Register
|
||||||
|
- Core SCB Register
|
||||||
|
- Core SysTick Register
|
||||||
|
******************************************************************************/
|
||||||
|
/**
|
||||||
|
\defgroup CMSIS_core_register Defines and Type Definitions
|
||||||
|
\brief Type definitions and defines for Cortex-M processor based devices.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_CORE Status and Control Registers
|
||||||
|
\brief Core Register type definitions.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Union type to access the Application Program Status Register (APSR).
|
||||||
|
*/
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */
|
||||||
|
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
|
||||||
|
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
|
||||||
|
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
|
||||||
|
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
|
||||||
|
} b; /*!< Structure used for bit access */
|
||||||
|
uint32_t w; /*!< Type used for word access */
|
||||||
|
} APSR_Type;
|
||||||
|
|
||||||
|
/* APSR Register Definitions */
|
||||||
|
#define APSR_N_Pos 31U /*!< APSR: N Position */
|
||||||
|
#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */
|
||||||
|
|
||||||
|
#define APSR_Z_Pos 30U /*!< APSR: Z Position */
|
||||||
|
#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */
|
||||||
|
|
||||||
|
#define APSR_C_Pos 29U /*!< APSR: C Position */
|
||||||
|
#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */
|
||||||
|
|
||||||
|
#define APSR_V_Pos 28U /*!< APSR: V Position */
|
||||||
|
#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Union type to access the Interrupt Program Status Register (IPSR).
|
||||||
|
*/
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
|
||||||
|
uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
|
||||||
|
} b; /*!< Structure used for bit access */
|
||||||
|
uint32_t w; /*!< Type used for word access */
|
||||||
|
} IPSR_Type;
|
||||||
|
|
||||||
|
/* IPSR Register Definitions */
|
||||||
|
#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */
|
||||||
|
#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Union type to access the Special-Purpose Program Status Registers (xPSR).
|
||||||
|
*/
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
|
||||||
|
uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */
|
||||||
|
uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */
|
||||||
|
uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */
|
||||||
|
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
|
||||||
|
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
|
||||||
|
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
|
||||||
|
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
|
||||||
|
} b; /*!< Structure used for bit access */
|
||||||
|
uint32_t w; /*!< Type used for word access */
|
||||||
|
} xPSR_Type;
|
||||||
|
|
||||||
|
/* xPSR Register Definitions */
|
||||||
|
#define xPSR_N_Pos 31U /*!< xPSR: N Position */
|
||||||
|
#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */
|
||||||
|
|
||||||
|
#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */
|
||||||
|
#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */
|
||||||
|
|
||||||
|
#define xPSR_C_Pos 29U /*!< xPSR: C Position */
|
||||||
|
#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */
|
||||||
|
|
||||||
|
#define xPSR_V_Pos 28U /*!< xPSR: V Position */
|
||||||
|
#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */
|
||||||
|
|
||||||
|
#define xPSR_T_Pos 24U /*!< xPSR: T Position */
|
||||||
|
#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */
|
||||||
|
|
||||||
|
#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */
|
||||||
|
#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Union type to access the Control Registers (CONTROL).
|
||||||
|
*/
|
||||||
|
typedef union
|
||||||
|
{
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
uint32_t _reserved0:1; /*!< bit: 0 Reserved */
|
||||||
|
uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
|
||||||
|
uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */
|
||||||
|
} b; /*!< Structure used for bit access */
|
||||||
|
uint32_t w; /*!< Type used for word access */
|
||||||
|
} CONTROL_Type;
|
||||||
|
|
||||||
|
/* CONTROL Register Definitions */
|
||||||
|
#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */
|
||||||
|
#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_CORE */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
|
||||||
|
\brief Type definitions for the NVIC Registers
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
__IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
|
||||||
|
uint32_t RESERVED0[31U];
|
||||||
|
__IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
|
||||||
|
uint32_t RSERVED1[31U];
|
||||||
|
__IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
|
||||||
|
uint32_t RESERVED2[31U];
|
||||||
|
__IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
|
||||||
|
uint32_t RESERVED3[31U];
|
||||||
|
uint32_t RESERVED4[64U];
|
||||||
|
__IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */
|
||||||
|
} NVIC_Type;
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_NVIC */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_SCB System Control Block (SCB)
|
||||||
|
\brief Type definitions for the System Control Block Registers
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Structure type to access the System Control Block (SCB).
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
__IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
|
||||||
|
__IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
|
||||||
|
uint32_t RESERVED0;
|
||||||
|
__IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
|
||||||
|
__IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
|
||||||
|
__IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
|
||||||
|
uint32_t RESERVED1;
|
||||||
|
__IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */
|
||||||
|
__IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
|
||||||
|
} SCB_Type;
|
||||||
|
|
||||||
|
/* SCB CPUID Register Definitions */
|
||||||
|
#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */
|
||||||
|
#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
|
||||||
|
|
||||||
|
#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */
|
||||||
|
#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
|
||||||
|
|
||||||
|
#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */
|
||||||
|
#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
|
||||||
|
|
||||||
|
#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */
|
||||||
|
#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
|
||||||
|
|
||||||
|
#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */
|
||||||
|
#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */
|
||||||
|
|
||||||
|
/* SCB Interrupt Control State Register Definitions */
|
||||||
|
#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */
|
||||||
|
#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */
|
||||||
|
#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */
|
||||||
|
#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */
|
||||||
|
#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */
|
||||||
|
#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */
|
||||||
|
#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */
|
||||||
|
#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */
|
||||||
|
#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
|
||||||
|
|
||||||
|
#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */
|
||||||
|
#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */
|
||||||
|
|
||||||
|
/* SCB Application Interrupt and Reset Control Register Definitions */
|
||||||
|
#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */
|
||||||
|
#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
|
||||||
|
|
||||||
|
#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */
|
||||||
|
#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
|
||||||
|
|
||||||
|
#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */
|
||||||
|
#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
|
||||||
|
|
||||||
|
#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */
|
||||||
|
#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
|
||||||
|
|
||||||
|
#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */
|
||||||
|
#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
|
||||||
|
|
||||||
|
/* SCB System Control Register Definitions */
|
||||||
|
#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */
|
||||||
|
#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
|
||||||
|
|
||||||
|
#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */
|
||||||
|
#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
|
||||||
|
|
||||||
|
#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */
|
||||||
|
#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
|
||||||
|
|
||||||
|
/* SCB Configuration Control Register Definitions */
|
||||||
|
#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */
|
||||||
|
#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
|
||||||
|
|
||||||
|
#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */
|
||||||
|
#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
|
||||||
|
|
||||||
|
/* SCB System Handler Control and State Register Definitions */
|
||||||
|
#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */
|
||||||
|
#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_SCB */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)
|
||||||
|
\brief Type definitions for the System Control and ID Register not in the SCB
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Structure type to access the System Control and ID Register not in the SCB.
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t RESERVED0[2U];
|
||||||
|
__IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */
|
||||||
|
} SCnSCB_Type;
|
||||||
|
|
||||||
|
/* Auxiliary Control Register Definitions */
|
||||||
|
#define SCnSCB_ACTLR_ITCMUAEN_Pos 4U /*!< ACTLR: Instruction TCM Upper Alias Enable Position */
|
||||||
|
#define SCnSCB_ACTLR_ITCMUAEN_Msk (1UL << SCnSCB_ACTLR_ITCMUAEN_Pos) /*!< ACTLR: Instruction TCM Upper Alias Enable Mask */
|
||||||
|
|
||||||
|
#define SCnSCB_ACTLR_ITCMLAEN_Pos 3U /*!< ACTLR: Instruction TCM Lower Alias Enable Position */
|
||||||
|
#define SCnSCB_ACTLR_ITCMLAEN_Msk (1UL << SCnSCB_ACTLR_ITCMLAEN_Pos) /*!< ACTLR: Instruction TCM Lower Alias Enable Mask */
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_SCnotSCB */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_SysTick System Tick Timer (SysTick)
|
||||||
|
\brief Type definitions for the System Timer Registers.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Structure type to access the System Timer (SysTick).
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
__IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
|
||||||
|
__IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
|
||||||
|
__IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
|
||||||
|
__IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
|
||||||
|
} SysTick_Type;
|
||||||
|
|
||||||
|
/* SysTick Control / Status Register Definitions */
|
||||||
|
#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */
|
||||||
|
#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
|
||||||
|
|
||||||
|
#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */
|
||||||
|
#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
|
||||||
|
|
||||||
|
#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */
|
||||||
|
#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
|
||||||
|
|
||||||
|
#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */
|
||||||
|
#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */
|
||||||
|
|
||||||
|
/* SysTick Reload Register Definitions */
|
||||||
|
#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */
|
||||||
|
#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */
|
||||||
|
|
||||||
|
/* SysTick Current Register Definitions */
|
||||||
|
#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */
|
||||||
|
#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */
|
||||||
|
|
||||||
|
/* SysTick Calibration Register Definitions */
|
||||||
|
#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */
|
||||||
|
#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
|
||||||
|
|
||||||
|
#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */
|
||||||
|
#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
|
||||||
|
|
||||||
|
#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */
|
||||||
|
#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_SysTick */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
|
||||||
|
\brief Cortex-M1 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor.
|
||||||
|
Therefore they are not covered by the Cortex-M1 header file.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
/*@} end of group CMSIS_CoreDebug */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_core_bitfield Core register bit field macros
|
||||||
|
\brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Mask and shift a bit field value for use in a register bit range.
|
||||||
|
\param[in] field Name of the register bit field.
|
||||||
|
\param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type.
|
||||||
|
\return Masked and shifted value.
|
||||||
|
*/
|
||||||
|
#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Mask and shift a register value to extract a bit filed value.
|
||||||
|
\param[in] field Name of the register bit field.
|
||||||
|
\param[in] value Value of register. This parameter is interpreted as an uint32_t type.
|
||||||
|
\return Masked and shifted bit field value.
|
||||||
|
*/
|
||||||
|
#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
|
||||||
|
|
||||||
|
/*@} end of group CMSIS_core_bitfield */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_core_register
|
||||||
|
\defgroup CMSIS_core_base Core Definitions
|
||||||
|
\brief Definitions for base addresses, unions, and structures.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Memory mapping of Core Hardware */
|
||||||
|
#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
|
||||||
|
#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
|
||||||
|
#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
|
||||||
|
#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
|
||||||
|
|
||||||
|
#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */
|
||||||
|
#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
|
||||||
|
#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
|
||||||
|
#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
|
||||||
|
|
||||||
|
|
||||||
|
/*@} */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* Hardware Abstraction Layer
|
||||||
|
Core Function Interface contains:
|
||||||
|
- Core NVIC Functions
|
||||||
|
- Core SysTick Functions
|
||||||
|
- Core Register Access Functions
|
||||||
|
******************************************************************************/
|
||||||
|
/**
|
||||||
|
\defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ########################## NVIC functions #################################### */
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_Core_FunctionInterface
|
||||||
|
\defgroup CMSIS_Core_NVICFunctions NVIC Functions
|
||||||
|
\brief Functions that manage interrupts and exceptions via the NVIC.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CMSIS_NVIC_VIRTUAL
|
||||||
|
#ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
|
||||||
|
#define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
|
||||||
|
#endif
|
||||||
|
#include CMSIS_NVIC_VIRTUAL_HEADER_FILE
|
||||||
|
#else
|
||||||
|
#define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
|
||||||
|
#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
|
||||||
|
#define NVIC_EnableIRQ __NVIC_EnableIRQ
|
||||||
|
#define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
|
||||||
|
#define NVIC_DisableIRQ __NVIC_DisableIRQ
|
||||||
|
#define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
|
||||||
|
#define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
|
||||||
|
#define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
|
||||||
|
/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M1 */
|
||||||
|
#define NVIC_SetPriority __NVIC_SetPriority
|
||||||
|
#define NVIC_GetPriority __NVIC_GetPriority
|
||||||
|
#define NVIC_SystemReset __NVIC_SystemReset
|
||||||
|
#endif /* CMSIS_NVIC_VIRTUAL */
|
||||||
|
|
||||||
|
#ifdef CMSIS_VECTAB_VIRTUAL
|
||||||
|
#ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
|
||||||
|
#define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
|
||||||
|
#endif
|
||||||
|
#include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
|
||||||
|
#else
|
||||||
|
#define NVIC_SetVector __NVIC_SetVector
|
||||||
|
#define NVIC_GetVector __NVIC_GetVector
|
||||||
|
#endif /* (CMSIS_VECTAB_VIRTUAL) */
|
||||||
|
|
||||||
|
#define NVIC_USER_IRQ_OFFSET 16
|
||||||
|
|
||||||
|
|
||||||
|
/* The following EXC_RETURN values are saved the LR on exception entry */
|
||||||
|
#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */
|
||||||
|
#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */
|
||||||
|
#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */
|
||||||
|
|
||||||
|
|
||||||
|
/* Interrupt Priorities are WORD accessible only under Armv6-M */
|
||||||
|
/* The following MACROS handle generation of the register offset and byte masks */
|
||||||
|
#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL)
|
||||||
|
#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )
|
||||||
|
#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )
|
||||||
|
|
||||||
|
#define __NVIC_SetPriorityGrouping(X) (void)(X)
|
||||||
|
#define __NVIC_GetPriorityGrouping() (0U)
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Enable Interrupt
|
||||||
|
\details Enables a device specific interrupt in the NVIC interrupt controller.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
__COMPILER_BARRIER();
|
||||||
|
NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||||
|
__COMPILER_BARRIER();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Interrupt Enable status
|
||||||
|
\details Returns a device specific interrupt enable status from the NVIC interrupt controller.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\return 0 Interrupt is not enabled.
|
||||||
|
\return 1 Interrupt is enabled.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return(0U);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Disable Interrupt
|
||||||
|
\details Disables a device specific interrupt in the NVIC interrupt controller.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||||
|
__DSB();
|
||||||
|
__ISB();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Pending Interrupt
|
||||||
|
\details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\return 0 Interrupt status is not pending.
|
||||||
|
\return 1 Interrupt status is pending.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return(0U);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Pending Interrupt
|
||||||
|
\details Sets the pending bit of a device specific interrupt in the NVIC pending register.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Clear Pending Interrupt
|
||||||
|
\details Clears the pending bit of a device specific interrupt in the NVIC pending register.
|
||||||
|
\param [in] IRQn Device specific interrupt number.
|
||||||
|
\note IRQn must not be negative.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Interrupt Priority
|
||||||
|
\details Sets the priority of a device specific interrupt or a processor exception.
|
||||||
|
The interrupt number can be positive to specify a device specific interrupt,
|
||||||
|
or negative to specify a processor exception.
|
||||||
|
\param [in] IRQn Interrupt number.
|
||||||
|
\param [in] priority Priority to set.
|
||||||
|
\note The priority cannot be set for every processor exception.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
|
||||||
|
{
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
|
||||||
|
(((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) |
|
||||||
|
(((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Interrupt Priority
|
||||||
|
\details Reads the priority of a device specific interrupt or a processor exception.
|
||||||
|
The interrupt number can be positive to specify a device specific interrupt,
|
||||||
|
or negative to specify a processor exception.
|
||||||
|
\param [in] IRQn Interrupt number.
|
||||||
|
\return Interrupt Priority.
|
||||||
|
Value is aligned automatically to the implemented priority bits of the microcontroller.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
|
||||||
|
if ((int32_t)(IRQn) >= 0)
|
||||||
|
{
|
||||||
|
return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Encode Priority
|
||||||
|
\details Encodes the priority for an interrupt with the given priority group,
|
||||||
|
preemptive priority value, and subpriority value.
|
||||||
|
In case of a conflict between priority grouping and available
|
||||||
|
priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
|
||||||
|
\param [in] PriorityGroup Used priority group.
|
||||||
|
\param [in] PreemptPriority Preemptive priority value (starting from 0).
|
||||||
|
\param [in] SubPriority Subpriority value (starting from 0).
|
||||||
|
\return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
|
||||||
|
{
|
||||||
|
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
|
||||||
|
uint32_t PreemptPriorityBits;
|
||||||
|
uint32_t SubPriorityBits;
|
||||||
|
|
||||||
|
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
|
||||||
|
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
|
||||||
|
|
||||||
|
return (
|
||||||
|
((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
|
||||||
|
((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Decode Priority
|
||||||
|
\details Decodes an interrupt priority value with a given priority group to
|
||||||
|
preemptive priority value and subpriority value.
|
||||||
|
In case of a conflict between priority grouping and available
|
||||||
|
priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
|
||||||
|
\param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
|
||||||
|
\param [in] PriorityGroup Used priority group.
|
||||||
|
\param [out] pPreemptPriority Preemptive priority value (starting from 0).
|
||||||
|
\param [out] pSubPriority Subpriority value (starting from 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
|
||||||
|
{
|
||||||
|
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
|
||||||
|
uint32_t PreemptPriorityBits;
|
||||||
|
uint32_t SubPriorityBits;
|
||||||
|
|
||||||
|
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
|
||||||
|
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
|
||||||
|
|
||||||
|
*pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
|
||||||
|
*pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Set Interrupt Vector
|
||||||
|
\details Sets an interrupt vector in SRAM based interrupt vector table.
|
||||||
|
The interrupt number can be positive to specify a device specific interrupt,
|
||||||
|
or negative to specify a processor exception.
|
||||||
|
Address 0 must be mapped to SRAM.
|
||||||
|
\param [in] IRQn Interrupt number
|
||||||
|
\param [in] vector Address of interrupt handler function
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
|
||||||
|
{
|
||||||
|
uint32_t *vectors = (uint32_t *)0x0U;
|
||||||
|
vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
|
||||||
|
/* ARM Application Note 321 states that the M1 does not require the architectural barrier */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief Get Interrupt Vector
|
||||||
|
\details Reads an interrupt vector from interrupt vector table.
|
||||||
|
The interrupt number can be positive to specify a device specific interrupt,
|
||||||
|
or negative to specify a processor exception.
|
||||||
|
\param [in] IRQn Interrupt number.
|
||||||
|
\return Address of interrupt handler function
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
|
||||||
|
{
|
||||||
|
uint32_t *vectors = (uint32_t *)0x0U;
|
||||||
|
return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief System Reset
|
||||||
|
\details Initiates a system reset request to reset the MCU.
|
||||||
|
*/
|
||||||
|
__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
|
||||||
|
{
|
||||||
|
__DSB(); /* Ensure all outstanding memory accesses included
|
||||||
|
buffered write are completed before reset */
|
||||||
|
SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
|
||||||
|
SCB_AIRCR_SYSRESETREQ_Msk);
|
||||||
|
__DSB(); /* Ensure completion of memory access */
|
||||||
|
|
||||||
|
for(;;) /* wait until reset */
|
||||||
|
{
|
||||||
|
__NOP();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*@} end of CMSIS_Core_NVICFunctions */
|
||||||
|
|
||||||
|
|
||||||
|
/* ########################## FPU functions #################################### */
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_Core_FunctionInterface
|
||||||
|
\defgroup CMSIS_Core_FpuFunctions FPU Functions
|
||||||
|
\brief Function that provides FPU type.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief get FPU type
|
||||||
|
\details returns the FPU type
|
||||||
|
\returns
|
||||||
|
- \b 0: No FPU
|
||||||
|
- \b 1: Single precision FPU
|
||||||
|
- \b 2: Double + Single precision FPU
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t SCB_GetFPUType(void)
|
||||||
|
{
|
||||||
|
return 0U; /* No FPU */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*@} end of CMSIS_Core_FpuFunctions */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* ################################## SysTick function ############################################ */
|
||||||
|
/**
|
||||||
|
\ingroup CMSIS_Core_FunctionInterface
|
||||||
|
\defgroup CMSIS_Core_SysTickFunctions SysTick Functions
|
||||||
|
\brief Functions that configure the System.
|
||||||
|
@{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
|
||||||
|
|
||||||
|
/**
|
||||||
|
\brief System Tick Configuration
|
||||||
|
\details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
|
||||||
|
Counter is in free running mode to generate periodic interrupts.
|
||||||
|
\param [in] ticks Number of ticks between two interrupts.
|
||||||
|
\return 0 Function succeeded.
|
||||||
|
\return 1 Function failed.
|
||||||
|
\note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
|
||||||
|
function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
|
||||||
|
must contain a vendor-specific implementation of this function.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
|
||||||
|
{
|
||||||
|
if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
|
||||||
|
{
|
||||||
|
return (1UL); /* Reload value impossible */
|
||||||
|
}
|
||||||
|
|
||||||
|
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
|
||||||
|
NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
|
||||||
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
|
SysTick_CTRL_TICKINT_Msk |
|
||||||
|
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
|
||||||
|
return (0UL); /* Function successful */
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*@} end of CMSIS_Core_SysTickFunctions */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __CORE_CM1_H_DEPENDANT */
|
||||||
|
|
||||||
|
#endif /* __CMSIS_GENERIC */
|
||||||
+1996
File diff suppressed because it is too large
Load Diff
+1937
File diff suppressed because it is too large
Load Diff
+2910
File diff suppressed because it is too large
Load Diff
+2910
File diff suppressed because it is too large
Load Diff
+2124
File diff suppressed because it is too large
Load Diff
+2725
File diff suppressed because it is too large
Load Diff
+1025
File diff suppressed because it is too large
Load Diff
+1912
File diff suppressed because it is too large
Load Diff
+272
@@ -0,0 +1,272 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @file mpu_armv7.h
|
||||||
|
* @brief CMSIS MPU API for Armv7-M MPU
|
||||||
|
* @version V5.1.0
|
||||||
|
* @date 08. March 2019
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2019 Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined ( __ICCARM__ )
|
||||||
|
#pragma system_include /* treat file as system include file for MISRA check */
|
||||||
|
#elif defined (__clang__)
|
||||||
|
#pragma clang system_header /* treat file as system include file */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ARM_MPU_ARMV7_H
|
||||||
|
#define ARM_MPU_ARMV7_H
|
||||||
|
|
||||||
|
#define ARM_MPU_REGION_SIZE_32B ((uint8_t)0x04U) ///!< MPU Region Size 32 Bytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_64B ((uint8_t)0x05U) ///!< MPU Region Size 64 Bytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_128B ((uint8_t)0x06U) ///!< MPU Region Size 128 Bytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_256B ((uint8_t)0x07U) ///!< MPU Region Size 256 Bytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_512B ((uint8_t)0x08U) ///!< MPU Region Size 512 Bytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_1KB ((uint8_t)0x09U) ///!< MPU Region Size 1 KByte
|
||||||
|
#define ARM_MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) ///!< MPU Region Size 2 KBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) ///!< MPU Region Size 4 KBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) ///!< MPU Region Size 8 KBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) ///!< MPU Region Size 16 KBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) ///!< MPU Region Size 32 KBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) ///!< MPU Region Size 64 KBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_128KB ((uint8_t)0x10U) ///!< MPU Region Size 128 KBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_256KB ((uint8_t)0x11U) ///!< MPU Region Size 256 KBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_512KB ((uint8_t)0x12U) ///!< MPU Region Size 512 KBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_1MB ((uint8_t)0x13U) ///!< MPU Region Size 1 MByte
|
||||||
|
#define ARM_MPU_REGION_SIZE_2MB ((uint8_t)0x14U) ///!< MPU Region Size 2 MBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_4MB ((uint8_t)0x15U) ///!< MPU Region Size 4 MBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_8MB ((uint8_t)0x16U) ///!< MPU Region Size 8 MBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_16MB ((uint8_t)0x17U) ///!< MPU Region Size 16 MBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_32MB ((uint8_t)0x18U) ///!< MPU Region Size 32 MBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_64MB ((uint8_t)0x19U) ///!< MPU Region Size 64 MBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) ///!< MPU Region Size 128 MBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) ///!< MPU Region Size 256 MBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) ///!< MPU Region Size 512 MBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) ///!< MPU Region Size 1 GByte
|
||||||
|
#define ARM_MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) ///!< MPU Region Size 2 GBytes
|
||||||
|
#define ARM_MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) ///!< MPU Region Size 4 GBytes
|
||||||
|
|
||||||
|
#define ARM_MPU_AP_NONE 0U ///!< MPU Access Permission no access
|
||||||
|
#define ARM_MPU_AP_PRIV 1U ///!< MPU Access Permission privileged access only
|
||||||
|
#define ARM_MPU_AP_URO 2U ///!< MPU Access Permission unprivileged access read-only
|
||||||
|
#define ARM_MPU_AP_FULL 3U ///!< MPU Access Permission full access
|
||||||
|
#define ARM_MPU_AP_PRO 5U ///!< MPU Access Permission privileged access read-only
|
||||||
|
#define ARM_MPU_AP_RO 6U ///!< MPU Access Permission read-only access
|
||||||
|
|
||||||
|
/** MPU Region Base Address Register Value
|
||||||
|
*
|
||||||
|
* \param Region The region to be configured, number 0 to 15.
|
||||||
|
* \param BaseAddress The base address for the region.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_RBAR(Region, BaseAddress) \
|
||||||
|
(((BaseAddress) & MPU_RBAR_ADDR_Msk) | \
|
||||||
|
((Region) & MPU_RBAR_REGION_Msk) | \
|
||||||
|
(MPU_RBAR_VALID_Msk))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Memory Access Attributes
|
||||||
|
*
|
||||||
|
* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral.
|
||||||
|
* \param IsShareable Region is shareable between multiple bus masters.
|
||||||
|
* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache.
|
||||||
|
* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable) \
|
||||||
|
((((TypeExtField) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk) | \
|
||||||
|
(((IsShareable) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk) | \
|
||||||
|
(((IsCacheable) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk) | \
|
||||||
|
(((IsBufferable) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Region Attribute and Size Register Value
|
||||||
|
*
|
||||||
|
* \param DisableExec Instruction access disable bit, 1= disable instruction fetches.
|
||||||
|
* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode.
|
||||||
|
* \param AccessAttributes Memory access attribution, see \ref ARM_MPU_ACCESS_.
|
||||||
|
* \param SubRegionDisable Sub-region disable field.
|
||||||
|
* \param Size Region size of the region to be configured, for example 4K, 8K.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size) \
|
||||||
|
((((DisableExec) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \
|
||||||
|
(((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \
|
||||||
|
(((AccessAttributes) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk))) | \
|
||||||
|
(((SubRegionDisable) << MPU_RASR_SRD_Pos) & MPU_RASR_SRD_Msk) | \
|
||||||
|
(((Size) << MPU_RASR_SIZE_Pos) & MPU_RASR_SIZE_Msk) | \
|
||||||
|
(((MPU_RASR_ENABLE_Msk))))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Region Attribute and Size Register Value
|
||||||
|
*
|
||||||
|
* \param DisableExec Instruction access disable bit, 1= disable instruction fetches.
|
||||||
|
* \param AccessPermission Data access permissions, allows you to configure read/write access for User and Privileged mode.
|
||||||
|
* \param TypeExtField Type extension field, allows you to configure memory access type, for example strongly ordered, peripheral.
|
||||||
|
* \param IsShareable Region is shareable between multiple bus masters.
|
||||||
|
* \param IsCacheable Region is cacheable, i.e. its value may be kept in cache.
|
||||||
|
* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy.
|
||||||
|
* \param SubRegionDisable Sub-region disable field.
|
||||||
|
* \param Size Region size of the region to be configured, for example 4K, 8K.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_RASR(DisableExec, AccessPermission, TypeExtField, IsShareable, IsCacheable, IsBufferable, SubRegionDisable, Size) \
|
||||||
|
ARM_MPU_RASR_EX(DisableExec, AccessPermission, ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable), SubRegionDisable, Size)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Memory Access Attribute for strongly ordered memory.
|
||||||
|
* - TEX: 000b
|
||||||
|
* - Shareable
|
||||||
|
* - Non-cacheable
|
||||||
|
* - Non-bufferable
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_ACCESS_ORDERED ARM_MPU_ACCESS_(0U, 1U, 0U, 0U)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Memory Access Attribute for device memory.
|
||||||
|
* - TEX: 000b (if shareable) or 010b (if non-shareable)
|
||||||
|
* - Shareable or non-shareable
|
||||||
|
* - Non-cacheable
|
||||||
|
* - Bufferable (if shareable) or non-bufferable (if non-shareable)
|
||||||
|
*
|
||||||
|
* \param IsShareable Configures the device memory as shareable or non-shareable.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_ACCESS_DEVICE(IsShareable) ((IsShareable) ? ARM_MPU_ACCESS_(0U, 1U, 0U, 1U) : ARM_MPU_ACCESS_(2U, 0U, 0U, 0U))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Memory Access Attribute for normal memory.
|
||||||
|
* - TEX: 1BBb (reflecting outer cacheability rules)
|
||||||
|
* - Shareable or non-shareable
|
||||||
|
* - Cacheable or non-cacheable (reflecting inner cacheability rules)
|
||||||
|
* - Bufferable or non-bufferable (reflecting inner cacheability rules)
|
||||||
|
*
|
||||||
|
* \param OuterCp Configures the outer cache policy.
|
||||||
|
* \param InnerCp Configures the inner cache policy.
|
||||||
|
* \param IsShareable Configures the memory as shareable or non-shareable.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_ACCESS_NORMAL(OuterCp, InnerCp, IsShareable) ARM_MPU_ACCESS_((4U | (OuterCp)), IsShareable, ((InnerCp) & 2U), ((InnerCp) & 1U))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Memory Access Attribute non-cacheable policy.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_CACHEP_NOCACHE 0U
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Memory Access Attribute write-back, write and read allocate policy.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_CACHEP_WB_WRA 1U
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Memory Access Attribute write-through, no write allocate policy.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_CACHEP_WT_NWA 2U
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MPU Memory Access Attribute write-back, no write allocate policy.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_CACHEP_WB_NWA 3U
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Struct for a single MPU Region
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
uint32_t RBAR; //!< The region base address register value (RBAR)
|
||||||
|
uint32_t RASR; //!< The region attribute and size register value (RASR) \ref MPU_RASR
|
||||||
|
} ARM_MPU_Region_t;
|
||||||
|
|
||||||
|
/** Enable the MPU.
|
||||||
|
* \param MPU_Control Default access permissions for unconfigured regions.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control)
|
||||||
|
{
|
||||||
|
MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
|
||||||
|
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||||
|
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
|
#endif
|
||||||
|
__DSB();
|
||||||
|
__ISB();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Disable the MPU.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_Disable(void)
|
||||||
|
{
|
||||||
|
__DMB();
|
||||||
|
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||||
|
SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
|
#endif
|
||||||
|
MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Clear and disable the given MPU region.
|
||||||
|
* \param rnr Region number to be cleared.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr)
|
||||||
|
{
|
||||||
|
MPU->RNR = rnr;
|
||||||
|
MPU->RASR = 0U;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Configure an MPU region.
|
||||||
|
* \param rbar Value for RBAR register.
|
||||||
|
* \param rsar Value for RSAR register.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rbar, uint32_t rasr)
|
||||||
|
{
|
||||||
|
MPU->RBAR = rbar;
|
||||||
|
MPU->RASR = rasr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Configure the given MPU region.
|
||||||
|
* \param rnr Region number to be configured.
|
||||||
|
* \param rbar Value for RBAR register.
|
||||||
|
* \param rsar Value for RSAR register.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_SetRegionEx(uint32_t rnr, uint32_t rbar, uint32_t rasr)
|
||||||
|
{
|
||||||
|
MPU->RNR = rnr;
|
||||||
|
MPU->RBAR = rbar;
|
||||||
|
MPU->RASR = rasr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Memcopy with strictly ordered memory access, e.g. for register targets.
|
||||||
|
* \param dst Destination data is copied to.
|
||||||
|
* \param src Source data is copied from.
|
||||||
|
* \param len Amount of data words to be copied.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)
|
||||||
|
{
|
||||||
|
uint32_t i;
|
||||||
|
for (i = 0U; i < len; ++i)
|
||||||
|
{
|
||||||
|
dst[i] = src[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Load the given number of MPU regions from a table.
|
||||||
|
* \param table Pointer to the MPU configuration table.
|
||||||
|
* \param cnt Amount of regions to be configured.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_Load(ARM_MPU_Region_t const* table, uint32_t cnt)
|
||||||
|
{
|
||||||
|
const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U;
|
||||||
|
while (cnt > MPU_TYPE_RALIASES) {
|
||||||
|
ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), MPU_TYPE_RALIASES*rowWordSize);
|
||||||
|
table += MPU_TYPE_RALIASES;
|
||||||
|
cnt -= MPU_TYPE_RALIASES;
|
||||||
|
}
|
||||||
|
ARM_MPU_OrderedMemcpy(&(MPU->RBAR), &(table->RBAR), cnt*rowWordSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
+346
@@ -0,0 +1,346 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @file mpu_armv8.h
|
||||||
|
* @brief CMSIS MPU API for Armv8-M and Armv8.1-M MPU
|
||||||
|
* @version V5.1.0
|
||||||
|
* @date 08. March 2019
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2019 Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined ( __ICCARM__ )
|
||||||
|
#pragma system_include /* treat file as system include file for MISRA check */
|
||||||
|
#elif defined (__clang__)
|
||||||
|
#pragma clang system_header /* treat file as system include file */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef ARM_MPU_ARMV8_H
|
||||||
|
#define ARM_MPU_ARMV8_H
|
||||||
|
|
||||||
|
/** \brief Attribute for device memory (outer only) */
|
||||||
|
#define ARM_MPU_ATTR_DEVICE ( 0U )
|
||||||
|
|
||||||
|
/** \brief Attribute for non-cacheable, normal memory */
|
||||||
|
#define ARM_MPU_ATTR_NON_CACHEABLE ( 4U )
|
||||||
|
|
||||||
|
/** \brief Attribute for normal memory (outer and inner)
|
||||||
|
* \param NT Non-Transient: Set to 1 for non-transient data.
|
||||||
|
* \param WB Write-Back: Set to 1 to use write-back update policy.
|
||||||
|
* \param RA Read Allocation: Set to 1 to use cache allocation on read miss.
|
||||||
|
* \param WA Write Allocation: Set to 1 to use cache allocation on write miss.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_ATTR_MEMORY_(NT, WB, RA, WA) \
|
||||||
|
(((NT & 1U) << 3U) | ((WB & 1U) << 2U) | ((RA & 1U) << 1U) | (WA & 1U))
|
||||||
|
|
||||||
|
/** \brief Device memory type non Gathering, non Re-ordering, non Early Write Acknowledgement */
|
||||||
|
#define ARM_MPU_ATTR_DEVICE_nGnRnE (0U)
|
||||||
|
|
||||||
|
/** \brief Device memory type non Gathering, non Re-ordering, Early Write Acknowledgement */
|
||||||
|
#define ARM_MPU_ATTR_DEVICE_nGnRE (1U)
|
||||||
|
|
||||||
|
/** \brief Device memory type non Gathering, Re-ordering, Early Write Acknowledgement */
|
||||||
|
#define ARM_MPU_ATTR_DEVICE_nGRE (2U)
|
||||||
|
|
||||||
|
/** \brief Device memory type Gathering, Re-ordering, Early Write Acknowledgement */
|
||||||
|
#define ARM_MPU_ATTR_DEVICE_GRE (3U)
|
||||||
|
|
||||||
|
/** \brief Memory Attribute
|
||||||
|
* \param O Outer memory attributes
|
||||||
|
* \param I O == ARM_MPU_ATTR_DEVICE: Device memory attributes, else: Inner memory attributes
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_ATTR(O, I) (((O & 0xFU) << 4U) | (((O & 0xFU) != 0U) ? (I & 0xFU) : ((I & 0x3U) << 2U)))
|
||||||
|
|
||||||
|
/** \brief Normal memory non-shareable */
|
||||||
|
#define ARM_MPU_SH_NON (0U)
|
||||||
|
|
||||||
|
/** \brief Normal memory outer shareable */
|
||||||
|
#define ARM_MPU_SH_OUTER (2U)
|
||||||
|
|
||||||
|
/** \brief Normal memory inner shareable */
|
||||||
|
#define ARM_MPU_SH_INNER (3U)
|
||||||
|
|
||||||
|
/** \brief Memory access permissions
|
||||||
|
* \param RO Read-Only: Set to 1 for read-only memory.
|
||||||
|
* \param NP Non-Privileged: Set to 1 for non-privileged memory.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_AP_(RO, NP) (((RO & 1U) << 1U) | (NP & 1U))
|
||||||
|
|
||||||
|
/** \brief Region Base Address Register value
|
||||||
|
* \param BASE The base address bits [31:5] of a memory region. The value is zero extended. Effective address gets 32 byte aligned.
|
||||||
|
* \param SH Defines the Shareability domain for this memory region.
|
||||||
|
* \param RO Read-Only: Set to 1 for a read-only memory region.
|
||||||
|
* \param NP Non-Privileged: Set to 1 for a non-privileged memory region.
|
||||||
|
* \oaram XN eXecute Never: Set to 1 for a non-executable memory region.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_RBAR(BASE, SH, RO, NP, XN) \
|
||||||
|
((BASE & MPU_RBAR_BASE_Msk) | \
|
||||||
|
((SH << MPU_RBAR_SH_Pos) & MPU_RBAR_SH_Msk) | \
|
||||||
|
((ARM_MPU_AP_(RO, NP) << MPU_RBAR_AP_Pos) & MPU_RBAR_AP_Msk) | \
|
||||||
|
((XN << MPU_RBAR_XN_Pos) & MPU_RBAR_XN_Msk))
|
||||||
|
|
||||||
|
/** \brief Region Limit Address Register value
|
||||||
|
* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended.
|
||||||
|
* \param IDX The attribute index to be associated with this memory region.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_RLAR(LIMIT, IDX) \
|
||||||
|
((LIMIT & MPU_RLAR_LIMIT_Msk) | \
|
||||||
|
((IDX << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \
|
||||||
|
(MPU_RLAR_EN_Msk))
|
||||||
|
|
||||||
|
#if defined(MPU_RLAR_PXN_Pos)
|
||||||
|
|
||||||
|
/** \brief Region Limit Address Register with PXN value
|
||||||
|
* \param LIMIT The limit address bits [31:5] for this memory region. The value is one extended.
|
||||||
|
* \param PXN Privileged execute never. Defines whether code can be executed from this privileged region.
|
||||||
|
* \param IDX The attribute index to be associated with this memory region.
|
||||||
|
*/
|
||||||
|
#define ARM_MPU_RLAR_PXN(LIMIT, PXN, IDX) \
|
||||||
|
((LIMIT & MPU_RLAR_LIMIT_Msk) | \
|
||||||
|
((PXN << MPU_RLAR_PXN_Pos) & MPU_RLAR_PXN_Msk) | \
|
||||||
|
((IDX << MPU_RLAR_AttrIndx_Pos) & MPU_RLAR_AttrIndx_Msk) | \
|
||||||
|
(MPU_RLAR_EN_Msk))
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Struct for a single MPU Region
|
||||||
|
*/
|
||||||
|
typedef struct {
|
||||||
|
uint32_t RBAR; /*!< Region Base Address Register value */
|
||||||
|
uint32_t RLAR; /*!< Region Limit Address Register value */
|
||||||
|
} ARM_MPU_Region_t;
|
||||||
|
|
||||||
|
/** Enable the MPU.
|
||||||
|
* \param MPU_Control Default access permissions for unconfigured regions.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_Enable(uint32_t MPU_Control)
|
||||||
|
{
|
||||||
|
MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
|
||||||
|
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||||
|
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
|
#endif
|
||||||
|
__DSB();
|
||||||
|
__ISB();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Disable the MPU.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_Disable(void)
|
||||||
|
{
|
||||||
|
__DMB();
|
||||||
|
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||||
|
SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
|
#endif
|
||||||
|
MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef MPU_NS
|
||||||
|
/** Enable the Non-secure MPU.
|
||||||
|
* \param MPU_Control Default access permissions for unconfigured regions.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_Enable_NS(uint32_t MPU_Control)
|
||||||
|
{
|
||||||
|
MPU_NS->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
|
||||||
|
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||||
|
SCB_NS->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
|
#endif
|
||||||
|
__DSB();
|
||||||
|
__ISB();
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Disable the Non-secure MPU.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_Disable_NS(void)
|
||||||
|
{
|
||||||
|
__DMB();
|
||||||
|
#ifdef SCB_SHCSR_MEMFAULTENA_Msk
|
||||||
|
SCB_NS->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
|
#endif
|
||||||
|
MPU_NS->CTRL &= ~MPU_CTRL_ENABLE_Msk;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Set the memory attribute encoding to the given MPU.
|
||||||
|
* \param mpu Pointer to the MPU to be configured.
|
||||||
|
* \param idx The attribute index to be set [0-7]
|
||||||
|
* \param attr The attribute value to be set.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_SetMemAttrEx(MPU_Type* mpu, uint8_t idx, uint8_t attr)
|
||||||
|
{
|
||||||
|
const uint8_t reg = idx / 4U;
|
||||||
|
const uint32_t pos = ((idx % 4U) * 8U);
|
||||||
|
const uint32_t mask = 0xFFU << pos;
|
||||||
|
|
||||||
|
if (reg >= (sizeof(mpu->MAIR) / sizeof(mpu->MAIR[0]))) {
|
||||||
|
return; // invalid index
|
||||||
|
}
|
||||||
|
|
||||||
|
mpu->MAIR[reg] = ((mpu->MAIR[reg] & ~mask) | ((attr << pos) & mask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Set the memory attribute encoding.
|
||||||
|
* \param idx The attribute index to be set [0-7]
|
||||||
|
* \param attr The attribute value to be set.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_SetMemAttr(uint8_t idx, uint8_t attr)
|
||||||
|
{
|
||||||
|
ARM_MPU_SetMemAttrEx(MPU, idx, attr);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef MPU_NS
|
||||||
|
/** Set the memory attribute encoding to the Non-secure MPU.
|
||||||
|
* \param idx The attribute index to be set [0-7]
|
||||||
|
* \param attr The attribute value to be set.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_SetMemAttr_NS(uint8_t idx, uint8_t attr)
|
||||||
|
{
|
||||||
|
ARM_MPU_SetMemAttrEx(MPU_NS, idx, attr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Clear and disable the given MPU region of the given MPU.
|
||||||
|
* \param mpu Pointer to MPU to be used.
|
||||||
|
* \param rnr Region number to be cleared.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_ClrRegionEx(MPU_Type* mpu, uint32_t rnr)
|
||||||
|
{
|
||||||
|
mpu->RNR = rnr;
|
||||||
|
mpu->RLAR = 0U;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Clear and disable the given MPU region.
|
||||||
|
* \param rnr Region number to be cleared.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_ClrRegion(uint32_t rnr)
|
||||||
|
{
|
||||||
|
ARM_MPU_ClrRegionEx(MPU, rnr);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef MPU_NS
|
||||||
|
/** Clear and disable the given Non-secure MPU region.
|
||||||
|
* \param rnr Region number to be cleared.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_ClrRegion_NS(uint32_t rnr)
|
||||||
|
{
|
||||||
|
ARM_MPU_ClrRegionEx(MPU_NS, rnr);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Configure the given MPU region of the given MPU.
|
||||||
|
* \param mpu Pointer to MPU to be used.
|
||||||
|
* \param rnr Region number to be configured.
|
||||||
|
* \param rbar Value for RBAR register.
|
||||||
|
* \param rlar Value for RLAR register.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_SetRegionEx(MPU_Type* mpu, uint32_t rnr, uint32_t rbar, uint32_t rlar)
|
||||||
|
{
|
||||||
|
mpu->RNR = rnr;
|
||||||
|
mpu->RBAR = rbar;
|
||||||
|
mpu->RLAR = rlar;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Configure the given MPU region.
|
||||||
|
* \param rnr Region number to be configured.
|
||||||
|
* \param rbar Value for RBAR register.
|
||||||
|
* \param rlar Value for RLAR register.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_SetRegion(uint32_t rnr, uint32_t rbar, uint32_t rlar)
|
||||||
|
{
|
||||||
|
ARM_MPU_SetRegionEx(MPU, rnr, rbar, rlar);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef MPU_NS
|
||||||
|
/** Configure the given Non-secure MPU region.
|
||||||
|
* \param rnr Region number to be configured.
|
||||||
|
* \param rbar Value for RBAR register.
|
||||||
|
* \param rlar Value for RLAR register.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_SetRegion_NS(uint32_t rnr, uint32_t rbar, uint32_t rlar)
|
||||||
|
{
|
||||||
|
ARM_MPU_SetRegionEx(MPU_NS, rnr, rbar, rlar);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/** Memcopy with strictly ordered memory access, e.g. for register targets.
|
||||||
|
* \param dst Destination data is copied to.
|
||||||
|
* \param src Source data is copied from.
|
||||||
|
* \param len Amount of data words to be copied.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_OrderedMemcpy(volatile uint32_t* dst, const uint32_t* __RESTRICT src, uint32_t len)
|
||||||
|
{
|
||||||
|
uint32_t i;
|
||||||
|
for (i = 0U; i < len; ++i)
|
||||||
|
{
|
||||||
|
dst[i] = src[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Load the given number of MPU regions from a table to the given MPU.
|
||||||
|
* \param mpu Pointer to the MPU registers to be used.
|
||||||
|
* \param rnr First region number to be configured.
|
||||||
|
* \param table Pointer to the MPU configuration table.
|
||||||
|
* \param cnt Amount of regions to be configured.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_LoadEx(MPU_Type* mpu, uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
|
||||||
|
{
|
||||||
|
const uint32_t rowWordSize = sizeof(ARM_MPU_Region_t)/4U;
|
||||||
|
if (cnt == 1U) {
|
||||||
|
mpu->RNR = rnr;
|
||||||
|
ARM_MPU_OrderedMemcpy(&(mpu->RBAR), &(table->RBAR), rowWordSize);
|
||||||
|
} else {
|
||||||
|
uint32_t rnrBase = rnr & ~(MPU_TYPE_RALIASES-1U);
|
||||||
|
uint32_t rnrOffset = rnr % MPU_TYPE_RALIASES;
|
||||||
|
|
||||||
|
mpu->RNR = rnrBase;
|
||||||
|
while ((rnrOffset + cnt) > MPU_TYPE_RALIASES) {
|
||||||
|
uint32_t c = MPU_TYPE_RALIASES - rnrOffset;
|
||||||
|
ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), c*rowWordSize);
|
||||||
|
table += c;
|
||||||
|
cnt -= c;
|
||||||
|
rnrOffset = 0U;
|
||||||
|
rnrBase += MPU_TYPE_RALIASES;
|
||||||
|
mpu->RNR = rnrBase;
|
||||||
|
}
|
||||||
|
|
||||||
|
ARM_MPU_OrderedMemcpy(&(mpu->RBAR)+(rnrOffset*2U), &(table->RBAR), cnt*rowWordSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Load the given number of MPU regions from a table.
|
||||||
|
* \param rnr First region number to be configured.
|
||||||
|
* \param table Pointer to the MPU configuration table.
|
||||||
|
* \param cnt Amount of regions to be configured.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_Load(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
|
||||||
|
{
|
||||||
|
ARM_MPU_LoadEx(MPU, rnr, table, cnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef MPU_NS
|
||||||
|
/** Load the given number of MPU regions from a table to the Non-secure MPU.
|
||||||
|
* \param rnr First region number to be configured.
|
||||||
|
* \param table Pointer to the MPU configuration table.
|
||||||
|
* \param cnt Amount of regions to be configured.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void ARM_MPU_Load_NS(uint32_t rnr, ARM_MPU_Region_t const* table, uint32_t cnt)
|
||||||
|
{
|
||||||
|
ARM_MPU_LoadEx(MPU_NS, rnr, table, cnt);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
/******************************************************************************
|
||||||
|
* @file tz_context.h
|
||||||
|
* @brief Context Management for Armv8-M TrustZone
|
||||||
|
* @version V1.0.1
|
||||||
|
* @date 10. January 2018
|
||||||
|
******************************************************************************/
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2017-2018 Arm Limited. All rights reserved.
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||||
|
* not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||||
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined ( __ICCARM__ )
|
||||||
|
#pragma system_include /* treat file as system include file for MISRA check */
|
||||||
|
#elif defined (__clang__)
|
||||||
|
#pragma clang system_header /* treat file as system include file */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef TZ_CONTEXT_H
|
||||||
|
#define TZ_CONTEXT_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifndef TZ_MODULEID_T
|
||||||
|
#define TZ_MODULEID_T
|
||||||
|
/// \details Data type that identifies secure software modules called by a process.
|
||||||
|
typedef uint32_t TZ_ModuleId_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/// \details TZ Memory ID identifies an allocated memory slot.
|
||||||
|
typedef uint32_t TZ_MemoryId_t;
|
||||||
|
|
||||||
|
/// Initialize secure context memory system
|
||||||
|
/// \return execution status (1: success, 0: error)
|
||||||
|
uint32_t TZ_InitContextSystem_S (void);
|
||||||
|
|
||||||
|
/// Allocate context memory for calling secure software modules in TrustZone
|
||||||
|
/// \param[in] module identifies software modules called from non-secure mode
|
||||||
|
/// \return value != 0 id TrustZone memory slot identifier
|
||||||
|
/// \return value 0 no memory available or internal error
|
||||||
|
TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);
|
||||||
|
|
||||||
|
/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
|
||||||
|
/// \param[in] id TrustZone memory slot identifier
|
||||||
|
/// \return execution status (1: success, 0: error)
|
||||||
|
uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);
|
||||||
|
|
||||||
|
/// Load secure context (called on RTOS thread context switch)
|
||||||
|
/// \param[in] id TrustZone memory slot identifier
|
||||||
|
/// \return execution status (1: success, 0: error)
|
||||||
|
uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);
|
||||||
|
|
||||||
|
/// Store secure context (called on RTOS thread context switch)
|
||||||
|
/// \param[in] id TrustZone memory slot identifier
|
||||||
|
/// \return execution status (1: success, 0: error)
|
||||||
|
uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);
|
||||||
|
|
||||||
|
#endif // TZ_CONTEXT_H
|
||||||
+201
@@ -0,0 +1,201 @@
|
|||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "{}"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright {yyyy} {name of copyright owner}
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
+4010
File diff suppressed because it is too large
Load Diff
+802
@@ -0,0 +1,802 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief This file contains all the functions prototypes for the HAL
|
||||||
|
* module driver.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_HAL_H
|
||||||
|
#define STM32MP1xx_HAL_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_conf.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HAL
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/** @defgroup HAL_Exported_Types HAL Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/** @defgroup HAL_Exported_Types_Group1 Tick Frequency
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_TICK_FREQ_10HZ = 100U,
|
||||||
|
HAL_TICK_FREQ_100HZ = 10U,
|
||||||
|
HAL_TICK_FREQ_1KHZ = 1U,
|
||||||
|
HAL_TICK_FREQ_DEFAULT = HAL_TICK_FREQ_1KHZ
|
||||||
|
} HAL_TickFreqTypeDef;
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Types_Group2 HDP SW Signal
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HDP SW Signal SET and Bit RESET enumeration
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HDP_SW_SIGNAL_RESET = 0,
|
||||||
|
HDP_SW_SIGNAL_SET
|
||||||
|
}HDP_SwSignalState;
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Constants HAL Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Constants_Group1 SYSCFG VREFBUF Voltage Scale
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define SYSCFG_VREFBUF_VOLTAGE_SCALE0 VREFBUF_CSR_VRS_OUT2 /*!< Voltage reference scale 0 (VREF_OUT2) */
|
||||||
|
#define SYSCFG_VREFBUF_VOLTAGE_SCALE1 VREFBUF_CSR_VRS_OUT1 /*!< Voltage reference scale 1 (VREF_OUT1) */
|
||||||
|
#define SYSCFG_VREFBUF_VOLTAGE_SCALE2 VREFBUF_CSR_VRS_OUT4 /*!< Voltage reference scale 2 (VREF_OUT4) */
|
||||||
|
#define SYSCFG_VREFBUF_VOLTAGE_SCALE3 VREFBUF_CSR_VRS_OUT3 /*!< Voltage reference scale 3 (VREF_OUT3) */
|
||||||
|
|
||||||
|
|
||||||
|
#define IS_SYSCFG_VREFBUF_VOLTAGE_SCALE(__SCALE__) (((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE0) || \
|
||||||
|
((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE1) || \
|
||||||
|
((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE2) || \
|
||||||
|
((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE3))
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Constants_Group2 SYSCFG VREFBUF High Impedance
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE ((uint32_t)0x00000000) /*!< VREF_plus pin is internally connected to Voltage reference buffer output */
|
||||||
|
#define SYSCFG_VREFBUF_HIGH_IMPEDANCE_ENABLE VREFBUF_CSR_HIZ /*!< VREF_plus pin is high impedance */
|
||||||
|
|
||||||
|
#define IS_SYSCFG_VREFBUF_HIGH_IMPEDANCE(__VALUE__) (((__VALUE__) == SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE) || \
|
||||||
|
((__VALUE__) == SYSCFG_VREFBUF_HIGH_IMPEDANCE_ENABLE))
|
||||||
|
|
||||||
|
#define IS_SYSCFG_VREFBUF_TRIMMING(__VALUE__) (((__VALUE__) > 0) && ((__VALUE__) <= VREFBUF_CCR_TRIM))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Constants_Group3 SYSCFG Ethernet Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SYSCFG_ETH_MII SYSCFG_PMCSETR_ETH_SELMII_SEL /*!< Select the Media Independent Interface */
|
||||||
|
#define SYSCFG_ETH_GMII ((uint32_t)0x00000000) /*!< Select the Gigabit Media Independent Interface */
|
||||||
|
#define SYSCFG_ETH_RMII SYSCFG_PMCSETR_ETH_SEL_2 /*!< Select the Reduced Media Independent Interface */
|
||||||
|
#define SYSCFG_ETH_RGMII SYSCFG_PMCSETR_ETH_SEL_0 /*!< Select the Reduced Gigabit Media Independent Interface */
|
||||||
|
|
||||||
|
#define IS_SYSCFG_ETHERNET_CONFIG(CONFIG) (((CONFIG) == SYSCFG_ETH_MII) || \
|
||||||
|
((CONFIG) == SYSCFG_ETH_RMII) || \
|
||||||
|
((CONFIG) == SYSCFG_ETH_GMII) || \
|
||||||
|
((CONFIG) == SYSCFG_ETH_RGMII))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Constants_Group4 SYSCFG Analog Switch Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define SYSCFG_SWITCH_PA0 SYSCFG_PMCSETR_ANA0_SEL_SEL /*!< Select PA0 analog switch */
|
||||||
|
#define SYSCFG_SWITCH_PA1 SYSCFG_PMCSETR_ANA1_SEL_SEL /*!< Select PA1 analog switch */
|
||||||
|
|
||||||
|
|
||||||
|
#define IS_SYSCFG_ANALOG_SWITCH(SWITCH) ((((SWITCH) & SYSCFG_SWITCH_PA0) == SYSCFG_SWITCH_PA0)|| \
|
||||||
|
(((SWITCH) & SYSCFG_SWITCH_PA1) == SYSCFG_SWITCH_PA1))
|
||||||
|
|
||||||
|
|
||||||
|
#define SYSCFG_SWITCH_PA0_OPEN SYSCFG_PMCSETR_ANA0_SEL_SEL /*!< PA0 analog switch opened */
|
||||||
|
#define SYSCFG_SWITCH_PA0_CLOSE ((uint32_t)0x00000000) /*!< PA0 analog switch closed */
|
||||||
|
#define SYSCFG_SWITCH_PA1_OPEN SYSCFG_PMCSETR_ANA1_SEL_SEL /*!< PA1 analog switch opened */
|
||||||
|
#define SYSCFG_SWITCH_PA1_CLOSE ((uint32_t)0x00000000) /*!< PA1 analog switch closed*/
|
||||||
|
|
||||||
|
#define IS_SYSCFG_SWITCH_STATE(STATE) ((((STATE) & SYSCFG_SWITCH_PA0_OPEN) == SYSCFG_SWITCH_PA0_OPEN) || \
|
||||||
|
(((STATE) & SYSCFG_SWITCH_PA0_CLOSE) == SYSCFG_SWITCH_PA0_CLOSE) || \
|
||||||
|
(((STATE) & SYSCFG_SWITCH_PA1_OPEN) == SYSCFG_SWITCH_PA1_OPEN) || \
|
||||||
|
(((STATE) & SYSCFG_SWITCH_PA1_CLOSE) == SYSCFG_SWITCH_PA1_CLOSE))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Constants_Group5 SYSCFG IOCompenstionCell Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define SYSCFG_CELL_CODE ((uint32_t)0x00000000) /*!< Select Code from the cell */
|
||||||
|
#define SYSCFG_REGISTER_CODE SYSCFG_CMPCR_SW_CTRL /*!< Code from the SYSCFG compensation cell code register */
|
||||||
|
|
||||||
|
#define IS_SYSCFG_CODE_SELECT(SELECT) (((SELECT) == SYSCFG_CELL_CODE)|| \
|
||||||
|
((SELECT) == SYSCFG_REGISTER_CODE))
|
||||||
|
|
||||||
|
#define IS_SYSCFG_CODE_CONFIG(CONFIG) ((CONFIG) < (0x10))
|
||||||
|
|
||||||
|
/** @brief Check SYSCFG Compensation Cell Ready flag is set or not.
|
||||||
|
* @retval State of bit (1 or 0)
|
||||||
|
*/
|
||||||
|
#define __HAL_SYSCFG_CMP_CELL_GET_FLAG() ((READ_BIT(SYSCFG->CMPCR, SYSCFG_CMPCR_READY) == (SYSCFG_CMPCR_READY)) ? 1U : 0U)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get I/O compensation cell value for PMOS transistors
|
||||||
|
* @retval The I/O compensation cell value for PMOS transistors
|
||||||
|
*/
|
||||||
|
#define __HAL_SYSCFG_GET_PMOS_CMP() (READ_BIT(SYSCFG->CMPCR, SYSCFG_CMPCR_APSRC))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get I/O compensation cell value for NMOS transistors
|
||||||
|
* @retval Returned value is the I/O compensation cell value for NMOS transistors
|
||||||
|
*/
|
||||||
|
#define __HAL_SYSCFG_GET_NMOS_CMP() (READ_BIT(SYSCFG->CMPCR, SYSCFG_CMPCR_ANSRC))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Constants_Group6 SYSCFG IOControl HighSpeed Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SYSCFG_HIGHSPEED_TRACE_SIGNAL SYSCFG_IOCTRLSETR_HSLVEN_TRACE /*!< High Speed Low Voltage Pad mode Enable when a TRACEx signal is selected in AFMUX */
|
||||||
|
#define SYSCFG_HIGHSPEED_QUADSPI_SIGNAL SYSCFG_IOCTRLSETR_HSLVEN_QUADSPI /*!< High Speed Low Voltage Pad mode Enable when a QUADSPI_x signal is selected in AFMUX */
|
||||||
|
#define SYSCFG_HIGHSPEED_ETH_SIGNAL SYSCFG_IOCTRLSETR_HSLVEN_ETH /*!< High Speed Low Voltage Pad mode Enable when a ETH_x signal is selected in AFMUX */
|
||||||
|
#define SYSCFG_HIGHSPEED_SDMMC_SIGNAL SYSCFG_IOCTRLSETR_HSLVEN_SDMMC /*!< High Speed Low Voltage Pad mode Enable when a SDMMCy_x signal is selected in AFMUX */
|
||||||
|
#define SYSCFG_HIGHSPEED_SPI_SIGNAL SYSCFG_IOCTRLSETR_HSLVEN_SPI /*!< High Speed Low Voltage Pad mode Enable when a SPIy_x signal is selected in AFMUX */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** @defgroup HAL_Exported_Constants_Group7 HDP Software signal define
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define HDP_SW_SIGNAL_0 ((uint8_t)0x01U) /* HDP Software signal 0 selected */
|
||||||
|
#define HDP_SW_SIGNAL_1 ((uint8_t)0x02U) /* HDP Software signal 1 selected */
|
||||||
|
#define HDP_SW_SIGNAL_2 ((uint8_t)0x04U) /* HDP Software signal 2 selected */
|
||||||
|
#define HDP_SW_SIGNAL_3 ((uint8_t)0x08U) /* HDP Software signal 3 selected */
|
||||||
|
#define HDP_SW_SIGNAL_4 ((uint8_t)0x10U) /* HDP Software signal 4 selected */
|
||||||
|
#define HDP_SW_SIGNAL_5 ((uint8_t)0x20U) /* HDP Software signal 5 selected */
|
||||||
|
#define HDP_SW_SIGNAL_6 ((uint8_t)0x40U) /* HDP Software signal 6 selected */
|
||||||
|
#define HDP_SW_SIGNAL_7 ((uint8_t)0x80U) /* HDP Software signal 7 selected */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup DBGMCU_Exported_Macros DBGMCU Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @brief Freeze/Unfreeze Peripherals in Debug mode
|
||||||
|
*/
|
||||||
|
#if defined (CORE_CM4)
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM2_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM2() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM2_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM2() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM2_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM3_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM3() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM3_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM3() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM3_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM4_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM4() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM4_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM4() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM4_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM5_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM5() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM5_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM5() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM5_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM6_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM6() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM6_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM6() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM6_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM7_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM7() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM7_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM7() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM7_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM12_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM12() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM12_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM12() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM12_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM13_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM13() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM13_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM13() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM13_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM14_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM14() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM14_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM14() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_TIM14_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_LPTIM1_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM1() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_LPTIM1_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM1() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_LPTIM1_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_WWDG1_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_WWDG1() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_WWDG1_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_WWDG1() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_WWDG1_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_I2C1_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C1() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_I2C1_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C1() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_I2C1_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_I2C2_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C2() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_I2C2_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C2() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_I2C2_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_I2C3_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C3() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_I2C3_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C3() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_I2C3_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_I2C5_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C5() SET_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_I2C5_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C5() CLEAR_BIT(DBGMCU->APB1FZ2, DBGMCU_APB1_FZ_DBG_I2C5_STOP)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM1_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM1() SET_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM1_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM1() CLEAR_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM1_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM8_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM8() SET_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM8_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM8() CLEAR_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM8_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM15_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM15() SET_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM15_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM15() CLEAR_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM15_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM16_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM16() SET_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM16_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM16() CLEAR_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM16_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM17_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM17() SET_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM17_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM17() CLEAR_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_TIM17_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_FDCAN_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_FDCAN() SET_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_FDCAN_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_FDCAN() CLEAR_BIT(DBGMCU->APB2FZ2, DBGMCU_APB2_FZ_DBG_FDCAN_STOP)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DBGMCU_APB3_FZ_DBG_LPTIM2_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM2() SET_BIT(DBGMCU->APB3FZ2, DBGMCU_APB3_FZ_DBG_LPTIM2_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM2() CLEAR_BIT(DBGMCU->APB3FZ2, DBGMCU_APB3_FZ_DBG_LPTIM2_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB3_FZ_DBG_LPTIM3_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM3() SET_BIT(DBGMCU->APB3FZ2, DBGMCU_APB3_FZ_DBG_LPTIM3_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM3() CLEAR_BIT(DBGMCU->APB3FZ2, DBGMCU_APB3_FZ_DBG_LPTIM3_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB3_FZ_DBG_LPTIM4_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM4() SET_BIT(DBGMCU->APB3FZ2, DBGMCU_APB3_FZ_DBG_LPTIM4_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM4() CLEAR_BIT(DBGMCU->APB3FZ2, DBGMCU_APB3_FZ_DBG_LPTIM4_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB3_FZ_DBG_LPTIM5_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM5() SET_BIT(DBGMCU->APB3FZ2, DBGMCU_APB3_FZ_DBG_LPTIM5_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM5() CLEAR_BIT(DBGMCU->APB3FZ2, DBGMCU_APB3_FZ_DBG_LPTIM5_STOP)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DBGMCU_APB5_FZ_DBG_I2C4_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C4() SET_BIT(DBGMCU->APB5FZ2, DBGMCU_APB5_FZ_DBG_I2C4_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C4() CLEAR_BIT(DBGMCU->APB5FZ2, DBGMCU_APB5_FZ_DBG_I2C4_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB5_FZ_DBG_RTC_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_RTC() SET_BIT(DBGMCU->APB5FZ2, DBGMCU_APB5_FZ_DBG_RTC_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_RTC() CLEAR_BIT(DBGMCU->APB5FZ2, DBGMCU_APB5_FZ_DBG_RTC_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB5_FZ_DBG_I2C6_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C6() SET_BIT(DBGMCU->APB5FZ2, DBGMCU_APB5_FZ_DBG_I2C6_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C6() CLEAR_BIT(DBGMCU->APB5FZ2, DBGMCU_APB5_FZ_DBG_I2C6_STOP)
|
||||||
|
#endif
|
||||||
|
#elif defined(CORE_CA7)
|
||||||
|
|
||||||
|
#if defined(DBGMCU_APB4_FZ_DBG_IWDG2_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_IWDG2() SET_BIT(DBGMCU->APB4FZ1, DBGMCU_APB4_FZ_DBG_IWDG2_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_IWDG2() CLEAR_BIT(DBGMCU->APB4FZ1, DBGMCU_APB4_FZ_DBG_IWDG2_STOP)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM2_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM2() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM2_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM2() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM2_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM3_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM3() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM3_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM3() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM3_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM4_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM4() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM4_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM4() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM4_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM5_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM5() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM5_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM5() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM5_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM6_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM6() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM6_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM6() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM6_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM7_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM7() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM7_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM7() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM7_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM12_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM12() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM12_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM12() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM12_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM13_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM13() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM13_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM13() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM13_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_TIM14_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM14() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM14_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM14() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_TIM14_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_LPTIM1_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM1() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_LPTIM1_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM1() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_LPTIM1_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_WWDG1_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_WWDG1() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_WWDG1_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_WWDG1() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_WWDG1_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_I2C1_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C1() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_I2C1_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C1() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_I2C1_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_I2C2_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C2() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_I2C2_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C2() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_I2C2_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_I2C3_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C3() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_I2C3_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C3() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_I2C3_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB1_FZ_DBG_I2C5_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C5() SET_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_I2C5_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C5() CLEAR_BIT(DBGMCU->APB1FZ1, DBGMCU_APB1_FZ_DBG_I2C5_STOP)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM1_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM1() SET_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM1_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM1() CLEAR_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM1_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM8_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM8() SET_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM8_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM8() CLEAR_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM8_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM15_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM15() SET_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM15_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM15() CLEAR_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM15_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM16_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM16() SET_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM16_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM16() CLEAR_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM16_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_TIM17_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_TIM17() SET_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM17_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_TIM17() CLEAR_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_TIM17_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB2_FZ_DBG_FDCAN_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_FDCAN() SET_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_FDCAN_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_FDCAN() CLEAR_BIT(DBGMCU->APB2FZ1, DBGMCU_APB2_FZ_DBG_FDCAN_STOP)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DBGMCU_APB3_FZ_DBG_LPTIM2_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM2() SET_BIT(DBGMCU->APB3FZ1, DBGMCU_APB3_FZ_DBG_LPTIM2_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM2() CLEAR_BIT(DBGMCU->APB3FZ1, DBGMCU_APB3_FZ_DBG_LPTIM2_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB3_FZ_DBG_LPTIM3_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM3() SET_BIT(DBGMCU->APB3FZ1, DBGMCU_APB3_FZ_DBG_LPTIM3_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM3() CLEAR_BIT(DBGMCU->APB3FZ1, DBGMCU_APB3_FZ_DBG_LPTIM3_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB3_FZ_DBG_LPTIM4_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM4() SET_BIT(DBGMCU->APB3FZ1, DBGMCU_APB3_FZ_DBG_LPTIM4_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM4() CLEAR_BIT(DBGMCU->APB3FZ1, DBGMCU_APB3_FZ_DBG_LPTIM4_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB3_FZ_DBG_LPTIM5_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_LPTIM5() SET_BIT(DBGMCU->APB3FZ1, DBGMCU_APB3_FZ_DBG_LPTIM5_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_LPTIM5() CLEAR_BIT(DBGMCU->APB3FZ1, DBGMCU_APB3_FZ_DBG_LPTIM5_STOP)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DBGMCU_APB5_FZ_DBG_I2C4_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C4() SET_BIT(DBGMCU->APB5FZ1, DBGMCU_APB5_FZ_DBG_I2C4_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C4() CLEAR_BIT(DBGMCU->APB5FZ1, DBGMCU_APB5_FZ_DBG_I2C4_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB5_FZ_DBG_IWDG1_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_IWDG1() SET_BIT(DBGMCU->APB5FZ1, DBGMCU_APB5_FZ_DBG_IWDG1_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_IWDG1() CLEAR_BIT(DBGMCU->APB5FZ1, DBGMCU_APB5_FZ_DBG_IWDG1_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB5_FZ_DBG_RTC_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_RTC() SET_BIT(DBGMCU->APB5FZ1, DBGMCU_APB5_FZ_DBG_RTC_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_RTC() CLEAR_BIT(DBGMCU->APB5FZ1, DBGMCU_APB5_FZ_DBG_RTC_STOP)
|
||||||
|
#endif
|
||||||
|
#if defined(DBGMCU_APB5_FZ_DBG_I2C6_STOP)
|
||||||
|
#define __HAL_DBGMCU_FREEZE_I2C6() SET_BIT(DBGMCU->APB5FZ1, DBGMCU_APB5_FZ_DBG_I2C6_STOP)
|
||||||
|
#define __HAL_DBGMCU_UNFREEZE_I2C6() CLEAR_BIT(DBGMCU->APB5FZ1, DBGMCU_APB5_FZ_DBG_I2C6_STOP)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HDP_Exported_Macros HDP Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HDP_Enable
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP_ENABLE() SET_BIT(HDP->HDP_CTRL, HDP_CTRL_EN)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** @addtogroup HDP_Configure_SW_Programmable_Signals
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @brief This macros allows atomic write of HDP_GPOVAL register
|
||||||
|
It uses HDP_GPOSET and HDP_GPOCLR regsiters to toogle
|
||||||
|
*
|
||||||
|
* @param __HDP_SW_Signal__: specifies the sw signal bit to be written.
|
||||||
|
* This parameter can be one of HDP_SW_SIGNAL_x(s) where x can be (0..7).
|
||||||
|
* @param __HDP_SwSignalState__: specifies the value to be written to the selected bit.
|
||||||
|
* This parameter can be one of the HDP_SwSignalState enum values:
|
||||||
|
* @arg HDP_SW_SIGNAL_RESET: to clear the signal pin
|
||||||
|
* @arg HDP_SW_SIGNAL_SET: to set the signal pin
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP_ATOMIC_WRITE_GPOVAL(__HDP_SW_Signal__, __HDP_SwSignalState__) \
|
||||||
|
do { \
|
||||||
|
if ((__HDP_SwSignalState__) != HDP_SW_SIGNAL_RESET) \
|
||||||
|
{ \
|
||||||
|
WRITE_REG(HDP->HDP_GPOSET, (uint8_t)(__HDP_SW_Signal__)); \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
WRITE_REG(HDP->HDP_GPOCLR, (uint8_t)(__HDP_SW_Signal__)); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
|
/** @brief This macros allows non-atomic write of HDP_GPOVAL register
|
||||||
|
*
|
||||||
|
* @param __GPOValue__: specifies the value to set in HDP_GPOVAL register
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP_NON_ATOMIC_WRITE_GPOVAL(__GPOValue__) WRITE_REG(HDP->HDP_GPOVAL, (uint8_t)(__GPOValue__))
|
||||||
|
|
||||||
|
/** @brief This macros returns value of HDP_GPOVAL register
|
||||||
|
*
|
||||||
|
* @retval the value to set in HDP_GPOVAL register
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP_READ_GPOVAL() READ_REG(HDP->HDP_GPOVAL)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HDP0_MUX0_Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP0_SELECT_PWR_PWRWAKE_SYS() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) 0x00000000))
|
||||||
|
#define __HAL_HDP0_SELECT_CM4_SLEEPDEEP() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) HDP_MUX_MUX0_0))
|
||||||
|
#define __HAL_HDP0_SELECT_PWR_STDBY_WKUP() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) HDP_MUX_MUX0_1))
|
||||||
|
#define __HAL_HDP0_SELECT_PWR_ENCOMP_VDDCORE() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) HDP_MUX_MUX0_1 | HDP_MUX_MUX0_0))
|
||||||
|
#define __HAL_HDP0_SELECT_BSEC_OUT_SEC_NIDEN() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) HDP_MUX_MUX0_2))
|
||||||
|
#define __HAL_HDP0_SELECT_RCC_CM4_SLEEPDEEP() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) HDP_MUX_MUX0_2 | HDP_MUX_MUX0_1))
|
||||||
|
#define __HAL_HDP0_SELECT_GPU_DBG7() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) HDP_MUX_MUX0_2 | HDP_MUX_MUX0_1 | HDP_MUX_MUX0_0))
|
||||||
|
#define __HAL_HDP0_SELECT_DDRCTRL_IP_REQ() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) HDP_MUX_MUX0_3))
|
||||||
|
#define __HAL_HDP0_SELECT_PWR_DDR_RET_ENABLE_N() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) HDP_MUX_MUX0_3 | HDP_MUX_MUX0_0))
|
||||||
|
#define __HAL_HDP0_SELECT_GPOVAL_0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX0, ((uint32_t) HDP_MUX_MUX0_3 | HDP_MUX_MUX0_2 | HDP_MUX_MUX0_1 | HDP_MUX_MUX0_0))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HDP1_MUX1_Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP1_SELECT_PWR_PWRWAKE_MCU() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) 0x00000000))
|
||||||
|
#define __HAL_HDP1_SELECT_CM4_HALTED() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_0))
|
||||||
|
#define __HAL_HDP1_SELECT_CA7_nAXIERRIRQ() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_1))
|
||||||
|
#define __HAL_HDP1_SELECT_PWR_OKIN_MR() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_1 | HDP_MUX_MUX1_0))
|
||||||
|
#define __HAL_HDP1_SELECT_BSEC_OUT_SEC_DBGEN() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_2))
|
||||||
|
#define __HAL_HDP1_SELECT_EXTI_SYS_WAKEUP() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_2 | HDP_MUX_MUX1_0))
|
||||||
|
#define __HAL_HDP1_SELECT_RCC_PWRDS_MPU() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_2 | HDP_MUX_MUX1_1))
|
||||||
|
#define __HAL_HDP1_SELECT_GPU_DBG6() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_2 | HDP_MUX_MUX1_1 | HDP_MUX_MUX1_0))
|
||||||
|
#define __HAL_HDP1_SELECT_DDRCTRL_DFI_CTRLUPD_REQ() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_3))
|
||||||
|
#define __HAL_HDP1_SELECT_DDRCTRL_CACTIVE_DDRC_ASR() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_3 | HDP_MUX_MUX1_0))
|
||||||
|
#define __HAL_HDP1_SELECT_GPOVAL_1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX1, ((uint32_t) HDP_MUX_MUX1_3 | HDP_MUX_MUX1_2 | HDP_MUX_MUX1_1 | HDP_MUX_MUX1_0))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HDP2_MUX2_Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP2_SELECT_PWR_PWRWAKE_MPU() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) 0x00000000))
|
||||||
|
#define __HAL_HDP2_SELECT_CM4_RXEV() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_0))
|
||||||
|
#define __HAL_HDP2_SELECT_CA7_nPMUIRQ1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_1))
|
||||||
|
#define __HAL_HDP2_SELECT_CA7_nFIQOUT1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_1 | HDP_MUX_MUX2_0))
|
||||||
|
#define __HAL_HDP2_SELECT_BSEC_IN_RSTCORE_n() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_2))
|
||||||
|
#define __HAL_HDP2_SELECT_EXTI_C2_WAKEUP() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_2 | HDP_MUX_MUX2_0))
|
||||||
|
#define __HAL_HDP2_SELECT_RCC_PWRDS_MCU() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_2 | HDP_MUX_MUX2_1))
|
||||||
|
#define __HAL_HDP2_SELECT_GPU_DBG5() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_2 | HDP_MUX_MUX2_1 | HDP_MUX_MUX2_0))
|
||||||
|
#define __HAL_HDP2_SELECT_DDRCTRL_DFI_INIT_COMPLETE() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_3))
|
||||||
|
#define __HAL_HDP2_SELECT_DDRCTRL_PERF_OP_IS_REFRESH() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_3 | HDP_MUX_MUX2_0))
|
||||||
|
#define __HAL_HDP2_SELECT_DDRCTRL_GSKP_DFI_LP_REQ() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_3 | HDP_MUX_MUX2_1))
|
||||||
|
#define __HAL_HDP2_SELECT_GPOVAL_2() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX2, ((uint32_t) HDP_MUX_MUX2_3 | HDP_MUX_MUX2_2 | HDP_MUX_MUX2_1 | HDP_MUX_MUX2_0))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HDP3_MUX3_Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP3_SELECT_PWR_SEL_VTH_VDD_CORE() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) 0x00000000))
|
||||||
|
#define __HAL_HDP3_SELECT_CM4_TXEV() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_0))
|
||||||
|
#define __HAL_HDP3_SELECT_CA7_nPMUIRQ0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_1))
|
||||||
|
#define __HAL_HDP3_SELECT_CA7_nFIQOUT0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_1 | HDP_MUX_MUX3_0))
|
||||||
|
#define __HAL_HDP3_SELECT_BSEC_OUT_SEC_DFTLOCK() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_2))
|
||||||
|
#define __HAL_HDP3_SELECT_EXTI_C1_WAKEUP() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_2 | HDP_MUX_MUX3_0))
|
||||||
|
#define __HAL_HDP3_SELECT_RCC_PWRDS_SYS() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_2 | HDP_MUX_MUX3_1))
|
||||||
|
#define __HAL_HDP3_SELECT_GPU_DBG4() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_2 | HDP_MUX_MUX3_1 | HDP_MUX_MUX3_0))
|
||||||
|
#define __HAL_HDP3_SELECT_DDRCTRL_STAT_DDRC_REG_SELREF_TYPE_0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_3))
|
||||||
|
#define __HAL_HDP3_SELECT_DDRCTRL_CACTIVE_1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_3 | HDP_MUX_MUX3_0))
|
||||||
|
#define __HAL_HDP3_SELECT_GPOVAL_3() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX3, ((uint32_t) HDP_MUX_MUX3_3 | HDP_MUX_MUX3_2 | HDP_MUX_MUX3_1 | HDP_MUX_MUX3_0))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HDP4_MUX4_Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP4_SELECT_PWR_MPUCR() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) 0x00000000))
|
||||||
|
#define __HAL_HDP4_SELECT_CM4_SLEEPING() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_0))
|
||||||
|
#define __HAL_HDP4_SELECT_CA7_nRESET1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_1))
|
||||||
|
#define __HAL_HDP4_SELECT_CA7_nIRQOUT1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_1 | HDP_MUX_MUX4_0))
|
||||||
|
#define __HAL_HDP4_SELECT_BSEC_OUT_SEC_DFTEN() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_2))
|
||||||
|
#define __HAL_HDP4_SELECT_BSEC_OUT_SEC_DBGSWENABLE() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_2 | HDP_MUX_MUX4_0))
|
||||||
|
#define __HAL_HDP4_SELECT_ETH_OUT_PMT_INTR_0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_2 | HDP_MUX_MUX4_1))
|
||||||
|
#define __HAL_HDP4_SELECT_GPU_DBG3() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_2 | HDP_MUX_MUX4_1 | HDP_MUX_MUX4_0))
|
||||||
|
#define __HAL_HDP4_SELECT_DDRCTRL_STAT_DDRC_REG_SELREF_TYPE_1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_3))
|
||||||
|
#define __HAL_HDP4_SELECT_DDRCTRL_CACTIVE_0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_3 | HDP_MUX_MUX4_0))
|
||||||
|
#define __HAL_HDP4_SELECT_GPOVAL_4() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX4, ((uint32_t) HDP_MUX_MUX4_3 | HDP_MUX_MUX4_2 | HDP_MUX_MUX4_1 | HDP_MUX_MUX4_0))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HDP5_MUX5_Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP5_SELECT_CA7_STANDBYWFIL2() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) 0x00000000))
|
||||||
|
#define __HAL_HDP5_SELECT_PWR_VTH_VDDCORE_ACK() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_0))
|
||||||
|
#define __HAL_HDP5_SELECT_CA7_nRESET0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_1))
|
||||||
|
#define __HAL_HDP5_SELECT_CA7_nIRQOUT0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_1 | HDP_MUX_MUX5_0))
|
||||||
|
#define __HAL_HDP5_SELECT_BSEC_IN_PWROK() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_2))
|
||||||
|
#define __HAL_HDP5_SELECT_BSEC_OUT_SEC_DEVICEEN() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_2 | HDP_MUX_MUX5_0))
|
||||||
|
#define __HAL_HDP5_SELECT_ETH_OUT_LPI_INTR_0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_2 | HDP_MUX_MUX5_1))
|
||||||
|
#define __HAL_HDP5_SELECT_GPU_DBG2() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_2 | HDP_MUX_MUX5_1 | HDP_MUX_MUX5_0))
|
||||||
|
#define __HAL_HDP5_SELECT_DDRCTRL_CACTIVE_DDRC() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_3))
|
||||||
|
#define __HAL_HDP5_SELECT_DDRCTRL_WR_CREDIT_CNT_4_0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_3 | HDP_MUX_MUX5_0)))
|
||||||
|
#define __HAL_HDP5_SELECT_GPOVAL_5() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX5, ((uint32_t) HDP_MUX_MUX5_3 | HDP_MUX_MUX5_2 | HDP_MUX_MUX5_1 | HDP_MUX_MUX5_0))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HDP6_MUX6_Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP6_SELECT_CA7_STANDBYWFI1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) 0x00000000))
|
||||||
|
#define __HAL_HDP6_SELECT_CA7_STANDBYWFE1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) HDP_MUX_MUX6_0))
|
||||||
|
#define __HAL_HDP6_SELECT_CA7_EVENTO() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) HDP_MUX_MUX6_1))
|
||||||
|
#define __HAL_HDP6_SELECT_CA7_DBGACK1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) HDP_MUX_MUX6_1 | HDP_MUX_MUX6_0))
|
||||||
|
#define __HAL_HDP6_SELECT_BSEC_OUT_SEC_SPNIDEN() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) HDP_MUX_MUX6_2 | HDP_MUX_MUX6_0))
|
||||||
|
#define __HAL_HDP6_SELECT_ETH_OUT_MAC_SPEED_O1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) HDP_MUX_MUX6_2 | HDP_MUX_MUX6_1))
|
||||||
|
#define __HAL_HDP6_SELECT_GPU_DBG1() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) HDP_MUX_MUX6_2 | HDP_MUX_MUX6_1 | HDP_MUX_MUX6_0))
|
||||||
|
#define __HAL_HDP6_SELECT_DDRCTRL_CSYSACK_DDRC() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) HDP_MUX_MUX6_3))
|
||||||
|
#define __HAL_HDP6_SELECT_DDRCTRL_LPR_CREDIT_CNT_4_0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) HDP_MUX_MUX6_3 | HDP_MUX_MUX6_0))
|
||||||
|
#define __HAL_HDP6_SELECT_GPOVAL_6() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX6, ((uint32_t) HDP_MUX_MUX6_3 | HDP_MUX_MUX6_2 | HDP_MUX_MUX6_1 | HDP_MUX_MUX6_0))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HDP7_MUX7_Config
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define __HAL_HDP7_SELECT_CA7_STANDBYWFI0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) 0x00000000))
|
||||||
|
#define __HAL_HDP7_SELECT_CA7_STANDBYWFE0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) HDP_MUX_MUX7_0))
|
||||||
|
#define __HAL_HDP7_SELECT_CA7_DBGACK0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) HDP_MUX_MUX7_1 | HDP_MUX_MUX7_0))
|
||||||
|
#define __HAL_HDP7_SELECT_BSEC_OUT_FUSE_OK() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) HDP_MUX_MUX7_2))
|
||||||
|
#define __HAL_HDP7_SELECT_BSEC_OUT_SEC_SPIDEN() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) HDP_MUX_MUX7_2 | HDP_MUX_MUX7_0))
|
||||||
|
#define __HAL_HDP7_SELECT_ETH_OUT_MAC_SPEED_O0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) HDP_MUX_MUX7_2 | HDP_MUX_MUX7_1))
|
||||||
|
#define __HAL_HDP7_SELECT_GPU_DBG0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) HDP_MUX_MUX7_2 | HDP_MUX_MUX7_1 | HDP_MUX_MUX7_0))
|
||||||
|
#define __HAL_HDP7_SELECT_DDRCTRL_CSYSREQ_DDRC() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) HDP_MUX_MUX7_3))
|
||||||
|
#define __HAL_HDP7_SELECT_DDRCTRL_HPR_CREDIT_CNT_4_0() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) HDP_MUX_MUX7_3 | HDP_MUX_MUX7_0))
|
||||||
|
#define __HAL_HDP7_SELECT_GPOVAL_7() MODIFY_REG(HDP->HDP_MUX, HDP_MUX_MUX7, ((uint32_t) HDP_MUX_MUX7_3 | HDP_MUX_MUX7_2 | HDP_MUX_MUX7_1 | HDP_MUX_MUX7_0))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** @defgroup HAL_Private_Macros HAL Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_TICKFREQ(FREQ) (((FREQ) == HAL_TICK_FREQ_10HZ) || \
|
||||||
|
((FREQ) == HAL_TICK_FREQ_100HZ) || \
|
||||||
|
((FREQ) == HAL_TICK_FREQ_1KHZ))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported variables --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @addtogroup HAL_Exported_Variables
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
extern __IO uint32_t uwTick;
|
||||||
|
extern uint32_t uwTickPrio;
|
||||||
|
extern HAL_TickFreqTypeDef uwTickFreq;
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup HAL_Exported_Functions HAL Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Initialization and de-initialization functions ******************************/
|
||||||
|
/** @defgroup HAL_Exported_Functions_Group1 Initialization and de-initialization functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef HAL_Init(void);
|
||||||
|
HAL_StatusTypeDef HAL_DeInit(void);
|
||||||
|
void HAL_MspInit(void);
|
||||||
|
void HAL_MspDeInit(void);
|
||||||
|
HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority);
|
||||||
|
|
||||||
|
void HAL_EnableDBGWakeUp(void);
|
||||||
|
void HAL_DisableDBGWakeUp(void);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Peripheral Control functions ************************************************/
|
||||||
|
/** @defgroup HAL_Exported_Functions_Group2 Peripheral Control functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
void HAL_IncTick(void);
|
||||||
|
void HAL_Delay(uint32_t Delay);
|
||||||
|
uint32_t HAL_GetTick(void);
|
||||||
|
uint32_t HAL_GetTickPrio(void);
|
||||||
|
HAL_StatusTypeDef HAL_SetTickFreq(HAL_TickFreqTypeDef Freq);
|
||||||
|
HAL_TickFreqTypeDef HAL_GetTickFreq(void);
|
||||||
|
void HAL_SuspendTick(void);
|
||||||
|
void HAL_ResumeTick(void);
|
||||||
|
uint32_t HAL_GetHalVersion(void);
|
||||||
|
uint32_t HAL_GetREVID(void);
|
||||||
|
uint32_t HAL_GetDEVID(void);
|
||||||
|
uint32_t HAL_GetUIDw0(void);
|
||||||
|
uint32_t HAL_GetUIDw1(void);
|
||||||
|
uint32_t HAL_GetUIDw2(void);
|
||||||
|
void HAL_SYSCFG_ETHInterfaceSelect(uint32_t SYSCFG_ETHInterface);
|
||||||
|
void HAL_SYSCFG_AnalogSwitchConfig(uint32_t SYSCFG_AnalogSwitch , uint32_t SYSCFG_SwitchState );
|
||||||
|
void HAL_SYSCFG_EnableBOOST(void);
|
||||||
|
void HAL_SYSCFG_DisableBOOST(void);
|
||||||
|
void HAL_EnableCompensationCell(void);
|
||||||
|
void HAL_DisableCompensationCell(void);
|
||||||
|
void HAL_SYSCFG_EnableIOSpeedOptimize(uint32_t SYSCFG_HighSpeedSignal);
|
||||||
|
void HAL_SYSCFG_DisableIOSpeedOptimize(uint32_t SYSCFG_HighSpeedSignal);
|
||||||
|
void HAL_SYSCFG_CompensationCodeSelect(uint32_t SYSCFG_CompCode);
|
||||||
|
void HAL_SYSCFG_CompensationCodeConfig(uint32_t SYSCFG_PMOSCode, uint32_t SYSCFG_NMOSCode);
|
||||||
|
HAL_StatusTypeDef HAL_SYSCFG_EnableIOCompensation(void);
|
||||||
|
void HAL_SYSCFG_DisableIOCompensation(void);
|
||||||
|
void HAL_EnableDBGSleepMode(void);
|
||||||
|
void HAL_DisableDBGSleepMode(void);
|
||||||
|
void HAL_EnableDBGStopMode(void);
|
||||||
|
void HAL_DisableDBGStopMode(void);
|
||||||
|
void HAL_EnableDBGStandbyMode(void);
|
||||||
|
void HAL_DisableDBGStandbyMode(void);
|
||||||
|
void HAL_EnableDBGWakeUp(void);
|
||||||
|
void HAL_DisableDBGWakeUp(void);
|
||||||
|
void HAL_SYSCFG_VREFBUF_VoltageScalingConfig(uint32_t VoltageScaling);
|
||||||
|
void HAL_SYSCFG_VREFBUF_HighImpedanceConfig(uint32_t Mode);
|
||||||
|
void HAL_SYSCFG_VREFBUF_TrimmingConfig(uint32_t TrimmingValue);
|
||||||
|
HAL_StatusTypeDef HAL_SYSCFG_EnableVREFBUF(void);
|
||||||
|
void HAL_SYSCFG_DisableVREFBUF(void);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_HAL_H */
|
||||||
+437
@@ -0,0 +1,437 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_cortex.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of CORTEX HAL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32MP1xx_HAL_CORTEX_H
|
||||||
|
#define __STM32MP1xx_HAL_CORTEX_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CORTEX
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/** @defgroup CORTEX_Exported_Types Cortex Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if (__MPU_PRESENT == 1)
|
||||||
|
/** @defgroup CORTEX_MPU_Region_Initialization_Structure_definition MPU Region Initialization Structure Definition
|
||||||
|
* @brief MPU Region initialization structure
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint8_t Enable; /*!< Specifies the status of the region.
|
||||||
|
This parameter can be a value of @ref CORTEX_MPU_Region_Enable */
|
||||||
|
uint8_t Number; /*!< Specifies the number of the region to protect.
|
||||||
|
This parameter can be a value of @ref CORTEX_MPU_Region_Number */
|
||||||
|
uint32_t BaseAddress; /*!< Specifies the base address of the region to protect. */
|
||||||
|
uint8_t Size; /*!< Specifies the size of the region to protect.
|
||||||
|
This parameter can be a value of @ref CORTEX_MPU_Region_Size */
|
||||||
|
uint8_t SubRegionDisable; /*!< Specifies the number of the subregion protection to disable.
|
||||||
|
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF */
|
||||||
|
uint8_t TypeExtField; /*!< Specifies the TEX field level.
|
||||||
|
This parameter can be a value of @ref CORTEX_MPU_TEX_Levels */
|
||||||
|
uint8_t AccessPermission; /*!< Specifies the region access permission type.
|
||||||
|
This parameter can be a value of @ref CORTEX_MPU_Region_Permission_Attributes */
|
||||||
|
uint8_t DisableExec; /*!< Specifies the instruction access status.
|
||||||
|
This parameter can be a value of @ref CORTEX_MPU_Instruction_Access */
|
||||||
|
uint8_t IsShareable; /*!< Specifies the shareability status of the protected region.
|
||||||
|
This parameter can be a value of @ref CORTEX_MPU_Access_Shareable */
|
||||||
|
uint8_t IsCacheable; /*!< Specifies the cacheable status of the region protected.
|
||||||
|
This parameter can be a value of @ref CORTEX_MPU_Access_Cacheable */
|
||||||
|
uint8_t IsBufferable; /*!< Specifies the bufferable status of the protected region.
|
||||||
|
This parameter can be a value of @ref CORTEX_MPU_Access_Bufferable */
|
||||||
|
} MPU_Region_InitTypeDef;
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
#endif /* __MPU_PRESENT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_Exported_Constants CORTEX Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_Preemption_Priority_Group CORTEX Preemption Priority Group
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define NVIC_PRIORITYGROUP_0 ((uint32_t)0x00000007) /*!< 0 bits for pre-emption priority
|
||||||
|
4 bits for subpriority */
|
||||||
|
#define NVIC_PRIORITYGROUP_1 ((uint32_t)0x00000006) /*!< 1 bits for pre-emption priority
|
||||||
|
3 bits for subpriority */
|
||||||
|
#define NVIC_PRIORITYGROUP_2 ((uint32_t)0x00000005) /*!< 2 bits for pre-emption priority
|
||||||
|
2 bits for subpriority */
|
||||||
|
#define NVIC_PRIORITYGROUP_3 ((uint32_t)0x00000004) /*!< 3 bits for pre-emption priority
|
||||||
|
1 bits for subpriority */
|
||||||
|
#define NVIC_PRIORITYGROUP_4 ((uint32_t)0x00000003) /*!< 4 bits for pre-emption priority
|
||||||
|
0 bits for subpriority */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if (__MPU_PRESENT == 1)
|
||||||
|
/** @defgroup CORTEX_MPU_HFNMI_PRIVDEF_Control MPU HFNMI and PRIVILEGED Access control
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_HFNMI_PRIVDEF_NONE ((uint32_t)0x00000000)
|
||||||
|
#define MPU_HARDFAULT_NMI ((uint32_t)0x00000002)
|
||||||
|
#define MPU_PRIVILEGED_DEFAULT ((uint32_t)0x00000004)
|
||||||
|
#define MPU_HFNMI_PRIVDEF ((uint32_t)0x00000006)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_MPU_Region_Enable CORTEX MPU Region Enable
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_REGION_ENABLE ((uint8_t)0x01)
|
||||||
|
#define MPU_REGION_DISABLE ((uint8_t)0x00)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_MPU_Instruction_Access CORTEX MPU Instruction Access
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_INSTRUCTION_ACCESS_ENABLE ((uint8_t)0x00)
|
||||||
|
#define MPU_INSTRUCTION_ACCESS_DISABLE ((uint8_t)0x01)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_MPU_Access_Shareable CORTEX MPU Instruction Access Shareable
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_ACCESS_SHAREABLE ((uint8_t)0x01)
|
||||||
|
#define MPU_ACCESS_NOT_SHAREABLE ((uint8_t)0x00)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_MPU_Access_Cacheable CORTEX MPU Instruction Access Cacheable
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_ACCESS_CACHEABLE ((uint8_t)0x01)
|
||||||
|
#define MPU_ACCESS_NOT_CACHEABLE ((uint8_t)0x00)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_MPU_Access_Bufferable CORTEX MPU Instruction Access Bufferable
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_ACCESS_BUFFERABLE ((uint8_t)0x01)
|
||||||
|
#define MPU_ACCESS_NOT_BUFFERABLE ((uint8_t)0x00)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_MPU_TEX_Levels MPU TEX Levels
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_TEX_LEVEL0 ((uint8_t)0x00)
|
||||||
|
#define MPU_TEX_LEVEL1 ((uint8_t)0x01)
|
||||||
|
#define MPU_TEX_LEVEL2 ((uint8_t)0x02)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_MPU_Region_Size CORTEX MPU Region Size
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_REGION_SIZE_32B ((uint8_t)0x04)
|
||||||
|
#define MPU_REGION_SIZE_64B ((uint8_t)0x05)
|
||||||
|
#define MPU_REGION_SIZE_128B ((uint8_t)0x06)
|
||||||
|
#define MPU_REGION_SIZE_256B ((uint8_t)0x07)
|
||||||
|
#define MPU_REGION_SIZE_512B ((uint8_t)0x08)
|
||||||
|
#define MPU_REGION_SIZE_1KB ((uint8_t)0x09)
|
||||||
|
#define MPU_REGION_SIZE_2KB ((uint8_t)0x0A)
|
||||||
|
#define MPU_REGION_SIZE_4KB ((uint8_t)0x0B)
|
||||||
|
#define MPU_REGION_SIZE_8KB ((uint8_t)0x0C)
|
||||||
|
#define MPU_REGION_SIZE_16KB ((uint8_t)0x0D)
|
||||||
|
#define MPU_REGION_SIZE_32KB ((uint8_t)0x0E)
|
||||||
|
#define MPU_REGION_SIZE_64KB ((uint8_t)0x0F)
|
||||||
|
#define MPU_REGION_SIZE_128KB ((uint8_t)0x10)
|
||||||
|
#define MPU_REGION_SIZE_256KB ((uint8_t)0x11)
|
||||||
|
#define MPU_REGION_SIZE_512KB ((uint8_t)0x12)
|
||||||
|
#define MPU_REGION_SIZE_1MB ((uint8_t)0x13)
|
||||||
|
#define MPU_REGION_SIZE_2MB ((uint8_t)0x14)
|
||||||
|
#define MPU_REGION_SIZE_4MB ((uint8_t)0x15)
|
||||||
|
#define MPU_REGION_SIZE_8MB ((uint8_t)0x16)
|
||||||
|
#define MPU_REGION_SIZE_16MB ((uint8_t)0x17)
|
||||||
|
#define MPU_REGION_SIZE_32MB ((uint8_t)0x18)
|
||||||
|
#define MPU_REGION_SIZE_64MB ((uint8_t)0x19)
|
||||||
|
#define MPU_REGION_SIZE_128MB ((uint8_t)0x1A)
|
||||||
|
#define MPU_REGION_SIZE_256MB ((uint8_t)0x1B)
|
||||||
|
#define MPU_REGION_SIZE_512MB ((uint8_t)0x1C)
|
||||||
|
#define MPU_REGION_SIZE_1GB ((uint8_t)0x1D)
|
||||||
|
#define MPU_REGION_SIZE_2GB ((uint8_t)0x1E)
|
||||||
|
#define MPU_REGION_SIZE_4GB ((uint8_t)0x1F)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_MPU_Region_Permission_Attributes CORTEX MPU Region Permission Attributes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_REGION_NO_ACCESS ((uint8_t)0x00)
|
||||||
|
#define MPU_REGION_PRIV_RW ((uint8_t)0x01)
|
||||||
|
#define MPU_REGION_PRIV_RW_URO ((uint8_t)0x02)
|
||||||
|
#define MPU_REGION_FULL_ACCESS ((uint8_t)0x03)
|
||||||
|
#define MPU_REGION_PRIV_RO ((uint8_t)0x05)
|
||||||
|
#define MPU_REGION_PRIV_RO_URO ((uint8_t)0x06)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup CORTEX_MPU_Region_Number CORTEX MPU Region Number
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MPU_REGION_NUMBER0 ((uint8_t)0x00)
|
||||||
|
#define MPU_REGION_NUMBER1 ((uint8_t)0x01)
|
||||||
|
#define MPU_REGION_NUMBER2 ((uint8_t)0x02)
|
||||||
|
#define MPU_REGION_NUMBER3 ((uint8_t)0x03)
|
||||||
|
#define MPU_REGION_NUMBER4 ((uint8_t)0x04)
|
||||||
|
#define MPU_REGION_NUMBER5 ((uint8_t)0x05)
|
||||||
|
#define MPU_REGION_NUMBER6 ((uint8_t)0x06)
|
||||||
|
#define MPU_REGION_NUMBER7 ((uint8_t)0x07)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
#endif /* __MPU_PRESENT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Exported Macros -----------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @addtogroup CORTEX_Exported_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CORTEX_Exported_Functions_Group1
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Initialization and de-initialization functions *****************************/
|
||||||
|
void HAL_NVIC_SetPriorityGrouping(uint32_t PriorityGroup);
|
||||||
|
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority);
|
||||||
|
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn);
|
||||||
|
void HAL_NVIC_DisableIRQ(IRQn_Type IRQn);
|
||||||
|
void HAL_NVIC_SystemReset(void);
|
||||||
|
uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup CORTEX_Exported_Functions_Group2
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Peripheral Control functions ***********************************************/
|
||||||
|
#if (__MPU_PRESENT == 1)
|
||||||
|
void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init);
|
||||||
|
#endif /* __MPU_PRESENT */
|
||||||
|
uint32_t HAL_NVIC_GetPriorityGrouping(void);
|
||||||
|
void HAL_NVIC_GetPriority(IRQn_Type IRQn, uint32_t PriorityGroup, uint32_t *pPreemptPriority, uint32_t *pSubPriority);
|
||||||
|
uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn);
|
||||||
|
void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn);
|
||||||
|
void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn);
|
||||||
|
uint32_t HAL_NVIC_GetActive(IRQn_Type IRQn);
|
||||||
|
void HAL_SYSTICK_IRQHandler(void);
|
||||||
|
void HAL_SYSTICK_Callback(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup CORTEX_Private_Macros CORTEX Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PRIORITYGROUP_0) || \
|
||||||
|
((GROUP) == NVIC_PRIORITYGROUP_1) || \
|
||||||
|
((GROUP) == NVIC_PRIORITYGROUP_2) || \
|
||||||
|
((GROUP) == NVIC_PRIORITYGROUP_3) || \
|
||||||
|
((GROUP) == NVIC_PRIORITYGROUP_4))
|
||||||
|
|
||||||
|
#define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
|
||||||
|
|
||||||
|
#define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10)
|
||||||
|
|
||||||
|
#define IS_NVIC_DEVICE_IRQ(IRQ) ((IRQ) >= 0x00)
|
||||||
|
|
||||||
|
#define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SYSTICK_CLKSOURCE_HCLK) || \
|
||||||
|
((SOURCE) == SYSTICK_CLKSOURCE_HCLK_DIV8))
|
||||||
|
|
||||||
|
#if (__MPU_PRESENT == 1)
|
||||||
|
#define IS_MPU_REGION_ENABLE(STATE) (((STATE) == MPU_REGION_ENABLE) || \
|
||||||
|
((STATE) == MPU_REGION_DISABLE))
|
||||||
|
|
||||||
|
#define IS_MPU_INSTRUCTION_ACCESS(STATE) (((STATE) == MPU_INSTRUCTION_ACCESS_ENABLE) || \
|
||||||
|
((STATE) == MPU_INSTRUCTION_ACCESS_DISABLE))
|
||||||
|
|
||||||
|
#define IS_MPU_ACCESS_SHAREABLE(STATE) (((STATE) == MPU_ACCESS_SHAREABLE) || \
|
||||||
|
((STATE) == MPU_ACCESS_NOT_SHAREABLE))
|
||||||
|
|
||||||
|
#define IS_MPU_ACCESS_CACHEABLE(STATE) (((STATE) == MPU_ACCESS_CACHEABLE) || \
|
||||||
|
((STATE) == MPU_ACCESS_NOT_CACHEABLE))
|
||||||
|
|
||||||
|
#define IS_MPU_ACCESS_BUFFERABLE(STATE) (((STATE) == MPU_ACCESS_BUFFERABLE) || \
|
||||||
|
((STATE) == MPU_ACCESS_NOT_BUFFERABLE))
|
||||||
|
|
||||||
|
#define IS_MPU_TEX_LEVEL(TYPE) (((TYPE) == MPU_TEX_LEVEL0) || \
|
||||||
|
((TYPE) == MPU_TEX_LEVEL1) || \
|
||||||
|
((TYPE) == MPU_TEX_LEVEL2))
|
||||||
|
|
||||||
|
#define IS_MPU_REGION_PERMISSION_ATTRIBUTE(TYPE) (((TYPE) == MPU_REGION_NO_ACCESS) || \
|
||||||
|
((TYPE) == MPU_REGION_PRIV_RW) || \
|
||||||
|
((TYPE) == MPU_REGION_PRIV_RW_URO) || \
|
||||||
|
((TYPE) == MPU_REGION_FULL_ACCESS) || \
|
||||||
|
((TYPE) == MPU_REGION_PRIV_RO) || \
|
||||||
|
((TYPE) == MPU_REGION_PRIV_RO_URO))
|
||||||
|
|
||||||
|
#define IS_MPU_REGION_NUMBER(NUMBER) (((NUMBER) == MPU_REGION_NUMBER0) || \
|
||||||
|
((NUMBER) == MPU_REGION_NUMBER1) || \
|
||||||
|
((NUMBER) == MPU_REGION_NUMBER2) || \
|
||||||
|
((NUMBER) == MPU_REGION_NUMBER3) || \
|
||||||
|
((NUMBER) == MPU_REGION_NUMBER4) || \
|
||||||
|
((NUMBER) == MPU_REGION_NUMBER5) || \
|
||||||
|
((NUMBER) == MPU_REGION_NUMBER6) || \
|
||||||
|
((NUMBER) == MPU_REGION_NUMBER7))
|
||||||
|
|
||||||
|
#define IS_MPU_REGION_SIZE(SIZE) (((SIZE) == MPU_REGION_SIZE_32B) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_64B) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_128B) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_256B) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_512B) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_1KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_2KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_4KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_8KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_16KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_32KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_64KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_128KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_256KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_512KB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_1MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_2MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_4MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_8MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_16MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_32MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_64MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_128MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_256MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_512MB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_1GB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_2GB) || \
|
||||||
|
((SIZE) == MPU_REGION_SIZE_4GB))
|
||||||
|
|
||||||
|
#define IS_MPU_SUB_REGION_DISABLE(SUBREGION) ((SUBREGION) < (uint16_t)0x00FF)
|
||||||
|
#endif /* __MPU_PRESENT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
/** @defgroup CORTEX_Private_Functions CORTEX Private Functions
|
||||||
|
* @brief CORTEX private functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if (__MPU_PRESENT == 1)
|
||||||
|
/**
|
||||||
|
* @brief Disables the MPU
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void HAL_MPU_Disable(void)
|
||||||
|
{
|
||||||
|
/* Disable fault exceptions */
|
||||||
|
SCB->SHCSR &= ~SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
|
|
||||||
|
/* Disable the MPU */
|
||||||
|
MPU->CTRL &= ~MPU_CTRL_ENABLE_Msk;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables the MPU
|
||||||
|
* @param MPU_Control: Specifies the control mode of the MPU during hard fault,
|
||||||
|
* NMI, FAULTMASK and privileged access to the default memory
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg MPU_HFNMI_PRIVDEF_NONE
|
||||||
|
* @arg MPU_HARDFAULT_NMI
|
||||||
|
* @arg MPU_PRIVILEGED_DEFAULT
|
||||||
|
* @arg MPU_HFNMI_PRIVDEF
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void HAL_MPU_Enable(uint32_t MPU_Control)
|
||||||
|
{
|
||||||
|
/* Enable the MPU */
|
||||||
|
MPU->CTRL = MPU_Control | MPU_CTRL_ENABLE_Msk;
|
||||||
|
|
||||||
|
/* Enable fault exceptions */
|
||||||
|
SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;
|
||||||
|
}
|
||||||
|
#endif /* __MPU_PRESENT */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_HAL_CORTEX_H */
|
||||||
+207
@@ -0,0 +1,207 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_def.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief This file contains HAL common defines, enumeration, macros and
|
||||||
|
* structures definitions.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_HAL_DEF
|
||||||
|
#define STM32MP1xx_HAL_DEF
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx.h"
|
||||||
|
#if defined(USE_HAL_LEGACY)
|
||||||
|
#include "Legacy/stm32_hal_legacy.h"
|
||||||
|
#endif
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL Status structures definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_OK = 0x00U,
|
||||||
|
HAL_ERROR = 0x01U,
|
||||||
|
HAL_BUSY = 0x02U,
|
||||||
|
HAL_TIMEOUT = 0x03U
|
||||||
|
} HAL_StatusTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL Lock structures definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_UNLOCKED = 0x00U,
|
||||||
|
HAL_LOCKED = 0x01U
|
||||||
|
} HAL_LockTypeDef;
|
||||||
|
|
||||||
|
/* Exported macros -----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */
|
||||||
|
|
||||||
|
#define HAL_MAX_DELAY 0xFFFFFFFFU
|
||||||
|
|
||||||
|
#define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == (BIT))
|
||||||
|
#define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U)
|
||||||
|
|
||||||
|
#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
|
||||||
|
do{ \
|
||||||
|
(__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
|
||||||
|
(__DMA_HANDLE__).Parent = (__HANDLE__); \
|
||||||
|
} while(0U)
|
||||||
|
|
||||||
|
/** @brief Reset the Handle's State field.
|
||||||
|
* @param __HANDLE__ specifies the Peripheral Handle.
|
||||||
|
* @note This macro can be used for the following purpose:
|
||||||
|
* - When the Handle is declared as local variable; before passing it as parameter
|
||||||
|
* to HAL_PPP_Init() for the first time, it is mandatory to use this macro
|
||||||
|
* to set to 0 the Handle's "State" field.
|
||||||
|
* Otherwise, "State" field may have any random value and the first time the function
|
||||||
|
* HAL_PPP_Init() is called, the low level hardware initialization will be missed
|
||||||
|
* (i.e. HAL_PPP_MspInit() will not be executed).
|
||||||
|
* - When there is a need to reconfigure the low level hardware: instead of calling
|
||||||
|
* HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init().
|
||||||
|
* In this later function, when the Handle's "State" field is set to 0, it will execute the function
|
||||||
|
* HAL_PPP_MspInit() which will reconfigure the low level hardware.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
|
||||||
|
|
||||||
|
#if (USE_RTOS == 1U)
|
||||||
|
/* Reserved for future use */
|
||||||
|
#error " USE_RTOS should be 0 in the current HAL release "
|
||||||
|
#else
|
||||||
|
#define __HAL_LOCK(__HANDLE__) \
|
||||||
|
do{ \
|
||||||
|
if((__HANDLE__)->Lock == HAL_LOCKED) \
|
||||||
|
{ \
|
||||||
|
return HAL_BUSY; \
|
||||||
|
} \
|
||||||
|
else \
|
||||||
|
{ \
|
||||||
|
(__HANDLE__)->Lock = HAL_LOCKED; \
|
||||||
|
} \
|
||||||
|
}while (0U)
|
||||||
|
|
||||||
|
#define __HAL_UNLOCK(__HANDLE__) \
|
||||||
|
do{ \
|
||||||
|
(__HANDLE__)->Lock = HAL_UNLOCKED; \
|
||||||
|
}while (0U)
|
||||||
|
#endif /* USE_RTOS */
|
||||||
|
|
||||||
|
#if defined ( __GNUC__ )
|
||||||
|
#ifndef __weak
|
||||||
|
#define __weak __attribute__((weak))
|
||||||
|
#endif /* __weak */
|
||||||
|
#ifndef __packed
|
||||||
|
#define __packed __attribute__((__packed__))
|
||||||
|
#endif /* __packed */
|
||||||
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
|
|
||||||
|
/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
|
||||||
|
#if defined (__GNUC__) /* GNU Compiler */
|
||||||
|
#ifndef __ALIGN_END
|
||||||
|
#define __ALIGN_END __attribute__ ((aligned (4U)))
|
||||||
|
#endif /* __ALIGN_END */
|
||||||
|
#ifndef __ALIGN_BEGIN
|
||||||
|
#define __ALIGN_BEGIN
|
||||||
|
#endif /* __ALIGN_BEGIN */
|
||||||
|
#else
|
||||||
|
#ifndef __ALIGN_END
|
||||||
|
#define __ALIGN_END
|
||||||
|
#endif /* __ALIGN_END */
|
||||||
|
#ifndef __ALIGN_BEGIN
|
||||||
|
#if defined (__CC_ARM) /* ARM Compiler */
|
||||||
|
#define __ALIGN_BEGIN __align(4U)
|
||||||
|
#elif defined (__ICCARM__) /* IAR Compiler */
|
||||||
|
#define __ALIGN_BEGIN
|
||||||
|
#endif /* __CC_ARM */
|
||||||
|
#endif /* __ALIGN_BEGIN */
|
||||||
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
|
/* Macro to get variable aligned on 32-bytes,needed for cache maintenance purpose */
|
||||||
|
#if defined (__GNUC__) /* GNU Compiler */
|
||||||
|
#define ALIGN_32BYTES(buf) buf __attribute__ ((aligned (32)))
|
||||||
|
#elif defined (__ICCARM__) /* IAR Compiler */
|
||||||
|
#define ALIGN_32BYTES(buf) _Pragma("data_alignment=32") buf
|
||||||
|
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||||
|
#define ALIGN_32BYTES(buf) __ALIGNED(32) buf
|
||||||
|
#elif defined (__CC_ARM) /* ARM Compiler */
|
||||||
|
#define ALIGN_32BYTES(buf) __align(32) buf
|
||||||
|
#endif /* __GNUC__ */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief __RAM_FUNC definition
|
||||||
|
*/
|
||||||
|
#if defined ( __CC_ARM )
|
||||||
|
/* ARM Compiler
|
||||||
|
------------
|
||||||
|
RAM functions are defined using the toolchain options.
|
||||||
|
Functions that are executed in RAM should reside in a separate source module.
|
||||||
|
Using the 'Options for File' dialog you can simply change the 'Code / Const'
|
||||||
|
area of a module to a memory space in physical RAM.
|
||||||
|
Available memory areas are declared in the 'Target' tab of the 'Options for Target'
|
||||||
|
dialog.
|
||||||
|
*/
|
||||||
|
#define __RAM_FUNC
|
||||||
|
|
||||||
|
#elif defined ( __ICCARM__ )
|
||||||
|
/* ICCARM Compiler
|
||||||
|
---------------
|
||||||
|
RAM functions are defined using a specific toolchain keyword "__ramfunc".
|
||||||
|
*/
|
||||||
|
#define __RAM_FUNC __ramfunc
|
||||||
|
|
||||||
|
#elif defined ( __GNUC__ )
|
||||||
|
/* GNU Compiler
|
||||||
|
------------
|
||||||
|
RAM functions are defined using a specific toolchain attribute
|
||||||
|
"__attribute__((section(".RamFunc")))".
|
||||||
|
*/
|
||||||
|
#define __RAM_FUNC __attribute__((section(".RamFunc")))
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief __NOINLINE definition
|
||||||
|
*/
|
||||||
|
#if defined ( __CC_ARM ) || defined ( __GNUC__ )
|
||||||
|
/* ARM & GNUCompiler
|
||||||
|
----------------
|
||||||
|
*/
|
||||||
|
#define __NOINLINE __attribute__ ( (noinline) )
|
||||||
|
|
||||||
|
#elif defined ( __ICCARM__ )
|
||||||
|
/* ICCARM Compiler
|
||||||
|
---------------
|
||||||
|
*/
|
||||||
|
#define __NOINLINE _Pragma("optimize = no_inline")
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_HAL_DEF */
|
||||||
+962
@@ -0,0 +1,962 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_dma.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of DMA HAL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32MP1xx_HAL_DMA_H
|
||||||
|
#define __STM32MP1xx_HAL_DMA_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup DMA
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Exported_Types DMA Exported Types
|
||||||
|
* @brief DMA Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief DMA Configuration Structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t Request; /*!< Specifies the request selected for the specified stream.
|
||||||
|
This parameter can be a value of @ref DMA_Request_selection */
|
||||||
|
|
||||||
|
uint32_t Direction; /*!< Specifies if the data will be transferred from memory to peripheral,
|
||||||
|
from memory to memory or from peripheral to memory.
|
||||||
|
This parameter can be a value of @ref DMA_Data_transfer_direction */
|
||||||
|
|
||||||
|
uint32_t PeriphInc; /*!< Specifies whether the Peripheral address register should be incremented or not.
|
||||||
|
This parameter can be a value of @ref DMA_Peripheral_incremented_mode */
|
||||||
|
|
||||||
|
uint32_t MemInc; /*!< Specifies whether the memory address register should be incremented or not.
|
||||||
|
This parameter can be a value of @ref DMA_Memory_incremented_mode */
|
||||||
|
|
||||||
|
uint32_t PeriphDataAlignment; /*!< Specifies the Peripheral data width.
|
||||||
|
This parameter can be a value of @ref DMA_Peripheral_data_size */
|
||||||
|
|
||||||
|
uint32_t MemDataAlignment; /*!< Specifies the Memory data width.
|
||||||
|
This parameter can be a value of @ref DMA_Memory_data_size */
|
||||||
|
|
||||||
|
uint32_t Mode; /*!< Specifies the operation mode of the DMAy Streamx.
|
||||||
|
This parameter can be a value of @ref DMA_mode
|
||||||
|
@note The circular buffer mode cannot be used if the memory-to-memory
|
||||||
|
data transfer is configured on the selected Stream */
|
||||||
|
|
||||||
|
uint32_t Priority; /*!< Specifies the software priority for the DMAy Streamx.
|
||||||
|
This parameter can be a value of @ref DMA_Priority_level */
|
||||||
|
|
||||||
|
uint32_t FIFOMode; /*!< Specifies if the FIFO mode or Direct mode will be used for the specified stream.
|
||||||
|
This parameter can be a value of @ref DMA_FIFO_direct_mode
|
||||||
|
@note The Direct mode (FIFO mode disabled) cannot be used if the
|
||||||
|
memory-to-memory data transfer is configured on the selected stream */
|
||||||
|
|
||||||
|
uint32_t FIFOThreshold; /*!< Specifies the FIFO threshold level.
|
||||||
|
This parameter can be a value of @ref DMA_FIFO_threshold_level */
|
||||||
|
|
||||||
|
uint32_t MemBurst; /*!< Specifies the Burst transfer configuration for the memory transfers.
|
||||||
|
It specifies the amount of data to be transferred in a single non interruptible
|
||||||
|
transaction.
|
||||||
|
This parameter can be a value of @ref DMA_Memory_burst
|
||||||
|
@note The burst mode is possible only if the address Increment mode is enabled. */
|
||||||
|
|
||||||
|
uint32_t PeriphBurst; /*!< Specifies the Burst transfer configuration for the peripheral transfers.
|
||||||
|
It specifies the amount of data to be transferred in a single non interruptible
|
||||||
|
transaction.
|
||||||
|
This parameter can be a value of @ref DMA_Peripheral_burst
|
||||||
|
@note The burst mode is possible only if the address Increment mode is enabled. */
|
||||||
|
} DMA_InitTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL DMA State structures definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_DMA_STATE_RESET = 0x00U, /*!< DMA not yet initialized or disabled */
|
||||||
|
HAL_DMA_STATE_READY = 0x01U, /*!< DMA initialized and ready for use */
|
||||||
|
HAL_DMA_STATE_BUSY = 0x02U, /*!< DMA process is ongoing */
|
||||||
|
HAL_DMA_STATE_ERROR = 0x03U, /*!< DMA error state */
|
||||||
|
HAL_DMA_STATE_ABORT = 0x04U, /*!< DMA Abort state */
|
||||||
|
} HAL_DMA_StateTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL DMA Transfer complete level structure definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_DMA_FULL_TRANSFER = 0x00U, /*!< Full transfer */
|
||||||
|
HAL_DMA_HALF_TRANSFER = 0x01U, /*!< Half Transfer */
|
||||||
|
} HAL_DMA_LevelCompleteTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL DMA Callbacks IDs structure definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_DMA_XFER_CPLT_CB_ID = 0x00U, /*!< Full transfer */
|
||||||
|
HAL_DMA_XFER_HALFCPLT_CB_ID = 0x01U, /*!< Half Transfer */
|
||||||
|
HAL_DMA_XFER_M1CPLT_CB_ID = 0x02U, /*!< M1 Full Transfer */
|
||||||
|
HAL_DMA_XFER_M1HALFCPLT_CB_ID = 0x03U, /*!< M1 Half Transfer */
|
||||||
|
HAL_DMA_XFER_ERROR_CB_ID = 0x04U, /*!< Error */
|
||||||
|
HAL_DMA_XFER_ABORT_CB_ID = 0x05U, /*!< Abort */
|
||||||
|
HAL_DMA_XFER_ALL_CB_ID = 0x06U /*!< All */
|
||||||
|
} HAL_DMA_CallbackIDTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief DMA handle Structure definition
|
||||||
|
*/
|
||||||
|
typedef struct __DMA_HandleTypeDef
|
||||||
|
{
|
||||||
|
DMA_Stream_TypeDef *Instance; /*!< Register base address */
|
||||||
|
|
||||||
|
DMA_InitTypeDef Init; /*!< DMA communication parameters */
|
||||||
|
|
||||||
|
HAL_LockTypeDef Lock; /*!< DMA locking object */
|
||||||
|
|
||||||
|
__IO HAL_DMA_StateTypeDef State; /*!< DMA transfer state */
|
||||||
|
|
||||||
|
void *Parent; /*!< Parent object state */
|
||||||
|
|
||||||
|
void (* XferCpltCallback)(struct __DMA_HandleTypeDef *hdma); /*!< DMA transfer complete callback */
|
||||||
|
|
||||||
|
void (* XferHalfCpltCallback)(struct __DMA_HandleTypeDef *hdma); /*!< DMA Half transfer complete callback */
|
||||||
|
|
||||||
|
void (* XferM1CpltCallback)(struct __DMA_HandleTypeDef *hdma); /*!< DMA transfer complete Memory1 callback */
|
||||||
|
|
||||||
|
void (* XferM1HalfCpltCallback)(struct __DMA_HandleTypeDef *hdma); /*!< DMA transfer Half complete Memory1 callback */
|
||||||
|
|
||||||
|
void (* XferErrorCallback)(struct __DMA_HandleTypeDef *hdma); /*!< DMA transfer error callback */
|
||||||
|
|
||||||
|
void (* XferAbortCallback)(struct __DMA_HandleTypeDef *hdma); /*!< DMA transfer Abort callback */
|
||||||
|
|
||||||
|
__IO uint32_t ErrorCode; /*!< DMA Error code */
|
||||||
|
|
||||||
|
uint32_t StreamBaseAddress; /*!< DMA Stream Base Address */
|
||||||
|
|
||||||
|
uint32_t StreamIndex; /*!< DMA Stream Index */
|
||||||
|
|
||||||
|
DMAMUX_Channel_TypeDef *DMAmuxChannel; /*!< DMAMUX Channel Base Address */
|
||||||
|
|
||||||
|
DMAMUX_ChannelStatus_TypeDef *DMAmuxChannelStatus; /*!< DMAMUX Channels Status Base Address */
|
||||||
|
|
||||||
|
uint32_t DMAmuxChannelStatusMask; /*!< DMAMUX Channel Status Mask */
|
||||||
|
|
||||||
|
|
||||||
|
DMAMUX_RequestGen_TypeDef *DMAmuxRequestGen; /*!< DMAMUX request generator Base Address */
|
||||||
|
|
||||||
|
DMAMUX_RequestGenStatus_TypeDef *DMAmuxRequestGenStatus; /*!< DMAMUX request generator Status Address */
|
||||||
|
|
||||||
|
uint32_t DMAmuxRequestGenStatusMask; /*!< DMAMUX request generator Status mask */
|
||||||
|
|
||||||
|
} DMA_HandleTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Exported_Constants DMA Exported Constants
|
||||||
|
* @brief DMA Exported constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Error_Code DMA Error Code
|
||||||
|
* @brief DMA Error Code
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define HAL_DMA_ERROR_NONE (0x00000000U) /*!< No error */
|
||||||
|
#define HAL_DMA_ERROR_TE (0x00000001U) /*!< Transfer error */
|
||||||
|
#define HAL_DMA_ERROR_FE (0x00000002U) /*!< FIFO error */
|
||||||
|
#define HAL_DMA_ERROR_DME (0x00000004U) /*!< Direct Mode error */
|
||||||
|
#define HAL_DMA_ERROR_TIMEOUT (0x00000020U) /*!< Timeout error */
|
||||||
|
#define HAL_DMA_ERROR_PARAM (0x00000040U) /*!< Parameter error */
|
||||||
|
#define HAL_DMA_ERROR_NO_XFER (0x00000080U) /*!< Abort requested with no Xfer ongoing */
|
||||||
|
#define HAL_DMA_ERROR_NOT_SUPPORTED (0x00000100U) /*!< Not supported mode */
|
||||||
|
#define HAL_DMA_ERROR_SYNC (0x00000200U) /*!< DMAMUX sync overrun error */
|
||||||
|
#define HAL_DMA_ERROR_REQGEN (0x00000400U) /*!< DMAMUX request generator overrun error */
|
||||||
|
#define HAL_DMA_ERROR_BUSY (0x00000800U) /*!< DMA Busy error */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Request_selection DMA Request selection
|
||||||
|
* @brief DMA Request selection
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* DMAMUX1 requests */
|
||||||
|
#define DMA_REQUEST_MEM2MEM 0U /*!< memory to memory transfer */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_GENERATOR0 1U /*!< DMAMUX1 request generator 0 */
|
||||||
|
#define DMA_REQUEST_GENERATOR1 2U /*!< DMAMUX1 request generator 1 */
|
||||||
|
#define DMA_REQUEST_GENERATOR2 3U /*!< DMAMUX1 request generator 2 */
|
||||||
|
#define DMA_REQUEST_GENERATOR3 4U /*!< DMAMUX1 request generator 3 */
|
||||||
|
#define DMA_REQUEST_GENERATOR4 5U /*!< DMAMUX1 request generator 4 */
|
||||||
|
#define DMA_REQUEST_GENERATOR5 6U /*!< DMAMUX1 request generator 5 */
|
||||||
|
#define DMA_REQUEST_GENERATOR6 7U /*!< DMAMUX1 request generator 6 */
|
||||||
|
#define DMA_REQUEST_GENERATOR7 8U /*!< DMAMUX1 request generator 7 */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_ADC1 9U /*!< DMAMUX1 ADC1 request */
|
||||||
|
#define DMA_REQUEST_ADC2 10U /*!< DMAMUX1 ADC2 request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM1_CH1 11U /*!< DMAMUX1 TIM1 CH1 request */
|
||||||
|
#define DMA_REQUEST_TIM1_CH2 12U /*!< DMAMUX1 TIM1 CH2 request */
|
||||||
|
#define DMA_REQUEST_TIM1_CH3 13U /*!< DMAMUX1 TIM1 CH3 request */
|
||||||
|
#define DMA_REQUEST_TIM1_CH4 14U /*!< DMAMUX1 TIM1 CH4 request */
|
||||||
|
#define DMA_REQUEST_TIM1_UP 15U /*!< DMAMUX1 TIM1 UP request */
|
||||||
|
#define DMA_REQUEST_TIM1_TRIG 16U /*!< DMAMUX1 TIM1 TRIG request */
|
||||||
|
#define DMA_REQUEST_TIM1_COM 17U /*!< DMAMUX1 TIM1 COM request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM2_CH1 18U /*!< DMAMUX1 TIM2 CH1 request */
|
||||||
|
#define DMA_REQUEST_TIM2_CH2 19U /*!< DMAMUX1 TIM2 CH2 request */
|
||||||
|
#define DMA_REQUEST_TIM2_CH3 20U /*!< DMAMUX1 TIM2 CH3 request */
|
||||||
|
#define DMA_REQUEST_TIM2_CH4 21U /*!< DMAMUX1 TIM2 CH4 request */
|
||||||
|
#define DMA_REQUEST_TIM2_UP 22U /*!< DMAMUX1 TIM2 UP request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM3_CH1 23U /*!< DMAMUX1 TIM3 CH1 request */
|
||||||
|
#define DMA_REQUEST_TIM3_CH2 24U /*!< DMAMUX1 TIM3 CH2 request */
|
||||||
|
#define DMA_REQUEST_TIM3_CH3 25U /*!< DMAMUX1 TIM3 CH3 request */
|
||||||
|
#define DMA_REQUEST_TIM3_CH4 26U /*!< DMAMUX1 TIM3 CH4 request */
|
||||||
|
#define DMA_REQUEST_TIM3_UP 27U /*!< DMAMUX1 TIM3 UP request */
|
||||||
|
#define DMA_REQUEST_TIM3_TRIG 28U /*!< DMAMUX1 TIM3 TRIG request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM4_CH1 29U /*!< DMAMUX1 TIM4 CH1 request */
|
||||||
|
#define DMA_REQUEST_TIM4_CH2 30U /*!< DMAMUX1 TIM4 CH2 request */
|
||||||
|
#define DMA_REQUEST_TIM4_CH3 31U /*!< DMAMUX1 TIM4 CH3 request */
|
||||||
|
#define DMA_REQUEST_TIM4_UP 32U /*!< DMAMUX1 TIM4 UP request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_I2C1_RX 33U /*!< DMAMUX1 I2C1 RX request */
|
||||||
|
#define DMA_REQUEST_I2C1_TX 34U /*!< DMAMUX1 I2C1 TX request */
|
||||||
|
#define DMA_REQUEST_I2C2_RX 35U /*!< DMAMUX1 I2C2 RX request */
|
||||||
|
#define DMA_REQUEST_I2C2_TX 36U /*!< DMAMUX1 I2C2 TX request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_SPI1_RX 37U /*!< DMAMUX1 SPI1 RX request */
|
||||||
|
#define DMA_REQUEST_SPI1_TX 38U /*!< DMAMUX1 SPI1 TX request */
|
||||||
|
#define DMA_REQUEST_SPI2_RX 39U /*!< DMAMUX1 SPI2 RX request */
|
||||||
|
#define DMA_REQUEST_SPI2_TX 40U /*!< DMAMUX1 SPI2 TX request */
|
||||||
|
|
||||||
|
|
||||||
|
#define DMA_REQUEST_USART2_RX 43U /*!< DMAMUX1 USART2 RX request */
|
||||||
|
#define DMA_REQUEST_USART2_TX 44U /*!< DMAMUX1 USART2 TX request */
|
||||||
|
#define DMA_REQUEST_USART3_RX 45U /*!< DMAMUX1 USART3 RX request */
|
||||||
|
#define DMA_REQUEST_USART3_TX 46U /*!< DMAMUX1 USART3 TX request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM8_CH1 47U /*!< DMAMUX1 TIM8 CH1 request */
|
||||||
|
#define DMA_REQUEST_TIM8_CH2 48U /*!< DMAMUX1 TIM8 CH2 request */
|
||||||
|
#define DMA_REQUEST_TIM8_CH3 49U /*!< DMAMUX1 TIM8 CH3 request */
|
||||||
|
#define DMA_REQUEST_TIM8_CH4 50U /*!< DMAMUX1 TIM8 CH4 request */
|
||||||
|
#define DMA_REQUEST_TIM8_UP 51U /*!< DMAMUX1 TIM8 UP request */
|
||||||
|
#define DMA_REQUEST_TIM8_TRIG 52U /*!< DMAMUX1 TIM8 TRIG request */
|
||||||
|
#define DMA_REQUEST_TIM8_COM 53U /*!< DMAMUX1 TIM8 COM request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM5_CH1 55U /*!< DMAMUX1 TIM5 CH1 request */
|
||||||
|
#define DMA_REQUEST_TIM5_CH2 56U /*!< DMAMUX1 TIM5 CH2 request */
|
||||||
|
#define DMA_REQUEST_TIM5_CH3 57U /*!< DMAMUX1 TIM5 CH3 request */
|
||||||
|
#define DMA_REQUEST_TIM5_CH4 58U /*!< DMAMUX1 TIM5 CH4 request */
|
||||||
|
#define DMA_REQUEST_TIM5_UP 59U /*!< DMAMUX1 TIM5 UP request */
|
||||||
|
#define DMA_REQUEST_TIM5_TRIG 60U /*!< DMAMUX1 TIM5 TRIG request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_SPI3_RX 61U /*!< DMAMUX1 SPI3 RX request */
|
||||||
|
#define DMA_REQUEST_SPI3_TX 62U /*!< DMAMUX1 SPI3 TX request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_UART4_RX 63U /*!< DMAMUX1 UART4 RX request */
|
||||||
|
#define DMA_REQUEST_UART4_TX 64U /*!< DMAMUX1 UART4 TX request */
|
||||||
|
#define DMA_REQUEST_UART5_RX 65U /*!< DMAMUX1 UART5 RX request */
|
||||||
|
#define DMA_REQUEST_UART5_TX 66U /*!< DMAMUX1 UART5 TX request */
|
||||||
|
|
||||||
|
#if defined (DAC1)
|
||||||
|
#define DMA_REQUEST_DAC1 67U /*!< DMAMUX1 DAC1 request */
|
||||||
|
#define DMA_REQUEST_DAC2 68U /*!< DMAMUX1 DAC2 request */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM6_UP 69U /*!< DMAMUX1 TIM6 UP request */
|
||||||
|
#define DMA_REQUEST_TIM7_UP 70U /*!< DMAMUX1 TIM7 UP request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_USART6_RX 71U /*!< DMAMUX1 USART6 RX request */
|
||||||
|
#define DMA_REQUEST_USART6_TX 72U /*!< DMAMUX1 USART6 TX request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_I2C3_RX 73U /*!< DMAMUX1 I2C3 RX request */
|
||||||
|
#define DMA_REQUEST_I2C3_TX 74U /*!< DMAMUX1 I2C3 TX request */
|
||||||
|
|
||||||
|
#if defined (DCMI)
|
||||||
|
#define DMA_REQUEST_DCMI 75U /*!< DMAMUX1 DCMI request */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(CRYP2)
|
||||||
|
#define DMA_REQUEST_CRYP2_IN 76U /*!< DMAMUX1 CRYP2 IN request */
|
||||||
|
#define DMA_REQUEST_CRYP2_OUT 77U /*!< DMAMUX1 CRYP2 OUT request */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#if defined (HASH2)
|
||||||
|
#define DMA_REQUEST_HASH2_IN 78U /*!< DMAMUX1 HASH2 IN request */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DMA_REQUEST_UART7_RX 79U /*!< DMAMUX1 UART7 RX request */
|
||||||
|
#define DMA_REQUEST_UART7_TX 80U /*!< DMAMUX1 UART7 TX request */
|
||||||
|
#define DMA_REQUEST_UART8_RX 81U /*!< DMAMUX1 UART8 RX request */
|
||||||
|
#define DMA_REQUEST_UART8_TX 82U /*!< DMAMUX1 UART8 TX request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_SPI4_RX 83U /*!< DMAMUX1 SPI4 RX request */
|
||||||
|
#define DMA_REQUEST_SPI4_TX 84U /*!< DMAMUX1 SPI4 TX request */
|
||||||
|
#define DMA_REQUEST_SPI5_RX 85U /*!< DMAMUX1 SPI5 RX request */
|
||||||
|
#define DMA_REQUEST_SPI5_TX 86U /*!< DMAMUX1 SPI5 TX request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_SAI1_A 87U /*!< DMAMUX1 SAI1 A request */
|
||||||
|
#define DMA_REQUEST_SAI1_B 88U /*!< DMAMUX1 SAI1 B request */
|
||||||
|
#define DMA_REQUEST_SAI2_A 89U /*!< DMAMUX1 SAI2 A request */
|
||||||
|
#define DMA_REQUEST_SAI2_B 90U /*!< DMAMUX1 SAI2 B request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_DFSDM1_FLT4 91U /*!< DMAMUX1 DFSDM1 Filter4 request */
|
||||||
|
#define DMA_REQUEST_DFSDM1_FLT5 92U /*!< DMAMUX1 DFSDM1 Filter5 request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_SPDIF_RX_DT 93U /*!< DMAMUX1 SPDIF RXDT request*/
|
||||||
|
#define DMA_REQUEST_SPDIF_RX_CS 94U /*!< DMAMUX1 SPDIF RXCS request*/
|
||||||
|
|
||||||
|
#if defined (SAI4)
|
||||||
|
#define DMA_REQUEST_SAI4_A 99U /*!< DMAMUX1 SAI4 A request */
|
||||||
|
#define DMA_REQUEST_SAI4_B 100U /*!< DMAMUX1 SAI4 B request */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DMA_REQUEST_DFSDM1_FLT0 101U /*!< DMAMUX1 DFSDM Filter0 request */
|
||||||
|
#define DMA_REQUEST_DFSDM1_FLT1 102U /*!< DMAMUX1 DFSDM Filter1 request */
|
||||||
|
#define DMA_REQUEST_DFSDM1_FLT2 103U /*!< DMAMUX1 DFSDM Filter2 request */
|
||||||
|
#define DMA_REQUEST_DFSDM1_FLT3 104U /*!< DMAMUX1 DFSDM Filter3 request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM15_CH1 105U /*!< DMAMUX1 TIM15 CH1 request */
|
||||||
|
#define DMA_REQUEST_TIM15_UP 106U /*!< DMAMUX1 TIM15 UP request */
|
||||||
|
#define DMA_REQUEST_TIM15_TRIG 107U /*!< DMAMUX1 TIM15 TRIG request */
|
||||||
|
#define DMA_REQUEST_TIM15_COM 108U /*!< DMAMUX1 TIM15 COM request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM16_CH1 109U /*!< DMAMUX1 TIM16 CH1 request */
|
||||||
|
#define DMA_REQUEST_TIM16_UP 110U /*!< DMAMUX1 TIM16 UP request */
|
||||||
|
|
||||||
|
#define DMA_REQUEST_TIM17_CH1 111U /*!< DMAMUX1 TIM17 CH1 request */
|
||||||
|
#define DMA_REQUEST_TIM17_UP 112U /*!< DMAMUX1 TIM17 UP request */
|
||||||
|
|
||||||
|
#if defined (SAI3)
|
||||||
|
#define DMA_REQUEST_SAI3_A 113U /*!< DMAMUX1 SAI3 A request */
|
||||||
|
#define DMA_REQUEST_SAI3_B 114U /*!< DMAMUX1 SAI3 B request */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define DMA_REQUEST_I2C5_RX 115U /*!< DMAMUX1 I2C5 RX request */
|
||||||
|
#define DMA_REQUEST_I2C5_TX 116U /*!< DMAMUX1 I2C5 TX request */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Data_transfer_direction DMA Data transfer direction
|
||||||
|
* @brief DMA data transfer direction
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_PERIPH_TO_MEMORY ((uint32_t)0x00000000U) /*!< Peripheral to memory direction */
|
||||||
|
#define DMA_MEMORY_TO_PERIPH ((uint32_t)DMA_SxCR_DIR_0) /*!< Memory to peripheral direction */
|
||||||
|
#define DMA_MEMORY_TO_MEMORY ((uint32_t)DMA_SxCR_DIR_1) /*!< Memory to memory direction */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode
|
||||||
|
* @brief DMA peripheral incremented mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_PINC_ENABLE ((uint32_t)DMA_SxCR_PINC) /*!< Peripheral increment mode enable */
|
||||||
|
#define DMA_PINC_DISABLE ((uint32_t)0x00000000U) /*!< Peripheral increment mode disable */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode
|
||||||
|
* @brief DMA memory incremented mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_MINC_ENABLE ((uint32_t)DMA_SxCR_MINC) /*!< Memory increment mode enable */
|
||||||
|
#define DMA_MINC_DISABLE ((uint32_t)0x00000000U) /*!< Memory increment mode disable */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Peripheral_data_size DMA Peripheral data size
|
||||||
|
* @brief DMA peripheral data size
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_PDATAALIGN_BYTE ((uint32_t)0x00000000U) /*!< Peripheral data alignment: Byte */
|
||||||
|
#define DMA_PDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_PSIZE_0) /*!< Peripheral data alignment: HalfWord */
|
||||||
|
#define DMA_PDATAALIGN_WORD ((uint32_t)DMA_SxCR_PSIZE_1) /*!< Peripheral data alignment: Word */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Memory_data_size DMA Memory data size
|
||||||
|
* @brief DMA memory data size
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_MDATAALIGN_BYTE ((uint32_t)0x00000000U) /*!< Memory data alignment: Byte */
|
||||||
|
#define DMA_MDATAALIGN_HALFWORD ((uint32_t)DMA_SxCR_MSIZE_0) /*!< Memory data alignment: HalfWord */
|
||||||
|
#define DMA_MDATAALIGN_WORD ((uint32_t)DMA_SxCR_MSIZE_1) /*!< Memory data alignment: Word */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_mode DMA mode
|
||||||
|
* @brief DMA mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_NORMAL ((uint32_t)0x00000000U) /*!< Normal mode */
|
||||||
|
#define DMA_CIRCULAR ((uint32_t)DMA_SxCR_CIRC) /*!< Circular mode */
|
||||||
|
#define DMA_PFCTRL ((uint32_t)DMA_SxCR_PFCTRL) /*!< Peripheral flow control mode */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Priority_level DMA Priority level
|
||||||
|
* @brief DMA priority levels
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_PRIORITY_LOW ((uint32_t)0x00000000U) /*!< Priority level: Low */
|
||||||
|
#define DMA_PRIORITY_MEDIUM ((uint32_t)DMA_SxCR_PL_0) /*!< Priority level: Medium */
|
||||||
|
#define DMA_PRIORITY_HIGH ((uint32_t)DMA_SxCR_PL_1) /*!< Priority level: High */
|
||||||
|
#define DMA_PRIORITY_VERY_HIGH ((uint32_t)DMA_SxCR_PL) /*!< Priority level: Very High */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_FIFO_direct_mode DMA FIFO direct mode
|
||||||
|
* @brief DMA FIFO direct mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_FIFOMODE_DISABLE ((uint32_t)0x00000000U) /*!< FIFO mode disable */
|
||||||
|
#define DMA_FIFOMODE_ENABLE ((uint32_t)DMA_SxFCR_DMDIS) /*!< FIFO mode enable */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_FIFO_threshold_level DMA FIFO threshold level
|
||||||
|
* @brief DMA FIFO level
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_FIFO_THRESHOLD_1QUARTERFULL ((uint32_t)0x00000000U) /*!< FIFO threshold 1 quart full configuration */
|
||||||
|
#define DMA_FIFO_THRESHOLD_HALFFULL ((uint32_t)DMA_SxFCR_FTH_0) /*!< FIFO threshold half full configuration */
|
||||||
|
#define DMA_FIFO_THRESHOLD_3QUARTERSFULL ((uint32_t)DMA_SxFCR_FTH_1) /*!< FIFO threshold 3 quarts full configuration */
|
||||||
|
#define DMA_FIFO_THRESHOLD_FULL ((uint32_t)DMA_SxFCR_FTH) /*!< FIFO threshold full configuration */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Memory_burst DMA Memory burst
|
||||||
|
* @brief DMA memory burst
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_MBURST_SINGLE ((uint32_t)0x00000000U)
|
||||||
|
#define DMA_MBURST_INC4 ((uint32_t)DMA_SxCR_MBURST_0)
|
||||||
|
#define DMA_MBURST_INC8 ((uint32_t)DMA_SxCR_MBURST_1)
|
||||||
|
#define DMA_MBURST_INC16 ((uint32_t)DMA_SxCR_MBURST)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Peripheral_burst DMA Peripheral burst
|
||||||
|
* @brief DMA peripheral burst
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_PBURST_SINGLE ((uint32_t)0x00000000U)
|
||||||
|
#define DMA_PBURST_INC4 ((uint32_t)DMA_SxCR_PBURST_0)
|
||||||
|
#define DMA_PBURST_INC8 ((uint32_t)DMA_SxCR_PBURST_1)
|
||||||
|
#define DMA_PBURST_INC16 ((uint32_t)DMA_SxCR_PBURST)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions
|
||||||
|
* @brief DMA interrupts definition
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_IT_TC ((uint32_t)DMA_SxCR_TCIE)
|
||||||
|
#define DMA_IT_HT ((uint32_t)DMA_SxCR_HTIE)
|
||||||
|
#define DMA_IT_TE ((uint32_t)DMA_SxCR_TEIE)
|
||||||
|
#define DMA_IT_DME ((uint32_t)DMA_SxCR_DMEIE)
|
||||||
|
#define DMA_IT_FE ((uint32_t)0x00000080U)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_flag_definitions DMA flag definitions
|
||||||
|
* @brief DMA flag definitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define DMA_FLAG_FEIF0_4 ((uint32_t)0x00000001U)
|
||||||
|
#define DMA_FLAG_DMEIF0_4 ((uint32_t)0x00000004U)
|
||||||
|
#define DMA_FLAG_TEIF0_4 ((uint32_t)0x00000008U)
|
||||||
|
#define DMA_FLAG_HTIF0_4 ((uint32_t)0x00000010U)
|
||||||
|
#define DMA_FLAG_TCIF0_4 ((uint32_t)0x00000020U)
|
||||||
|
#define DMA_FLAG_FEIF1_5 ((uint32_t)0x00000040U)
|
||||||
|
#define DMA_FLAG_DMEIF1_5 ((uint32_t)0x00000100U)
|
||||||
|
#define DMA_FLAG_TEIF1_5 ((uint32_t)0x00000200U)
|
||||||
|
#define DMA_FLAG_HTIF1_5 ((uint32_t)0x00000400U)
|
||||||
|
#define DMA_FLAG_TCIF1_5 ((uint32_t)0x00000800U)
|
||||||
|
#define DMA_FLAG_FEIF2_6 ((uint32_t)0x00010000U)
|
||||||
|
#define DMA_FLAG_DMEIF2_6 ((uint32_t)0x00040000U)
|
||||||
|
#define DMA_FLAG_TEIF2_6 ((uint32_t)0x00080000U)
|
||||||
|
#define DMA_FLAG_HTIF2_6 ((uint32_t)0x00100000U)
|
||||||
|
#define DMA_FLAG_TCIF2_6 ((uint32_t)0x00200000U)
|
||||||
|
#define DMA_FLAG_FEIF3_7 ((uint32_t)0x00400000U)
|
||||||
|
#define DMA_FLAG_DMEIF3_7 ((uint32_t)0x01000000U)
|
||||||
|
#define DMA_FLAG_TEIF3_7 ((uint32_t)0x02000000U)
|
||||||
|
#define DMA_FLAG_HTIF3_7 ((uint32_t)0x04000000U)
|
||||||
|
#define DMA_FLAG_TCIF3_7 ((uint32_t)0x08000000U)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/** @defgroup DMA_Exported_Macros DMA Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @brief Reset DMA handle state
|
||||||
|
* @param __HANDLE__: specifies the DMA handle.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA_STATE_RESET)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return the current DMA Stream FIFO filled level.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @retval The FIFO filling state.
|
||||||
|
* - DMA_FIFOStatus_Less1QuarterFull: when FIFO is less than 1 quarter-full
|
||||||
|
* and not empty.
|
||||||
|
* - DMA_FIFOStatus_1QuarterFull: if more than 1 quarter-full.
|
||||||
|
* - DMA_FIFOStatus_HalfFull: if more than 1 half-full.
|
||||||
|
* - DMA_FIFOStatus_3QuartersFull: if more than 3 quarters-full.
|
||||||
|
* - DMA_FIFOStatus_Empty: when FIFO is empty
|
||||||
|
* - DMA_FIFOStatus_Full: when FIFO is full
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_GET_FS(__HANDLE__) ((IS_DMA_INSTANCE(__HANDLE__))? (((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->FCR & (DMA_SxFCR_FS)) : 0)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable the specified DMA Stream.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_ENABLE(__HANDLE__) (((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->CR |= DMA_SxCR_EN)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable the specified DMA Stream.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_DISABLE(__HANDLE__) (((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->CR &= ~DMA_SxCR_EN)
|
||||||
|
|
||||||
|
/* Interrupt & Flag management */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return the current DMA Stream transfer complete flag.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @retval The specified transfer complete flag index.
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \
|
||||||
|
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TCIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TCIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TCIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TCIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TCIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TCIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TCIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TCIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TCIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TCIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TCIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TCIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream3))? DMA_FLAG_TCIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream3))? DMA_FLAG_TCIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream7))? DMA_FLAG_TCIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream7))? DMA_FLAG_TCIF3_7 :\
|
||||||
|
(uint32_t)0x00000000)
|
||||||
|
/**
|
||||||
|
* @brief Return the current DMA Stream half transfer complete flag.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @retval The specified half transfer complete flag index.
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\
|
||||||
|
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_HTIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_HTIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_HTIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_HTIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_HTIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_HTIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_HTIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_HTIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_HTIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_HTIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_HTIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_HTIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream3))? DMA_FLAG_HTIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream3))? DMA_FLAG_HTIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream7))? DMA_FLAG_HTIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream7))? DMA_FLAG_HTIF3_7 :\
|
||||||
|
(uint32_t)0x00000000)
|
||||||
|
/**
|
||||||
|
* @brief Return the current DMA Stream transfer error flag.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @retval The specified transfer error flag index.
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\
|
||||||
|
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_TEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_TEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_TEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_TEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_TEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_TEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_TEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_TEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_TEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_TEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_TEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_TEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream3))? DMA_FLAG_TEIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream3))? DMA_FLAG_TEIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream7))? DMA_FLAG_TEIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream7))? DMA_FLAG_TEIF3_7 :\
|
||||||
|
(uint32_t)0x00000000)
|
||||||
|
/**
|
||||||
|
* @brief Return the current DMA Stream FIFO error flag.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @retval The specified FIFO error flag index.
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_GET_FE_FLAG_INDEX(__HANDLE__)\
|
||||||
|
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_FEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_FEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_FEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_FEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_FEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_FEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_FEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_FEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_FEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_FEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_FEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_FEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream3))? DMA_FLAG_FEIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream3))? DMA_FLAG_FEIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream7))? DMA_FLAG_FEIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream7))? DMA_FLAG_FEIF3_7 :\
|
||||||
|
(uint32_t)0x00000000)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return the current DMA Stream direct mode error flag.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @retval The specified direct mode error flag index.
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_GET_DME_FLAG_INDEX(__HANDLE__)\
|
||||||
|
(((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream0))? DMA_FLAG_DMEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream0))? DMA_FLAG_DMEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream4))? DMA_FLAG_DMEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream4))? DMA_FLAG_DMEIF0_4 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream1))? DMA_FLAG_DMEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream1))? DMA_FLAG_DMEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream5))? DMA_FLAG_DMEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream5))? DMA_FLAG_DMEIF1_5 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream2))? DMA_FLAG_DMEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream2))? DMA_FLAG_DMEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream6))? DMA_FLAG_DMEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream6))? DMA_FLAG_DMEIF2_6 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream3))? DMA_FLAG_DMEIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream3))? DMA_FLAG_DMEIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Stream7))? DMA_FLAG_DMEIF3_7 :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA2_Stream7))? DMA_FLAG_DMEIF3_7 :\
|
||||||
|
(uint32_t)0x00000000)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the DMA Stream pending flags.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @param __FLAG__: Get the specified flag.
|
||||||
|
* This parameter can be any combination of the following values:
|
||||||
|
* @arg DMA_FLAG_TCIFx: Transfer complete flag.
|
||||||
|
* @arg DMA_FLAG_HTIFx: Half transfer complete flag.
|
||||||
|
* @arg DMA_FLAG_TEIFx: Transfer error flag.
|
||||||
|
* @arg DMA_FLAG_DMEIFx: Direct mode error flag.
|
||||||
|
* @arg DMA_FLAG_FEIFx: FIFO error flag.
|
||||||
|
* Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
|
||||||
|
* @retval The state of FLAG (SET or RESET).
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__)\
|
||||||
|
(((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HISR & (__FLAG__)) :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LISR & (__FLAG__)) :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HISR & (__FLAG__)) : (DMA1->LISR & (__FLAG__)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear the DMA Stream pending flags.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @param __FLAG__: specifies the flag to clear.
|
||||||
|
* This parameter can be any combination of the following values:
|
||||||
|
* @arg DMA_FLAG_TCIFx: Transfer complete flag.
|
||||||
|
* @arg DMA_FLAG_HTIFx: Half transfer complete flag.
|
||||||
|
* @arg DMA_FLAG_TEIFx: Transfer error flag.
|
||||||
|
* @arg DMA_FLAG_DMEIFx: Direct mode error flag.
|
||||||
|
* @arg DMA_FLAG_FEIFx: FIFO error flag.
|
||||||
|
* Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Stream flag.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) \
|
||||||
|
(((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA2_Stream3)? (DMA2->HIFCR = (__FLAG__)) :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream7)? (DMA2->LIFCR = (__FLAG__)) :\
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) > (uint32_t)DMA1_Stream3)? (DMA1->HIFCR = (__FLAG__)) : (DMA1->LIFCR = (__FLAG__)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable the specified DMA Stream interrupts.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DMA_IT_TC: Transfer complete interrupt mask.
|
||||||
|
* @arg DMA_IT_HT: Half transfer complete interrupt mask.
|
||||||
|
* @arg DMA_IT_TE: Transfer error interrupt mask.
|
||||||
|
* @arg DMA_IT_FE: FIFO error interrupt mask.
|
||||||
|
* @arg DMA_IT_DME: Direct mode error interrupt.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
|
||||||
|
(((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->CR |= (__INTERRUPT__)) : (((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->FCR |= (__INTERRUPT__)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable the specified DMA Stream interrupts.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DMA_IT_TC: Transfer complete interrupt mask.
|
||||||
|
* @arg DMA_IT_HT: Half transfer complete interrupt mask.
|
||||||
|
* @arg DMA_IT_TE: Transfer error interrupt mask.
|
||||||
|
* @arg DMA_IT_FE: FIFO error interrupt mask.
|
||||||
|
* @arg DMA_IT_DME: Direct mode error interrupt.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
|
||||||
|
(((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->CR &= ~(__INTERRUPT__)) : (((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->FCR &= ~(__INTERRUPT__)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check whether the specified DMA Stream interrupt is enabled or not.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @param __INTERRUPT__: specifies the DMA interrupt source to check.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg DMA_IT_TC: Transfer complete interrupt mask.
|
||||||
|
* @arg DMA_IT_HT: Half transfer complete interrupt mask.
|
||||||
|
* @arg DMA_IT_TE: Transfer error interrupt mask.
|
||||||
|
* @arg DMA_IT_FE: FIFO error interrupt mask.
|
||||||
|
* @arg DMA_IT_DME: Direct mode error interrupt.
|
||||||
|
* @retval The state of DMA_IT.
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__INTERRUPT__) != DMA_IT_FE)? \
|
||||||
|
(((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->CR & (__INTERRUPT__)) : \
|
||||||
|
(((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->FCR & (__INTERRUPT__)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Writes the number of data units to be transferred on the DMA Stream.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
* @param __COUNTER__: Number of data units to be transferred (from 0 to 65535)
|
||||||
|
* Number of data items depends only on the Peripheral data format.
|
||||||
|
*
|
||||||
|
* @note If Peripheral data format is Bytes: number of data units is equal
|
||||||
|
* to total number of bytes to be transferred.
|
||||||
|
*
|
||||||
|
* @note If Peripheral data format is Half-Word: number of data units is
|
||||||
|
* equal to total number of bytes to be transferred / 2.
|
||||||
|
*
|
||||||
|
* @note If Peripheral data format is Word: number of data units is equal
|
||||||
|
* to total number of bytes to be transferred / 4.
|
||||||
|
*
|
||||||
|
* @retval The number of remaining data units in the current DMAy Streamx transfer.
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_SET_COUNTER(__HANDLE__, __COUNTER__) (((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->NDTR = (uint16_t)(__COUNTER__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the number of remaining data units in the current DMAy Streamx transfer.
|
||||||
|
* @param __HANDLE__: DMA handle
|
||||||
|
*
|
||||||
|
* @retval The number of remaining data units in the current DMA Stream transfer.
|
||||||
|
*/
|
||||||
|
#define __HAL_DMA_GET_COUNTER(__HANDLE__) (((DMA_Stream_TypeDef *)(__HANDLE__)->Instance)->NDTR)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Include DMA HAL Extension module */
|
||||||
|
#include "stm32mp1xx_hal_dma_ex.h"
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Exported_Functions DMA Exported Functions
|
||||||
|
* @brief DMA Exported functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Exported_Functions_Group1 Initialization and de-initialization functions
|
||||||
|
* @brief Initialization and de-initialization functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma);
|
||||||
|
HAL_StatusTypeDef HAL_DMA_DeInit(DMA_HandleTypeDef *hdma);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Exported_Functions_Group2 I/O operation functions
|
||||||
|
* @brief I/O operation functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef HAL_DMA_Start(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
|
||||||
|
HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength);
|
||||||
|
HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma);
|
||||||
|
HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma);
|
||||||
|
HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, HAL_DMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout);
|
||||||
|
void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma);
|
||||||
|
HAL_StatusTypeDef HAL_DMA_RegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void (* pCallback)(DMA_HandleTypeDef *_hdma));
|
||||||
|
HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMA_Exported_Functions_Group3 Peripheral State functions
|
||||||
|
* @brief Peripheral State functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma);
|
||||||
|
uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* Private Constants -------------------------------------------------------------*/
|
||||||
|
/** @defgroup DMA_Private_Constants DMA Private Constants
|
||||||
|
* @brief DMA private defines and constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup DMA_Private_Macros DMA Private Macros
|
||||||
|
* @brief DMA private macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_DMA_REQUEST(REQUEST) ((REQUEST) <= DMA_REQUEST_I2C5_TX)
|
||||||
|
|
||||||
|
|
||||||
|
#define IS_DMA_INSTANCE(__HANDLE__) ( \
|
||||||
|
(((uint32_t)((__HANDLE__)->Instance) >= ((uint32_t)DMA1_Stream0)) && \
|
||||||
|
((uint32_t)((__HANDLE__)->Instance) <= ((uint32_t)DMA2_Stream7))) \
|
||||||
|
)
|
||||||
|
|
||||||
|
#define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \
|
||||||
|
((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \
|
||||||
|
((DIRECTION) == DMA_MEMORY_TO_MEMORY))
|
||||||
|
|
||||||
|
#define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x01U) && ((SIZE) < 0x10000U))
|
||||||
|
|
||||||
|
#define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \
|
||||||
|
((STATE) == DMA_PINC_DISABLE))
|
||||||
|
|
||||||
|
#define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \
|
||||||
|
((STATE) == DMA_MINC_DISABLE))
|
||||||
|
|
||||||
|
#define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \
|
||||||
|
((SIZE) == DMA_PDATAALIGN_HALFWORD) || \
|
||||||
|
((SIZE) == DMA_PDATAALIGN_WORD))
|
||||||
|
|
||||||
|
#define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \
|
||||||
|
((SIZE) == DMA_MDATAALIGN_HALFWORD) || \
|
||||||
|
((SIZE) == DMA_MDATAALIGN_WORD ))
|
||||||
|
|
||||||
|
#define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \
|
||||||
|
((MODE) == DMA_CIRCULAR) || \
|
||||||
|
((MODE) == DMA_PFCTRL))
|
||||||
|
|
||||||
|
#define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \
|
||||||
|
((PRIORITY) == DMA_PRIORITY_MEDIUM) || \
|
||||||
|
((PRIORITY) == DMA_PRIORITY_HIGH) || \
|
||||||
|
((PRIORITY) == DMA_PRIORITY_VERY_HIGH))
|
||||||
|
|
||||||
|
#define IS_DMA_FIFO_MODE_STATE(STATE) (((STATE) == DMA_FIFOMODE_DISABLE ) || \
|
||||||
|
((STATE) == DMA_FIFOMODE_ENABLE))
|
||||||
|
|
||||||
|
#define IS_DMA_FIFO_THRESHOLD(THRESHOLD) (((THRESHOLD) == DMA_FIFO_THRESHOLD_1QUARTERFULL ) || \
|
||||||
|
((THRESHOLD) == DMA_FIFO_THRESHOLD_HALFFULL) || \
|
||||||
|
((THRESHOLD) == DMA_FIFO_THRESHOLD_3QUARTERSFULL) || \
|
||||||
|
((THRESHOLD) == DMA_FIFO_THRESHOLD_FULL))
|
||||||
|
|
||||||
|
#define IS_DMA_MEMORY_BURST(BURST) (((BURST) == DMA_MBURST_SINGLE) || \
|
||||||
|
((BURST) == DMA_MBURST_INC4) || \
|
||||||
|
((BURST) == DMA_MBURST_INC8) || \
|
||||||
|
((BURST) == DMA_MBURST_INC16))
|
||||||
|
|
||||||
|
#define IS_DMA_PERIPHERAL_BURST(BURST) (((BURST) == DMA_PBURST_SINGLE) || \
|
||||||
|
((BURST) == DMA_PBURST_INC4) || \
|
||||||
|
((BURST) == DMA_PBURST_INC8) || \
|
||||||
|
((BURST) == DMA_PBURST_INC16))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
/** @defgroup DMA_Private_Functions DMA Private Functions
|
||||||
|
* @brief DMA private functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_HAL_DMA_H */
|
||||||
+252
@@ -0,0 +1,252 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_dma_ex.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of DMA HAL extension module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_HAL_DMA_EX_H
|
||||||
|
#define STM32MP1xx_HAL_DMA_EX_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup DMAEx
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/** @defgroup DMAEx_Exported_Types DMAEx Exported Types
|
||||||
|
* @brief DMAEx Exported types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL DMA Memory definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
MEMORY0 = 0x00U, /*!< Memory 0 */
|
||||||
|
MEMORY1 = 0x01U, /*!< Memory 1 */
|
||||||
|
|
||||||
|
} HAL_DMA_MemoryTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL DMAMUX Synchronization configuration structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t SyncSignalID; /*!< Specifies the synchronization signal gating the DMA request in periodic mode.
|
||||||
|
This parameter can be a value of @ref DMAEx_MUX_SyncSignalID_selection */
|
||||||
|
|
||||||
|
uint32_t SyncPolarity; /*!< Specifies the polarity of the signal on which the DMA request is synchronized.
|
||||||
|
This parameter can be a value of @ref DMAEx_MUX_SyncPolarity_selection */
|
||||||
|
|
||||||
|
FunctionalState SyncEnable; /*!< Specifies if the synchronization shall be enabled or disabled
|
||||||
|
This parameter can take the value ENABLE or DISABLE*/
|
||||||
|
|
||||||
|
|
||||||
|
FunctionalState EventEnable; /*!< Specifies if an event shall be generated once the RequestNumber is reached.
|
||||||
|
This parameter can take the value ENABLE or DISABLE */
|
||||||
|
|
||||||
|
uint32_t RequestNumber; /*!< Specifies the number of DMA request that will be authorized after a sync event.
|
||||||
|
This parameters can be in the range 1 to 32 */
|
||||||
|
|
||||||
|
} HAL_DMA_MuxSyncConfigTypeDef;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL DMAMUX request generator parameters structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t SignalID; /*!< Specifies the ID of the signal used for DMAMUX request generator
|
||||||
|
This parameter can be a value of @ref DMAEx_MUX_SignalGeneratorID_selection */
|
||||||
|
|
||||||
|
uint32_t Polarity; /*!< Specifies the polarity of the signal on which the request is generated.
|
||||||
|
This parameter can be a value of @ref DMAEx_MUX_RequestGeneneratorPolarity_selection */
|
||||||
|
|
||||||
|
uint32_t RequestNumber; /*!< Specifies the number of DMA request that will be generated after a signal event.
|
||||||
|
This parameters can be in the range 1 to 32 */
|
||||||
|
|
||||||
|
} HAL_DMA_MuxRequestGeneratorConfigTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup DMAEx_Exported_Constants DMA Exported Constants
|
||||||
|
* @brief DMAEx Exported constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMAEx_MUX_SyncSignalID_selection DMAEx MUX SyncSignalID selection
|
||||||
|
* @brief DMAEx MUX SyncSignalID selection
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define HAL_DMAMUX1_SYNC_DMAMUX1_CH0_EVT 0U /*!< DMAMUX1 synchronization Signal is DMAMUX1 Channel0 Event */
|
||||||
|
#define HAL_DMAMUX1_SYNC_DMAMUX1_CH1_EVT 1U /*!< DMAMUX1 synchronization Signal is DMAMUX1 Channel1 Event */
|
||||||
|
#define HAL_DMAMUX1_SYNC_DMAMUX1_CH2_EVT 2U /*!< DMAMUX1 synchronization Signal is DMAMUX1 Channel2 Event */
|
||||||
|
#define HAL_DMAMUX1_SYNC_LPTIM1_OUT 3U /*!< DMAMUX1 synchronization Signal is LPTIM1 OUT */
|
||||||
|
#define HAL_DMAMUX1_SYNC_LPTIM2_OUT 4U /*!< DMAMUX1 synchronization Signal is LPTIM2 OUT */
|
||||||
|
#define HAL_DMAMUX1_SYNC_LPTIM3_OUT 5U /*!< DMAMUX1 synchronization Signal is LPTIM3 OUT */
|
||||||
|
#define HAL_DMAMUX1_SYNC_EXTI0 6U /*!< DMAMUX1 synchronization Signal is EXTI0 IT */
|
||||||
|
#define HAL_DMAMUX1_SYNC_TIM12_TRGO 7U /*!< DMAMUX1 synchronization Signal is TIM12 TRGO */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMAEx_MUX_SyncPolarity_selection DMAEx MUX SyncPolarity selection
|
||||||
|
* @brief DMAEx MUX SyncPolarity selection
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define HAL_DMAMUX_SYNC_NO_EVENT 0x00000000U /*!< block synchronization events */
|
||||||
|
#define HAL_DMAMUX_SYNC_RISING DMAMUX_CxCR_SPOL_0 /*!< synchronize with rising edge events */
|
||||||
|
#define HAL_DMAMUX_SYNC_FALLING DMAMUX_CxCR_SPOL_1 /*!< synchronize with falling edge events */
|
||||||
|
#define HAL_DMAMUX_SYNC_RISING_FALLING DMAMUX_CxCR_SPOL /*!< synchronize with rising and falling edge events */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** @defgroup DMAEx_MUX_SignalGeneratorID_selection DMAEx MUX SignalGeneratorID selection
|
||||||
|
* @brief DMAEx MUX SignalGeneratorID selection
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH0_EVT 0U /*!< DMAMUX1 Request generator Signal is DMAMUX1 Channel0 Event */
|
||||||
|
#define HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH1_EVT 1U /*!< DMAMUX1 Request generator Signal is DMAMUX1 Channel1 Event */
|
||||||
|
#define HAL_DMAMUX1_REQ_GEN_DMAMUX1_CH2_EVT 2U /*!< DMAMUX1 Request generator Signal is DMAMUX1 Channel2 Event */
|
||||||
|
#define HAL_DMAMUX1_REQ_GEN_LPTIM1_OUT 3U /*!< DMAMUX1 Request generator Signal is LPTIM1 OUT */
|
||||||
|
#define HAL_DMAMUX1_REQ_GEN_LPTIM2_OUT 4U /*!< DMAMUX1 Request generator Signal is LPTIM2 OUT */
|
||||||
|
#define HAL_DMAMUX1_REQ_GEN_LPTIM3_OUT 5U /*!< DMAMUX1 Request generator Signal is LPTIM3 OUT */
|
||||||
|
#define HAL_DMAMUX1_REQ_GEN_EXTI0 6U /*!< DMAMUX1 Request generator Signal is EXTI0 IT */
|
||||||
|
#define HAL_DMAMUX1_REQ_GEN_TIM12_TRGO 7U /*!< DMAMUX1 Request generator Signal is TIM12 TRGO */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMAEx_MUX_RequestGeneneratorPolarity_selection DMAEx MUX RequestGeneneratorPolarity selection
|
||||||
|
* @brief DMAEx MUX RequestGeneneratorPolarity selection
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define HAL_DMAMUX_REQ_GEN_NO_EVENT 0x00000000U /*!< block request generator events */
|
||||||
|
#define HAL_DMAMUX_REQ_GEN_RISING DMAMUX_RGxCR_GPOL_0 /*!< generate request on rising edge events */
|
||||||
|
#define HAL_DMAMUX_REQ_GEN_FALLING DMAMUX_RGxCR_GPOL_1 /*!< generate request on falling edge events */
|
||||||
|
#define HAL_DMAMUX_REQ_GEN_RISING_FALLING DMAMUX_RGxCR_GPOL /*!< generate request on rising and falling edge events */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup DMAEx_Exported_Functions DMAEx Exported Functions
|
||||||
|
* @brief DMAEx Exported functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup DMAEx_Exported_Functions_Group1 Extended features functions
|
||||||
|
* @brief Extended features functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* IO operation functions *******************************************************/
|
||||||
|
HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
|
||||||
|
HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength);
|
||||||
|
HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Address, HAL_DMA_MemoryTypeDef memory);
|
||||||
|
HAL_StatusTypeDef HAL_DMAEx_ConfigMuxSync(DMA_HandleTypeDef *hdma, HAL_DMA_MuxSyncConfigTypeDef *pSyncConfig);
|
||||||
|
HAL_StatusTypeDef HAL_DMAEx_ConfigMuxRequestGenerator(DMA_HandleTypeDef *hdma, HAL_DMA_MuxRequestGeneratorConfigTypeDef *pRequestGeneratorConfig);
|
||||||
|
HAL_StatusTypeDef HAL_DMAEx_EnableMuxRequestGenerator(DMA_HandleTypeDef *hdma);
|
||||||
|
HAL_StatusTypeDef HAL_DMAEx_DisableMuxRequestGenerator(DMA_HandleTypeDef *hdma);
|
||||||
|
|
||||||
|
void HAL_DMAEx_MUX_IRQHandler(DMA_HandleTypeDef *hdma);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup DMAEx_Private_Macros DMA Private Macros
|
||||||
|
* @brief DMAEx private macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define IS_DMAMUX_SYNC_SIGNAL_ID(SIGNAL_ID) ((SIGNAL_ID) <= HAL_DMAMUX1_SYNC_TIM12_TRGO)
|
||||||
|
#define IS_DMAMUX_SYNC_REQUEST_NUMBER(REQUEST_NUMBER) (((REQUEST_NUMBER) > 0U) && ((REQUEST_NUMBER) <= 32U))
|
||||||
|
|
||||||
|
#define IS_DMAMUX_SYNC_POLARITY(POLARITY) (((POLARITY) == HAL_DMAMUX_SYNC_NO_EVENT) || \
|
||||||
|
((POLARITY) == HAL_DMAMUX_SYNC_RISING) || \
|
||||||
|
((POLARITY) == HAL_DMAMUX_SYNC_FALLING) || \
|
||||||
|
((POLARITY) == HAL_DMAMUX_SYNC_RISING_FALLING))
|
||||||
|
|
||||||
|
#define IS_DMAMUX_SYNC_STATE(SYNC) (((SYNC) == DISABLE) || ((SYNC) == ENABLE))
|
||||||
|
|
||||||
|
#define IS_DMAMUX_SYNC_EVENT(EVENT) (((EVENT) == DISABLE) || \
|
||||||
|
((EVENT) == ENABLE))
|
||||||
|
|
||||||
|
#define IS_DMAMUX_REQUEST_GEN_SIGNAL_ID(SIGNAL_ID) ((SIGNAL_ID) <= HAL_DMAMUX1_REQ_GEN_TIM12_TRGO)
|
||||||
|
|
||||||
|
#define IS_DMAMUX_REQUEST_GEN_REQUEST_NUMBER(REQUEST_NUMBER) (((REQUEST_NUMBER) > 0U) && ((REQUEST_NUMBER) <= 32U))
|
||||||
|
|
||||||
|
#define IS_DMAMUX_REQUEST_GEN_POLARITY(POLARITY) (((POLARITY) == HAL_DMAMUX_REQ_GEN_NO_EVENT) || \
|
||||||
|
((POLARITY) == HAL_DMAMUX_REQ_GEN_RISING) || \
|
||||||
|
((POLARITY) == HAL_DMAMUX_REQ_GEN_FALLING) || \
|
||||||
|
((POLARITY) == HAL_DMAMUX_REQ_GEN_RISING_FALLING))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
/** @defgroup DMAEx_Private_Functions DMAEx Private Functions
|
||||||
|
* @brief DMAEx Private functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_HAL_DMA_EX_H */
|
||||||
+368
@@ -0,0 +1,368 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_exti.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of EXTI HAL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_HAL_EXTI_H
|
||||||
|
#define STM32MP1xx_HAL_EXTI_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup EXTI EXTI
|
||||||
|
* @brief EXTI HAL module driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup EXTI_Exported_Types EXTI Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_EXTI_COMMON_CB_ID = 0x00U,
|
||||||
|
HAL_EXTI_RISING_CB_ID = 0x01U,
|
||||||
|
HAL_EXTI_FALLING_CB_ID = 0x02U,
|
||||||
|
} EXTI_CallbackIDTypeDef;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief EXTI Handle structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t Line; /*!< Exti line number */
|
||||||
|
void (* RisingCallback)(void); /*!< Exti rising callback */
|
||||||
|
void (* FallingCallback)(void); /*!< Exti falling callback */
|
||||||
|
} EXTI_HandleTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief EXTI Configuration structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t Line; /*!< The Exti line to be configured. This parameter
|
||||||
|
can be a value of @ref EXTI_Line */
|
||||||
|
uint32_t Mode; /*!< The Exit Mode to be configured for a core.
|
||||||
|
This parameter can be a combination of @ref EXTI_Mode */
|
||||||
|
uint32_t Trigger; /*!< The Exti Trigger to be configured. This parameter
|
||||||
|
can be a value of @ref EXTI_Trigger */
|
||||||
|
uint32_t GPIOSel; /*!< The Exti GPIO multiplexer selection to be configured.
|
||||||
|
This parameter is only possible for line 0 to 15. It
|
||||||
|
can be a value of @ref EXTI_GPIOSel */
|
||||||
|
} EXTI_ConfigTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/** @defgroup EXTI_Exported_Constants EXTI Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup EXTI_Line EXTI Line
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define EXTI_LINE_0 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x00u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_1 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x01u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_2 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x02u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_3 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x03u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_4 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x04u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_5 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x05u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_6 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x06u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_7 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x07u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_8 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x08u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_9 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x09u) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_10 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x0Au) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_11 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x0Bu) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_12 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x0Cu) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_13 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x0Du) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_14 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x0Eu) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_15 (EXTI_GPIO | EXTI_EVENT | EXTI_REG1 | 0x0Fu) /* EXTI_GPIO */
|
||||||
|
#define EXTI_LINE_16 (EXTI_CONFIG | EXTI_REG1 | 0x10u) /* PVD and AVD */
|
||||||
|
#define EXTI_LINE_17 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | 0x11u) /* RTC timestamp and SecureError wakeup */
|
||||||
|
#define EXTI_LINE_18 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | 0x12u) /* TAMP tamper and SecureError wakeup */
|
||||||
|
#define EXTI_LINE_19 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG1 | 0x13u) /* RTC Wakeup timer and Alarms (A and B) and SecureError wakeup */
|
||||||
|
#define EXTI_LINE_20 (EXTI_RESERVED | EXTI_REG1 | 0x14u) /* RESERVED */
|
||||||
|
#define EXTI_LINE_21 (EXTI_DIRECT | EXTI_REG1 | 0x15u) /* I2C1 wakeup */
|
||||||
|
#define EXTI_LINE_22 (EXTI_DIRECT | EXTI_REG1 | 0x16u) /* I2C2 wakeup */
|
||||||
|
#define EXTI_LINE_23 (EXTI_DIRECT | EXTI_REG1 | 0x17u) /* I2C3 wakeup */
|
||||||
|
#define EXTI_LINE_24 (EXTI_DIRECT | EXTI_REG1 | 0x18u) /* I2C4 wakeup */
|
||||||
|
#define EXTI_LINE_25 (EXTI_DIRECT | EXTI_REG1 | 0x19u) /* I2C5 wakeup */
|
||||||
|
#define EXTI_LINE_26 (EXTI_DIRECT | EXTI_REG1 | 0x1Au) /* USART1 wakeup */
|
||||||
|
#define EXTI_LINE_27 (EXTI_DIRECT | EXTI_REG1 | 0x1Bu) /* USART2 wakeup */
|
||||||
|
#define EXTI_LINE_28 (EXTI_DIRECT | EXTI_REG1 | 0x1Cu) /* USART3 wakeup */
|
||||||
|
#define EXTI_LINE_29 (EXTI_DIRECT | EXTI_REG1 | 0x1Du) /* USART6 wakeup */
|
||||||
|
#define EXTI_LINE_30 (EXTI_DIRECT | EXTI_REG1 | 0x1Eu) /* UART4 wakeup */
|
||||||
|
#define EXTI_LINE_31 (EXTI_DIRECT | EXTI_REG1 | 0x1Fu) /* UART5 wakeup */
|
||||||
|
#define EXTI_LINE_32 (EXTI_DIRECT | EXTI_REG2 | 0x00u) /* UART7 wakeup */
|
||||||
|
#define EXTI_LINE_33 (EXTI_DIRECT | EXTI_REG2 | 0x01u) /* UART8 wakeup */
|
||||||
|
#define EXTI_LINE_34 (EXTI_RESERVED | EXTI_REG2 | 0x02u) /* RESERVED */
|
||||||
|
#define EXTI_LINE_35 (EXTI_RESERVED | EXTI_REG2 | 0x03u) /* RESERVED */
|
||||||
|
#define EXTI_LINE_36 (EXTI_DIRECT | EXTI_REG2 | 0x04u) /* SPI1 wakeup */
|
||||||
|
#define EXTI_LINE_37 (EXTI_DIRECT | EXTI_REG2 | 0x05u) /* SPI2 wakeup */
|
||||||
|
#define EXTI_LINE_38 (EXTI_DIRECT | EXTI_REG2 | 0x06u) /* SPI3 wakeup */
|
||||||
|
#define EXTI_LINE_39 (EXTI_DIRECT | EXTI_REG2 | 0x07u) /* SPI4 wakeup */
|
||||||
|
#define EXTI_LINE_40 (EXTI_DIRECT | EXTI_REG2 | 0x08u) /* SPI5 wakeup */
|
||||||
|
#define EXTI_LINE_41 (EXTI_DIRECT | EXTI_REG2 | 0x09u) /* SPI6 wakeup */
|
||||||
|
#define EXTI_LINE_42 (EXTI_DIRECT | EXTI_REG2 | 0x0Au) /* MDIOS wakeup */
|
||||||
|
#define EXTI_LINE_43 (EXTI_DIRECT | EXTI_REG2 | 0x0Bu) /* USBH wakeup */
|
||||||
|
#define EXTI_LINE_44 (EXTI_DIRECT | EXTI_REG2 | 0x0Cu) /* OTG wakeup */
|
||||||
|
#define EXTI_LINE_45 (EXTI_DIRECT | EXTI_REG2 | 0x0Du) /* IWDG1 early wake */
|
||||||
|
#define EXTI_LINE_46 (EXTI_DIRECT | EXTI_REG2 | 0x0Eu) /* IWDG1 early wake */
|
||||||
|
#define EXTI_LINE_47 (EXTI_DIRECT | EXTI_REG2 | 0x0Fu) /* LPTIM1 wakeup */
|
||||||
|
#define EXTI_LINE_48 (EXTI_DIRECT | EXTI_REG2 | 0x10u) /* LPTIM2 wakeup */
|
||||||
|
#define EXTI_LINE_49 (EXTI_RESERVED | EXTI_REG2 | 0x11u) /* RESERVED */
|
||||||
|
#define EXTI_LINE_50 (EXTI_DIRECT | EXTI_REG2 | 0x12u) /* LPTIM3 wakeup */
|
||||||
|
#define EXTI_LINE_51 (EXTI_RESERVED | EXTI_REG2 | 0x13u) /* RESERVED */
|
||||||
|
#define EXTI_LINE_52 (EXTI_DIRECT | EXTI_REG2 | 0x14u) /* LPTIM4 wakeup */
|
||||||
|
#define EXTI_LINE_53 (EXTI_DIRECT | EXTI_REG2 | 0x15u) /* LPTIM5 wakeup */
|
||||||
|
#define EXTI_LINE_54 (EXTI_DIRECT | EXTI_REG2 | 0x16u) /* I2C6 wakeup */
|
||||||
|
#define EXTI_LINE_55 (EXTI_DIRECT | EXTI_REG2 | 0x17u) /* WKUP1 wakeup */
|
||||||
|
#define EXTI_LINE_56 (EXTI_DIRECT | EXTI_REG2 | 0x18u) /* WKUP2 wakeup */
|
||||||
|
#define EXTI_LINE_57 (EXTI_DIRECT | EXTI_REG2 | 0x19u) /* WKUP3 wakeup */
|
||||||
|
#define EXTI_LINE_58 (EXTI_DIRECT | EXTI_REG2 | 0x1Au) /* WKUP4 wakeup */
|
||||||
|
#define EXTI_LINE_59 (EXTI_DIRECT | EXTI_REG2 | 0x1Bu) /* WKUP5 wakeup */
|
||||||
|
#define EXTI_LINE_60 (EXTI_DIRECT | EXTI_REG2 | 0x1Cu) /* WKUP6 wakeup */
|
||||||
|
#define EXTI_LINE_61 (EXTI_DIRECT | EXTI_REG2 | 0x1Du) /* IPCC interrupt CPU1 */
|
||||||
|
#define EXTI_LINE_62 (EXTI_DIRECT | EXTI_REG2 | 0x1Eu) /* IPCC interrupt CPU2 */
|
||||||
|
#define EXTI_LINE_63 (EXTI_DIRECT | EXTI_REG2 | 0x1Fu) /* HSEM_IT1 interrupt */
|
||||||
|
#define EXTI_LINE_64 (EXTI_DIRECT | EXTI_REG3 | 0x00u) /* HSEM_IT2 interrupt */
|
||||||
|
#define EXTI_LINE_65 (EXTI_CONFIG | EXTI_REG3 | 0x01u) /* CPU2 SEV interrupt */
|
||||||
|
#define EXTI_LINE_66 (EXTI_CONFIG | EXTI_EVENT | EXTI_REG3 | 0x02u) /* CPU1 SEV interrupt */
|
||||||
|
#define EXTI_LINE_67 (EXTI_RESERVED | EXTI_REG3 | 0x03u) /* RESERVED */
|
||||||
|
#define EXTI_LINE_68 (EXTI_CONFIG | EXTI_REG3 | 0x04u) /* WWDG1 reset */
|
||||||
|
#define EXTI_LINE_69 (EXTI_DIRECT | EXTI_REG3 | 0x05u) /* HDMI CEC wakeup */
|
||||||
|
#define EXTI_LINE_70 (EXTI_DIRECT | EXTI_REG3 | 0x06u) /* ETH1 pmt_intr_o wakeup */
|
||||||
|
#define EXTI_LINE_71 (EXTI_DIRECT | EXTI_REG3 | 0x07u) /* ETH1 lpi_intr_o wakeup */
|
||||||
|
#define EXTI_LINE_72 (EXTI_DIRECT | EXTI_REG3 | 0x08u) /* DTS wakeup */
|
||||||
|
#define EXTI_LINE_73 (EXTI_CONFIG | EXTI_REG3 | 0x09u) /* CPU2 SYSRESETREQ local CPU2 reset */
|
||||||
|
#define EXTI_LINE_74 (EXTI_RESERVED | EXTI_REG3 | 0x0Au) /* RESERVED */
|
||||||
|
#define EXTI_LINE_75 (EXTI_DIRECT | EXTI_REG3 | 0x0Bu) /* CDBGPWRUPREQ event */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup EXTI_Mode EXTI Mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define EXTI_MODE_C1_NONE 0x00000010u
|
||||||
|
#define EXTI_MODE_C1_INTERRUPT 0x00000011u
|
||||||
|
#define EXTI_MODE_C2_NONE 0x00000020u
|
||||||
|
#define EXTI_MODE_C2_INTERRUPT 0x00000021u
|
||||||
|
#define EXTI_MODE_C2_EVENT 0x00000022u
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup EXTI_Trigger EXTI Trigger
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define EXTI_TRIGGER_NONE 0x00000000u
|
||||||
|
#define EXTI_TRIGGER_RISING 0x00000001u
|
||||||
|
#define EXTI_TRIGGER_FALLING 0x00000002u
|
||||||
|
#define EXTI_TRIGGER_RISING_FALLING (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup EXTI_GPIOSel EXTI GPIOSel
|
||||||
|
* @brief
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define EXTI_GPIOA 0x00000000u
|
||||||
|
#define EXTI_GPIOB 0x00000001u
|
||||||
|
#define EXTI_GPIOC 0x00000002u
|
||||||
|
#define EXTI_GPIOD 0x00000003u
|
||||||
|
#define EXTI_GPIOE 0x00000004u
|
||||||
|
#define EXTI_GPIOF 0x00000005u
|
||||||
|
#define EXTI_GPIOG 0x00000006u
|
||||||
|
#define EXTI_GPIOH 0x00000007u
|
||||||
|
#define EXTI_GPIOI 0x00000008u
|
||||||
|
#define EXTI_GPIOJ 0x00000009u
|
||||||
|
#define EXTI_GPIOK 0x0000000Au
|
||||||
|
#define EXTI_GPIOZ 0x0000000Bu
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/** @defgroup EXTI_Exported_Macros EXTI Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private constants --------------------------------------------------------*/
|
||||||
|
/** @defgroup EXTI_Private_Constants EXTI Private Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @brief EXTI Line property definition
|
||||||
|
*/
|
||||||
|
#define EXTI_PROPERTY_SHIFT 24u
|
||||||
|
#define EXTI_DIRECT (0x01uL << EXTI_PROPERTY_SHIFT)
|
||||||
|
#define EXTI_CONFIG (0x02uL << EXTI_PROPERTY_SHIFT)
|
||||||
|
#define EXTI_GPIO ((0x04uL << EXTI_PROPERTY_SHIFT) | EXTI_CONFIG)
|
||||||
|
#define EXTI_RESERVED (0x08uL << EXTI_PROPERTY_SHIFT)
|
||||||
|
#define EXTI_PROPERTY_MASK (EXTI_DIRECT | EXTI_CONFIG | EXTI_GPIO)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief EXTI Event presence definition
|
||||||
|
*/
|
||||||
|
#define EXTI_EVENT_PRESENCE_SHIFT 28u
|
||||||
|
#define EXTI_EVENT (0x01uL << EXTI_EVENT_PRESENCE_SHIFT)
|
||||||
|
#define EXTI_EVENT_PRESENCE_MASK (EXTI_EVENT)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief EXTI Register and bit usage
|
||||||
|
*/
|
||||||
|
#define EXTI_REG_SHIFT 16u
|
||||||
|
#define EXTI_REG1 (0x00uL << EXTI_REG_SHIFT)
|
||||||
|
#define EXTI_REG2 (0x01uL << EXTI_REG_SHIFT)
|
||||||
|
#define EXTI_REG3 (0x02uL << EXTI_REG_SHIFT)
|
||||||
|
#define EXTI_REG_MASK (EXTI_REG1 | EXTI_REG2 | EXTI_REG3)
|
||||||
|
#define EXTI_PIN_MASK 0x0000001Fu
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief EXTI Mask for interrupt & event mode
|
||||||
|
*/
|
||||||
|
#define EXTI_MODE_MASK (EXTI_MODE_C1 | EXTI_MODE_C2 | EXTI_MODE_EVENT | EXTI_MODE_INTERRUPT)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief EXTI Mask for trigger possibilities
|
||||||
|
*/
|
||||||
|
#define EXTI_TRIGGER_MASK (EXTI_TRIGGER_RISING | EXTI_TRIGGER_FALLING)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief EXTI Line number
|
||||||
|
*/
|
||||||
|
#define EXTI_LINE_NB 76uL
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup EXTI_Private_Macros EXTI Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_EXTI_LINE(__LINE__) ((((__LINE__) & ~(EXTI_PROPERTY_MASK | EXTI_EVENT_PRESENCE_MASK | EXTI_REG_MASK | EXTI_PIN_MASK)) == 0x00u) && \
|
||||||
|
((((__LINE__) & EXTI_PROPERTY_MASK) == EXTI_DIRECT) || \
|
||||||
|
(((__LINE__) & EXTI_PROPERTY_MASK) == EXTI_CONFIG) || \
|
||||||
|
(((__LINE__) & EXTI_PROPERTY_MASK) == EXTI_GPIO)) && \
|
||||||
|
(((__LINE__) & (EXTI_REG_MASK | EXTI_PIN_MASK)) < \
|
||||||
|
(((EXTI_LINE_NB / 32u) << EXTI_REG_SHIFT) | (EXTI_LINE_NB % 32u))))
|
||||||
|
|
||||||
|
#define IS_EXTI_MODE(__LINE__) ((((__LINE__) & EXTI_MODE_MASK) != 0x00u) && \
|
||||||
|
(((__LINE__) & ~EXTI_MODE_MASK) == 0x00u))
|
||||||
|
|
||||||
|
#define IS_EXTI_TRIGGER(__LINE__) (((__LINE__) & ~EXTI_TRIGGER_MASK) == 0x00u)
|
||||||
|
|
||||||
|
#define IS_EXTI_PENDING_EDGE(__LINE__) (((__LINE__) == EXTI_TRIGGER_RISING) || \
|
||||||
|
((__LINE__) == EXTI_TRIGGER_FALLING))
|
||||||
|
|
||||||
|
#define IS_EXTI_CONFIG_LINE(__LINE__) (((__LINE__) & EXTI_CONFIG) != 0x00u)
|
||||||
|
|
||||||
|
#define IS_EXTI_GPIO_PORT(__PORT__) (((__PORT__) == EXTI_GPIOA) || \
|
||||||
|
((__PORT__) == EXTI_GPIOB) || \
|
||||||
|
((__PORT__) == EXTI_GPIOC) || \
|
||||||
|
((__PORT__) == EXTI_GPIOD) || \
|
||||||
|
((__PORT__) == EXTI_GPIOE) || \
|
||||||
|
((__PORT__) == EXTI_GPIOF) || \
|
||||||
|
((__PORT__) == EXTI_GPIOG) || \
|
||||||
|
((__PORT__) == EXTI_GPIOH) || \
|
||||||
|
((__PORT__) == EXTI_GPIOI) || \
|
||||||
|
((__PORT__) == EXTI_GPIOK) || \
|
||||||
|
((__PORT__) == EXTI_GPIOZ))
|
||||||
|
#define IS_EXTI_GPIO_PIN(__PIN__) ((__PIN__) < 16u)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup EXTI_Exported_Functions EXTI Exported Functions
|
||||||
|
* @brief EXTI Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup EXTI_Exported_Functions_Group1 Configuration functions
|
||||||
|
* @brief Configuration functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Configuration functions ****************************************************/
|
||||||
|
HAL_StatusTypeDef HAL_EXTI_SetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig);
|
||||||
|
HAL_StatusTypeDef HAL_EXTI_GetConfigLine(EXTI_HandleTypeDef *hexti, EXTI_ConfigTypeDef *pExtiConfig);
|
||||||
|
HAL_StatusTypeDef HAL_EXTI_ClearConfigLine(EXTI_HandleTypeDef *hexti);
|
||||||
|
HAL_StatusTypeDef HAL_EXTI_RegisterCallback(EXTI_HandleTypeDef *hexti, EXTI_CallbackIDTypeDef CallbackID, void (*pPendingCbfn)(void));
|
||||||
|
HAL_StatusTypeDef HAL_EXTI_GetHandle(EXTI_HandleTypeDef *hexti, uint32_t ExtiLine);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup EXTI_Exported_Functions_Group2 IO operation functions
|
||||||
|
* @brief IO operation functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* IO operation functions *****************************************************/
|
||||||
|
void HAL_EXTI_IRQHandler(EXTI_HandleTypeDef *hexti);
|
||||||
|
uint32_t HAL_EXTI_GetPending(EXTI_HandleTypeDef *hexti, uint32_t Edge);
|
||||||
|
void HAL_EXTI_ClearPending(EXTI_HandleTypeDef *hexti, uint32_t Edge);
|
||||||
|
void HAL_EXTI_GenerateSWI(EXTI_HandleTypeDef *hexti);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_HAL_EXTI_H */
|
||||||
+359
@@ -0,0 +1,359 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_gpio.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of GPIO HAL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32MP1xx_HAL_GPIO_H
|
||||||
|
#define __STM32MP1xx_HAL_GPIO_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup GPIO
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIO_Exported_Types GPIO Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GPIO Init structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t Pin; /*!< Specifies the GPIO pins to be configured.
|
||||||
|
This parameter can be any value of @ref GPIO_pins_define */
|
||||||
|
|
||||||
|
uint32_t Mode; /*!< Specifies the operating mode for the selected pins.
|
||||||
|
This parameter can be a value of @ref GPIO_mode_define */
|
||||||
|
|
||||||
|
uint32_t Pull; /*!< Specifies the Pull-up or Pull-Down activation for the selected pins.
|
||||||
|
This parameter can be a value of @ref GPIO_pull_define */
|
||||||
|
|
||||||
|
uint32_t Speed; /*!< Specifies the speed for the selected pins.
|
||||||
|
This parameter can be a value of @ref GPIO_speed_define */
|
||||||
|
|
||||||
|
uint32_t Alternate; /*!< Peripheral to be connected to the selected pins.
|
||||||
|
This parameter can be a value of @ref GPIO_Alternate_function_selection */
|
||||||
|
}GPIO_InitTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief GPIO Bit SET and Bit RESET enumeration
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
GPIO_PIN_RESET = 0,
|
||||||
|
GPIO_PIN_SET
|
||||||
|
}GPIO_PinState;
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_Exported_Constants GPIO Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_pins_define GPIO pins define
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define GPIO_PIN_0 ((uint16_t)0x0001U) /* Pin 0 selected */
|
||||||
|
#define GPIO_PIN_1 ((uint16_t)0x0002U) /* Pin 1 selected */
|
||||||
|
#define GPIO_PIN_2 ((uint16_t)0x0004U) /* Pin 2 selected */
|
||||||
|
#define GPIO_PIN_3 ((uint16_t)0x0008U) /* Pin 3 selected */
|
||||||
|
#define GPIO_PIN_4 ((uint16_t)0x0010U) /* Pin 4 selected */
|
||||||
|
#define GPIO_PIN_5 ((uint16_t)0x0020U) /* Pin 5 selected */
|
||||||
|
#define GPIO_PIN_6 ((uint16_t)0x0040U) /* Pin 6 selected */
|
||||||
|
#define GPIO_PIN_7 ((uint16_t)0x0080U) /* Pin 7 selected */
|
||||||
|
#define GPIO_PIN_8 ((uint16_t)0x0100U) /* Pin 8 selected */
|
||||||
|
#define GPIO_PIN_9 ((uint16_t)0x0200U) /* Pin 9 selected */
|
||||||
|
#define GPIO_PIN_10 ((uint16_t)0x0400U) /* Pin 10 selected */
|
||||||
|
#define GPIO_PIN_11 ((uint16_t)0x0800U) /* Pin 11 selected */
|
||||||
|
#define GPIO_PIN_12 ((uint16_t)0x1000U) /* Pin 12 selected */
|
||||||
|
#define GPIO_PIN_13 ((uint16_t)0x2000U) /* Pin 13 selected */
|
||||||
|
#define GPIO_PIN_14 ((uint16_t)0x4000U) /* Pin 14 selected */
|
||||||
|
#define GPIO_PIN_15 ((uint16_t)0x8000U) /* Pin 15 selected */
|
||||||
|
#define GPIO_PIN_All ((uint16_t)0xFFFFU) /* All pins selected */
|
||||||
|
|
||||||
|
#define GPIO_PIN_MASK ((uint32_t)0x0000FFFFU) /* PIN mask for assert test */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_mode_define GPIO mode define
|
||||||
|
* @brief GPIO Configuration Mode
|
||||||
|
* Elements values convention: 0xX0yz00YZ
|
||||||
|
* - X : GPIO mode or EXTI Mode
|
||||||
|
* - y : External IT or Event trigger detection
|
||||||
|
* - z : IO configuration on External IT or Event
|
||||||
|
* - Y : Output type (Push Pull or Open Drain)
|
||||||
|
* - Z : IO Direction mode (Input, Output, Alternate or Analog)
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define GPIO_MODE_INPUT ((uint32_t)0x00000000U) /*!< Input Floating Mode */
|
||||||
|
#define GPIO_MODE_OUTPUT_PP ((uint32_t)0x00000001U) /*!< Output Push Pull Mode */
|
||||||
|
#define GPIO_MODE_OUTPUT_OD ((uint32_t)0x00000011U) /*!< Output Open Drain Mode */
|
||||||
|
#define GPIO_MODE_AF_PP ((uint32_t)0x00000002U) /*!< Alternate Function Push Pull Mode */
|
||||||
|
#define GPIO_MODE_AF_OD ((uint32_t)0x00000012U) /*!< Alternate Function Open Drain Mode */
|
||||||
|
|
||||||
|
#define GPIO_MODE_AF GPIO_MODE_AF_PP /*!< Alternate Function for Input PIN */
|
||||||
|
|
||||||
|
#define GPIO_MODE_ANALOG ((uint32_t)0x00000003U) /*!< Analog Mode */
|
||||||
|
|
||||||
|
#define GPIO_MODE_IT_RISING ((uint32_t)0x10110000U) /*!< External Interrupt Mode with Rising edge trigger detection */
|
||||||
|
#define GPIO_MODE_IT_FALLING ((uint32_t)0x10210000U) /*!< External Interrupt Mode with Falling edge trigger detection */
|
||||||
|
#define GPIO_MODE_IT_RISING_FALLING ((uint32_t)0x10310000U) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
|
||||||
|
|
||||||
|
#define GPIO_MODE_EVT_RISING ((uint32_t)0x10120000U) /*!< External Event Mode with Rising edge trigger detection */
|
||||||
|
#define GPIO_MODE_EVT_FALLING ((uint32_t)0x10220000U) /*!< External Event Mode with Falling edge trigger detection */
|
||||||
|
#define GPIO_MODE_EVT_RISING_FALLING ((uint32_t)0x10320000U) /*!< External Event Mode with Rising/Falling edge trigger detection */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_speed_define GPIO speed define
|
||||||
|
* @brief GPIO Output Maximum frequency
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define GPIO_SPEED_FREQ_LOW ((uint32_t)0x00000000U) /*!< Low speed */
|
||||||
|
#define GPIO_SPEED_FREQ_MEDIUM ((uint32_t)0x00000001U) /*!< Medium speed */
|
||||||
|
#define GPIO_SPEED_FREQ_HIGH ((uint32_t)0x00000002U) /*!< Fast speed */
|
||||||
|
#define GPIO_SPEED_FREQ_VERY_HIGH ((uint32_t)0x00000003U) /*!< High speed */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_pull_define GPIO pull define
|
||||||
|
* @brief GPIO Pull-Up or Pull-Down Activation
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define GPIO_NOPULL ((uint32_t)0x00000000U) /*!< No Pull-up or Pull-down activation */
|
||||||
|
#define GPIO_PULLUP ((uint32_t)0x00000001U) /*!< Pull-up activation */
|
||||||
|
#define GPIO_PULLDOWN ((uint32_t)0x00000002U) /*!< Pull-down activation */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIO_Exported_Macros GPIO Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Checks whether the specified EXTI line is asserted or not.
|
||||||
|
|
||||||
|
* @param __EXTI_LINE__: specifies the EXTI line to check.
|
||||||
|
* This parameter can be GPIO_PIN_x where x can be(0..15)
|
||||||
|
* @retval The new state of __EXTI_LINE__ (SET or RESET).
|
||||||
|
*/
|
||||||
|
#define __HAL_GPIO_EXTI_GET_IT(__EXTI_LINE__) ((EXTI->RPR1 & (__EXTI_LINE__)) | (EXTI->FPR1 & (__EXTI_LINE__)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clears the EXTI's line pending bits.
|
||||||
|
* @param __EXTI_LINE__: specifies the EXTI lines to clear.
|
||||||
|
* This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
|
||||||
|
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_GPIO_EXTI_CLEAR_IT(__EXTI_LINE__) do { \
|
||||||
|
EXTI->RPR1 = (__EXTI_LINE__); \
|
||||||
|
EXTI->FPR1 = (__EXTI_LINE__); \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Checks whether the specified EXTI line is asserted or not for Rising edge.
|
||||||
|
|
||||||
|
* @param __EXTI_LINE__: specifies the EXTI line to check.
|
||||||
|
* This parameter can be GPIO_PIN_x where x can be(0..15)
|
||||||
|
* @retval The new state of __EXTI_LINE__ (SET or RESET).
|
||||||
|
*/
|
||||||
|
#define __HAL_GPIO_EXTI_GET_RISING_IT(__EXTI_LINE__) (EXTI->RPR1 & (__EXTI_LINE__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Checks whether the specified EXTI line is asserted or not for Falling edge.
|
||||||
|
|
||||||
|
* @param __EXTI_LINE__: specifies the EXTI line to check.
|
||||||
|
* This parameter can be GPIO_PIN_x where x can be(0..15)
|
||||||
|
* @retval The new state of __EXTI_LINE__ (SET or RESET).
|
||||||
|
*/
|
||||||
|
#define __HAL_GPIO_EXTI_GET_FALLING_IT(__EXTI_LINE__) (EXTI->FPR1 & (__EXTI_LINE__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clears the EXTI's line pending bits for Risng edge.
|
||||||
|
* @param __EXTI_LINE__: specifies the EXTI lines to clear.
|
||||||
|
* This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_GPIO_EXTI_CLEAR_RISING_IT(__EXTI_LINE__) do { \
|
||||||
|
EXTI->RPR1 = (__EXTI_LINE__); \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clears the EXTI's line pending bits for Falling edge.
|
||||||
|
* @param __EXTI_LINE__: specifies the EXTI lines to clear.
|
||||||
|
* This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_GPIO_EXTI_CLEAR_FALLING_IT(__EXTI_LINE__) do { \
|
||||||
|
EXTI->FPR1 = (__EXTI_LINE__); \
|
||||||
|
} while (0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Generates a Software interrupt on selected EXTI line.
|
||||||
|
* @param __EXTI_LINE__: specifies the EXTI line to check.
|
||||||
|
* This parameter can be GPIO_PIN_x where x can be(0..15)
|
||||||
|
* @retval None
|
||||||
|
|
||||||
|
*/
|
||||||
|
#define __HAL_GPIO_EXTI_GENERATE_SWIT(__EXTI_LINE__) (EXTI->SWIER1 |= (__EXTI_LINE__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check whether the specified EXTI line flag is set or not.
|
||||||
|
* @param __EXTI_LINE__ specifies the EXTI line flag to check.
|
||||||
|
* This parameter can be GPIO_PIN_x where x can be(0..15)
|
||||||
|
* @retval The new state of __EXTI_LINE__ (SET or RESET).
|
||||||
|
*/
|
||||||
|
#define __HAL_GPIO_EXTI_GET_FLAG(__EXTI_LINE__) __HAL_GPIO_EXTI_GET_IT(__EXTI_LINE__)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear the EXTI line pending flags.
|
||||||
|
* @param __EXTI_LINE__ specifies the EXTI lines flags to clear.
|
||||||
|
* This parameter can be any combination of GPIO_PIN_x where x can be (0..15)
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_GPIO_EXTI_CLEAR_FLAG(__EXTI_LINE__) __HAL_GPIO_EXTI_CLEAR_IT(__EXTI_LINE__)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Include GPIO HAL Extension module */
|
||||||
|
#include "stm32mp1xx_hal_gpio_ex.h"
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @addtogroup GPIO_Exported_Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup GPIO_Exported_Functions_Group1
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Initialization and de-initialization functions *****************************/
|
||||||
|
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init);
|
||||||
|
void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup GPIO_Exported_Functions_Group2
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* IO operation functions *****************************************************/
|
||||||
|
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
|
||||||
|
void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState);
|
||||||
|
void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
|
||||||
|
HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
|
||||||
|
void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin);
|
||||||
|
void HAL_GPIO_EXTI_Rising_Callback(uint16_t GPIO_Pin);
|
||||||
|
void HAL_GPIO_EXTI_Falling_Callback(uint16_t GPIO_Pin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIO_Private_Constants GPIO Private Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIO_Private_Macros GPIO Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_GPIO_PIN_ACTION(ACTION) (((ACTION) == GPIO_PIN_RESET) || ((ACTION) == GPIO_PIN_SET))
|
||||||
|
|
||||||
|
#define IS_GPIO_PIN(__PIN__) ((((uint32_t)(__PIN__) & GPIO_PIN_MASK ) != 0x00u) &&\
|
||||||
|
(((uint32_t)(__PIN__) & ~GPIO_PIN_MASK) == 0x00u))
|
||||||
|
|
||||||
|
#define IS_GPIO_MODE(MODE) (((MODE) == GPIO_MODE_INPUT) ||\
|
||||||
|
((MODE) == GPIO_MODE_OUTPUT_PP) ||\
|
||||||
|
((MODE) == GPIO_MODE_OUTPUT_OD) ||\
|
||||||
|
((MODE) == GPIO_MODE_AF_PP) ||\
|
||||||
|
((MODE) == GPIO_MODE_AF_OD) ||\
|
||||||
|
((MODE) == GPIO_MODE_IT_RISING) ||\
|
||||||
|
((MODE) == GPIO_MODE_IT_FALLING) ||\
|
||||||
|
((MODE) == GPIO_MODE_IT_RISING_FALLING) ||\
|
||||||
|
((MODE) == GPIO_MODE_EVT_RISING) ||\
|
||||||
|
((MODE) == GPIO_MODE_EVT_FALLING) ||\
|
||||||
|
((MODE) == GPIO_MODE_EVT_RISING_FALLING) ||\
|
||||||
|
((MODE) == GPIO_MODE_ANALOG))
|
||||||
|
|
||||||
|
#define IS_GPIO_SPEED(SPEED) (((SPEED) == GPIO_SPEED_FREQ_LOW) || ((SPEED) == GPIO_SPEED_FREQ_MEDIUM) || \
|
||||||
|
((SPEED) == GPIO_SPEED_FREQ_HIGH) || ((SPEED) == GPIO_SPEED_FREQ_VERY_HIGH))
|
||||||
|
|
||||||
|
#define IS_GPIO_PULL(PULL) (((PULL) == GPIO_NOPULL) || ((PULL) == GPIO_PULLUP) || \
|
||||||
|
((PULL) == GPIO_PULLDOWN))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIO_Private_Functions GPIO Private Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_HAL_GPIO_H */
|
||||||
+314
@@ -0,0 +1,314 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_gpio_ex.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of GPIO HAL Extension module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32MP1xx_HAL_GPIO_EX_H
|
||||||
|
#define __STM32MP1xx_HAL_GPIO_EX_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup GPIOEx GPIOEx
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIOEx_Exported_Constants GPIO Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_Alternate_function_selection GPIO Alternate Function Selection
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @brief AF 0 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
|
||||||
|
#define GPIO_AF0_MCO1 ((uint8_t)0x00) /* MCO1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
|
||||||
|
#define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */
|
||||||
|
#define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
|
||||||
|
#define GPIO_AF0_HDP ((uint8_t)0x00) /* HDP Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 1 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */
|
||||||
|
#define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */
|
||||||
|
#define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF1_MCO2 ((uint8_t)0x01) /* MCO2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF1_RTC ((uint8_t)0x01) /* RTC Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 2 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
|
||||||
|
#define GPIO_AF2_TIM12 ((uint8_t)0x02) /* TIM12 Alternate Function mapping */
|
||||||
|
#define GPIO_AF2_SAI1 ((uint8_t)0x02) /* SAI1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF2_SAI4 ((uint8_t)0x02) /* SAI4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF2_I2C6 ((uint8_t)0x02) /* I2C6 Alternate Function mapping */
|
||||||
|
#define GPIO_AF2_MCO1 ((uint8_t)0x02) /* MCO1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF2_MCO2 ((uint8_t)0x02) /* MCO2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF2_HDP ((uint8_t)0x02) /* HDP Alternate Function mapping */
|
||||||
|
/**
|
||||||
|
* @brief AF 3 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
|
||||||
|
#define GPIO_AF3_LPTIM2 ((uint8_t)0x03) /* LPTIM2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF3_DFSDM1 ((uint8_t)0x03) /* DFSDM1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF3_I2C2 ((uint8_t)0x03) /* I2C6 Alternate Function mapping */
|
||||||
|
#define GPIO_AF3_LPTIM3 ((uint8_t)0x03) /* LPTIM3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF3_LPTIM4 ((uint8_t)0x03) /* LPTIM4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF3_LPTIM5 ((uint8_t)0x03) /* LPTIM5 Alternate Function mapping */
|
||||||
|
#define GPIO_AF3_SAI4 ((uint8_t)0x03) /* SAI4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF3_SDIO1 ((uint8_t)0x03) /* SDIO1 Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 4 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_I2C5 ((uint8_t)0x04) /* I2C5 Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_TIM15 ((uint8_t)0x04) /* TIM15 Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_CEC ((uint8_t)0x04) /* CEC Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_DFSDM1 ((uint8_t)0x04) /* DFSDM1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_LPTIM2 ((uint8_t)0x04) /* LPTIM2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_SAI4 ((uint8_t)0x04) /* SAI4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 5 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */
|
||||||
|
#define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */
|
||||||
|
#define GPIO_AF5_CEC ((uint8_t)0x05) /* CEC Alternate Function mapping */
|
||||||
|
#define GPIO_AF5_I2C1 ((uint8_t)0x05) /* I2C1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF5_SDIO1 ((uint8_t)0x05) /* SDIO1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF5_SDIO3 ((uint8_t)0x05) /* SDIO3 Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 6 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF6_SAI3 ((uint8_t)0x06) /* SAI3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF6_SAI4 ((uint8_t)0x06) /* SAI4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF6_I2C4 ((uint8_t)0x06) /* I2C4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF6_UART4 ((uint8_t)0x06) /* UART4 Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 7 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF7_SPI2 ((uint8_t)0x07) /* SPI2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF7_SPI3 ((uint8_t)0x07) /* SPI3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF7_SPI6 ((uint8_t)0x07) /* SPI6 Alternate Function mapping */
|
||||||
|
#define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF7_USART6 ((uint8_t)0x07) /* USART6 Alternate Function mapping */
|
||||||
|
#define GPIO_AF7_UART7 ((uint8_t)0x07) /* UART7 Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 8 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF8_SPI6 ((uint8_t)0x08) /* SPI6 Alternate Function mapping */
|
||||||
|
#define GPIO_AF8_SAI2 ((uint8_t)0x08) /* SAI2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF8_USART3 ((uint8_t)0x08) /* USART3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
|
||||||
|
#define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */
|
||||||
|
#define GPIO_AF8_SPDIF ((uint8_t)0x08) /* SPDIF Alternate Function mapping */
|
||||||
|
#define GPIO_AF8_SDIO1 ((uint8_t)0x08) /* SDIO1 Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 9 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF9_QUADSPI ((uint8_t)0x09) /* QUADSPI Alternate Function mapping */
|
||||||
|
#if defined (FDCAN1)
|
||||||
|
#define GPIO_AF9_FDCAN1 ((uint8_t)0x09) /* FDCAN1 Alternate Function mapping */
|
||||||
|
#endif
|
||||||
|
#if defined (FDCAN2)
|
||||||
|
#define GPIO_AF9_FDCAN2 ((uint8_t)0x09) /* FDCAN2 Alternate Function mapping */
|
||||||
|
#endif
|
||||||
|
#define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
|
||||||
|
#define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
|
||||||
|
#define GPIO_AF9_SDIO2 ((uint8_t)0x09) /* SDIO2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF9_LCD ((uint8_t)0x09) /* LCD Alternate Function mapping */
|
||||||
|
#define GPIO_AF9_SPDIF ((uint8_t)0x09) /* SPDIF Alternate Function mapping */
|
||||||
|
#define GPIO_AF9_SDIO3 ((uint8_t)0x09) /* SDIO3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF9_SDIO2 ((uint8_t)0x09) /* SDIO3 Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 10 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF10_QUADSPI ((uint8_t)0xA) /* QUADSPI Alternate Function mapping */
|
||||||
|
#define GPIO_AF10_SAI2 ((uint8_t)0xA) /* SAI2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF10_SAI4 ((uint8_t)0xA) /* SAI4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF10_SDIO2 ((uint8_t)0xA) /* SDIO2 Alternate Function mapping */
|
||||||
|
#define GPIO_AF10_SDIO3 ((uint8_t)0xA) /* SDIO3 Alternate Function mapping */
|
||||||
|
#define GPIO_AF10_OTG2_HS ((uint8_t)0xA) /* OTG2_HS Alternate Function mapping */
|
||||||
|
#define GPIO_AF10_OTG1_FS ((uint8_t)0xA) /* OTG1_FS Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 11 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF11_DFSDM1 ((uint8_t)0x0B) /* DFSDM1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF11_QUADSPI ((uint8_t)0x0B) /* QUADSPI Alternate Function mapping */
|
||||||
|
#define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETH Alternate Function mapping */
|
||||||
|
#if defined (DSI)
|
||||||
|
#define GPIO_AF11_DSI ((uint8_t)0x0B) /* DSI Alternate Function mapping */
|
||||||
|
#endif
|
||||||
|
#define GPIO_AF11_SDIO1 ((uint8_t)0x0B) /* SDIO1 Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 12 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF12_UART5 ((uint8_t)0xC) /* UART5 Alternate Function mapping */
|
||||||
|
#define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */
|
||||||
|
#define GPIO_AF12_SDIO1 ((uint8_t)0xC) /* SDIO1 Alternate Function mapping */
|
||||||
|
#define GPIO_AF12_MDIOS ((uint8_t)0xC) /* MDIOS Alternate Function mapping */
|
||||||
|
#define GPIO_AF12_SAI4 ((uint8_t)0xC) /* SAI4 Alternate Function mapping */
|
||||||
|
#define GPIO_AF12_SDIO1 ((uint8_t)0xC) /* SAI4 Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 13 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF13_UART7 ((uint8_t)0x0D) /* UART7 Alternate Function mapping */
|
||||||
|
#define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
|
||||||
|
#define GPIO_AF13_LCD ((uint8_t)0x0D) /* LCD Alternate Function mapping */
|
||||||
|
#if defined (DSI)
|
||||||
|
#define GPIO_AF13_DSI ((uint8_t)0x0D) /* DSI Alternate Function mapping */
|
||||||
|
#endif
|
||||||
|
#define GPIO_AF13_RNG ((uint8_t)0x0D) /* RNG Alternate Function mapping */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 14 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF14_UART5 ((uint8_t)0x0E) /* UART5 Alternate Function mapping */
|
||||||
|
#define GPIO_AF14_LCD ((uint8_t)0x0E) /* LCD Alternate Function mapping */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief AF 15 selection
|
||||||
|
*/
|
||||||
|
#define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
|
||||||
|
|
||||||
|
#define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIOEx_Private_Macros GPIO Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/** @defgroup GPIOEx_Get_Port_Index GPIO Get Port Index
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\
|
||||||
|
((__GPIOx__) == (GPIOB))? 1U :\
|
||||||
|
((__GPIOx__) == (GPIOC))? 2U :\
|
||||||
|
((__GPIOx__) == (GPIOD))? 3U :\
|
||||||
|
((__GPIOx__) == (GPIOE))? 4U :\
|
||||||
|
((__GPIOx__) == (GPIOF))? 5U :\
|
||||||
|
((__GPIOx__) == (GPIOG))? 6U :\
|
||||||
|
((__GPIOx__) == (GPIOH))? 7U :\
|
||||||
|
((__GPIOx__) == (GPIOI))? 8U :\
|
||||||
|
((__GPIOx__) == (GPIOJ))? 9U :\
|
||||||
|
((__GPIOx__) == (GPIOK))? 10U :\
|
||||||
|
((__GPIOx__) == (GPIOZ))? 11U : 25U)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @addtogroup GPIOEx_Exported_Functions GPIO Extended Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup GPIOEx_Exported_Functions_Group1 Extended Peripheral Control functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
void HAL_GPIOEx_SecurePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
|
||||||
|
void HAL_GPIOEx_NonSecurePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
|
||||||
|
|
||||||
|
|
||||||
|
GPIO_PinState HAL_GPIOEx_IsPinSecured(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_HAL_GPIO_EX_H */
|
||||||
+207
@@ -0,0 +1,207 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_hsem.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of HSEM HAL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_HAL_HSEM_H
|
||||||
|
#define STM32MP1xx_HAL_HSEM_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HSEM
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/** @defgroup HSEM_Exported_Macros HSEM Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief SemID to mask helper Macro.
|
||||||
|
* @param __SEMID__: semaphore ID from 0 to 31
|
||||||
|
* @retval Semaphore Mask.
|
||||||
|
*/
|
||||||
|
#define __HAL_HSEM_SEMID_TO_MASK(__SEMID__) (1 << (__SEMID__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables the specified HSEM interrupts.
|
||||||
|
* @param __SEM_MASK__: semaphores Mask
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#if defined(DUAL_CORE)
|
||||||
|
#define __HAL_HSEM_ENABLE_IT(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
|
||||||
|
(HSEM->C1IER |= (__SEM_MASK__)) : \
|
||||||
|
(HSEM->C2IER |= (__SEM_MASK__)))
|
||||||
|
#else
|
||||||
|
#define __HAL_HSEM_ENABLE_IT(__SEM_MASK__) (HSEM->IER |= (__SEM_MASK__))
|
||||||
|
#endif /* DUAL_CORE */
|
||||||
|
/**
|
||||||
|
* @brief Disables the specified HSEM interrupts.
|
||||||
|
* @param __SEM_MASK__: semaphores Mask
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#if defined(DUAL_CORE)
|
||||||
|
#define __HAL_HSEM_DISABLE_IT(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
|
||||||
|
(HSEM->C1IER &= ~(__SEM_MASK__)) : \
|
||||||
|
(HSEM->C2IER &= ~(__SEM_MASK__)))
|
||||||
|
#else
|
||||||
|
#define __HAL_HSEM_DISABLE_IT(__SEM_MASK__) (HSEM->IER &= ~(__SEM_MASK__))
|
||||||
|
#endif /* DUAL_CORE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Checks whether interrupt has occurred or not for semaphores specified by a mask.
|
||||||
|
* @param __SEM_MASK__: semaphores Mask
|
||||||
|
* @retval semaphores Mask : Semaphores where an interrupt occurred.
|
||||||
|
*/
|
||||||
|
#if defined(DUAL_CORE)
|
||||||
|
#define __HAL_HSEM_GET_IT(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
|
||||||
|
((__SEM_MASK__) & HSEM->C1MISR) : \
|
||||||
|
((__SEM_MASK__) & HSEM->C2MISR1))
|
||||||
|
#else
|
||||||
|
#define __HAL_HSEM_GET_IT(__SEM_MASK__) ((__SEM_MASK__) & HSEM->MISR)
|
||||||
|
#endif /* DUAL_CORE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the semaphores release status flags.
|
||||||
|
* @param __SEM_MASK__: semaphores Mask
|
||||||
|
* @retval semaphores Mask : Semaphores where Release flags rise.
|
||||||
|
*/
|
||||||
|
#if defined(DUAL_CORE)
|
||||||
|
#define __HAL_HSEM_GET_FLAG(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
|
||||||
|
(__SEM_MASK__) & HSEM->C1ISR : \
|
||||||
|
(__SEM_MASK__) & HSEM->C2ISR)
|
||||||
|
#else
|
||||||
|
#define __HAL_HSEM_GET_FLAG(__SEM_MASK__) ((__SEM_MASK__) & HSEM->ISR)
|
||||||
|
#endif /* DUAL_CORE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clears the HSEM Interrupt flags.
|
||||||
|
* @param __SEM_MASK__: semaphores Mask
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#if defined(DUAL_CORE)
|
||||||
|
#define __HAL_HSEM_CLEAR_FLAG(__SEM_MASK__) ((((SCB->CPUID & 0x000000F0) >> 4 )== 0x7) ? \
|
||||||
|
(HSEM->C1ICR |= (__SEM_MASK__)) : \
|
||||||
|
(HSEM->C2ICR |= (__SEM_MASK__)))
|
||||||
|
#else
|
||||||
|
#define __HAL_HSEM_CLEAR_FLAG(__SEM_MASK__) (HSEM->ICR |= (__SEM_MASK__))
|
||||||
|
#endif /* DUAL_CORE */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup HSEM_Exported_Functions HSEM Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HSEM_Exported_Functions_Group1 Take and Release functions
|
||||||
|
* @brief HSEM Take and Release functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* HSEM semaphore take (lock) using 2-Step method ****************************/
|
||||||
|
HAL_StatusTypeDef HAL_HSEM_Take(uint32_t SemID, uint32_t ProcessID);
|
||||||
|
/* HSEM semaphore fast take (lock) using 1-Step method ***********************/
|
||||||
|
HAL_StatusTypeDef HAL_HSEM_FastTake(uint32_t SemID);
|
||||||
|
/* HSEM Check semaphore state Taken or not **********************************/
|
||||||
|
uint32_t HAL_HSEM_IsSemTaken(uint32_t SemID);
|
||||||
|
/* HSEM Release **************************************************************/
|
||||||
|
void HAL_HSEM_Release(uint32_t SemID, uint32_t ProcessID);
|
||||||
|
/* HSEM Release All************************************************************/
|
||||||
|
void HAL_HSEM_ReleaseAll(uint32_t Key, uint32_t CoreID);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HSEM_Exported_Functions_Group2 HSEM Set and Get Key functions
|
||||||
|
* @brief HSEM Set and Get Key functions.
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* HSEM Set Clear Key *********************************************************/
|
||||||
|
void HAL_HSEM_SetClearKey(uint32_t Key);
|
||||||
|
/* HSEM Get Clear Key *********************************************************/
|
||||||
|
uint32_t HAL_HSEM_GetClearKey(void);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup HSEM_Exported_Functions_Group3
|
||||||
|
* @brief HSEM Notification functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* HSEM Activate HSEM Notification (When a semaphore is released) ) *****************/
|
||||||
|
void HAL_HSEM_ActivateNotification(uint32_t SemMask);
|
||||||
|
/* HSEM Deactivate HSEM Notification (When a semaphore is released) ****************/
|
||||||
|
void HAL_HSEM_DeactivateNotification(uint32_t SemMask);
|
||||||
|
/* HSEM Free Callback (When a semaphore is released) *******************************/
|
||||||
|
void HAL_HSEM_FreeCallback(uint32_t SemMask);
|
||||||
|
/* HSEM IRQ Handler **********************************************************/
|
||||||
|
void HAL_HSEM_IRQHandler(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup HSEM_Private_Macros HSEM Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define IS_HSEM_SEMID(__SEMID__) ((__SEMID__) <= HSEM_SEMID_MAX )
|
||||||
|
|
||||||
|
#define IS_HSEM_PROCESSID(__PROCESSID__) ((__PROCESSID__) <= HSEM_PROCESSID_MAX )
|
||||||
|
|
||||||
|
#define IS_HSEM_KEY(__KEY__) ((__KEY__) <= HSEM_CLEAR_KEY_MAX )
|
||||||
|
|
||||||
|
#define IS_HSEM_COREID(__COREID__) (((__COREID__) == HSEM_CPU1_COREID) || \
|
||||||
|
((__COREID__) == HSEM_CPU2_COREID))
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_HAL_HSEM_H */
|
||||||
+289
@@ -0,0 +1,289 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_ipcc.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of Mailbox HAL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_HAL_IPCC_H
|
||||||
|
#define STM32MP1xx_HAL_IPCC_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC IPCC
|
||||||
|
* @brief IPCC HAL module driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_Exported_Constants IPCC Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_Channel IPCC Channel
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IPCC_CHANNEL_1 0x00000000U
|
||||||
|
#define IPCC_CHANNEL_2 0x00000001U
|
||||||
|
#define IPCC_CHANNEL_3 0x00000002U
|
||||||
|
#define IPCC_CHANNEL_4 0x00000003U
|
||||||
|
#define IPCC_CHANNEL_5 0x00000004U
|
||||||
|
#define IPCC_CHANNEL_6 0x00000005U
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/** @defgroup IPCC_Exported_Types IPCC Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL IPCC State structures definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_IPCC_STATE_RESET = 0x00U, /*!< IPCC not yet initialized or disabled */
|
||||||
|
HAL_IPCC_STATE_READY = 0x01U, /*!< IPCC initialized and ready for use */
|
||||||
|
HAL_IPCC_STATE_BUSY = 0x02U /*!< IPCC internal processing is ongoing */
|
||||||
|
} HAL_IPCC_StateTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief IPCC channel direction structure definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
IPCC_CHANNEL_DIR_TX = 0x00U, /*!< Channel direction Tx is used by an MCU to transmit */
|
||||||
|
IPCC_CHANNEL_DIR_RX = 0x01U /*!< Channel direction Rx is used by an MCU to receive */
|
||||||
|
} IPCC_CHANNELDirTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief IPCC channel status structure definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
IPCC_CHANNEL_STATUS_FREE = 0x00U, /*!< Means that a new msg can be posted on that channel */
|
||||||
|
IPCC_CHANNEL_STATUS_OCCUPIED = 0x01U /*!< An MCU has posted a msg the other MCU hasn't retrieved */
|
||||||
|
} IPCC_CHANNELStatusTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief IPCC handle structure definition
|
||||||
|
*/
|
||||||
|
typedef struct __IPCC_HandleTypeDef
|
||||||
|
{
|
||||||
|
IPCC_TypeDef *Instance; /*!< IPCC registers base address */
|
||||||
|
void (* ChannelCallbackRx[IPCC_CHANNEL_NUMBER])(struct __IPCC_HandleTypeDef *hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir); /*!< Rx Callback registration table */
|
||||||
|
void (* ChannelCallbackTx[IPCC_CHANNEL_NUMBER])(struct __IPCC_HandleTypeDef *hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir); /*!< Tx Callback registration table */
|
||||||
|
uint32_t callbackRequest; /*!< Store information about callback notification by channel */
|
||||||
|
__IO HAL_IPCC_StateTypeDef State; /*!< IPCC State: initialized or not */
|
||||||
|
} IPCC_HandleTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief IPCC callback typedef
|
||||||
|
*/
|
||||||
|
typedef void ChannelCb(IPCC_HandleTypeDef *hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macros -----------------------------------------------------------*/
|
||||||
|
/** @defgroup IPCC_Exported_Macros IPCC Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable the specified interrupt.
|
||||||
|
* @param __HANDLE__ specifies the IPCC Handle
|
||||||
|
* @param __CHDIRECTION__ specifies the channels Direction
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg @ref IPCC_CHANNEL_DIR_TX Transmit channel free interrupt enable
|
||||||
|
* @arg @ref IPCC_CHANNEL_DIR_RX Receive channel occupied interrupt enable
|
||||||
|
*/
|
||||||
|
#if defined(CORE_CM4)
|
||||||
|
#define __HAL_IPCC_ENABLE_IT(__HANDLE__, __CHDIRECTION__) \
|
||||||
|
(((__CHDIRECTION__) == IPCC_CHANNEL_DIR_RX) ? \
|
||||||
|
((__HANDLE__)->Instance->C2CR |= IPCC_C2CR_RXOIE) : \
|
||||||
|
((__HANDLE__)->Instance->C2CR |= IPCC_C2CR_TXFIE))
|
||||||
|
#else
|
||||||
|
#define __HAL_IPCC_ENABLE_IT(__HANDLE__, __CHDIRECTION__) \
|
||||||
|
(((__CHDIRECTION__) == IPCC_CHANNEL_DIR_RX) ? \
|
||||||
|
((__HANDLE__)->Instance->C1CR |= IPCC_C1CR_RXOIE) : \
|
||||||
|
((__HANDLE__)->Instance->C1CR |= IPCC_C1CR_TXFIE))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable the specified interrupt.
|
||||||
|
* @param __HANDLE__ specifies the IPCC Handle
|
||||||
|
* @param __CHDIRECTION__ specifies the channels Direction
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg @ref IPCC_CHANNEL_DIR_TX Transmit channel free interrupt enable
|
||||||
|
* @arg @ref IPCC_CHANNEL_DIR_RX Receive channel occupied interrupt enable
|
||||||
|
*/
|
||||||
|
#if defined(CORE_CM4)
|
||||||
|
#define __HAL_IPCC_DISABLE_IT(__HANDLE__, __CHDIRECTION__) \
|
||||||
|
(((__CHDIRECTION__) == IPCC_CHANNEL_DIR_RX) ? \
|
||||||
|
((__HANDLE__)->Instance->C2CR &= ~IPCC_C2CR_RXOIE) : \
|
||||||
|
((__HANDLE__)->Instance->C2CR &= ~IPCC_C2CR_TXFIE))
|
||||||
|
#else
|
||||||
|
#define __HAL_IPCC_DISABLE_IT(__HANDLE__, __CHDIRECTION__) \
|
||||||
|
(((__CHDIRECTION__) == IPCC_CHANNEL_DIR_RX) ? \
|
||||||
|
((__HANDLE__)->Instance->C1CR &= ~IPCC_C1CR_RXOIE) : \
|
||||||
|
((__HANDLE__)->Instance->C1CR &= ~IPCC_C1CR_TXFIE))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mask the specified interrupt.
|
||||||
|
* @param __HANDLE__ specifies the IPCC Handle
|
||||||
|
* @param __CHDIRECTION__ specifies the channels Direction
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg @ref IPCC_CHANNEL_DIR_TX Transmit channel free interrupt enable
|
||||||
|
* @arg @ref IPCC_CHANNEL_DIR_RX Receive channel occupied interrupt enable
|
||||||
|
* @param __CHINDEX__ specifies the channels number:
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg IPCC_CHANNEL_1: IPCC Channel 1
|
||||||
|
* @arg IPCC_CHANNEL_2: IPCC Channel 2
|
||||||
|
* @arg IPCC_CHANNEL_3: IPCC Channel 3
|
||||||
|
* @arg IPCC_CHANNEL_4: IPCC Channel 4
|
||||||
|
* @arg IPCC_CHANNEL_5: IPCC Channel 5
|
||||||
|
* @arg IPCC_CHANNEL_6: IPCC Channel 6
|
||||||
|
*/
|
||||||
|
#if defined(CORE_CM4)
|
||||||
|
#define __HAL_IPCC_MASK_CHANNEL_IT(__HANDLE__, __CHDIRECTION__, __CHINDEX__) \
|
||||||
|
(((__CHDIRECTION__) == IPCC_CHANNEL_DIR_RX) ? \
|
||||||
|
((__HANDLE__)->Instance->C2MR |= (IPCC_C1MR_CH1OM_Msk << (__CHINDEX__))) : \
|
||||||
|
((__HANDLE__)->Instance->C2MR |= (IPCC_C1MR_CH1FM_Msk << (__CHINDEX__))))
|
||||||
|
#else
|
||||||
|
#define __HAL_IPCC_MASK_CHANNEL_IT(__HANDLE__, __CHDIRECTION__, __CHINDEX__) \
|
||||||
|
(((__CHDIRECTION__) == IPCC_CHANNEL_DIR_RX) ? \
|
||||||
|
((__HANDLE__)->Instance->C1MR |= (IPCC_C1MR_CH1OM_Msk << (__CHINDEX__))) : \
|
||||||
|
((__HANDLE__)->Instance->C1MR |= (IPCC_C1MR_CH1FM_Msk << (__CHINDEX__))))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Unmask the specified interrupt.
|
||||||
|
* @param __HANDLE__ specifies the IPCC Handle
|
||||||
|
* @param __CHDIRECTION__ specifies the channels Direction
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg @ref IPCC_CHANNEL_DIR_TX Transmit channel free interrupt enable
|
||||||
|
* @arg @ref IPCC_CHANNEL_DIR_RX Receive channel occupied interrupt enable
|
||||||
|
* @param __CHINDEX__ specifies the channels number:
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg IPCC_CHANNEL_1: IPCC Channel 1
|
||||||
|
* @arg IPCC_CHANNEL_2: IPCC Channel 2
|
||||||
|
* @arg IPCC_CHANNEL_3: IPCC Channel 3
|
||||||
|
* @arg IPCC_CHANNEL_4: IPCC Channel 4
|
||||||
|
* @arg IPCC_CHANNEL_5: IPCC Channel 5
|
||||||
|
* @arg IPCC_CHANNEL_6: IPCC Channel 6
|
||||||
|
*/
|
||||||
|
#if defined(CORE_CM4)
|
||||||
|
#define __HAL_IPCC_UNMASK_CHANNEL_IT(__HANDLE__, __CHDIRECTION__, __CHINDEX__) \
|
||||||
|
(((__CHDIRECTION__) == IPCC_CHANNEL_DIR_RX) ? \
|
||||||
|
((__HANDLE__)->Instance->C2MR &= ~(IPCC_C1MR_CH1OM_Msk << (__CHINDEX__))) : \
|
||||||
|
((__HANDLE__)->Instance->C2MR &= ~(IPCC_C1MR_CH1FM_Msk << (__CHINDEX__))))
|
||||||
|
#else
|
||||||
|
#define __HAL_IPCC_UNMASK_CHANNEL_IT(__HANDLE__, __CHDIRECTION__, __CHINDEX__) \
|
||||||
|
(((__CHDIRECTION__) == IPCC_CHANNEL_DIR_RX) ? \
|
||||||
|
((__HANDLE__)->Instance->C1MR &= ~(IPCC_C1MR_CH1OM_Msk << (__CHINDEX__))) : \
|
||||||
|
((__HANDLE__)->Instance->C1MR &= ~(IPCC_C1MR_CH1FM_Msk << (__CHINDEX__))))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup IPCC_Exported_Functions IPCC Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Initialization and de-initialization functions *******************************/
|
||||||
|
/** @defgroup IPCC_Exported_Functions_Group1 Initialization and deinitialization functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef HAL_IPCC_Init(IPCC_HandleTypeDef *hipcc);
|
||||||
|
HAL_StatusTypeDef HAL_IPCC_DeInit(IPCC_HandleTypeDef *hipcc);
|
||||||
|
void HAL_IPCC_MspInit(IPCC_HandleTypeDef *hipcc);
|
||||||
|
void HAL_IPCC_MspDeInit(IPCC_HandleTypeDef *hipcc);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_Exported_Functions_Group2 Communication functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* IO operation functions *****************************************************/
|
||||||
|
HAL_StatusTypeDef HAL_IPCC_ActivateNotification(IPCC_HandleTypeDef *hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir, ChannelCb cb);
|
||||||
|
HAL_StatusTypeDef HAL_IPCC_DeActivateNotification(IPCC_HandleTypeDef *hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir);
|
||||||
|
IPCC_CHANNELStatusTypeDef HAL_IPCC_GetChannelStatus(IPCC_HandleTypeDef const *const hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir);
|
||||||
|
HAL_StatusTypeDef HAL_IPCC_NotifyCPU(IPCC_HandleTypeDef const *const hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_Exported_Functions_Group3 Peripheral State and Error functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Peripheral State and Error functions ****************************************/
|
||||||
|
HAL_IPCC_StateTypeDef HAL_IPCC_GetState(IPCC_HandleTypeDef const *const hipcc);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_IRQ_Handler_and_Callbacks Peripheral IRQ Handler and Callbacks
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* IRQHandler and Callbacks used in non blocking modes ************************/
|
||||||
|
void HAL_IPCC_TX_IRQHandler(IPCC_HandleTypeDef *const hipcc);
|
||||||
|
void HAL_IPCC_RX_IRQHandler(IPCC_HandleTypeDef *const hipcc);
|
||||||
|
void HAL_IPCC_TxCallback(IPCC_HandleTypeDef *hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir);
|
||||||
|
void HAL_IPCC_RxCallback(IPCC_HandleTypeDef *hipcc, uint32_t ChannelIndex, IPCC_CHANNELDirTypeDef ChannelDir);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_HAL_IPCC_H */
|
||||||
|
|
||||||
+860
@@ -0,0 +1,860 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_mdma.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of DMA HAL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_HAL_MDMA_H
|
||||||
|
#define STM32MP1xx_HAL_MDMA_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup MDMA
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Exported_Types MDMA Exported Types
|
||||||
|
* @brief MDMA Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief MDMA Configuration Structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
|
||||||
|
uint32_t Request; /*!< Specifies the MDMA request.
|
||||||
|
This parameter can be a value of @ref MDMA_Request_selection*/
|
||||||
|
|
||||||
|
uint32_t TransferTriggerMode; /*!< Specifies the Trigger Transfer mode : each request triggers a :
|
||||||
|
a buffer transfer, a block transfer, a repeated block transfer or a linked list transfer
|
||||||
|
This parameter can be a value of @ref MDMA_Transfer_TriggerMode */
|
||||||
|
|
||||||
|
uint32_t Priority; /*!< Specifies the software priority for the MDMAy channelx.
|
||||||
|
This parameter can be a value of @ref MDMA_Priority_level */
|
||||||
|
|
||||||
|
uint32_t SecureMode; /*!< Specifies if the MDMA master transactions are done in secure mode.
|
||||||
|
This parameter can be a value of @ref MDMA_Secure_Mode */
|
||||||
|
|
||||||
|
uint32_t Endianness; /*!< Specifies if the MDMA transactions preserve the Little endianness.
|
||||||
|
This parameter can be a value of @ref MDMA_Endianness */
|
||||||
|
|
||||||
|
uint32_t SourceInc; /*!< Specifies if the Source increment mode .
|
||||||
|
This parameter can be a value of @ref MDMA_Source_increment_mode */
|
||||||
|
|
||||||
|
uint32_t DestinationInc; /*!< Specifies if the Destination increment mode .
|
||||||
|
This parameter can be a value of @ref MDMA_Destination_increment_mode */
|
||||||
|
|
||||||
|
uint32_t SourceDataSize; /*!< Specifies the source data size.
|
||||||
|
This parameter can be a value of @ref MDMA_Source_data_size */
|
||||||
|
|
||||||
|
uint32_t DestDataSize; /*!< Specifies the destination data size.
|
||||||
|
This parameter can be a value of @ref MDMA_Destination_data_size */
|
||||||
|
|
||||||
|
|
||||||
|
uint32_t DataAlignment; /*!< Specifies the source to destination Memory data packing/padding mode.
|
||||||
|
This parameter can be a value of @ref MDMA_data_Alignment */
|
||||||
|
|
||||||
|
uint32_t BufferTransferLength; /*!< Specifies the buffer Transfer Length (number of bytes),
|
||||||
|
this is the number of bytes to be transferred in a single transfer (1 byte to 128 bytes)*/
|
||||||
|
|
||||||
|
uint32_t SourceBurst; /*!< Specifies the Burst transfer configuration for the source memory transfers.
|
||||||
|
It specifies the amount of data to be transferred in a single non interruptable
|
||||||
|
transaction.
|
||||||
|
This parameter can be a value of @ref MDMA_Source_burst
|
||||||
|
@note : the burst may be FIXED/INCR based on SourceInc value ,
|
||||||
|
the BURST must be programmed as to ensure that the burst size will be lower than than
|
||||||
|
BufferTransferLength */
|
||||||
|
|
||||||
|
uint32_t DestBurst; /*!< Specifies the Burst transfer configuration for the destination memory transfers.
|
||||||
|
It specifies the amount of data to be transferred in a single non interruptable
|
||||||
|
transaction.
|
||||||
|
This parameter can be a value of @ref MDMA_Destination_burst
|
||||||
|
@note : the burst may be FIXED/INCR based on DestinationInc value ,
|
||||||
|
the BURST must be programmed as to ensure that the burst size will be lower than than
|
||||||
|
BufferTransferLength */
|
||||||
|
|
||||||
|
int32_t SourceBlockAddressOffset; /*!< this field specifies the Next block source address offset
|
||||||
|
signed value : if > 0 then increment the next block source Address by offset from where the last block ends
|
||||||
|
if < 0 then decrement the next block source Address by offset from where the last block ends
|
||||||
|
if == 0, the next block source address starts from where the last block ends
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
int32_t DestBlockAddressOffset; /*!< this field specifies the Next block destination address offset
|
||||||
|
signed value : if > 0 then increment the next block destination Address by offset from where the last block ends
|
||||||
|
if < 0 then decrement the next block destination Address by offset from where the last block ends
|
||||||
|
if == 0, the next block destination address starts from where the last block ends
|
||||||
|
*/
|
||||||
|
|
||||||
|
}MDMA_InitTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL MDMA linked list node structure definition
|
||||||
|
* @note The Linked list node allows to define a new MDMA configuration
|
||||||
|
* (CTCR ,CBNDTR ,CSAR ,CDAR ,CBRUR, CLAR, CTBR, CMAR and CMDR registers).
|
||||||
|
* When CLAR register is configured to a non NULL value , each time a transfer ends,
|
||||||
|
* a new configuration (linked list node) is automatically loaded from the address given in CLAR register.
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
__IO uint32_t CTCR; /*!< New CTCR register configuration for the given MDMA linked list node */
|
||||||
|
__IO uint32_t CBNDTR; /*!< New CBNDTR register configuration for the given MDMA linked list node */
|
||||||
|
__IO uint32_t CSAR; /*!< New CSAR register configuration for the given MDMA linked list node */
|
||||||
|
__IO uint32_t CDAR; /*!< New CDAR register configuration for the given MDMA linked list node */
|
||||||
|
__IO uint32_t CBRUR; /*!< New CBRUR register configuration for the given MDMA linked list node */
|
||||||
|
__IO uint32_t CLAR; /*!< New CLAR register configuration for the given MDMA linked list node */
|
||||||
|
__IO uint32_t CTBR; /*!< New CTBR register configuration for the given MDMA linked list node */
|
||||||
|
__IO uint32_t Reserved; /*!< Reserved register */
|
||||||
|
__IO uint32_t CMAR; /*!< New CMAR register configuration for the given MDMA linked list node */
|
||||||
|
__IO uint32_t CMDR; /*!< New CMDR register configuration for the given MDMA linked list node */
|
||||||
|
|
||||||
|
}MDMA_LinkNodeTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL MDMA linked list node configuration structure definition
|
||||||
|
* @note used with HAL_MDMA_LinkedList_CreateNode function
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
MDMA_InitTypeDef Init; /*!< configuration of the specified MDMA Linked List Node */
|
||||||
|
uint32_t SrcAddress; /*!< The source memory address for the Linked list Node */
|
||||||
|
uint32_t DstAddress; /*!< The destination memory address for the Linked list Node */
|
||||||
|
uint32_t BlockDataLength; /*!< The data length of a block in bytes */
|
||||||
|
uint32_t BlockCount; /*!< The number of blocks to be transferred */
|
||||||
|
|
||||||
|
uint32_t PostRequestMaskAddress; /*!< specifies the address to be updated (written) with PostRequestMaskData after a request is served.
|
||||||
|
PostRequestMaskAddress and PostRequestMaskData could be used to automatically clear a peripheral flag when the request is served */
|
||||||
|
|
||||||
|
uint32_t PostRequestMaskData; /*!< specifies the value to be written to PostRequestMaskAddress after a request is served.
|
||||||
|
PostRequestMaskAddress and PostRequestMaskData could be used to automatically clear a peripheral flag when the request is served */
|
||||||
|
|
||||||
|
|
||||||
|
}MDMA_LinkNodeConfTypeDef;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL MDMA State structure definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_MDMA_STATE_RESET = 0x00U, /*!< MDMA not yet initialized or disabled */
|
||||||
|
HAL_MDMA_STATE_READY = 0x01U, /*!< MDMA initialized and ready for use */
|
||||||
|
HAL_MDMA_STATE_BUSY = 0x02U, /*!< MDMA process is ongoing */
|
||||||
|
HAL_MDMA_STATE_ERROR = 0x03U, /*!< MDMA error state */
|
||||||
|
HAL_MDMA_STATE_ABORT = 0x04U, /*!< MDMA Abort state */
|
||||||
|
HAL_MDMA_STATE_TIMEOUT = 0x05U, /*!< MDMA timeout state */
|
||||||
|
|
||||||
|
}HAL_MDMA_StateTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL MDMA Level Complete structure definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_MDMA_FULL_TRANSFER = 0x00U, /*!< Full transfer */
|
||||||
|
HAL_MDMA_BUFFER_TRANSFER = 0x01U, /*!< Buffer Transfer */
|
||||||
|
HAL_MDMA_BLOCK_TRANSFER = 0x02U, /*!< Block Transfer */
|
||||||
|
HAL_MDMA_REPEAT_BLOCK_TRANSFER = 0x03U /*!< repeat block Transfer */
|
||||||
|
|
||||||
|
}HAL_MDMA_LevelCompleteTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief HAL MDMA Callbacks IDs structure definition
|
||||||
|
*/
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HAL_MDMA_XFER_CPLT_CB_ID = 0x00U, /*!< Full transfer */
|
||||||
|
HAL_MDMA_XFER_BUFFERCPLT_CB_ID = 0x01U, /*!< Buffer Transfer */
|
||||||
|
HAL_MDMA_XFER_BLOCKCPLT_CB_ID = 0x02U, /*!< Block Transfer */
|
||||||
|
HAL_MDMA_XFER_REPBLOCKCPLT_CB_ID = 0x03U, /*!< Repeated Block Transfer */
|
||||||
|
HAL_MDMA_XFER_ERROR_CB_ID = 0x04U, /*!< Error */
|
||||||
|
HAL_MDMA_XFER_ABORT_CB_ID = 0x05U, /*!< Abort */
|
||||||
|
HAL_MDMA_XFER_ALL_CB_ID = 0x06U /*!< All */
|
||||||
|
|
||||||
|
}HAL_MDMA_CallbackIDTypeDef;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief MDMA handle Structure definition
|
||||||
|
*/
|
||||||
|
typedef struct __MDMA_HandleTypeDef
|
||||||
|
{
|
||||||
|
MDMA_Channel_TypeDef *Instance; /*!< Register base address */
|
||||||
|
|
||||||
|
MDMA_InitTypeDef Init; /*!< MDMA communication parameters */
|
||||||
|
|
||||||
|
HAL_LockTypeDef Lock; /*!< MDMA locking object */
|
||||||
|
|
||||||
|
__IO HAL_MDMA_StateTypeDef State; /*!< MDMA transfer state */
|
||||||
|
|
||||||
|
void *Parent; /*!< Parent object state */
|
||||||
|
|
||||||
|
void (* XferCpltCallback)( struct __MDMA_HandleTypeDef * hmdma); /*!< MDMA transfer complete callback */
|
||||||
|
|
||||||
|
void (* XferBufferCpltCallback)( struct __MDMA_HandleTypeDef * hmdma); /*!< MDMA buffer transfer complete callback */
|
||||||
|
|
||||||
|
void (* XferBlockCpltCallback)( struct __MDMA_HandleTypeDef * hmdma); /*!< MDMA block transfer complete callback */
|
||||||
|
|
||||||
|
void (* XferRepeatBlockCpltCallback)( struct __MDMA_HandleTypeDef * hmdma); /*!< MDMA block transfer repeat callback */
|
||||||
|
|
||||||
|
void (* XferErrorCallback)( struct __MDMA_HandleTypeDef * hmdma); /*!< MDMA transfer error callback */
|
||||||
|
|
||||||
|
void (* XferAbortCallback)( struct __MDMA_HandleTypeDef * hmdma); /*!< MDMA transfer Abort callback */
|
||||||
|
|
||||||
|
|
||||||
|
MDMA_LinkNodeTypeDef *FirstLinkedListNodeAddress; /*!< specifies the first node address of the transfer list
|
||||||
|
(after the initial node defined by the Init struct)
|
||||||
|
this parameter is used internally by the MDMA driver
|
||||||
|
to construct the linked list node
|
||||||
|
*/
|
||||||
|
|
||||||
|
MDMA_LinkNodeTypeDef *LastLinkedListNodeAddress; /*!< specifies the last node address of the transfer list
|
||||||
|
this parameter is used internally by the MDMA driver
|
||||||
|
to construct the linked list node
|
||||||
|
*/
|
||||||
|
uint32_t LinkedListNodeCounter; /*!< Number of nodes in the MDMA linked list */
|
||||||
|
|
||||||
|
__IO uint32_t ErrorCode; /*!< MDMA Error code */
|
||||||
|
|
||||||
|
} MDMA_HandleTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Exported_Constants MDMA Exported Constants
|
||||||
|
* @brief MDMA Exported constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Error_Codes MDMA Error Codes
|
||||||
|
* @brief MDMA Error Codes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define HAL_MDMA_ERROR_NONE ((uint32_t)0x00000000U) /*!< No error */
|
||||||
|
#define HAL_MDMA_ERROR_READ_XFER ((uint32_t)0x00000001U) /*!< Read Transfer error */
|
||||||
|
#define HAL_MDMA_ERROR_WRITE_XFER ((uint32_t)0x00000002U) /*!< Write Transfer error */
|
||||||
|
#define HAL_MDMA_ERROR_MASK_DATA ((uint32_t)0x00000004U) /*!< Error Mask Data error */
|
||||||
|
#define HAL_MDMA_ERROR_LINKED_LIST ((uint32_t)0x00000008U) /*!< Linked list Data error */
|
||||||
|
#define HAL_MDMA_ERROR_ALIGNMENT ((uint32_t)0x00000010U) /*!< Address/Size alignment error */
|
||||||
|
#define HAL_MDMA_ERROR_BLOCK_SIZE ((uint32_t)0x00000020U) /*!< Block Size error */
|
||||||
|
#define HAL_MDMA_ERROR_TIMEOUT ((uint32_t)0x00000040U) /*!< Timeout error */
|
||||||
|
#define HAL_MDMA_ERROR_NO_XFER ((uint32_t)0x00000080U) /*!< Abort or SW trigger requested with no Xfer ongoing */
|
||||||
|
#define HAL_MDMA_ERROR_BUSY ((uint32_t)0x00000100U) /*!< DeInit or SW trigger requested with Xfer ongoing */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Request_selection MDMA Request selection
|
||||||
|
* @brief MDMA_Request_selection
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MDMA_REQUEST_DMA1_Stream0_TC ((uint32_t)0x00000000U) /*!< MDMA HW request is DMA1 Stream 0 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA1_Stream1_TC ((uint32_t)0x00000001U) /*!< MDMA HW request is DMA1 Stream 1 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA1_Stream2_TC ((uint32_t)0x00000002U) /*!< MDMA HW request is DMA1 Stream 2 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA1_Stream3_TC ((uint32_t)0x00000003U) /*!< MDMA HW request is DMA1 Stream 3 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA1_Stream4_TC ((uint32_t)0x00000004U) /*!< MDMA HW request is DMA1 Stream 4 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA1_Stream5_TC ((uint32_t)0x00000005U) /*!< MDMA HW request is DMA1 Stream 5 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA1_Stream6_TC ((uint32_t)0x00000006U) /*!< MDMA HW request is DMA1 Stream 6 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA1_Stream7_TC ((uint32_t)0x00000007U) /*!< MDMA HW request is DMA1 Stream 7 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA2_Stream0_TC ((uint32_t)0x00000008U) /*!< MDMA HW request is DMA2 Stream 0 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA2_Stream1_TC ((uint32_t)0x00000009U) /*!< MDMA HW request is DMA2 Stream 1 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA2_Stream2_TC ((uint32_t)0x0000000AU) /*!< MDMA HW request is DMA2 Stream 2 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA2_Stream3_TC ((uint32_t)0x0000000BU) /*!< MDMA HW request is DMA2 Stream 3 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA2_Stream4_TC ((uint32_t)0x0000000CU) /*!< MDMA HW request is DMA2 Stream 4 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA2_Stream5_TC ((uint32_t)0x0000000DU) /*!< MDMA HW request is DMA2 Stream 5 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA2_Stream6_TC ((uint32_t)0x0000000EU) /*!< MDMA HW request is DMA2 Stream 6 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_DMA2_Stream7_TC ((uint32_t)0x0000000FU) /*!< MDMA HW request is DMA2 Stream 7 Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_FMC_DATA ((uint32_t)0x00000014U) /*!< MDMA HW request is NAND data transfer (Tx or Rx) channel */
|
||||||
|
#define MDMA_REQUEST_FMC_ERROR ((uint32_t)0x00000015U) /*!< MDMA HW request is NAND ECC/BCH Error channel */
|
||||||
|
#define MDMA_REQUEST_QUADSPI_FIFO_TH ((uint32_t)0x00000016U) /*!< MDMA HW request is QSPI FIFO threshold Flag */
|
||||||
|
#define MDMA_REQUEST_QUADSPI_TC ((uint32_t)0x00000017U) /*!< MDMA HW request is QSPI Transfer complete Flag */
|
||||||
|
#if defined(CRYP1)
|
||||||
|
#define MDMA_REQUEST_CRYP1_IN ((uint32_t)0x0000001DU) /*!< MDMA HW request is CRYP1 4 word request from input */
|
||||||
|
#define MDMA_REQUEST_CRYP1_OUT ((uint32_t)0x0000001EU) /*!< MDMA HW request is CRYP1 4 word request from output */
|
||||||
|
#endif
|
||||||
|
#define MDMA_REQUEST_HASH1_IN ((uint32_t)0x0000001FU) /*!< MDMA HW request is HASH1 16 word request from input */
|
||||||
|
#define MDMA_REQUEST_USART1_RX ((uint32_t)0x00000020U) /*!< MDMA HW request is USART1 Rx Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_USART1_TX ((uint32_t)0x00000021U) /*!< MDMA HW request is USART1 Tx Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_SPI6_RX ((uint32_t)0x00000022U) /*!< MDMA HW request is SPI6 Rx Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_SPI6_TX ((uint32_t)0x00000023U) /*!< MDMA HW request is SPI6 Tx Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_I2C4_RX ((uint32_t)0x00000024U) /*!< MDMA HW request is I2C4 Rx Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_I2C4_TX ((uint32_t)0x00000025U) /*!< MDMA HW request is I2C4 Tx Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_I2C6_RX ((uint32_t)0x00000026U) /*!< MDMA HW request is I2C6 Rx Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_I2C6_TX ((uint32_t)0x00000027U) /*!< MDMA HW request is I2C6 Tx Transfer Complete Flag */
|
||||||
|
#define MDMA_REQUEST_SW ((uint32_t)0x40000000U) /*!< MDMA SW request */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Transfer_TriggerMode MDMA Transfer Trigger Mode
|
||||||
|
* @brief MDMA Transfer Trigger Mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_BUFFER_TRANSFER ((uint32_t)0x00000000U) /*!< Each MDMA request (SW or HW) triggers a buffer transfer */
|
||||||
|
#define MDMA_BLOCK_TRANSFER ((uint32_t)MDMA_CTCR_TRGM_0) /*!< Each MDMA request (SW or HW) triggers a block transfer */
|
||||||
|
#define MDMA_REPEAT_BLOCK_TRANSFER ((uint32_t)MDMA_CTCR_TRGM_1) /*!< Each MDMA request (SW or HW) triggers a repeated block transfer */
|
||||||
|
#define MDMA_FULL_TRANSFER ((uint32_t)MDMA_CTCR_TRGM) /*!< Each MDMA request (SW or HW) triggers a Full transfer or a linked list transfer if any */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Priority_level MDMA Priority level
|
||||||
|
* @brief MDMA Priority level
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_PRIORITY_LOW ((uint32_t)0x00000000U) /*!< Priority level: Low */
|
||||||
|
#define MDMA_PRIORITY_MEDIUM ((uint32_t)MDMA_CCR_PL_0) /*!< Priority level: Medium */
|
||||||
|
#define MDMA_PRIORITY_HIGH ((uint32_t)MDMA_CCR_PL_1) /*!< Priority level: High */
|
||||||
|
#define MDMA_PRIORITY_VERY_HIGH ((uint32_t)MDMA_CCR_PL) /*!< Priority level: Very High */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Secure_Mode MDMA Secure Mode
|
||||||
|
* @brief MDMA Secure Mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_SECURE_MODE_DISABLE ((uint32_t)0x00000000U) /*!< Secure Mode disabled */
|
||||||
|
#define MDMA_SECURE_MODE_ENABLE ((uint32_t)MDMA_CCR_SM) /*!< Secure Mode enabled */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Endianness MDMA Endianness
|
||||||
|
* @brief MDMA Endianness
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_LITTLE_ENDIANNESS_PRESERVE ((uint32_t)0x00000000U) /*!< little endianness preserve */
|
||||||
|
#define MDMA_LITTLE_BYTE_ENDIANNESS_EXCHANGE ((uint32_t)MDMA_CCR_BEX) /*!< BYTEs endianness exchange when destination data size is > Byte */
|
||||||
|
#define MDMA_LITTLE_HALFWORD_ENDIANNESS_EXCHANGE ((uint32_t)MDMA_CCR_HEX) /*!< HALF WORDs endianness exchange when destination data size is > HALF WORD */
|
||||||
|
#define MDMA_LITTLE_WORD_ENDIANNESS_EXCHANGE ((uint32_t)MDMA_CCR_WEX) /*!< WORDs endianness exchange when destination data size is > DOUBLE WORD */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Source_increment_mode MDMA Source increment mode
|
||||||
|
* @brief MDMA Source increment mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_SRC_INC_DISABLE ((uint32_t)0x00000000U) /*!< Source address pointer is fixed */
|
||||||
|
#define MDMA_SRC_INC_BYTE ((uint32_t)MDMA_CTCR_SINC_1) /*!< Source address pointer is incremented by a BYTE (8 bits) */
|
||||||
|
#define MDMA_SRC_INC_HALFWORD ((uint32_t)MDMA_CTCR_SINC_1 | (uint32_t)MDMA_CTCR_SINCOS_0) /*!< Source address pointer is incremented by a half Word (16 bits) */
|
||||||
|
#define MDMA_SRC_INC_WORD ((uint32_t)MDMA_CTCR_SINC_1 | (uint32_t)MDMA_CTCR_SINCOS_1) /*!< Source address pointer is incremented by a Word (32 bits) */
|
||||||
|
#define MDMA_SRC_INC_DOUBLEWORD ((uint32_t)MDMA_CTCR_SINC_1 | (uint32_t)MDMA_CTCR_SINCOS) /*!< Source address pointer is incremented by a double Word (64 bits)) */
|
||||||
|
#define MDMA_SRC_DEC_BYTE ((uint32_t)MDMA_CTCR_SINC) /*!< Source address pointer is decremented by a BYTE (8 bits) */
|
||||||
|
#define MDMA_SRC_DEC_HALFWORD ((uint32_t)MDMA_CTCR_SINC | (uint32_t)MDMA_CTCR_SINCOS_0) /*!< Source address pointer is decremented by a half Word (16 bits) */
|
||||||
|
#define MDMA_SRC_DEC_WORD ((uint32_t)MDMA_CTCR_SINC | (uint32_t)MDMA_CTCR_SINCOS_1) /*!< Source address pointer is decremented by a Word (32 bits) */
|
||||||
|
#define MDMA_SRC_DEC_DOUBLEWORD ((uint32_t)MDMA_CTCR_SINC | (uint32_t)MDMA_CTCR_SINCOS) /*!< Source address pointer is decremented by a double Word (64 bits)) */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Destination_increment_mode MDMA Destination increment mode
|
||||||
|
* @brief MDMA Destination increment mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_DEST_INC_DISABLE ((uint32_t)0x00000000U) /*!< Source address pointer is fixed */
|
||||||
|
#define MDMA_DEST_INC_BYTE ((uint32_t)MDMA_CTCR_DINC_1) /*!< Source address pointer is incremented by a BYTE (8 bits) */
|
||||||
|
#define MDMA_DEST_INC_HALFWORD ((uint32_t)MDMA_CTCR_DINC_1 | (uint32_t)MDMA_CTCR_DINCOS_0) /*!< Source address pointer is incremented by a half Word (16 bits) */
|
||||||
|
#define MDMA_DEST_INC_WORD ((uint32_t)MDMA_CTCR_DINC_1 | (uint32_t)MDMA_CTCR_DINCOS_1) /*!< Source address pointer is incremented by a Word (32 bits) */
|
||||||
|
#define MDMA_DEST_INC_DOUBLEWORD ((uint32_t)MDMA_CTCR_DINC_1 | (uint32_t)MDMA_CTCR_DINCOS) /*!< Source address pointer is incremented by a double Word (64 bits)) */
|
||||||
|
#define MDMA_DEST_DEC_BYTE ((uint32_t)MDMA_CTCR_DINC) /*!< Source address pointer is decremented by a BYTE (8 bits) */
|
||||||
|
#define MDMA_DEST_DEC_HALFWORD ((uint32_t)MDMA_CTCR_DINC | (uint32_t)MDMA_CTCR_DINCOS_0) /*!< Source address pointer is decremented by a half Word (16 bits) */
|
||||||
|
#define MDMA_DEST_DEC_WORD ((uint32_t)MDMA_CTCR_DINC | (uint32_t)MDMA_CTCR_DINCOS_1) /*!< Source address pointer is decremented by a Word (32 bits) */
|
||||||
|
#define MDMA_DEST_DEC_DOUBLEWORD ((uint32_t)MDMA_CTCR_DINC | (uint32_t)MDMA_CTCR_DINCOS) /*!< Source address pointer is decremented by a double Word (64 bits)) */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Source_data_size MDMA Source data size
|
||||||
|
* @brief MDMA Source data size
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_SRC_DATASIZE_BYTE ((uint32_t)0x00000000U) /*!< Source data size is Byte */
|
||||||
|
#define MDMA_SRC_DATASIZE_HALFWORD ((uint32_t)MDMA_CTCR_SSIZE_0) /*!< Source data size is half word */
|
||||||
|
#define MDMA_SRC_DATASIZE_WORD ((uint32_t)MDMA_CTCR_SSIZE_1) /*!< Source data size is word */
|
||||||
|
#define MDMA_SRC_DATASIZE_DOUBLEWORD ((uint32_t)MDMA_CTCR_SSIZE) /*!< Source data size is double word */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Destination_data_size MDMA Destination data size
|
||||||
|
* @brief MDMA Destination data size
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_DEST_DATASIZE_BYTE ((uint32_t)0x00000000U) /*!< Destination data size is Byte */
|
||||||
|
#define MDMA_DEST_DATASIZE_HALFWORD ((uint32_t)MDMA_CTCR_DSIZE_0) /*!< Destination data size is half word */
|
||||||
|
#define MDMA_DEST_DATASIZE_WORD ((uint32_t)MDMA_CTCR_DSIZE_1) /*!< Destination data size is word */
|
||||||
|
#define MDMA_DEST_DATASIZE_DOUBLEWORD ((uint32_t)MDMA_CTCR_DSIZE) /*!< Destination data size is double word */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_data_Alignment MDMA data alignment
|
||||||
|
* @brief MDMA data alignment
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_DATAALIGN_PACKENABLE ((uint32_t)MDMA_CTCR_PKE) /*!< The source data is packed/un-packed into the destination data size
|
||||||
|
All data are right aligned, in Little Endien mode. */
|
||||||
|
#define MDMA_DATAALIGN_RIGHT ((uint32_t)0x00000000U) /*!< Right Aligned, padded w/ 0s (default) */
|
||||||
|
#define MDMA_DATAALIGN_RIGHT_SIGNED ((uint32_t)MDMA_CTCR_PAM_0) /*!< Right Aligned, Sign extended ,
|
||||||
|
Note : this mode is allowed only if the Source data size is smaller than Destination data size */
|
||||||
|
#define MDMA_DATAALIGN_LEFT ((uint32_t)MDMA_CTCR_PAM_1) /*!< Left Aligned (padded with 0s) */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Source_burst MDMA Source burst
|
||||||
|
* @brief MDMA Source burst
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_SOURCE_BURST_SINGLE ((uint32_t)0x00000000U) /*!< single transfer */
|
||||||
|
#define MDMA_SOURCE_BURST_2BEATS ((uint32_t)MDMA_CTCR_SBURST_0) /*!< Burst 2 beats */
|
||||||
|
#define MDMA_SOURCE_BURST_4BEATS ((uint32_t)MDMA_CTCR_SBURST_1) /*!< Burst 4 beats */
|
||||||
|
#define MDMA_SOURCE_BURST_8BEATS ((uint32_t)MDMA_CTCR_SBURST_0 | (uint32_t)MDMA_CTCR_SBURST_1) /*!< Burst 8 beats */
|
||||||
|
#define MDMA_SOURCE_BURST_16BEATS ((uint32_t)MDMA_CTCR_SBURST_2) /*!< Burst 16 beats */
|
||||||
|
#define MDMA_SOURCE_BURST_32BEATS ((uint32_t)MDMA_CTCR_SBURST_0 | (uint32_t)MDMA_CTCR_SBURST_2) /*!< Burst 32 beats */
|
||||||
|
#define MDMA_SOURCE_BURST_64BEATS ((uint32_t)MDMA_CTCR_SBURST_1 | (uint32_t)MDMA_CTCR_SBURST_2) /*!< Burst 64 beats */
|
||||||
|
#define MDMA_SOURCE_BURST_128BEATS ((uint32_t)MDMA_CTCR_SBURST) /*!< Burst 128 beats */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Destination_burst MDMA Destination burst
|
||||||
|
* @brief MDMA Destination burst
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_DEST_BURST_SINGLE ((uint32_t)0x00000000U) /*!< single transfer */
|
||||||
|
#define MDMA_DEST_BURST_2BEATS ((uint32_t)MDMA_CTCR_DBURST_0) /*!< Burst 2 beats */
|
||||||
|
#define MDMA_DEST_BURST_4BEATS ((uint32_t)MDMA_CTCR_DBURST_1) /*!< Burst 4 beats */
|
||||||
|
#define MDMA_DEST_BURST_8BEATS ((uint32_t)MDMA_CTCR_DBURST_0 | (uint32_t)MDMA_CTCR_DBURST_1) /*!< Burst 8 beats */
|
||||||
|
#define MDMA_DEST_BURST_16BEATS ((uint32_t)MDMA_CTCR_DBURST_2) /*!< Burst 16 beats */
|
||||||
|
#define MDMA_DEST_BURST_32BEATS ((uint32_t)MDMA_CTCR_DBURST_0 | (uint32_t)MDMA_CTCR_DBURST_2) /*!< Burst 32 beats */
|
||||||
|
#define MDMA_DEST_BURST_64BEATS ((uint32_t)MDMA_CTCR_DBURST_1 | (uint32_t)MDMA_CTCR_DBURST_2) /*!< Burst 64 beats */
|
||||||
|
#define MDMA_DEST_BURST_128BEATS ((uint32_t)MDMA_CTCR_DBURST) /*!< Burst 128 beats */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_interrupt_enable_definitions MDMA interrupt enable definitions
|
||||||
|
* @brief MDMA interrupt enable definitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_IT_TE ((uint32_t)MDMA_CCR_TEIE) /*!< Transfer Error interrupt */
|
||||||
|
#define MDMA_IT_CTC ((uint32_t)MDMA_CCR_CTCIE) /*!< Channel Transfer Complete interrupt */
|
||||||
|
#define MDMA_IT_BRT ((uint32_t)MDMA_CCR_BRTIE) /*!< Block Repeat Transfer interrupt */
|
||||||
|
#define MDMA_IT_BT ((uint32_t)MDMA_CCR_BTIE) /*!< Block Transfer interrupt */
|
||||||
|
#define MDMA_IT_BFTC ((uint32_t)MDMA_CCR_TCIE) /*!< Buffer Transfer Complete interrupt */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_flag_definitions MDMA flag definitions
|
||||||
|
* @brief MDMA flag definitions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define MDMA_FLAG_TE ((uint32_t)MDMA_CISR_TEIF) /*!< Transfer Error flag */
|
||||||
|
#define MDMA_FLAG_CTC ((uint32_t)MDMA_CISR_CTCIF) /*!< Channel Transfer Complete flag */
|
||||||
|
#define MDMA_FLAG_BRT ((uint32_t)MDMA_CISR_BRTIF) /*!< Block Repeat Transfer complete flag */
|
||||||
|
#define MDMA_FLAG_BT ((uint32_t)MDMA_CISR_BTIF) /*!< Block Transfer complete flag */
|
||||||
|
#define MDMA_FLAG_BFTC ((uint32_t)MDMA_CISR_TCIF) /*!< BuFfer Transfer complete flag */
|
||||||
|
#define MDMA_FLAG_CRQA ((uint32_t)MDMA_CISR_CRQA) /*!< Channel ReQest Active flag */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup MDMA_Exported_Macros MDMA Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable the specified MDMA Channel.
|
||||||
|
* @param __HANDLE__: MDMA handle
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_MDMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CCR |= MDMA_CCR_EN)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable the specified MDMA Channel.
|
||||||
|
* @param __HANDLE__: MDMA handle
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_MDMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CCR &= ~MDMA_CCR_EN)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the MDMA Channel pending flags.
|
||||||
|
* @param __HANDLE__: MDMA handle
|
||||||
|
* @param __FLAG__: Get the specified flag.
|
||||||
|
* This parameter can be any combination of the following values:
|
||||||
|
* @arg MDMA_FLAG_TE : Transfer Error flag.
|
||||||
|
* @arg MDMA_FLAG_CTC : Channel Transfer Complete flag.
|
||||||
|
* @arg MDMA_FLAG_BRT : Block Repeat Transfer flag.
|
||||||
|
* @arg MDMA_FLAG_BT : Block Transfer complete flag.
|
||||||
|
* @arg MDMA_FLAG_BFTC : BuFfer Transfer Complete flag.
|
||||||
|
* @arg MDMA_FLAG_CRQA : Channel ReQest Active flag.
|
||||||
|
* @retval The state of FLAG (SET or RESET).
|
||||||
|
*/
|
||||||
|
#define __HAL_MDMA_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CISR & (__FLAG__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear the MDMA Stream pending flags.
|
||||||
|
* @param __HANDLE__: MDMA handle
|
||||||
|
* @param __FLAG__: specifies the flag to clear.
|
||||||
|
* This parameter can be any combination of the following values:
|
||||||
|
* @arg MDMA_FLAG_TE : Transfer Error flag.
|
||||||
|
* @arg MDMA_FLAG_CTC : Channel Transfer Complete flag.
|
||||||
|
* @arg MDMA_FLAG_BRT : Block Repeat Transfer flag.
|
||||||
|
* @arg MDMA_FLAG_BT : Block Transfer complete flag.
|
||||||
|
* @arg MDMA_FLAG_BFTC : BuFfer Transfer Complete flag.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_MDMA_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->CIFCR = (__FLAG__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enables the specified MDMA Channel interrupts.
|
||||||
|
* @param __HANDLE__: MDMA handle
|
||||||
|
* @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled.
|
||||||
|
* This parameter can be any combination of the following values:
|
||||||
|
* @arg MDMA_IT_TE : Transfer Error interrupt mask
|
||||||
|
* @arg MDMA_IT_CTC : Channel Transfer Complete interrupt mask
|
||||||
|
* @arg MDMA_IT_BRT : Block Repeat Transfer interrupt mask
|
||||||
|
* @arg MDMA_IT_BT : Block Transfer interrupt mask
|
||||||
|
* @arg MDMA_IT_BFTC : BuFfer Transfer Complete interrupt mask
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_MDMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CCR |= (__INTERRUPT__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disables the specified MDMA Channel interrupts.
|
||||||
|
* @param __HANDLE__: MDMA handle
|
||||||
|
* @param __INTERRUPT__: specifies the MDMA interrupt sources to be enabled or disabled.
|
||||||
|
* This parameter can be any combination of the following values:
|
||||||
|
* @arg MDMA_IT_TE : Transfer Error interrupt mask
|
||||||
|
* @arg MDMA_IT_CTC : Channel Transfer Complete interrupt mask
|
||||||
|
* @arg MDMA_IT_BRT : Block Repeat Transfer interrupt mask
|
||||||
|
* @arg MDMA_IT_BT : Block Transfer interrupt mask
|
||||||
|
* @arg MDMA_IT_BFTC : BuFfer Transfer Complete interrupt mask
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_MDMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CCR &= ~(__INTERRUPT__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Checks whether the specified MDMA Channel interrupt is enabled or not.
|
||||||
|
* @param __HANDLE__: MDMA handle
|
||||||
|
* @param __INTERRUPT__: specifies the MDMA interrupt source to check.
|
||||||
|
* @arg MDMA_IT_TE : Transfer Error interrupt mask
|
||||||
|
* @arg MDMA_IT_CTC : Channel Transfer Complete interrupt mask
|
||||||
|
* @arg MDMA_IT_BRT : Block Repeat Transfer interrupt mask
|
||||||
|
* @arg MDMA_IT_BT : Block Transfer interrupt mask
|
||||||
|
* @arg MDMA_IT_BFTC : BuFfer Transfer Complete interrupt mask
|
||||||
|
* @retval The state of MDMA_IT (SET or RESET).
|
||||||
|
*/
|
||||||
|
#define __HAL_MDMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CCR & (__INTERRUPT__)))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Writes the number of data in bytes to be transferred on the MDMA Channelx.
|
||||||
|
* @param __HANDLE__ : MDMA handle
|
||||||
|
* @param __COUNTER__: Number of data in bytes to be transferred.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define __HAL_MDMA_SET_COUNTER(__HANDLE__, __COUNTER__) ((__HANDLE__)->Instance->CBNDTR |= ((__COUNTER__) & MDMA_CBNDTR_BNDT))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Returns the number of remaining data in bytes in the current MDMA Channelx transfer.
|
||||||
|
* @param __HANDLE__ : MDMA handle
|
||||||
|
* @retval The number of remaining data in bytes in the current MDMA Channelx transfer.
|
||||||
|
*/
|
||||||
|
#define __HAL_MDMA_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CBNDTR & MDMA_CBNDTR_BNDT)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup MDMA_Exported_Functions MDMA Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Initialization and de-initialization functions *****************************/
|
||||||
|
/** @defgroup MDMA_Exported_Functions_Group1 Initialization and de-initialization functions
|
||||||
|
* @brief Initialization and de-initialization functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_Init(MDMA_HandleTypeDef *hmdma);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_DeInit (MDMA_HandleTypeDef *hmdma);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_ConfigPostRequestMask(MDMA_HandleTypeDef *hmdma, uint32_t MaskAddress, uint32_t MaskData);
|
||||||
|
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_RegisterCallback(MDMA_HandleTypeDef *hmdma, HAL_MDMA_CallbackIDTypeDef CallbackID, void (* pCallback)(MDMA_HandleTypeDef *_hmdma));
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_UnRegisterCallback(MDMA_HandleTypeDef *hmdma, HAL_MDMA_CallbackIDTypeDef CallbackID);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Linked list operation functions ********************************************/
|
||||||
|
/** @defgroup MDMA_Exported_Functions_Group2 Linked List operation functions
|
||||||
|
* @brief Linked list operation functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_LinkedList_CreateNode(MDMA_LinkNodeTypeDef *pNode, MDMA_LinkNodeConfTypeDef *pNodeConfig);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_LinkedList_AddNode(MDMA_HandleTypeDef *hmdma, MDMA_LinkNodeTypeDef *pNewNode, MDMA_LinkNodeTypeDef *pPrevNode);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_LinkedList_RemoveNode(MDMA_HandleTypeDef *hmdma, MDMA_LinkNodeTypeDef *pNode);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_LinkedList_EnableCircularMode(MDMA_HandleTypeDef *hmdma);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_LinkedList_DisableCircularMode(MDMA_HandleTypeDef *hmdma);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* IO operation functions *****************************************************/
|
||||||
|
/** @defgroup MDMA_Exported_Functions_Group3 I/O operation functions
|
||||||
|
* @brief I/O operation functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_Start (MDMA_HandleTypeDef *hmdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t BlockDataLength, uint32_t BlockCount);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_Start_IT(MDMA_HandleTypeDef *hmdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t BlockDataLength, uint32_t BlockCount);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_Abort(MDMA_HandleTypeDef *hmdma);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_Abort_IT(MDMA_HandleTypeDef *hmdma);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_PollForTransfer(MDMA_HandleTypeDef *hmdma, HAL_MDMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout);
|
||||||
|
HAL_StatusTypeDef HAL_MDMA_GenerateSWRequest(MDMA_HandleTypeDef *hmdma);
|
||||||
|
void HAL_MDMA_IRQHandler(MDMA_HandleTypeDef *hmdma);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Peripheral State and Error functions ***************************************/
|
||||||
|
/** @defgroup MDMA_Exported_Functions_Group4 Peripheral State functions
|
||||||
|
* @brief Peripheral State functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
HAL_MDMA_StateTypeDef HAL_MDMA_GetState(MDMA_HandleTypeDef *hmdma);
|
||||||
|
uint32_t HAL_MDMA_GetError(MDMA_HandleTypeDef *hmdma);
|
||||||
|
|
||||||
|
void HAL_MDMA_MspInit(MDMA_HandleTypeDef *hmdma);
|
||||||
|
void HAL_MDMA_MspDeInit(MDMA_HandleTypeDef *hmdma);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
/** @defgroup MDMA_Private_Types MDMA Private Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private defines -----------------------------------------------------------*/
|
||||||
|
/** @defgroup MDMA_Private_Defines MDMA Private Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/** @defgroup MDMA_Private_Variables MDMA Private Variables
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
/** @defgroup MDMA_Private_Constants MDMA Private Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup MDMA_Private_Macros MDMA Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define IS_MDMA_LEVEL_COMPLETE(__LEVEL__) (((__LEVEL__) == HAL_MDMA_FULL_TRANSFER ) || \
|
||||||
|
((__LEVEL__) == HAL_MDMA_BUFFER_TRANSFER )|| \
|
||||||
|
((__LEVEL__) == HAL_MDMA_BLOCK_TRANSFER ) || \
|
||||||
|
((__LEVEL__) == HAL_MDMA_REPEAT_BLOCK_TRANSFER ))
|
||||||
|
|
||||||
|
|
||||||
|
#define IS_MDMA_PRIORITY(__PRIORITY__) (((__PRIORITY__) == MDMA_PRIORITY_LOW ) || \
|
||||||
|
((__PRIORITY__) == MDMA_PRIORITY_MEDIUM) || \
|
||||||
|
((__PRIORITY__) == MDMA_PRIORITY_HIGH) || \
|
||||||
|
((__PRIORITY__) == MDMA_PRIORITY_VERY_HIGH))
|
||||||
|
|
||||||
|
#define IS_MDMA_SECURE_MODE(__SECURE_MODE__) (((__SECURE_MODE__) == MDMA_SECURE_MODE_DISABLE ) || \
|
||||||
|
((__SECURE_MODE__) == MDMA_SECURE_MODE_ENABLE))
|
||||||
|
#define IS_MDMA_ENDIANNESS_MODE(__ENDIANNESS__) (((__ENDIANNESS__) == MDMA_LITTLE_ENDIANNESS_PRESERVE ) || \
|
||||||
|
((__ENDIANNESS__) == MDMA_LITTLE_BYTE_ENDIANNESS_EXCHANGE) || \
|
||||||
|
((__ENDIANNESS__) == MDMA_LITTLE_HALFWORD_ENDIANNESS_EXCHANGE) || \
|
||||||
|
((__ENDIANNESS__) == MDMA_LITTLE_WORD_ENDIANNESS_EXCHANGE))
|
||||||
|
|
||||||
|
#define IS_MDMA_REQUEST(__REQUEST__) (((__REQUEST__) == MDMA_REQUEST_SW ) || ((__REQUEST__) <= MDMA_REQUEST_I2C6_TX))
|
||||||
|
|
||||||
|
#define IS_MDMA_SOURCE_INC(__INC__) (((__INC__) == MDMA_SRC_INC_DISABLE ) || \
|
||||||
|
((__INC__) == MDMA_SRC_INC_BYTE ) || \
|
||||||
|
((__INC__) == MDMA_SRC_INC_HALFWORD ) || \
|
||||||
|
((__INC__) == MDMA_SRC_INC_WORD ) || \
|
||||||
|
((__INC__) == MDMA_SRC_INC_DOUBLEWORD) || \
|
||||||
|
((__INC__) == MDMA_SRC_DEC_BYTE) || \
|
||||||
|
((__INC__) == MDMA_SRC_DEC_HALFWORD) || \
|
||||||
|
((__INC__) == MDMA_SRC_DEC_WORD) || \
|
||||||
|
((__INC__) == MDMA_SRC_DEC_DOUBLEWORD))
|
||||||
|
|
||||||
|
#define IS_MDMA_DESTINATION_INC(__INC__) (((__INC__) == MDMA_DEST_INC_DISABLE ) || \
|
||||||
|
((__INC__) == MDMA_DEST_INC_BYTE ) || \
|
||||||
|
((__INC__) == MDMA_DEST_INC_HALFWORD ) || \
|
||||||
|
((__INC__) == MDMA_DEST_INC_WORD ) || \
|
||||||
|
((__INC__) == MDMA_DEST_INC_DOUBLEWORD) || \
|
||||||
|
((__INC__) == MDMA_DEST_DEC_BYTE) || \
|
||||||
|
((__INC__) == MDMA_DEST_DEC_HALFWORD) || \
|
||||||
|
((__INC__) == MDMA_DEST_DEC_WORD) || \
|
||||||
|
((__INC__) == MDMA_DEST_DEC_DOUBLEWORD))
|
||||||
|
|
||||||
|
#define IS_MDMA_SOURCE_DATASIZE(__SIZE__) (((__SIZE__) == MDMA_SRC_DATASIZE_BYTE ) || \
|
||||||
|
((__SIZE__) == MDMA_SRC_DATASIZE_HALFWORD ) || \
|
||||||
|
((__SIZE__) == MDMA_SRC_DATASIZE_WORD ) || \
|
||||||
|
((__SIZE__) == MDMA_SRC_DATASIZE_DOUBLEWORD))
|
||||||
|
|
||||||
|
#define IS_MDMA_DESTINATION_DATASIZE(__SIZE__) (((__SIZE__) == MDMA_DEST_DATASIZE_BYTE ) || \
|
||||||
|
((__SIZE__) == MDMA_DEST_DATASIZE_HALFWORD ) || \
|
||||||
|
((__SIZE__) == MDMA_DEST_DATASIZE_WORD ) || \
|
||||||
|
((__SIZE__) == MDMA_DEST_DATASIZE_DOUBLEWORD))
|
||||||
|
|
||||||
|
#define IS_MDMA_DATA_ALIGNMENT(__ALIGNMENT__) (((__ALIGNMENT__) == MDMA_DATAALIGN_PACKENABLE ) || \
|
||||||
|
((__ALIGNMENT__) == MDMA_DATAALIGN_RIGHT ) || \
|
||||||
|
((__ALIGNMENT__) == MDMA_DATAALIGN_RIGHT_SIGNED ) || \
|
||||||
|
((__ALIGNMENT__) == MDMA_DATAALIGN_LEFT))
|
||||||
|
|
||||||
|
|
||||||
|
#define IS_MDMA_SOURCE_BURST(__BURST__) (((__BURST__) == MDMA_SOURCE_BURST_SINGLE ) || \
|
||||||
|
((__BURST__) == MDMA_SOURCE_BURST_2BEATS ) || \
|
||||||
|
((__BURST__) == MDMA_SOURCE_BURST_4BEATS ) || \
|
||||||
|
((__BURST__) == MDMA_SOURCE_BURST_8BEATS) || \
|
||||||
|
((__BURST__) == MDMA_SOURCE_BURST_16BEATS) || \
|
||||||
|
((__BURST__) == MDMA_SOURCE_BURST_32BEATS) || \
|
||||||
|
((__BURST__) == MDMA_SOURCE_BURST_64BEATS) || \
|
||||||
|
((__BURST__) == MDMA_SOURCE_BURST_128BEATS))
|
||||||
|
|
||||||
|
|
||||||
|
#define IS_MDMA_DESTINATION_BURST(__BURST__) (((__BURST__) == MDMA_DEST_BURST_SINGLE ) || \
|
||||||
|
((__BURST__) == MDMA_DEST_BURST_2BEATS ) || \
|
||||||
|
((__BURST__) == MDMA_DEST_BURST_4BEATS ) || \
|
||||||
|
((__BURST__) == MDMA_DEST_BURST_8BEATS) || \
|
||||||
|
((__BURST__) == MDMA_DEST_BURST_16BEATS) || \
|
||||||
|
((__BURST__) == MDMA_DEST_BURST_32BEATS) || \
|
||||||
|
((__BURST__) == MDMA_DEST_BURST_64BEATS) || \
|
||||||
|
((__BURST__) == MDMA_DEST_BURST_128BEATS))
|
||||||
|
|
||||||
|
#define IS_MDMA_TRANSFER_TRIGGER_MODE(__MODE__) (((__MODE__) == MDMA_BUFFER_TRANSFER ) || \
|
||||||
|
((__MODE__) == MDMA_BLOCK_TRANSFER ) || \
|
||||||
|
((__MODE__) == MDMA_REPEAT_BLOCK_TRANSFER ) || \
|
||||||
|
((__MODE__) == MDMA_FULL_TRANSFER))
|
||||||
|
|
||||||
|
#define IS_MDMA_BUFFER_TRANSFER_LENGTH(__LENGTH__) (((__LENGTH__) >= 0x00000001U) && ((__LENGTH__) < 0x000000FFU))
|
||||||
|
|
||||||
|
#define IS_MDMA_BLOCK_COUNT(__COUNT__) (((__COUNT__) > 0U ) && ((__COUNT__) <= 4096U))
|
||||||
|
|
||||||
|
#define IS_MDMA_TRANSFER_LENGTH(SIZE) (((SIZE) > 0U) && ((SIZE) <= 65536U))
|
||||||
|
|
||||||
|
#define IS_MDMA_BLOCK_ADDR_OFFSET(__BLOCK_ADD_OFFSET__) (((__BLOCK_ADD_OFFSET__) > (-65536)) && ((__BLOCK_ADD_OFFSET__) < 65536))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private functions prototypes ----------------------------------------------*/
|
||||||
|
/** @defgroup MDMA_Private_Functions_Prototypes MDMA Private Functions Prototypes
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private functions ---------------------------------------------------------*/
|
||||||
|
/** @defgroup MDMA_Private_Functions MDMA Private Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_HAL_MDMA_H */
|
||||||
+491
@@ -0,0 +1,491 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_pwr.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of PWR HAL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32MP1xx_HAL_PWR_H
|
||||||
|
#define __STM32MP1xx_HAL_PWR_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup PWR
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/** @defgroup PWR_Exported_Types PWR Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @brief PWR PVD configuration structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t PVDLevel; /*!< PVDLevel: Specifies the PVD detection level.
|
||||||
|
This parameter can be a value of @ref PWR_PVD_detection_level */
|
||||||
|
|
||||||
|
uint32_t Mode; /*!< Mode: Specifies the operating mode for the selected pins.
|
||||||
|
This parameter can be a value of @ref PWR_PVD_Mode */
|
||||||
|
} PWR_PVDTypeDef;
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_Exported_Constants PWR Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_PVD_detection_level PWR PVD detection level
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_PVDLEVEL_0 PWR_CR1_PLS_LEV0 /* 1.95V */
|
||||||
|
#define PWR_PVDLEVEL_1 PWR_CR1_PLS_LEV1 /* 2.1V */
|
||||||
|
#define PWR_PVDLEVEL_2 PWR_CR1_PLS_LEV2 /* 2.25V */
|
||||||
|
#define PWR_PVDLEVEL_3 PWR_CR1_PLS_LEV3 /* 2.4V */
|
||||||
|
#define PWR_PVDLEVEL_4 PWR_CR1_PLS_LEV4 /* 2.55V */
|
||||||
|
#define PWR_PVDLEVEL_5 PWR_CR1_PLS_LEV5 /* 2.7V */
|
||||||
|
#define PWR_PVDLEVEL_6 PWR_CR1_PLS_LEV6 /* 2.85V */
|
||||||
|
#define PWR_PVDLEVEL_7 PWR_CR1_PLS_LEV7 /* External voltage level on PVD_IN
|
||||||
|
(compared to internal VREFINT) */
|
||||||
|
|
||||||
|
#define IS_PWR_PVD_LEVEL(__LEVEL__) (((__LEVEL__) == PWR_PVDLEVEL_0) || ((__LEVEL__) == PWR_PVDLEVEL_1)|| \
|
||||||
|
((__LEVEL__) == PWR_PVDLEVEL_2) || ((__LEVEL__) == PWR_PVDLEVEL_3)|| \
|
||||||
|
((__LEVEL__) == PWR_PVDLEVEL_4) || ((__LEVEL__) == PWR_PVDLEVEL_5)|| \
|
||||||
|
((__LEVEL__) == PWR_PVDLEVEL_6) || ((__LEVEL__) == PWR_PVDLEVEL_7))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_PVD_Mode PWR PVD Mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_PVD_MODE_NORMAL ((uint32_t)0x00000000U) /*!< Basic mode is used */
|
||||||
|
#define PWR_PVD_MODE_IT_RISING ((uint32_t)0x00010001U) /*!< External Interrupt Mode with Rising edge trigger detection */
|
||||||
|
#define PWR_PVD_MODE_IT_FALLING ((uint32_t)0x00010002U) /*!< External Interrupt Mode with Falling edge trigger detection */
|
||||||
|
#define PWR_PVD_MODE_IT_RISING_FALLING ((uint32_t)0x00010003U) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
|
||||||
|
|
||||||
|
#define IS_PWR_PVD_MODE(__MODE__) (((__MODE__) == PWR_PVD_MODE_NORMAL) || ((__MODE__) == PWR_PVD_MODE_IT_RISING) || \
|
||||||
|
((__MODE__) == PWR_PVD_MODE_IT_FALLING) || ((__MODE__) == PWR_PVD_MODE_IT_RISING_FALLING))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_Regulator_state_in_STOP_mode PWR Regulator state in STOP_mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_MAINREGULATOR_ON ((uint32_t)0x00000000)
|
||||||
|
#define PWR_LOWPOWERREGULATOR_ON PWR_CR1_LPDS
|
||||||
|
|
||||||
|
#define IS_PWR_REGULATOR(__REGULATOR__) (((__REGULATOR__) == PWR_MAINREGULATOR_ON) || \
|
||||||
|
((__REGULATOR__) == PWR_LOWPOWERREGULATOR_ON))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_SLEEP_mode_entry PWR SLEEP mode entry
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_SLEEPENTRY_WFI ((uint8_t)0x01)
|
||||||
|
#define PWR_SLEEPENTRY_WFE ((uint8_t)0x02)
|
||||||
|
#define IS_PWR_SLEEP_ENTRY(__ENTRY__) (((__ENTRY__) == PWR_SLEEPENTRY_WFI) || ((__ENTRY__) == PWR_SLEEPENTRY_WFE))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_STOP_mode_entry PWR STOP mode entry
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_STOPENTRY_WFI ((uint8_t)0x01)
|
||||||
|
#define PWR_STOPENTRY_WFE ((uint8_t)0x02)
|
||||||
|
|
||||||
|
#define IS_PWR_STOP_ENTRY(__ENTRY__) (((__ENTRY__) == PWR_STOPENTRY_WFI) || ((__ENTRY__) == PWR_STOPENTRY_WFE))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** @defgroup PWR_Flag PWR Flag
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_FLAG_SB ((uint8_t)0x01U) /* System STANDBY Flag */
|
||||||
|
#define PWR_FLAG_STOP ((uint8_t)0x02U) /* STOP Flag */
|
||||||
|
#define PWR_FLAG_CSB ((uint8_t)0x03U) /* MPU CSTANBY flag */
|
||||||
|
#define PWR_FLAG_AVDO ((uint8_t)0x06U)
|
||||||
|
#define PWR_FLAG_PVDO ((uint8_t)0x07U)
|
||||||
|
#define PWR_FLAG_BRR ((uint8_t)0x08U)
|
||||||
|
#define PWR_FLAG_RRR ((uint8_t)0x09U)
|
||||||
|
#define PWR_FLAG_VBATL ((uint8_t)0x0AU)
|
||||||
|
#define PWR_FLAG_VBATH ((uint8_t)0x0BU)
|
||||||
|
#define PWR_FLAG_TEMPL ((uint8_t)0x0CU)
|
||||||
|
#define PWR_FLAG_TEMPH ((uint8_t)0x0DU)
|
||||||
|
#define PWR_FLAG_11R ((uint8_t)0x0EU)
|
||||||
|
#define PWR_FLAG_18R ((uint8_t)0x0FU)
|
||||||
|
#define PWR_FLAG_USB ((uint8_t)0x10U)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_Exported_Macro PWR Exported Macro
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @brief Check PWR flag is set or not.
|
||||||
|
* @param __FLAG__: specifies the flag to check.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg PWR_FLAG_PVDO: PVD Output. This flag is valid only if PVD is enabled
|
||||||
|
* by the HAL_PWR_EnablePVD() function. The PVD is stopped by Standby mode
|
||||||
|
* @arg PWR_FLAG_AVDO: AVD Output. This flag is valid only if AVD is enabled
|
||||||
|
* by the HAL_PWREx_EnableAVD() function. The AVD is stopped by Standby mode
|
||||||
|
* @arg PWR_FLAG_SB: StandBy flag. This flag indicates that the system was
|
||||||
|
* resumed from StandBy mode.
|
||||||
|
* @arg PWR_FLAG_BRR: Backup regulator ready flag. This bit is not reset
|
||||||
|
* when the device wakes up from Standby mode or by a system reset
|
||||||
|
* or power reset.
|
||||||
|
* @arg PWR_FLAG_RRR: Retention Regulator ready flag. This bit is not reset
|
||||||
|
* when the device wakes up from Standby mode or by a system reset
|
||||||
|
* or power reset.
|
||||||
|
* @arg PWR_FLAG_VBATL:
|
||||||
|
* @arg PWR_FLAG_VBATH:
|
||||||
|
* @arg PWR_FLAG_TEMPL:
|
||||||
|
* @arg PWR_FLAG_TEMPH:
|
||||||
|
* @arg PWR_FLAG_11R: 1V1 regulator supply ready
|
||||||
|
* @arg PWR_FLAG_18R: 1V8 regulator supply ready
|
||||||
|
* @arg PWR_FLAG_USB: USB 3.3V supply ready
|
||||||
|
* @arg PWR_FLAG_SB: StandBy flag
|
||||||
|
* @arg PWR_FLAG_STOP: STOP flag
|
||||||
|
* @arg PWR_FLAG_CSB_MPU: MPU CSTANBY flag
|
||||||
|
*
|
||||||
|
* @retval The new state of __FLAG__ (TRUE or FALSE).
|
||||||
|
*/
|
||||||
|
#ifdef CORE_CM4
|
||||||
|
#define __HAL_PWR_GET_FLAG(__FLAG__) ( \
|
||||||
|
((__FLAG__) == PWR_FLAG_PVDO)?((PWR->CSR1 & PWR_CSR1_PVDO) == PWR_CSR1_PVDO) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_AVDO)?((PWR->CSR1 & PWR_CSR1_AVDO) == PWR_CSR1_AVDO) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_BRR)?((PWR->CR2 & PWR_CR2_BRRDY) == PWR_CR2_BRRDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_RRR)?((PWR->CR2 & PWR_CR2_RRRDY) == PWR_CR2_RRRDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_VBATL)?((PWR->CR2 & PWR_CR2_VBATL) == PWR_CR2_VBATL) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_VBATH)?((PWR->CR2 & PWR_CR2_VBATH) == PWR_CR2_VBATH) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_TEMPL)?((PWR->CR2 & PWR_CR2_TEMPL) == PWR_CR2_TEMPL) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_TEMPH)?((PWR->CR2 & PWR_CR2_TEMPH) == PWR_CR2_TEMPH) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_11R)?((PWR->CR3 & PWR_CR3_REG11RDY) == PWR_CR3_REG11RDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_18R)?((PWR->CR3 & PWR_CR3_REG18RDY) == PWR_CR3_REG18RDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_USB)?((PWR->CR3 & PWR_CR3_USB33RDY) == PWR_CR3_USB33RDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_SB)?((PWR->MCUCR & PWR_MCUCR_SBF) == PWR_MCUCR_SBF) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_STOP)?((PWR->MCUCR & PWR_MCUCR_STOPF) == PWR_MCUCR_STOPF) : \
|
||||||
|
((PWR->MPUCR & PWR_MPUCR_SBF_MPU) == PWR_MPUCR_SBF_MPU))
|
||||||
|
#elif defined (CORE_CA7)
|
||||||
|
#define __HAL_PWR_GET_FLAG(__FLAG__) ( \
|
||||||
|
((__FLAG__) == PWR_FLAG_PVDO)?((PWR->CSR1 & PWR_CSR1_PVDO) == PWR_CSR1_PVDO) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_AVDO)?((PWR->CSR1 & PWR_CSR1_AVDO) == PWR_CSR1_AVDO) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_BRR)?((PWR->CR2 & PWR_CR2_BRRDY) == PWR_CR2_BRRDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_RRR)?((PWR->CR2 & PWR_CR2_RRRDY) == PWR_CR2_RRRDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_VBATL)?((PWR->CR2 & PWR_CR2_VBATL) == PWR_CR2_VBATL) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_VBATH)?((PWR->CR2 & PWR_CR2_VBATH) == PWR_CR2_VBATH) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_TEMPL)?((PWR->CR2 & PWR_CR2_TEMPL) == PWR_CR2_TEMPL) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_TEMPH)?((PWR->CR2 & PWR_CR2_TEMPH) == PWR_CR2_TEMPH) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_11R)?((PWR->CR3 & PWR_CR3_REG11RDY) == PWR_CR3_REG11RDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_18R)?((PWR->CR3 & PWR_CR3_REG18RDY) == PWR_CR3_REG18RDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_USB)?((PWR->CR3 & PWR_CR3_USB33RDY) == PWR_CR3_USB33RDY) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_SB)?((PWR->MPUCR & PWR_MPUCR_SBF) == PWR_MPUCR_SBF) : \
|
||||||
|
((__FLAG__) == PWR_FLAG_STOP)?((PWR->MPUCR & PWR_MPUCR_STOPF) == PWR_MPUCR_STOPF) : \
|
||||||
|
((PWR->MPUCR & PWR_MPUCR_SBF_MPU) == PWR_MPUCR_SBF_MPU))
|
||||||
|
#endif /*CORE_CA7*/
|
||||||
|
|
||||||
|
#ifdef CORE_CM4
|
||||||
|
/** @brief Clear the PWR's flags.
|
||||||
|
* @param __FLAG__: specifies the flag to clear.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg @ref PWR_FLAG_STOP
|
||||||
|
* @arg @ref PWR_FLAG_SB
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_CLEAR_FLAG(__FLAG__) SET_BIT(PWR->MCUCR, PWR_MCUCR_CSSF);
|
||||||
|
#elif defined (CORE_CA7)
|
||||||
|
/** @brief Clear the PWR's flags.
|
||||||
|
* @param __FLAG__: specifies the flag to clear.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg @ref PWR_FLAG_STOP
|
||||||
|
* @arg @ref PWR_FLAG_SB
|
||||||
|
* @arg @ref PWR_FLAG_CSB flags
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_CLEAR_FLAG(__FLAG__) SET_BIT(PWR->MPUCR, PWR_MPUCR_CSSF);
|
||||||
|
|
||||||
|
|
||||||
|
#endif /*CORE_CA7*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable the PVD AVD Exti Line.
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#ifdef CORE_CM4
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_ENABLE_IT() SET_BIT(EXTI_C2->IMR1, PWR_EXTI_LINE_PVD_AVD)
|
||||||
|
#elif defined (CORE_CA7)
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_ENABLE_IT() SET_BIT(EXTI_C1->IMR1, PWR_EXTI_LINE_PVD_AVD)
|
||||||
|
#endif /*CORE_CA7*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable the PVD AVD EXTI Line.
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#ifdef CORE_CM4
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_DISABLE_IT() CLEAR_BIT(EXTI_C2->IMR1, PWR_EXTI_LINE_PVD_AVD)
|
||||||
|
#elif defined (CORE_CA7)
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_DISABLE_IT() CLEAR_BIT(EXTI_C1->IMR1, PWR_EXTI_LINE_PVD_AVD)
|
||||||
|
#endif /*CORE_CA7*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable the PVD AVD Extended Interrupt Rising Trigger.
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR1, PWR_EXTI_LINE_PVD_AVD)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable the PVD AVD Extended Interrupt Rising Trigger.
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR1, PWR_EXTI_LINE_PVD_AVD)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable the PVD AVD Extended Interrupt Falling Trigger.
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR1, PWR_EXTI_LINE_PVD_AVD)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable the PVD AVD Extended Interrupt Falling Trigger.
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR1, PWR_EXTI_LINE_PVD_AVD)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief PVD AVD EXTI line configuration: set rising & falling edge trigger.
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_ENABLE_RISING_FALLING_EDGE() \
|
||||||
|
do { \
|
||||||
|
__HAL_PWR_PVD_AVD_EXTI_ENABLE_RISING_EDGE(); \
|
||||||
|
__HAL_PWR_PVD_AVD_EXTI_ENABLE_FALLING_EDGE(); \
|
||||||
|
} while(0);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable the PVD AVD Extended Interrupt Rising & Falling Trigger.
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_DISABLE_RISING_FALLING_EDGE() \
|
||||||
|
do { \
|
||||||
|
__HAL_PWR_PVD_AVD_EXTI_DISABLE_RISING_EDGE(); \
|
||||||
|
__HAL_PWR_PVD_AVD_EXTI_DISABLE_FALLING_EDGE(); \
|
||||||
|
} while(0);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check whether the specified PVD AVD EXTI interrupt flag is set or not.
|
||||||
|
* @retval EXTI PVD AVD Line Status.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_GET_FLAG() \
|
||||||
|
(((EXTI->RPR1 & PWR_EXTI_LINE_PVD_AVD) == PWR_EXTI_LINE_PVD_AVD) || \
|
||||||
|
((EXTI->FPR1 & PWR_EXTI_LINE_PVD_AVD) == PWR_EXTI_LINE_PVD_AVD))
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear the PVD AVD Exti flag.
|
||||||
|
* @retval None.
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_CLEAR_FLAG() \
|
||||||
|
do { \
|
||||||
|
SET_BIT(EXTI->RPR1, PWR_EXTI_LINE_PVD_AVD); \
|
||||||
|
SET_BIT(EXTI->FPR1, PWR_EXTI_LINE_PVD_AVD); \
|
||||||
|
} while(0);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Generates a Software interrupt on selected EXTI line.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
/* PVD AVD Event in Bank1 */
|
||||||
|
#define __HAL_PWR_PVD_AVD_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER1, PWR_EXTI_LINE_PVD_AVD )
|
||||||
|
|
||||||
|
|
||||||
|
/* Include PWR HAL Extension module */
|
||||||
|
#include "stm32mp1xx_hal_pwr_ex.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable WKUPx pin wakeup interrupt on AIEC for core 2.
|
||||||
|
* @param __WKUP_LINE__: specifies the WKUP pin line.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg AIEC_WKUP1_WAKEUP: Wakeup pin 1 line
|
||||||
|
* @arg AIEC_WKUP1_WAKEUP: Wakeup pin 2 line
|
||||||
|
* @arg AIEC_WKUP1_WAKEUP: Wakeup pin 3 line
|
||||||
|
* @arg AIEC_WKUP1_WAKEUP: Wakeup pin 4 line
|
||||||
|
* @arg AIEC_WKUP1_WAKEUP: Wakeup pin 5 line
|
||||||
|
* @arg AIEC_WKUP1_WAKEUP: Wakeup pin 6 line
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#ifdef CORE_CM4
|
||||||
|
#define __HAL_WKUP_EXTI_ENABLE_IT(__WKUP_LINE__) (EXTI_C2->IMR2 |= (__WKUP_LINE__))
|
||||||
|
#elif defined(CORE_CA7)
|
||||||
|
#define __HAL_WKUP_EXTI_ENABLE_IT(__WKUP_LINE__) (EXTI_C1->IMR2 |= (__WKUP_LINE__))
|
||||||
|
#endif /*CORE_CA7*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable WKUPx pin wakeup interrupt on AIEC for core 2.
|
||||||
|
* * @param __WKUP_LINE__: specifies the WKUP pin line.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg AIEC_WKUP1_WAKEUP: Wakeup pin 1 line
|
||||||
|
* @arg AIEC_WKUP2_WAKEUP: Wakeup pin 2 line
|
||||||
|
* @arg AIEC_WKUP3_WAKEUP: Wakeup pin 3 line
|
||||||
|
* @arg AIEC_WKUP4_WAKEUP: Wakeup pin 4 line
|
||||||
|
* @arg AIEC_WKUP5_WAKEUP: Wakeup pin 5 line
|
||||||
|
* @arg AIEC_WKUP6_WAKEUP: Wakeup pin 6 line
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#ifdef CORE_CM4
|
||||||
|
#define __HAL_WKUP_EXTI_DISABLE_IT(__WKUP_LINE__) CLEAR_BIT(EXTI_C2->IMR2, __WKUP_LINE__)
|
||||||
|
#elif defined(CORE_CA7)
|
||||||
|
#define __HAL_WKUP_EXTI_DISABLE_IT(__WKUP_LINE__) CLEAR_BIT(EXTI_C1->IMR2, __WKUP_LINE__)
|
||||||
|
#endif /*CORE_CA7*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup PWR_Exported_Functions PWR Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_Exported_Functions_Group1 Initialization and de-initialization functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Initialization and de-initialization functions *****************************/
|
||||||
|
void HAL_PWR_DeInit(void);
|
||||||
|
void HAL_PWR_EnableBkUpAccess(void);
|
||||||
|
void HAL_PWR_DisableBkUpAccess(void);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Peripheral Control functions **********************************************/
|
||||||
|
/** @defgroup PWR_Exported_Functions_Group2 Peripheral Control functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* PVD configuration */
|
||||||
|
void HAL_PWR_ConfigPVD(PWR_PVDTypeDef *sConfigPVD);
|
||||||
|
void HAL_PWR_EnablePVD(void);
|
||||||
|
void HAL_PWR_DisablePVD(void);
|
||||||
|
|
||||||
|
/* WakeUp pins configuration */
|
||||||
|
void HAL_PWR_EnableWakeUpPin(uint32_t WakeUpPinPolarity);
|
||||||
|
void HAL_PWR_DisableWakeUpPin(uint32_t WakeUpPinx);
|
||||||
|
|
||||||
|
/* WakeUp pin IT functions */
|
||||||
|
void HAL_PWR_EnableWakeUpPinIT(uint32_t WakeUpPinx);
|
||||||
|
void HAL_PWR_DisableWakeUpPinIT(uint32_t WakeUpPinx);
|
||||||
|
|
||||||
|
|
||||||
|
/* Low Power modes entry */
|
||||||
|
void HAL_PWR_EnterSTOPMode(uint32_t Regulator, uint8_t STOPEntry);
|
||||||
|
void HAL_PWR_EnterSLEEPMode(uint32_t Regulator, uint8_t SLEEPEntry);
|
||||||
|
void HAL_PWR_EnterSTANDBYMode(void);
|
||||||
|
|
||||||
|
|
||||||
|
/* Power PVD IRQ Callback */
|
||||||
|
void HAL_PWR_PVDCallback(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Cortex System Control functions *******************************************/
|
||||||
|
/** @defgroup PWR_Exported_Functions_Group3 Cortex System Control functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
void HAL_PWR_EnableSleepOnExit(void);
|
||||||
|
void HAL_PWR_DisableSleepOnExit(void);
|
||||||
|
void HAL_PWR_EnableSEVOnPend(void);
|
||||||
|
void HAL_PWR_DisableSEVOnPend(void);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_Private_Constants PWR Private Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWR_EXTI_LINE_PVD_AVD PWR EXTI Line PVD AVD
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_EXTI_LINE_PVD_AVD EXTI_IMR1_IM16 /*!< External interrupt line 16
|
||||||
|
Connected to the PVD AVD EXTI
|
||||||
|
Line */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_HAL_PWR_H */
|
||||||
+437
@@ -0,0 +1,437 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_pwr_ex.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of PWR HAL Extension module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32MP1xx_HAL_PWR_EX_H
|
||||||
|
#define __STM32MP1xx_HAL_PWR_EX_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup PWREx
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/** @defgroup PWREx_Exported_Types PWREx Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @brief PWREx AVD configuration structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t AVDLevel; /*!< AVDLevel: Specifies the AVD detection level.
|
||||||
|
This parameter can be a value of @ref PWREx AVD detection level */
|
||||||
|
uint32_t Mode; /*!< Mode: Specifies the operating mode for the selected pins.
|
||||||
|
This parameter can be a value of @ref PWREx AVD Mode */
|
||||||
|
} PWREx_AVDTypeDef;
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Constants PWREx Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Constants_Group1 PWREx_WakeUp_Pins
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CORE_CA7
|
||||||
|
/* Defines for legacy purpose */
|
||||||
|
#define PWR_WAKEUP_PIN_MASK PWR_MPUWKUPENR_WKUPEN
|
||||||
|
#define PWR_WAKEUP_PIN6 PWR_MPUWKUPENR_WKUPEN_6
|
||||||
|
#define PWR_WAKEUP_PIN5 PWR_MPUWKUPENR_WKUPEN_5
|
||||||
|
#define PWR_WAKEUP_PIN4 PWR_MPUWKUPENR_WKUPEN_4
|
||||||
|
#define PWR_WAKEUP_PIN3 PWR_MPUWKUPENR_WKUPEN_3
|
||||||
|
#define PWR_WAKEUP_PIN2 PWR_MPUWKUPENR_WKUPEN_2
|
||||||
|
#define PWR_WAKEUP_PIN1 PWR_MPUWKUPENR_WKUPEN_1
|
||||||
|
/* Defines for legacy purpose */
|
||||||
|
|
||||||
|
/* High level + No pull */
|
||||||
|
#define PWR_WAKEUP_PIN6_HIGH PWR_MPUWKUPENR_WKUPEN_6
|
||||||
|
#define PWR_WAKEUP_PIN5_HIGH PWR_MPUWKUPENR_WKUPEN_5
|
||||||
|
#define PWR_WAKEUP_PIN4_HIGH PWR_MPUWKUPENR_WKUPEN_4
|
||||||
|
#define PWR_WAKEUP_PIN3_HIGH PWR_MPUWKUPENR_WKUPEN_3
|
||||||
|
#define PWR_WAKEUP_PIN2_HIGH PWR_MPUWKUPENR_WKUPEN_2
|
||||||
|
#define PWR_WAKEUP_PIN1_HIGH PWR_MPUWKUPENR_WKUPEN_1
|
||||||
|
/* Low level + No pull */
|
||||||
|
#define PWR_WAKEUP_PIN6_LOW (uint32_t)(PWR_WKUPCR_WKUPP_6 | PWR_MPUWKUPENR_WKUPEN_6)
|
||||||
|
#define PWR_WAKEUP_PIN5_LOW (uint32_t)(PWR_WKUPCR_WKUPP_5 | PWR_MPUWKUPENR_WKUPEN_5)
|
||||||
|
#define PWR_WAKEUP_PIN4_LOW (uint32_t)(PWR_WKUPCR_WKUPP_4 | PWR_MPUWKUPENR_WKUPEN_4)
|
||||||
|
#define PWR_WAKEUP_PIN3_LOW (uint32_t)(PWR_WKUPCR_WKUPP_3 | PWR_MPUWKUPENR_WKUPEN_3)
|
||||||
|
#define PWR_WAKEUP_PIN2_LOW (uint32_t)(PWR_WKUPCR_WKUPP_2 | PWR_MPUWKUPENR_WKUPEN_2)
|
||||||
|
#define PWR_WAKEUP_PIN1_LOW (uint32_t)(PWR_WKUPCR_WKUPP_1 | PWR_MPUWKUPENR_WKUPEN_1)
|
||||||
|
#endif /*CORE_CA7*/
|
||||||
|
|
||||||
|
#ifdef CORE_CM4
|
||||||
|
/* Defines for legacy purpose */
|
||||||
|
#define PWR_WAKEUP_PIN_MASK PWR_MCUWKUPENR_WKUPEN
|
||||||
|
#define PWR_WAKEUP_PIN6 PWR_MCUWKUPENR_WKUPEN6
|
||||||
|
#define PWR_WAKEUP_PIN5 PWR_MCUWKUPENR_WKUPEN5
|
||||||
|
#define PWR_WAKEUP_PIN4 PWR_MCUWKUPENR_WKUPEN4
|
||||||
|
#define PWR_WAKEUP_PIN3 PWR_MCUWKUPENR_WKUPEN3
|
||||||
|
#define PWR_WAKEUP_PIN2 PWR_MCUWKUPENR_WKUPEN2
|
||||||
|
#define PWR_WAKEUP_PIN1 PWR_MCUWKUPENR_WKUPEN1
|
||||||
|
/* Defines for legacy purpose */
|
||||||
|
|
||||||
|
/* High level + No pull */
|
||||||
|
#define PWR_WAKEUP_PIN6_HIGH PWR_MCUWKUPENR_WKUPEN6
|
||||||
|
#define PWR_WAKEUP_PIN5_HIGH PWR_MCUWKUPENR_WKUPEN5
|
||||||
|
#define PWR_WAKEUP_PIN4_HIGH PWR_MCUWKUPENR_WKUPEN4
|
||||||
|
#define PWR_WAKEUP_PIN3_HIGH PWR_MCUWKUPENR_WKUPEN3
|
||||||
|
#define PWR_WAKEUP_PIN2_HIGH PWR_MCUWKUPENR_WKUPEN2
|
||||||
|
#define PWR_WAKEUP_PIN1_HIGH PWR_MCUWKUPENR_WKUPEN1
|
||||||
|
/* Low level + No pull */
|
||||||
|
#define PWR_WAKEUP_PIN6_LOW (uint32_t)(PWR_WKUPCR_WKUPP_6 | PWR_MCUWKUPENR_WKUPEN6)
|
||||||
|
#define PWR_WAKEUP_PIN5_LOW (uint32_t)(PWR_WKUPCR_WKUPP_5 | PWR_MCUWKUPENR_WKUPEN5)
|
||||||
|
#define PWR_WAKEUP_PIN4_LOW (uint32_t)(PWR_WKUPCR_WKUPP_4 | PWR_MCUWKUPENR_WKUPEN4)
|
||||||
|
#define PWR_WAKEUP_PIN3_LOW (uint32_t)(PWR_WKUPCR_WKUPP_3 | PWR_MCUWKUPENR_WKUPEN3)
|
||||||
|
#define PWR_WAKEUP_PIN2_LOW (uint32_t)(PWR_WKUPCR_WKUPP_2 | PWR_MCUWKUPENR_WKUPEN2)
|
||||||
|
#define PWR_WAKEUP_PIN1_LOW (uint32_t)(PWR_WKUPCR_WKUPP_1 | PWR_MCUWKUPENR_WKUPEN1)
|
||||||
|
#endif /*CORE_CM4*/
|
||||||
|
|
||||||
|
/* High level + Pull-up */
|
||||||
|
#define PWR_WAKEUP_PIN6_HIGH_PULLUP (uint32_t)(PWR_MPUWKUPENR_WKUPEN_6 | PWR_WKUPCR_WKUPPUPD6_0 )
|
||||||
|
#define PWR_WAKEUP_PIN5_HIGH_PULLUP (uint32_t)(PWR_MPUWKUPENR_WKUPEN_5 | PWR_WKUPCR_WKUPPUPD5_0 )
|
||||||
|
#define PWR_WAKEUP_PIN4_HIGH_PULLUP (uint32_t)(PWR_MPUWKUPENR_WKUPEN_4 | PWR_WKUPCR_WKUPPUPD4_0 )
|
||||||
|
#define PWR_WAKEUP_PIN3_HIGH_PULLUP (uint32_t)(PWR_MPUWKUPENR_WKUPEN_3 | PWR_WKUPCR_WKUPPUPD3_0 )
|
||||||
|
#define PWR_WAKEUP_PIN2_HIGH_PULLUP (uint32_t)(PWR_MPUWKUPENR_WKUPEN_2 | PWR_WKUPCR_WKUPPUPD2_0 )
|
||||||
|
#define PWR_WAKEUP_PIN1_HIGH_PULLUP (uint32_t)(PWR_MPUWKUPENR_WKUPEN_1 | PWR_WKUPCR_WKUPPUPD1_0 )
|
||||||
|
/* Low level + Pull-up */
|
||||||
|
#define PWR_WAKEUP_PIN6_LOW_PULLUP (uint32_t)(PWR_WKUPCR_WKUPP_6 | PWR_MPUWKUPENR_WKUPEN_6 | PWR_WKUPCR_WKUPPUPD6_0)
|
||||||
|
#define PWR_WAKEUP_PIN5_LOW_PULLUP (uint32_t)(PWR_WKUPCR_WKUPP_5 | PWR_MPUWKUPENR_WKUPEN_5 | PWR_WKUPCR_WKUPPUPD5_0)
|
||||||
|
#define PWR_WAKEUP_PIN4_LOW_PULLUP (uint32_t)(PWR_WKUPCR_WKUPP_4 | PWR_MPUWKUPENR_WKUPEN_4 | PWR_WKUPCR_WKUPPUPD4_0)
|
||||||
|
#define PWR_WAKEUP_PIN3_LOW_PULLUP (uint32_t)(PWR_WKUPCR_WKUPP_3 | PWR_MPUWKUPENR_WKUPEN_3 | PWR_WKUPCR_WKUPPUPD3_0)
|
||||||
|
#define PWR_WAKEUP_PIN2_LOW_PULLUP (uint32_t)(PWR_WKUPCR_WKUPP_2 | PWR_MPUWKUPENR_WKUPEN_2 | PWR_WKUPCR_WKUPPUPD2_0)
|
||||||
|
#define PWR_WAKEUP_PIN1_LOW_PULLUP (uint32_t)(PWR_WKUPCR_WKUPP_1 | PWR_MPUWKUPENR_WKUPEN_1 | PWR_WKUPCR_WKUPPUPD1_0)
|
||||||
|
/* High level + Pull-down */
|
||||||
|
#define PWR_WAKEUP_PIN6_HIGH_PULLDOWN (uint32_t)(PWR_MPUWKUPENR_WKUPEN_6 | PWR_WKUPCR_WKUPPUPD6_1 )
|
||||||
|
#define PWR_WAKEUP_PIN5_HIGH_PULLDOWN (uint32_t)(PWR_MPUWKUPENR_WKUPEN_5 | PWR_WKUPCR_WKUPPUPD5_1 )
|
||||||
|
#define PWR_WAKEUP_PIN4_HIGH_PULLDOWN (uint32_t)(PWR_MPUWKUPENR_WKUPEN_4 | PWR_WKUPCR_WKUPPUPD4_1 )
|
||||||
|
#define PWR_WAKEUP_PIN3_HIGH_PULLDOWN (uint32_t)(PWR_MPUWKUPENR_WKUPEN_3 | PWR_WKUPCR_WKUPPUPD3_1 )
|
||||||
|
#define PWR_WAKEUP_PIN2_HIGH_PULLDOWN (uint32_t)(PWR_MPUWKUPENR_WKUPEN_2 | PWR_WKUPCR_WKUPPUPD2_1 )
|
||||||
|
#define PWR_WAKEUP_PIN1_HIGH_PULLDOWN (uint32_t)(PWR_MPUWKUPENR_WKUPEN_1 | PWR_WKUPCR_WKUPPUPD1_1 )
|
||||||
|
/* Low level + Pull-down */
|
||||||
|
#define PWR_WAKEUP_PIN6_LOW_PULLDOWN (uint32_t)(PWR_WKUPCR_WKUPP_6 | PWR_MPUWKUPENR_WKUPEN_6 | PWR_WKUPCR_WKUPPUPD6_1)
|
||||||
|
#define PWR_WAKEUP_PIN5_LOW_PULLDOWN (uint32_t)(PWR_WKUPCR_WKUPP_5 | PWR_MPUWKUPENR_WKUPEN_5 | PWR_WKUPCR_WKUPPUPD5_1)
|
||||||
|
#define PWR_WAKEUP_PIN4_LOW_PULLDOWN (uint32_t)(PWR_WKUPCR_WKUPP_4 | PWR_MPUWKUPENR_WKUPEN_4 | PWR_WKUPCR_WKUPPUPD4_1)
|
||||||
|
#define PWR_WAKEUP_PIN3_LOW_PULLDOWN (uint32_t)(PWR_WKUPCR_WKUPP_3 | PWR_MPUWKUPENR_WKUPEN_3 | PWR_WKUPCR_WKUPPUPD3_1)
|
||||||
|
#define PWR_WAKEUP_PIN2_LOW_PULLDOWN (uint32_t)(PWR_WKUPCR_WKUPP_2 | PWR_MPUWKUPENR_WKUPEN_2 | PWR_WKUPCR_WKUPPUPD2_1)
|
||||||
|
#define PWR_WAKEUP_PIN1_LOW_PULLDOWN (uint32_t)(PWR_WKUPCR_WKUPP_1 | PWR_MPUWKUPENR_WKUPEN_1 | PWR_WKUPCR_WKUPPUPD1_1)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Constants_Group2 PWREx Wakeup Pins Flags
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_WAKEUP_PIN_FLAG1 PWR_WKUPFR_WKUPF1 /*!< Wakeup event on pin 1 */
|
||||||
|
#define PWR_WAKEUP_PIN_FLAG2 PWR_WKUPFR_WKUPF2 /*!< Wakeup event on pin 2 */
|
||||||
|
#define PWR_WAKEUP_PIN_FLAG3 PWR_WKUPFR_WKUPF3 /*!< Wakeup event on pin 3 */
|
||||||
|
#define PWR_WAKEUP_PIN_FLAG4 PWR_WKUPFR_WKUPF4 /*!< Wakeup event on pin 4 */
|
||||||
|
#define PWR_WAKEUP_PIN_FLAG5 PWR_WKUPFR_WKUPF5 /*!< Wakeup event on pin 5 */
|
||||||
|
#define PWR_WAKEUP_PIN_FLAG6 PWR_WKUPFR_WKUPF6 /*!< Wakeup event on pin 6 */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Constants_Group3 PWREx Core definition
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_CORE_CPU1 ((uint32_t)0x00)
|
||||||
|
#define PWR_CORE_CPU2 ((uint32_t)0x01)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Constants_Group4 PWREx AVD detection level
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_AVDLEVEL_0 PWR_CR1_ALS_LEV0 /* 1.7 V */
|
||||||
|
#define PWR_AVDLEVEL_1 PWR_CR1_ALS_LEV1 /* 2.1 V */
|
||||||
|
#define PWR_AVDLEVEL_2 PWR_CR1_ALS_LEV2 /* 2.5 V */
|
||||||
|
#define PWR_AVDLEVEL_3 PWR_CR1_ALS_LEV3 /* 2.8 V */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Constants_Group5 PWREx AVD Mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_AVD_MODE_NORMAL ((uint32_t)0x00000000U) /*!< Basic mode is used */
|
||||||
|
#define PWR_AVD_MODE_IT_RISING ((uint32_t)0x00010001U) /*!< External Interrupt Mode with Rising edge trigger detection */
|
||||||
|
#define PWR_AVD_MODE_IT_FALLING ((uint32_t)0x00010002U) /*!< External Interrupt Mode with Falling edge trigger detection */
|
||||||
|
#define PWR_AVD_MODE_IT_RISING_FALLING ((uint32_t)0x00010003U) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Constants_Group6 PWR battery charging resistor selection
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_BATTERY_CHARGING_RESISTOR_5 ((uint32_t)0x00000000U) /*!< VBAT charging through a 5 kOhm resistor */
|
||||||
|
#define PWR_BATTERY_CHARGING_RESISTOR_1_5 PWR_CR3_VBRS /*!< VBAT charging through a 1.5 kOhm resistor */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Constants_Group7 PWREx VBAT Thresholds
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_VBAT_BETWEEN_HIGH_LOW_THRESHOLD ((uint32_t)0x00000000U)
|
||||||
|
#define PWR_VBAT_BELOW_LOW_THRESHOLD PWR_CR2_VBATL /*!< Vsw low threshold is ~1.35V */
|
||||||
|
#define PWR_VBAT_ABOVE_HIGH_THRESHOLD PWR_CR2_VBATH /*!< Vsw high threshold is ~3.6V */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Constants_Group8 PWREx Temperature Thresholds
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define PWR_TEMP_BETWEEN_HIGH_LOW_THRESHOLD ((uint32_t)0x00000000U)
|
||||||
|
#define PWR_TEMP_BELOW_LOW_THRESHOLD PWR_CR2_TEMPL
|
||||||
|
#define PWR_TEMP_ABOVE_HIGH_THRESHOLD PWR_CR2_TEMPH
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/** @defgroup PWREx_Exported_Macro PWREx Exported Macro
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @brief Check Wake Up flag is set or not.
|
||||||
|
* @param __WUFLAG__: specifies the Wake Up flag to check.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG1: Wakeup Pin Flag 1
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG2: Wakeup Pin Flag 2
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG3: Wakeup Pin Flag 3
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG4: Wakeup Pin Flag 4
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG5: Wakeup Pin Flag 5
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG6: Wakeup Pin Flag 6
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_GET_WAKEUP_FLAG(__WUFLAG__) (PWR->WKUPFR & (__WUFLAG__))
|
||||||
|
|
||||||
|
/** @brief Clear the WakeUp pins flags.
|
||||||
|
* @param __WUFLAG__: specifies the Wake Up pin flag to clear.
|
||||||
|
* This parameter can be one of the following values:
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG1: Wakeup Pin Flag 1
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG2: Wakeup Pin Flag 2
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG3: Wakeup Pin Flag 3
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG4: Wakeup Pin Flag 4
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG5: Wakeup Pin Flag 5
|
||||||
|
* @arg PWR_WAKEUP_PIN_FLAG6: Wakeup Pin Flag 6
|
||||||
|
*/
|
||||||
|
#define __HAL_PWR_CLEAR_WAKEUP_FLAG(__WUFLAG__) SET_BIT(PWR->WKUPCR, (__WUFLAG__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup PWREx_Exported_Functions PWREx Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Functions_Group1 Low power control functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Power core holding functions */
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_HoldCore(uint32_t CPU);
|
||||||
|
void HAL_PWREx_ReleaseCore(uint32_t CPU);
|
||||||
|
|
||||||
|
|
||||||
|
/* Power Wakeup PIN IRQ Handler */
|
||||||
|
void HAL_PWREx_WAKEUP_PIN_IRQHandler(void);
|
||||||
|
void HAL_PWREx_WKUP1_Callback(void);
|
||||||
|
void HAL_PWREx_WKUP2_Callback(void);
|
||||||
|
void HAL_PWREx_WKUP3_Callback(void);
|
||||||
|
void HAL_PWREx_WKUP4_Callback(void);
|
||||||
|
void HAL_PWREx_WKUP5_Callback(void);
|
||||||
|
void HAL_PWREx_WKUP6_Callback(void);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Functions_Group2 Peripherals control functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Backup regulator control functions */
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_EnableBkUpReg(void);
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_DisableBkUpReg(void);
|
||||||
|
|
||||||
|
/* Retention regulator control functions */
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_EnableRetReg(void);
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_DisableRetReg(void);
|
||||||
|
|
||||||
|
/* 1V1 regulator control functions */
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_Enable1V1Reg(void);
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_Disable1V1Reg(void);
|
||||||
|
|
||||||
|
/* 1V8 regulator control functions */
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_Enable1V8Reg(void);
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_Disable1V8Reg(void);
|
||||||
|
|
||||||
|
/* Battery control functions */
|
||||||
|
void HAL_PWREx_EnableBatteryCharging(uint32_t ResistorValue);
|
||||||
|
void HAL_PWREx_DisableBatteryCharging(void);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_Exported_Functions_Group3 Power Monitoring functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Power VBAT/Temperature monitoring functions */
|
||||||
|
void HAL_PWREx_EnableMonitoring(void);
|
||||||
|
void HAL_PWREx_DisableMonitoring(void);
|
||||||
|
uint32_t HAL_PWREx_GetTemperatureLevel(void);
|
||||||
|
uint32_t HAL_PWREx_GetVBATLevel(void);
|
||||||
|
|
||||||
|
/* USB Voltage level detector functions */
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_EnableUSBVoltageDetector(void);
|
||||||
|
HAL_StatusTypeDef HAL_PWREx_DisableUSBVoltageDetector(void);
|
||||||
|
|
||||||
|
/* Power AVD configuration functions */
|
||||||
|
void HAL_PWREx_ConfigAVD(PWREx_AVDTypeDef *sConfigAVD);
|
||||||
|
void HAL_PWREx_EnableAVD(void);
|
||||||
|
void HAL_PWREx_DisableAVD(void);
|
||||||
|
|
||||||
|
/* Power PVD/AVD IRQ Handler */
|
||||||
|
void HAL_PWREx_PVD_AVD_IRQHandler(void);
|
||||||
|
void HAL_PWREx_AVDCallback(void);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup PWREx_Private_Macros PWREx Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup PWREx_IS_PWR_Definitions PWREx Private macros to check input parameters
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define IS_PWR_WAKEUP_PIN(__PIN__) (((__PIN__) == PWR_WAKEUP_PIN1) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN2) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN3) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN4) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN5) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN6) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN1_HIGH) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN2_HIGH) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN3_HIGH) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN4_HIGH) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN5_HIGH) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN6_HIGH) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN1_LOW) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN2_LOW) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN3_LOW) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN4_LOW) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN5_LOW) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN6_LOW) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN6_HIGH_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN5_HIGH_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN4_HIGH_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN3_HIGH_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN2_HIGH_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN1_HIGH_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN6_LOW_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN5_LOW_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN4_LOW_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN3_LOW_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN2_LOW_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN1_LOW_PULLUP) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN6_HIGH_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN5_HIGH_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN4_HIGH_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN3_HIGH_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN2_HIGH_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN1_HIGH_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN6_LOW_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN5_LOW_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN4_LOW_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN3_LOW_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN2_LOW_PULLDOWN) || \
|
||||||
|
((__PIN__) == PWR_WAKEUP_PIN1_LOW_PULLDOWN))
|
||||||
|
|
||||||
|
#define IS_PWR_AVD_LEVEL(LEVEL) (((LEVEL) == PWR_AVDLEVEL_0) || ((LEVEL) == PWR_AVDLEVEL_1) || \
|
||||||
|
((LEVEL) == PWR_AVDLEVEL_2) || ((LEVEL) == PWR_AVDLEVEL_3))
|
||||||
|
|
||||||
|
#define IS_PWR_AVD_MODE(MODE) (((MODE) == PWR_AVD_MODE_IT_RISING)|| ((MODE) == PWR_AVD_MODE_IT_FALLING) || \
|
||||||
|
((MODE) == PWR_AVD_MODE_IT_RISING_FALLING) || ((MODE) == PWR_AVD_MODE_NORMAL))
|
||||||
|
|
||||||
|
#define IS_PWR_BATTERY_RESISTOR_SELECT(RESISTOR) (((RESISTOR) == PWR_BATTERY_CHARGING_RESISTOR_5) ||\
|
||||||
|
((RESISTOR) == PWR_BATTERY_CHARGING_RESISTOR_1_5))
|
||||||
|
|
||||||
|
#define IS_PWR_CORE(CPU) (((CPU) == PWR_CORE_CPU1) || ((CPU) == PWR_CORE_CPU2))
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_HAL_PWR_EX_H */
|
||||||
+4480
File diff suppressed because it is too large
Load Diff
+2025
File diff suppressed because it is too large
Load Diff
+2216
File diff suppressed because it is too large
Load Diff
+442
@@ -0,0 +1,442 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_hal_tim_ex.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of TIM HAL Extended module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_HAL_TIM_EX_H
|
||||||
|
#define STM32MP1xx_HAL_TIM_EX_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx_hal_def.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_HAL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup TIMEx
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/** @defgroup TIMEx_Exported_Types TIM Extended Exported Types
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief TIM Hall sensor Configuration Structure definition
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal.
|
||||||
|
This parameter can be a value of @ref TIM_Input_Capture_Polarity */
|
||||||
|
|
||||||
|
uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler.
|
||||||
|
This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
|
||||||
|
|
||||||
|
uint32_t IC1Filter; /*!< Specifies the input capture filter.
|
||||||
|
This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
|
||||||
|
|
||||||
|
uint32_t Commutation_Delay; /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
|
||||||
|
This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
|
||||||
|
} TIM_HallSensor_InitTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief TIM Break/Break2 input configuration
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t Source; /*!< Specifies the source of the timer break input.
|
||||||
|
This parameter can be a value of @ref TIMEx_Break_Input_Source */
|
||||||
|
uint32_t Enable; /*!< Specifies whether or not the break input source is enabled.
|
||||||
|
This parameter can be a value of @ref TIMEx_Break_Input_Source_Enable */
|
||||||
|
uint32_t Polarity; /*!< Specifies the break input source polarity.
|
||||||
|
This parameter can be a value of @ref TIMEx_Break_Input_Source_Polarity
|
||||||
|
Not relevant when analog watchdog output of the DFSDM1 used as break input source */
|
||||||
|
}
|
||||||
|
TIMEx_BreakInputConfigTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* End of exported types -----------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/** @defgroup TIMEx_Exported_Constants TIM Extended Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup TIMEx_Remap TIM Extended Remapping
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define TIM_TIM1_ETR_GPIO 0x00000000U /* !< TIM1_ETR is connected to GPIO */
|
||||||
|
#define TIM_TIM1_ETR_ADC1_AWD1 (TIM1_AF1_ETRSEL_1 | TIM1_AF1_ETRSEL_0) /* !< TIM1_ETR is connected to ADC1 AWD1 */
|
||||||
|
#define TIM_TIM1_ETR_ADC1_AWD2 (TIM1_AF1_ETRSEL_2) /* !< TIM1_ETR is connected to ADC1 AWD2 */
|
||||||
|
#define TIM_TIM1_ETR_ADC1_AWD3 (TIM1_AF1_ETRSEL_2 | TIM1_AF1_ETRSEL_0) /* !< TIM1_ETR is connected to ADC1 AWD3 */
|
||||||
|
#define TIM_TIM1_ETR_ADC2_AWD1 (TIM1_AF1_ETRSEL_2 | TIM1_AF1_ETRSEL_1) /* !< TIM1_ETR is connected to ADC3 AWD1 */
|
||||||
|
#define TIM_TIM1_ETR_ADC2_AWD2 (TIM1_AF1_ETRSEL_2 | TIM1_AF1_ETRSEL_1 | TIM1_AF1_ETRSEL_0) /* !< TIM1_ETR is connected to ADC3 AWD2 */
|
||||||
|
#define TIM_TIM1_ETR_ADC2_AWD3 TIM1_AF1_ETRSEL_3 /* !< TIM1_ETR is connected to ADC3 AWD3 */
|
||||||
|
#if defined(TIM8)
|
||||||
|
#define TIM_TIM8_ETR_GPIO 0x00000000U /* !< TIM8_ETR is connected to GPIO */
|
||||||
|
#define TIM_TIM8_ETR_ADC1_AWD1 (TIM8_AF1_ETRSEL_1 | TIM8_AF1_ETRSEL_0) /* !< TIM8_ETR is connected to ADC1 AWD1 */
|
||||||
|
#define TIM_TIM8_ETR_ADC1_AWD2 (TIM8_AF1_ETRSEL_2) /* !< TIM8_ETR is connected to ADC1 AWD2 */
|
||||||
|
#define TIM_TIM8_ETR_ADC1_AWD3 (TIM8_AF1_ETRSEL_2 | TIM8_AF1_ETRSEL_0) /* !< TIM8_ETR is connected to ADC1 AWD3 */
|
||||||
|
#define TIM_TIM8_ETR_ADC2_AWD1 (TIM8_AF1_ETRSEL_2 | TIM8_AF1_ETRSEL_1) /* !< TIM8_ETR is connected to ADC3 AWD1 */
|
||||||
|
#define TIM_TIM8_ETR_ADC2_AWD2 (TIM8_AF1_ETRSEL_2 | TIM8_AF1_ETRSEL_1 | TIM8_AF1_ETRSEL_0) /* !< TIM8_ETR is connected to ADC3 AWD2 */
|
||||||
|
#define TIM_TIM8_ETR_ADC2_AWD3 TIM8_AF1_ETRSEL_3 /* !< TIM8_ETR is connected to ADC3 AWD3 */
|
||||||
|
#endif
|
||||||
|
#if defined(TIM2)
|
||||||
|
#define TIM_TIM2_ETR_GPIO 0x00000000U /* !< TIM2_ETR is connected to GPIO */
|
||||||
|
#define TIM_TIM2_ETR_RCC_LSE (TIM2_AF1_ETRSEL_1 | TIM2_AF1_ETRSEL_0) /* !< TIM2_ETR is connected to RCC LSE */
|
||||||
|
#define TIM_TIM2_ETR_SAI1_FSA (TIM2_AF1_ETRSEL_2) /* !< TIM2_ETR is connected to SAI1 FS_A */
|
||||||
|
#define TIM_TIM2_ETR_SAI1_FSB (TIM2_AF1_ETRSEL_2 | TIM2_AF1_ETRSEL_0) /* !< TIM2_ETR is connected to SAI1 FS_B */
|
||||||
|
#define TIM_TIM2_ETR_ETH_PPS (TIM2_AF1_ETRSEL_2 | TIM2_AF1_ETRSEL_1) /* !< TIM2_ETR is connected to ETH PPS */
|
||||||
|
#endif
|
||||||
|
#if defined(TIM3)
|
||||||
|
#define TIM_TIM3_ETR_GPIO 0x00000000U /* !< TIM3_ETR is connected to GPIO */
|
||||||
|
#define TIM_TIM3_ETR_ETH_PPS (TIM3_AF1_ETRSEL_2 | TIM3_AF1_ETRSEL_1) /* !< TIM3_ETR is connected to ETH PPS */
|
||||||
|
#endif
|
||||||
|
#if defined(TIM4)
|
||||||
|
#define TIM_TIM4_ETR_GPIO 0x00000000U /* !< TIM4_ETR is connected to GPIO */
|
||||||
|
#endif
|
||||||
|
#if defined(TIM5)
|
||||||
|
#define TIM_TIM5_ETR_GPIO 0x00000000U /* !< TIM5_ETR is connected to GPIO */
|
||||||
|
#define TIM_TIM5_ETR_SAI2_FSA TIM5_AF1_ETRSEL_0 /* !< TIM5_ETR is connected to SAI2 FS_A */
|
||||||
|
#define TIM_TIM5_ETR_SAI2_FSB TIM5_AF1_ETRSEL_1 /* !< TIM5_ETR is connected to SAI2 FS_B */
|
||||||
|
#define TIM_TIM5_ETR_OTG_SOF (TIM5_AF1_ETRSEL_1 | TIM5_AF1_ETRSEL_0) /* !< TIM5_ETR is connected to OTG SOF */
|
||||||
|
#endif
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup TIMEx_Break_Input TIM Extended Break input
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define TIM_BREAKINPUT_BRK 0x00000001U /* !< Timer break input */
|
||||||
|
#define TIM_BREAKINPUT_BRK2 0x00000002U /* !< Timer break2 input */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup TIMEx_Break_Input_Source TIM Extended Break input source
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define TIM_BREAKINPUTSOURCE_BKIN 0x00000001U /* !< An external source (GPIO) is connected to the BKIN pin */
|
||||||
|
#define TIM_BREAKINPUTSOURCE_DFSDM1 0x00000008U /* !< The analog watchdog output of the DFSDM1 peripheral is connected to the break input */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup TIMEx_Break_Input_Source_Enable TIM Extended Break input source enabling
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define TIM_BREAKINPUTSOURCE_DISABLE 0x00000000U /* !< Break input source is disabled */
|
||||||
|
#define TIM_BREAKINPUTSOURCE_ENABLE 0x00000001U /* !< Break input source is enabled */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup TIMEx_Break_Input_Source_Polarity TIM Extended Break input polarity
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define TIM_BREAKINPUTSOURCE_POLARITY_LOW 0x00000001U /* !< Break input source is active low */
|
||||||
|
#define TIM_BREAKINPUTSOURCE_POLARITY_HIGH 0x00000000U /* !< Break input source is active_high */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup TIMEx_Timer_Input_Selection TIM Extended Timer input selection
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define TIM_TIM1_TI1_GPIO 0x00000000UL /* !< TIM1_TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM1_TI2_GPIO 0x00000000UL /* !< TIM1_TI2 is connected to GPIO */
|
||||||
|
#define TIM_TIM1_TI3_GPIO 0x00000000UL /* !< TIM1_TI3 is connected to GPIO */
|
||||||
|
#define TIM_TIM1_TI4_GPIO 0x00000000UL /* !< TIM1_TI4 is connected to GPIO */
|
||||||
|
|
||||||
|
#define TIM_TIM8_TI1_GPIO 0x00000000UL /* !< TIM8_TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM8_TI2_GPIO 0x00000000UL /* !< TIM8_TI2 is connected to GPIO */
|
||||||
|
#define TIM_TIM8_TI3_GPIO 0x00000000UL /* !< TIM8_TI3 is connected to GPIO */
|
||||||
|
#define TIM_TIM8_TI4_GPIO 0x00000000UL /* !< TIM8_TI4 is connected to GPIO */
|
||||||
|
|
||||||
|
#define TIM_TIM2_TI1_GPIO 0x00000000UL /* !< TIM2_TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM2_TI2_GPIO 0x00000000UL /* !< TIM2_TI2 is connected to GPIO */
|
||||||
|
#define TIM_TIM2_TI3_GPIO 0x00000000UL /* !< TIM2_TI3 is connected to GPIO */
|
||||||
|
#define TIM_TIM2_TI4_GPIO 0x00000000UL /* !< TIM2_TI4 is connected to GPIO */
|
||||||
|
|
||||||
|
#define TIM_TIM3_TI1_GPIO 0x00000000UL /* !< TIM3_TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM3_TI2_GPIO 0x00000000UL /* !< TIM3_TI2 is connected to GPIO */
|
||||||
|
#define TIM_TIM3_TI3_GPIO 0x00000000UL /* !< TIM3_TI3 is connected to GPIO */
|
||||||
|
#define TIM_TIM3_TI4_GPIO 0x00000000UL /* !< TIM3_TI4 is connected to GPIO */
|
||||||
|
|
||||||
|
#define TIM_TIM4_TI1_GPIO 0x00000000UL /* !< TIM4_TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM4_TI2_GPIO 0x00000000UL /* !< TIM4_TI2 is connected to GPIO */
|
||||||
|
#define TIM_TIM4_TI3_GPIO 0x00000000UL /* !< TIM4_TI3 is connected to GPIO */
|
||||||
|
#define TIM_TIM4_TI4_GPIO 0x00000000UL /* !< TIM4_TI4 is connected to GPIO */
|
||||||
|
|
||||||
|
#define TIM_TIM5_TI1_GPIO 0x00000000U /* !< TIM5_TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM5_TI1_FDCAN1_TMP TIM_TISEL_TI1SEL_0 /* !< TIM5_TI1 is connected to FDCAN1 TMP */
|
||||||
|
#define TIM_TIM5_TI1_FDCAN1_RTP TIM_TISEL_TI1SEL_1 /* !< TIM5_TI1 is connected to FDCAN1 RTP */
|
||||||
|
#define TIM_TIM5_TI2_GPIO 0x00000000UL /* !< TIM5_TI2 is connected to GPIO */
|
||||||
|
#define TIM_TIM5_TI3_GPIO 0x00000000UL /* !< TIM5_TI3 is connected to GPIO */
|
||||||
|
#define TIM_TIM5_TI4_GPIO 0x00000000UL /* !< TIM5_TI4 is connected to GPIO */
|
||||||
|
|
||||||
|
#define TIM_TIM12_TI1_GPIO 0x00000000UL /* !< TIM12_TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM12_TI1_HSI_CAL_CK TIM_TISEL_TI1SEL_0 /* !< TIM12_TI1 is connected to HSI CAL CK */
|
||||||
|
#define TIM_TIM12_TI1_CSI_CAL_CK TIM_TISEL_TI1SEL_1 /* !< TIM12_TI1 is connected to CSI CAL CK */
|
||||||
|
#define TIM_TIM12_TI2_GPIO 0x00000000UL /* !< TIM12_TI2 is connected to GPIO */
|
||||||
|
|
||||||
|
#define TIM_TIM13_TI1_GPIO 0x00000000UL /* !< TIM13_TI1 is connected to GPIO */
|
||||||
|
|
||||||
|
#define TIM_TIM14_TI1_GPIO 0x00000000UL /* !< TIM14_TI1 is connected to GPIO */
|
||||||
|
|
||||||
|
#define TIM_TIM15_TI1_GPIO 0x00000000U /* !< TIM15_TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM15_TI1_TIM2_CH1 TIM_TISEL_TI1SEL_0 /* !< TIM15_TI1 is connected to TIM2 CH1 */
|
||||||
|
#define TIM_TIM15_TI1_TIM3_CH1 TIM_TISEL_TI1SEL_1 /* !< TIM15_TI1 is connected to TIM3 CH1 */
|
||||||
|
#define TIM_TIM15_TI1_TIM4_CH1 (TIM_TISEL_TI1SEL_0 | TIM_TISEL_TI1SEL_1) /* !< TIM15_TI1 is connected to TIM4 CH1 */
|
||||||
|
#define TIM_TIM15_TI1_RCC_LSE (TIM_TISEL_TI1SEL_2) /* !< TIM15_TI1 is connected to RCC LSE */
|
||||||
|
#define TIM_TIM15_TI1_RCC_CSI (TIM_TISEL_TI1SEL_2 | TIM_TISEL_TI1SEL_0) /* !< TIM15_TI1 is connected to RCC CSI */
|
||||||
|
#define TIM_TIM15_TI1_RCC_MCO2 (TIM_TISEL_TI1SEL_2 | TIM_TISEL_TI1SEL_1) /* !< TIM15_TI1 is connected to RCC MCO2 */
|
||||||
|
#define TIM_TIM15_TI1_HSI_CAL_CK (TIM_TISEL_TI1SEL_2 | TIM_TISEL_TI1SEL_1 | TIM_TISEL_TI1SEL_0) /* !< TIM15_TI1 is connected to HSI CAL CK */
|
||||||
|
#define TIM_TIM15_TI1_CSI_CAL_CK TIM_TISEL_TI1SEL_3 /* !< TIM15_TI1 is connected to CSI CAL CK */
|
||||||
|
|
||||||
|
#define TIM_TIM15_TI2_GPIO 0x00000000U /* !< TIM15_TI2 is connected to GPIO */
|
||||||
|
#define TIM_TIM15_TI2_TIM2_CH2 (TIM_TISEL_TI2SEL_0) /* !< TIM15_TI2 is connected to TIM2 CH2 */
|
||||||
|
#define TIM_TIM15_TI2_TIM3_CH2 (TIM_TISEL_TI2SEL_1) /* !< TIM15_TI2 is connected to TIM3 CH2 */
|
||||||
|
#define TIM_TIM15_TI2_TIM4_CH2 (TIM_TISEL_TI2SEL_0 | TIM_TISEL_TI2SEL_1) /* !< TIM15_TI2 is connected to TIM4 CH2 */
|
||||||
|
|
||||||
|
#define TIM_TIM16_TI1_GPIO 0x00000000U /* !< TIM16 TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM16_TI1_RCC_LSI TIM_TISEL_TI1SEL_0 /* !< TIM16 TI1 is connected to RCC LSI */
|
||||||
|
#define TIM_TIM16_TI1_RCC_LSE TIM_TISEL_TI1SEL_1 /* !< TIM16 TI1 is connected to RCC LSE */
|
||||||
|
#define TIM_TIM16_TI1_WKUP_IT (TIM_TISEL_TI1SEL_0 | TIM_TISEL_TI1SEL_1) /* !< TIM16 TI1 is connected to WKUP_IT */
|
||||||
|
|
||||||
|
#define TIM_TIM17_TI1_GPIO 0x00000000U /* !< TIM17 TI1 is connected to GPIO */
|
||||||
|
#define TIM_TIM17_TI1_SPDIFRX_FS TIM_TISEL_TI1SEL_0 /* !< TIM17 TI1 is connected to SPDIF FS */
|
||||||
|
#define TIM_TIM17_TI1_RCC_HSE_RTC TIM_TISEL_TI1SEL_1 /* !< TIM17 TI1 is connected to RCC HSE RTC */
|
||||||
|
#define TIM_TIM17_TI1_RCC_MCO1 (TIM_TISEL_TI1SEL_0 | TIM_TISEL_TI1SEL_1) /* !< TIM17 TI1 is connected to RCC MCO1 */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* End of exported constants -------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/** @defgroup TIMEx_Exported_Macros TIM Extended Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* End of exported macro -----------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Private macro -------------------------------------------------------------*/
|
||||||
|
/** @defgroup TIMEx_Private_Macros TIM Extended Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define IS_TIM_REMAP(__REMAP__) ((((__REMAP__) & 0xFFFC3FFFU) == 0x00000000U))
|
||||||
|
|
||||||
|
#define IS_TIM_BREAKINPUT(__BREAKINPUT__) (((__BREAKINPUT__) == TIM_BREAKINPUT_BRK) || \
|
||||||
|
((__BREAKINPUT__) == TIM_BREAKINPUT_BRK2))
|
||||||
|
|
||||||
|
#define IS_TIM_BREAKINPUTSOURCE(__SOURCE__) ((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN)
|
||||||
|
|
||||||
|
#define IS_TIM_BREAKINPUTSOURCE_STATE(__STATE__) (((__STATE__) == TIM_BREAKINPUTSOURCE_DISABLE) || \
|
||||||
|
((__STATE__) == TIM_BREAKINPUTSOURCE_ENABLE))
|
||||||
|
|
||||||
|
#define IS_TIM_BREAKINPUTSOURCE_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_BREAKINPUTSOURCE_POLARITY_LOW) || \
|
||||||
|
((__POLARITY__) == TIM_BREAKINPUTSOURCE_POLARITY_HIGH))
|
||||||
|
|
||||||
|
#define IS_TIM_TISEL(__TISEL__) ((((__TISEL__) & 0xF0F0F0F0U) == 0x00000000U))
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* End of private macro ------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @addtogroup TIMEx_Exported_Functions TIM Extended Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup TIMEx_Exported_Functions_Group1 Extended Timer Hall Sensor functions
|
||||||
|
* @brief Timer Hall Sensor functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Timer Hall Sensor functions **********************************************/
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, TIM_HallSensor_InitTypeDef *sConfig);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim);
|
||||||
|
|
||||||
|
void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim);
|
||||||
|
void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim);
|
||||||
|
|
||||||
|
/* Blocking mode: Polling */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim);
|
||||||
|
/* Non-Blocking mode: Interrupt */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim);
|
||||||
|
/* Non-Blocking mode: DMA */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup TIMEx_Exported_Functions_Group2 Extended Timer Complementary Output Compare functions
|
||||||
|
* @brief Timer Complementary Output Compare functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Timer Complementary Output Compare functions *****************************/
|
||||||
|
/* Blocking mode: Polling */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
|
||||||
|
/* Non-Blocking mode: Interrupt */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
|
||||||
|
/* Non-Blocking mode: DMA */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup TIMEx_Exported_Functions_Group3 Extended Timer Complementary PWM functions
|
||||||
|
* @brief Timer Complementary PWM functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Timer Complementary PWM functions ****************************************/
|
||||||
|
/* Blocking mode: Polling */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
|
||||||
|
/* Non-Blocking mode: Interrupt */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
/* Non-Blocking mode: DMA */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup TIMEx_Exported_Functions_Group4 Extended Timer Complementary One Pulse functions
|
||||||
|
* @brief Timer Complementary One Pulse functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Timer Complementary One Pulse functions **********************************/
|
||||||
|
/* Blocking mode: Polling */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
|
||||||
|
|
||||||
|
/* Non-Blocking mode: Interrupt */
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup TIMEx_Exported_Functions_Group5 Extended Peripheral Control functions
|
||||||
|
* @brief Peripheral Control functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Extended Control functions ************************************************/
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent(TIM_HandleTypeDef *htim, uint32_t InputTrigger,
|
||||||
|
uint32_t CommutationSource);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_IT(TIM_HandleTypeDef *htim, uint32_t InputTrigger,
|
||||||
|
uint32_t CommutationSource);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_DMA(TIM_HandleTypeDef *htim, uint32_t InputTrigger,
|
||||||
|
uint32_t CommutationSource);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim,
|
||||||
|
TIM_MasterConfigTypeDef *sMasterConfig);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim,
|
||||||
|
TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_ConfigBreakInput(TIM_HandleTypeDef *htim, uint32_t BreakInput,
|
||||||
|
TIMEx_BreakInputConfigTypeDef *sBreakInputConfig);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t Channels);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_TISelection(TIM_HandleTypeDef *htim, uint32_t TISelection, uint32_t Channel);
|
||||||
|
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_DisarmBreakInput(TIM_HandleTypeDef *htim, uint32_t BreakInput);
|
||||||
|
HAL_StatusTypeDef HAL_TIMEx_ReArmBreakInput(TIM_HandleTypeDef *htim, uint32_t BreakInput);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup TIMEx_Exported_Functions_Group6 Extended Callbacks functions
|
||||||
|
* @brief Extended Callbacks functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Extended Callback **********************************************************/
|
||||||
|
void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim);
|
||||||
|
void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim);
|
||||||
|
void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim);
|
||||||
|
void HAL_TIMEx_Break2Callback(TIM_HandleTypeDef *htim);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @addtogroup TIMEx_Exported_Functions_Group7 Extended Peripheral State functions
|
||||||
|
* @brief Extended Peripheral State functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/* Extended Peripheral State functions ***************************************/
|
||||||
|
HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef *htim);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* End of exported functions -------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Private functions----------------------------------------------------------*/
|
||||||
|
/** @addtogroup TIMEx_Private_Functions TIMEx Private Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma);
|
||||||
|
void TIMEx_DMACommutationHalfCplt(DMA_HandleTypeDef *hdma);
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* End of private functions --------------------------------------------------*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_HAL_TIM_EX_H */
|
||||||
+2918
File diff suppressed because it is too large
Load Diff
+3177
File diff suppressed because it is too large
Load Diff
+2119
File diff suppressed because it is too large
Load Diff
+1605
File diff suppressed because it is too large
Load Diff
+982
@@ -0,0 +1,982 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_ll_gpio.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of GPIO LL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef __STM32MP1xx_LL_GPIO_H
|
||||||
|
#define __STM32MP1xx_LL_GPIO_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_LL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) || defined (GPIOG) || defined (GPIOH) || defined (GPIOI) || defined (GPIOJ) || defined (GPIOK)
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL GPIO
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
#if defined(USE_FULL_LL_DRIVER)
|
||||||
|
/** @defgroup GPIO_LL_Private_Macros GPIO Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
#endif /*USE_FULL_LL_DRIVER*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
#if defined(USE_FULL_LL_DRIVER)
|
||||||
|
/** @defgroup GPIO_LL_ES_INIT GPIO Exported Init structures
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief LL GPIO Init Structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t Pin; /*!< Specifies the GPIO pins to be configured.
|
||||||
|
This parameter can be any value of @ref GPIO_LL_EC_PIN */
|
||||||
|
|
||||||
|
uint32_t Mode; /*!< Specifies the operating mode for the selected pins.
|
||||||
|
This parameter can be a value of @ref GPIO_LL_EC_MODE.
|
||||||
|
|
||||||
|
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinMode().*/
|
||||||
|
|
||||||
|
uint32_t Speed; /*!< Specifies the speed for the selected pins.
|
||||||
|
This parameter can be a value of @ref GPIO_LL_EC_SPEED.
|
||||||
|
|
||||||
|
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinSpeed().*/
|
||||||
|
|
||||||
|
uint32_t OutputType; /*!< Specifies the operating output type for the selected pins.
|
||||||
|
This parameter can be a value of @ref GPIO_LL_EC_OUTPUT.
|
||||||
|
|
||||||
|
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinOutputType().*/
|
||||||
|
|
||||||
|
uint32_t Pull; /*!< Specifies the operating Pull-up/Pull down for the selected pins.
|
||||||
|
This parameter can be a value of @ref GPIO_LL_EC_PULL.
|
||||||
|
|
||||||
|
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetPinPull().*/
|
||||||
|
|
||||||
|
uint32_t Alternate; /*!< Specifies the Peripheral to be connected to the selected pins.
|
||||||
|
This parameter can be a value of @ref GPIO_LL_EC_AF.
|
||||||
|
|
||||||
|
GPIO HW configuration can be modified afterwards using unitary function @ref LL_GPIO_SetAFPin_0_7() and LL_GPIO_SetAFPin_8_15().*/
|
||||||
|
} LL_GPIO_InitTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
#endif /* USE_FULL_LL_DRIVER */
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIO_LL_Exported_Constants GPIO Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL_EC_PIN PIN
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_GPIO_PIN_0 GPIO_BSRR_BS0 /*!< Select pin 0 */
|
||||||
|
#define LL_GPIO_PIN_1 GPIO_BSRR_BS1 /*!< Select pin 1 */
|
||||||
|
#define LL_GPIO_PIN_2 GPIO_BSRR_BS2 /*!< Select pin 2 */
|
||||||
|
#define LL_GPIO_PIN_3 GPIO_BSRR_BS3 /*!< Select pin 3 */
|
||||||
|
#define LL_GPIO_PIN_4 GPIO_BSRR_BS4 /*!< Select pin 4 */
|
||||||
|
#define LL_GPIO_PIN_5 GPIO_BSRR_BS5 /*!< Select pin 5 */
|
||||||
|
#define LL_GPIO_PIN_6 GPIO_BSRR_BS6 /*!< Select pin 6 */
|
||||||
|
#define LL_GPIO_PIN_7 GPIO_BSRR_BS7 /*!< Select pin 7 */
|
||||||
|
#define LL_GPIO_PIN_8 GPIO_BSRR_BS8 /*!< Select pin 8 */
|
||||||
|
#define LL_GPIO_PIN_9 GPIO_BSRR_BS9 /*!< Select pin 9 */
|
||||||
|
#define LL_GPIO_PIN_10 GPIO_BSRR_BS10 /*!< Select pin 10 */
|
||||||
|
#define LL_GPIO_PIN_11 GPIO_BSRR_BS11 /*!< Select pin 11 */
|
||||||
|
#define LL_GPIO_PIN_12 GPIO_BSRR_BS12 /*!< Select pin 12 */
|
||||||
|
#define LL_GPIO_PIN_13 GPIO_BSRR_BS13 /*!< Select pin 13 */
|
||||||
|
#define LL_GPIO_PIN_14 GPIO_BSRR_BS14 /*!< Select pin 14 */
|
||||||
|
#define LL_GPIO_PIN_15 GPIO_BSRR_BS15 /*!< Select pin 15 */
|
||||||
|
#define LL_GPIO_PIN_ALL (GPIO_BSRR_BS0 | GPIO_BSRR_BS1 | GPIO_BSRR_BS2 | \
|
||||||
|
GPIO_BSRR_BS3 | GPIO_BSRR_BS4 | GPIO_BSRR_BS5 | \
|
||||||
|
GPIO_BSRR_BS6 | GPIO_BSRR_BS7 | GPIO_BSRR_BS8 | \
|
||||||
|
GPIO_BSRR_BS9 | GPIO_BSRR_BS10 | GPIO_BSRR_BS11 | \
|
||||||
|
GPIO_BSRR_BS12 | GPIO_BSRR_BS13 | GPIO_BSRR_BS14 | \
|
||||||
|
GPIO_BSRR_BS15) /*!< Select all pins */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL_EC_MODE Mode
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_GPIO_MODE_INPUT (0x00000000U) /*!< Select input mode */
|
||||||
|
#define LL_GPIO_MODE_OUTPUT GPIO_MODER_MODER0_0 /*!< Select output mode */
|
||||||
|
#define LL_GPIO_MODE_ALTERNATE GPIO_MODER_MODER0_1 /*!< Select alternate function mode */
|
||||||
|
#define LL_GPIO_MODE_ANALOG GPIO_MODER_MODER0 /*!< Select analog mode */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL_EC_OUTPUT Output Type
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_GPIO_OUTPUT_PUSHPULL (0x00000000U) /*!< Select push-pull as output type */
|
||||||
|
#define LL_GPIO_OUTPUT_OPENDRAIN GPIO_OTYPER_OT0 /*!< Select open-drain as output type */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL_EC_SPEED Output Speed
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_GPIO_SPEED_FREQ_LOW (0x00000000U) /*!< Select I/O low output speed */
|
||||||
|
#define LL_GPIO_SPEED_FREQ_MEDIUM GPIO_OSPEEDR_OSPEEDR0_0 /*!< Select I/O medium output speed */
|
||||||
|
#define LL_GPIO_SPEED_FREQ_HIGH GPIO_OSPEEDR_OSPEEDR0_1 /*!< Select I/O fast output speed */
|
||||||
|
#define LL_GPIO_SPEED_FREQ_VERY_HIGH GPIO_OSPEEDR_OSPEEDR0 /*!< Select I/O high output speed */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
#define LL_GPIO_SPEED_LOW LL_GPIO_SPEED_FREQ_LOW
|
||||||
|
#define LL_GPIO_SPEED_MEDIUM LL_GPIO_SPEED_FREQ_MEDIUM
|
||||||
|
#define LL_GPIO_SPEED_FAST LL_GPIO_SPEED_FREQ_HIGH
|
||||||
|
#define LL_GPIO_SPEED_HIGH LL_GPIO_SPEED_FREQ_VERY_HIGH
|
||||||
|
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL_EC_PULL Pull Up Pull Down
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_GPIO_PULL_NO (0x00000000U) /*!< Select I/O no pull */
|
||||||
|
#define LL_GPIO_PULL_UP GPIO_PUPDR_PUPDR0_0 /*!< Select I/O pull up */
|
||||||
|
#define LL_GPIO_PULL_DOWN GPIO_PUPDR_PUPDR0_1 /*!< Select I/O pull down */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL_EC_AF Alternate Function
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_GPIO_AF_0 (0x0000000U) /*!< Select alternate function 0 */
|
||||||
|
#define LL_GPIO_AF_1 (0x0000001U) /*!< Select alternate function 1 */
|
||||||
|
#define LL_GPIO_AF_2 (0x0000002U) /*!< Select alternate function 2 */
|
||||||
|
#define LL_GPIO_AF_3 (0x0000003U) /*!< Select alternate function 3 */
|
||||||
|
#define LL_GPIO_AF_4 (0x0000004U) /*!< Select alternate function 4 */
|
||||||
|
#define LL_GPIO_AF_5 (0x0000005U) /*!< Select alternate function 5 */
|
||||||
|
#define LL_GPIO_AF_6 (0x0000006U) /*!< Select alternate function 6 */
|
||||||
|
#define LL_GPIO_AF_7 (0x0000007U) /*!< Select alternate function 7 */
|
||||||
|
#define LL_GPIO_AF_8 (0x0000008U) /*!< Select alternate function 8 */
|
||||||
|
#define LL_GPIO_AF_9 (0x0000009U) /*!< Select alternate function 9 */
|
||||||
|
#define LL_GPIO_AF_10 (0x000000AU) /*!< Select alternate function 10 */
|
||||||
|
#define LL_GPIO_AF_11 (0x000000BU) /*!< Select alternate function 11 */
|
||||||
|
#define LL_GPIO_AF_12 (0x000000CU) /*!< Select alternate function 12 */
|
||||||
|
#define LL_GPIO_AF_13 (0x000000DU) /*!< Select alternate function 13 */
|
||||||
|
#define LL_GPIO_AF_14 (0x000000EU) /*!< Select alternate function 14 */
|
||||||
|
#define LL_GPIO_AF_15 (0x000000FU) /*!< Select alternate function 15 */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIO_LL_Exported_Macros GPIO Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL_EM_WRITE_READ Common Write and read registers Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Write a value in GPIO register
|
||||||
|
* @param __INSTANCE__ GPIO Instance
|
||||||
|
* @param __REG__ Register to be written
|
||||||
|
* @param __VALUE__ Value to be written in the register
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define LL_GPIO_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Read a value in GPIO register
|
||||||
|
* @param __INSTANCE__ GPIO Instance
|
||||||
|
* @param __REG__ Register to be read
|
||||||
|
* @retval Register value
|
||||||
|
*/
|
||||||
|
#define LL_GPIO_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup GPIO_LL_Exported_Functions GPIO Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL_EF_Port_Configuration Port Configuration
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configure gpio mode for a dedicated pin on dedicated port.
|
||||||
|
* @note I/O mode can be Input mode, General purpose output, Alternate function mode or Analog.
|
||||||
|
* @note Warning: only one pin can be passed as parameter.
|
||||||
|
* @rmtoll MODER MODEy LL_GPIO_SetPinMode
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @param Mode This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_MODE_INPUT
|
||||||
|
* @arg @ref LL_GPIO_MODE_OUTPUT
|
||||||
|
* @arg @ref LL_GPIO_MODE_ALTERNATE
|
||||||
|
* @arg @ref LL_GPIO_MODE_ANALOG
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)
|
||||||
|
{
|
||||||
|
MODIFY_REG(GPIOx->MODER, ((Pin * Pin) * GPIO_MODER_MODER0), ((Pin * Pin) * Mode));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return gpio mode for a dedicated pin on dedicated port.
|
||||||
|
* @note I/O mode can be Input mode, General purpose output, Alternate function mode or Analog.
|
||||||
|
* @note Warning: only one pin can be passed as parameter.
|
||||||
|
* @rmtoll MODER MODEy LL_GPIO_GetPinMode
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_MODE_INPUT
|
||||||
|
* @arg @ref LL_GPIO_MODE_OUTPUT
|
||||||
|
* @arg @ref LL_GPIO_MODE_ALTERNATE
|
||||||
|
* @arg @ref LL_GPIO_MODE_ANALOG
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(GPIOx->MODER, ((Pin * Pin) * GPIO_MODER_MODER0)) / (Pin * Pin));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configure gpio output type for several pins on dedicated port.
|
||||||
|
* @note Output type as to be set when gpio pin is in output or
|
||||||
|
* alternate modes. Possible type are Push-pull or Open-drain.
|
||||||
|
* @rmtoll OTYPER OTy LL_GPIO_SetPinOutputType
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param PinMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @arg @ref LL_GPIO_PIN_ALL
|
||||||
|
* @param OutputType This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_OUTPUT_PUSHPULL
|
||||||
|
* @arg @ref LL_GPIO_OUTPUT_OPENDRAIN
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t PinMask, uint32_t OutputType)
|
||||||
|
{
|
||||||
|
MODIFY_REG(GPIOx->OTYPER, PinMask, (PinMask * OutputType));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return gpio output type for several pins on dedicated port.
|
||||||
|
* @note Output type as to be set when gpio pin is in output or
|
||||||
|
* alternate modes. Possible type are Push-pull or Open-drain.
|
||||||
|
* @note Warning: only one pin can be passed as parameter.
|
||||||
|
* @rmtoll OTYPER OTy LL_GPIO_GetPinOutputType
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @arg @ref LL_GPIO_PIN_ALL
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_OUTPUT_PUSHPULL
|
||||||
|
* @arg @ref LL_GPIO_OUTPUT_OPENDRAIN
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_GetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(GPIOx->OTYPER, Pin) / Pin);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configure gpio speed for a dedicated pin on dedicated port.
|
||||||
|
* @note I/O speed can be Low, Medium, Fast or High speed.
|
||||||
|
* @note Warning: only one pin can be passed as parameter.
|
||||||
|
* @note Refer to datasheet for frequency specifications and the power
|
||||||
|
* supply and load conditions for each speed.
|
||||||
|
* @rmtoll OSPEEDR OSPEEDy LL_GPIO_SetPinSpeed
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @param Speed This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_SPEED_FREQ_LOW
|
||||||
|
* @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM
|
||||||
|
* @arg @ref LL_GPIO_SPEED_FREQ_HIGH
|
||||||
|
* @arg @ref LL_GPIO_SPEED_FREQ_VERY_HIGH
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Speed)
|
||||||
|
{
|
||||||
|
MODIFY_REG(GPIOx->OSPEEDR, ((Pin * Pin) * GPIO_OSPEEDR_OSPEEDR0), ((Pin * Pin) * Speed));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return gpio speed for a dedicated pin on dedicated port.
|
||||||
|
* @note I/O speed can be Low, Medium, Fast or High speed.
|
||||||
|
* @note Warning: only one pin can be passed as parameter.
|
||||||
|
* @note Refer to datasheet for frequency specifications and the power
|
||||||
|
* supply and load conditions for each speed.
|
||||||
|
* @rmtoll OSPEEDR OSPEEDy LL_GPIO_GetPinSpeed
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_SPEED_FREQ_LOW
|
||||||
|
* @arg @ref LL_GPIO_SPEED_FREQ_MEDIUM
|
||||||
|
* @arg @ref LL_GPIO_SPEED_FREQ_HIGH
|
||||||
|
* @arg @ref LL_GPIO_SPEED_FREQ_VERY_HIGH
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_GetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(GPIOx->OSPEEDR, ((Pin * Pin) * GPIO_OSPEEDR_OSPEEDR0)) / (Pin * Pin));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configure gpio pull-up or pull-down for a dedicated pin on a dedicated port.
|
||||||
|
* @note Warning: only one pin can be passed as parameter.
|
||||||
|
* @rmtoll PUPDR PUPDy LL_GPIO_SetPinPull
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @param Pull This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PULL_NO
|
||||||
|
* @arg @ref LL_GPIO_PULL_UP
|
||||||
|
* @arg @ref LL_GPIO_PULL_DOWN
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull)
|
||||||
|
{
|
||||||
|
MODIFY_REG(GPIOx->PUPDR, ((Pin * Pin) * GPIO_PUPDR_PUPDR0), ((Pin * Pin) * Pull));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return gpio pull-up or pull-down for a dedicated pin on a dedicated port
|
||||||
|
* @note Warning: only one pin can be passed as parameter.
|
||||||
|
* @rmtoll PUPDR PUPDy LL_GPIO_GetPinPull
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PULL_NO
|
||||||
|
* @arg @ref LL_GPIO_PULL_UP
|
||||||
|
* @arg @ref LL_GPIO_PULL_DOWN
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_GetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(GPIOx->PUPDR, ((Pin * Pin) * GPIO_PUPDR_PUPDR0)) / (Pin * Pin));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configure gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port.
|
||||||
|
* @note Possible values are from AF0 to AF15 depending on target.
|
||||||
|
* @note Warning: only one pin can be passed as parameter.
|
||||||
|
* @rmtoll AFRL AFRy LL_GPIO_SetAFPin_0_7
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @param Alternate This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_AF_0
|
||||||
|
* @arg @ref LL_GPIO_AF_1
|
||||||
|
* @arg @ref LL_GPIO_AF_2
|
||||||
|
* @arg @ref LL_GPIO_AF_3
|
||||||
|
* @arg @ref LL_GPIO_AF_4
|
||||||
|
* @arg @ref LL_GPIO_AF_5
|
||||||
|
* @arg @ref LL_GPIO_AF_6
|
||||||
|
* @arg @ref LL_GPIO_AF_7
|
||||||
|
* @arg @ref LL_GPIO_AF_8
|
||||||
|
* @arg @ref LL_GPIO_AF_9
|
||||||
|
* @arg @ref LL_GPIO_AF_10
|
||||||
|
* @arg @ref LL_GPIO_AF_11
|
||||||
|
* @arg @ref LL_GPIO_AF_12
|
||||||
|
* @arg @ref LL_GPIO_AF_13
|
||||||
|
* @arg @ref LL_GPIO_AF_14
|
||||||
|
* @arg @ref LL_GPIO_AF_15
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_SetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
|
||||||
|
{
|
||||||
|
MODIFY_REG(GPIOx->AFR[0], ((((Pin * Pin) * Pin) * Pin) * GPIO_AFRL_AFR0),
|
||||||
|
((((Pin * Pin) * Pin) * Pin) * Alternate));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return gpio alternate function of a dedicated pin from 0 to 7 for a dedicated port.
|
||||||
|
* @rmtoll AFRL AFRy LL_GPIO_GetAFPin_0_7
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_AF_0
|
||||||
|
* @arg @ref LL_GPIO_AF_1
|
||||||
|
* @arg @ref LL_GPIO_AF_2
|
||||||
|
* @arg @ref LL_GPIO_AF_3
|
||||||
|
* @arg @ref LL_GPIO_AF_4
|
||||||
|
* @arg @ref LL_GPIO_AF_5
|
||||||
|
* @arg @ref LL_GPIO_AF_6
|
||||||
|
* @arg @ref LL_GPIO_AF_7
|
||||||
|
* @arg @ref LL_GPIO_AF_8
|
||||||
|
* @arg @ref LL_GPIO_AF_9
|
||||||
|
* @arg @ref LL_GPIO_AF_10
|
||||||
|
* @arg @ref LL_GPIO_AF_11
|
||||||
|
* @arg @ref LL_GPIO_AF_12
|
||||||
|
* @arg @ref LL_GPIO_AF_13
|
||||||
|
* @arg @ref LL_GPIO_AF_14
|
||||||
|
* @arg @ref LL_GPIO_AF_15
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(GPIOx->AFR[0],
|
||||||
|
((((Pin * Pin) * Pin) * Pin) * GPIO_AFRL_AFR0)) / (((Pin * Pin) * Pin) * Pin));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Configure gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port.
|
||||||
|
* @note Possible values are from AF0 to AF15 depending on target.
|
||||||
|
* @note Warning: only one pin can be passed as parameter.
|
||||||
|
* @rmtoll AFRH AFRy LL_GPIO_SetAFPin_8_15
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @param Alternate This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_AF_0
|
||||||
|
* @arg @ref LL_GPIO_AF_1
|
||||||
|
* @arg @ref LL_GPIO_AF_2
|
||||||
|
* @arg @ref LL_GPIO_AF_3
|
||||||
|
* @arg @ref LL_GPIO_AF_4
|
||||||
|
* @arg @ref LL_GPIO_AF_5
|
||||||
|
* @arg @ref LL_GPIO_AF_6
|
||||||
|
* @arg @ref LL_GPIO_AF_7
|
||||||
|
* @arg @ref LL_GPIO_AF_8
|
||||||
|
* @arg @ref LL_GPIO_AF_9
|
||||||
|
* @arg @ref LL_GPIO_AF_10
|
||||||
|
* @arg @ref LL_GPIO_AF_11
|
||||||
|
* @arg @ref LL_GPIO_AF_12
|
||||||
|
* @arg @ref LL_GPIO_AF_13
|
||||||
|
* @arg @ref LL_GPIO_AF_14
|
||||||
|
* @arg @ref LL_GPIO_AF_15
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_SetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
|
||||||
|
{
|
||||||
|
MODIFY_REG(GPIOx->AFR[1], (((((Pin >> 8U) * (Pin >> 8U)) * (Pin >> 8U)) * (Pin >> 8U)) * GPIO_AFRH_AFR8),
|
||||||
|
(((((Pin >> 8U) * (Pin >> 8U)) * (Pin >> 8U)) * (Pin >> 8U)) * Alternate));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return gpio alternate function of a dedicated pin from 8 to 15 for a dedicated port.
|
||||||
|
* @note Possible values are from AF0 to AF15 depending on target.
|
||||||
|
* @rmtoll AFRH AFRy LL_GPIO_GetAFPin_8_15
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param Pin This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_GPIO_AF_0
|
||||||
|
* @arg @ref LL_GPIO_AF_1
|
||||||
|
* @arg @ref LL_GPIO_AF_2
|
||||||
|
* @arg @ref LL_GPIO_AF_3
|
||||||
|
* @arg @ref LL_GPIO_AF_4
|
||||||
|
* @arg @ref LL_GPIO_AF_5
|
||||||
|
* @arg @ref LL_GPIO_AF_6
|
||||||
|
* @arg @ref LL_GPIO_AF_7
|
||||||
|
* @arg @ref LL_GPIO_AF_8
|
||||||
|
* @arg @ref LL_GPIO_AF_9
|
||||||
|
* @arg @ref LL_GPIO_AF_10
|
||||||
|
* @arg @ref LL_GPIO_AF_11
|
||||||
|
* @arg @ref LL_GPIO_AF_12
|
||||||
|
* @arg @ref LL_GPIO_AF_13
|
||||||
|
* @arg @ref LL_GPIO_AF_14
|
||||||
|
* @arg @ref LL_GPIO_AF_15
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_GetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(GPIOx->AFR[1],
|
||||||
|
(((((Pin >> 8U) * (Pin >> 8U)) * (Pin >> 8U)) * (Pin >> 8U)) * GPIO_AFRH_AFR8)) / ((((Pin >> 8U) *
|
||||||
|
(Pin >> 8U)) * (Pin >> 8U)) * (Pin >> 8U)));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Lock configuration of several pins for a dedicated port.
|
||||||
|
* @note When the lock sequence has been applied on a port bit, the
|
||||||
|
* value of this port bit can no longer be modified until the
|
||||||
|
* next reset.
|
||||||
|
* @note Each lock bit freezes a specific configuration register
|
||||||
|
* (control and alternate function registers).
|
||||||
|
* @rmtoll LCKR LCKK LL_GPIO_LockPin
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param PinMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @arg @ref LL_GPIO_PIN_ALL
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_LockPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
|
{
|
||||||
|
__IO uint32_t temp;
|
||||||
|
WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask);
|
||||||
|
WRITE_REG(GPIOx->LCKR, PinMask);
|
||||||
|
WRITE_REG(GPIOx->LCKR, GPIO_LCKR_LCKK | PinMask);
|
||||||
|
/* Read LCKK register. This read is mandatory to complete key lock sequence */
|
||||||
|
temp = READ_REG(GPIOx->LCKR);
|
||||||
|
(void) temp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return 1 if all pins passed as parameter, of a dedicated port, are locked. else Return 0.
|
||||||
|
* @rmtoll LCKR LCKy LL_GPIO_IsPinLocked
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param PinMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @arg @ref LL_GPIO_PIN_ALL
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_IsPinLocked(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
|
{
|
||||||
|
return (READ_BIT(GPIOx->LCKR, PinMask) == (PinMask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return 1 if one of the pin of a dedicated port is locked. else return 0.
|
||||||
|
* @rmtoll LCKR LCKK LL_GPIO_IsAnyPinLocked
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_IsAnyPinLocked(GPIO_TypeDef *GPIOx)
|
||||||
|
{
|
||||||
|
return (READ_BIT(GPIOx->LCKR, GPIO_LCKR_LCKK) == (GPIO_LCKR_LCKK));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup GPIO_LL_EF_Data_Access Data Access
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return full input data register value for a dedicated port.
|
||||||
|
* @rmtoll IDR IDy LL_GPIO_ReadInputPort
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @retval Input data register value of port
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_ReadInputPort(GPIO_TypeDef *GPIOx)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_REG(GPIOx->IDR));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return if input data level for several pins of dedicated port is high or low.
|
||||||
|
* @rmtoll IDR IDy LL_GPIO_IsInputPinSet
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param PinMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @arg @ref LL_GPIO_PIN_ALL
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_IsInputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
|
{
|
||||||
|
return (READ_BIT(GPIOx->IDR, PinMask) == (PinMask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Write output data register for the port.
|
||||||
|
* @rmtoll ODR ODy LL_GPIO_WriteOutputPort
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param PortValue Level value for each pin of the port
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_WriteOutputPort(GPIO_TypeDef *GPIOx, uint32_t PortValue)
|
||||||
|
{
|
||||||
|
WRITE_REG(GPIOx->ODR, PortValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return full output data register value for a dedicated port.
|
||||||
|
* @rmtoll ODR ODy LL_GPIO_ReadOutputPort
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @retval Output data register value of port
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_ReadOutputPort(GPIO_TypeDef *GPIOx)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_REG(GPIOx->ODR));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return if input data level for several pins of dedicated port is high or low.
|
||||||
|
* @rmtoll ODR ODy LL_GPIO_IsOutputPinSet
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param PinMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @arg @ref LL_GPIO_PIN_ALL
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GPIO_IsOutputPinSet(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
|
{
|
||||||
|
return (READ_BIT(GPIOx->ODR, PinMask) == (PinMask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set several pins to high level on dedicated gpio port.
|
||||||
|
* @rmtoll BSRR BSy LL_GPIO_SetOutputPin
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param PinMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @arg @ref LL_GPIO_PIN_ALL
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_SetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
|
{
|
||||||
|
WRITE_REG(GPIOx->BSRR, PinMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set several pins to low level on dedicated gpio port.
|
||||||
|
* @rmtoll BSRR BRy LL_GPIO_ResetOutputPin
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param PinMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @arg @ref LL_GPIO_PIN_ALL
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_ResetOutputPin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
|
{
|
||||||
|
WRITE_REG(GPIOx->BSRR, PinMask << 16U);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Toggle data value for several pin of dedicated port.
|
||||||
|
* @rmtoll ODR ODy LL_GPIO_TogglePin
|
||||||
|
* @param GPIOx GPIO Port
|
||||||
|
* @param PinMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_GPIO_PIN_0
|
||||||
|
* @arg @ref LL_GPIO_PIN_1
|
||||||
|
* @arg @ref LL_GPIO_PIN_2
|
||||||
|
* @arg @ref LL_GPIO_PIN_3
|
||||||
|
* @arg @ref LL_GPIO_PIN_4
|
||||||
|
* @arg @ref LL_GPIO_PIN_5
|
||||||
|
* @arg @ref LL_GPIO_PIN_6
|
||||||
|
* @arg @ref LL_GPIO_PIN_7
|
||||||
|
* @arg @ref LL_GPIO_PIN_8
|
||||||
|
* @arg @ref LL_GPIO_PIN_9
|
||||||
|
* @arg @ref LL_GPIO_PIN_10
|
||||||
|
* @arg @ref LL_GPIO_PIN_11
|
||||||
|
* @arg @ref LL_GPIO_PIN_12
|
||||||
|
* @arg @ref LL_GPIO_PIN_13
|
||||||
|
* @arg @ref LL_GPIO_PIN_14
|
||||||
|
* @arg @ref LL_GPIO_PIN_15
|
||||||
|
* @arg @ref LL_GPIO_PIN_ALL
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t PinMask)
|
||||||
|
{
|
||||||
|
WRITE_REG(GPIOx->ODR, READ_REG(GPIOx->ODR) ^ PinMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(USE_FULL_LL_DRIVER)
|
||||||
|
/** @defgroup GPIO_LL_EF_Init Initialization and de-initialization functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
ErrorStatus LL_GPIO_DeInit(GPIO_TypeDef *GPIOx);
|
||||||
|
ErrorStatus LL_GPIO_Init(GPIO_TypeDef *GPIOx, LL_GPIO_InitTypeDef *GPIO_InitStruct);
|
||||||
|
void LL_GPIO_StructInit(LL_GPIO_InitTypeDef *GPIO_InitStruct);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
#endif /* USE_FULL_LL_DRIVER */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* defined (GPIOA) || defined (GPIOB) || defined (GPIOC) || defined (GPIOD) || defined (GPIOE) || defined (GPIOF) */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_LL_GPIO_H */
|
||||||
+606
@@ -0,0 +1,606 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_ll_hsem.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of HSEM LL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_LL_HSEM_H
|
||||||
|
#define STM32MP1xx_LL_HSEM_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_LL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(HSEM)
|
||||||
|
|
||||||
|
/** @defgroup HSEM_LL HSEM
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
|
/** @defgroup HSEM_LL_Exported_Constants HSEM Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HSEM_LL_EC_COREID COREID Defines
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_HSEM_COREID_NONE 0U
|
||||||
|
#define LL_HSEM_COREID_CPU1 HSEM_CR_COREID_CPU1
|
||||||
|
#define LL_HSEM_COREID HSEM_CR_COREID_CURRENT
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HSEM_LL_EC_GET_FLAG Get Flags Defines
|
||||||
|
* @brief Flags defines which can be used with LL_HSEM_ReadReg function
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LL_HSEM_SEMAPHORE_0 HSEM_C1IER_ISE0
|
||||||
|
#define LL_HSEM_SEMAPHORE_1 HSEM_C1IER_ISE1
|
||||||
|
#define LL_HSEM_SEMAPHORE_2 HSEM_C1IER_ISE2
|
||||||
|
#define LL_HSEM_SEMAPHORE_3 HSEM_C1IER_ISE3
|
||||||
|
#define LL_HSEM_SEMAPHORE_4 HSEM_C1IER_ISE4
|
||||||
|
#define LL_HSEM_SEMAPHORE_5 HSEM_C1IER_ISE5
|
||||||
|
#define LL_HSEM_SEMAPHORE_6 HSEM_C1IER_ISE6
|
||||||
|
#define LL_HSEM_SEMAPHORE_7 HSEM_C1IER_ISE7
|
||||||
|
#define LL_HSEM_SEMAPHORE_8 HSEM_C1IER_ISE8
|
||||||
|
#define LL_HSEM_SEMAPHORE_9 HSEM_C1IER_ISE9
|
||||||
|
#define LL_HSEM_SEMAPHORE_10 HSEM_C1IER_ISE10
|
||||||
|
#define LL_HSEM_SEMAPHORE_11 HSEM_C1IER_ISE11
|
||||||
|
#define LL_HSEM_SEMAPHORE_12 HSEM_C1IER_ISE12
|
||||||
|
#define LL_HSEM_SEMAPHORE_13 HSEM_C1IER_ISE13
|
||||||
|
#define LL_HSEM_SEMAPHORE_14 HSEM_C1IER_ISE14
|
||||||
|
#define LL_HSEM_SEMAPHORE_15 HSEM_C1IER_ISE15
|
||||||
|
#define LL_HSEM_SEMAPHORE_16 HSEM_C1IER_ISE16
|
||||||
|
#define LL_HSEM_SEMAPHORE_17 HSEM_C1IER_ISE17
|
||||||
|
#define LL_HSEM_SEMAPHORE_18 HSEM_C1IER_ISE18
|
||||||
|
#define LL_HSEM_SEMAPHORE_19 HSEM_C1IER_ISE19
|
||||||
|
#define LL_HSEM_SEMAPHORE_20 HSEM_C1IER_ISE20
|
||||||
|
#define LL_HSEM_SEMAPHORE_21 HSEM_C1IER_ISE21
|
||||||
|
#define LL_HSEM_SEMAPHORE_22 HSEM_C1IER_ISE22
|
||||||
|
#define LL_HSEM_SEMAPHORE_23 HSEM_C1IER_ISE23
|
||||||
|
#define LL_HSEM_SEMAPHORE_24 HSEM_C1IER_ISE24
|
||||||
|
#define LL_HSEM_SEMAPHORE_25 HSEM_C1IER_ISE25
|
||||||
|
#define LL_HSEM_SEMAPHORE_26 HSEM_C1IER_ISE26
|
||||||
|
#define LL_HSEM_SEMAPHORE_27 HSEM_C1IER_ISE27
|
||||||
|
#define LL_HSEM_SEMAPHORE_28 HSEM_C1IER_ISE28
|
||||||
|
#define LL_HSEM_SEMAPHORE_29 HSEM_C1IER_ISE29
|
||||||
|
#define LL_HSEM_SEMAPHORE_30 HSEM_C1IER_ISE30
|
||||||
|
#define LL_HSEM_SEMAPHORE_31 HSEM_C1IER_ISE31
|
||||||
|
#define LL_HSEM_SEMAPHORE_ALL 0xFFFFFFFFU
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/** @defgroup HSEM_LL_Exported_Macros HSEM Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HSEM_LL_EM_WRITE_READ Common Write and read registers Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Write a value in HSEM register
|
||||||
|
* @param __INSTANCE__ HSEM Instance
|
||||||
|
* @param __REG__ Register to be written
|
||||||
|
* @param __VALUE__ Value to be written in the register
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define LL_HSEM_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Read a value in HSEM register
|
||||||
|
* @param __INSTANCE__ HSEM Instance
|
||||||
|
* @param __REG__ Register to be read
|
||||||
|
* @retval Register value
|
||||||
|
*/
|
||||||
|
#define LL_HSEM_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup HSEM_LL_Exported_Functions HSEM Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HSEM_LL_EF_Data_Management Data_Management
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Return 1 if the semaphore is locked, else return 0.
|
||||||
|
* @rmtoll R LOCK LL_HSEM_IsSemaphoreLocked
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_IsSemaphoreLocked(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(HSEMx->R[Semaphore], HSEM_R_LOCK) == (HSEM_R_LOCK_Msk)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get core id.
|
||||||
|
* @rmtoll R COREID LL_HSEM_GetCoreId
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_HSEM_COREID_NONE
|
||||||
|
* @arg @ref LL_HSEM_COREID_CPU1
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_GetCoreId(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(HSEMx->R[Semaphore], HSEM_R_COREID_Msk));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get process id.
|
||||||
|
* @rmtoll R PROCID LL_HSEM_GetProcessId
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
|
||||||
|
* @retval Process number. Value between Min_Data=0 and Max_Data=255
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_GetProcessId(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(HSEMx->R[Semaphore], HSEM_R_PROCID_Msk));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the lock by writing in R register.
|
||||||
|
* @note The R register has to be read to determined if the lock is taken.
|
||||||
|
* @rmtoll R LOCK LL_HSEM_SetLock
|
||||||
|
* @rmtoll R COREID LL_HSEM_SetLock
|
||||||
|
* @rmtoll R PROCID LL_HSEM_SetLock
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
|
||||||
|
* @param process Process id. Value between Min_Data=0 and Max_Data=255
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_HSEM_SetLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore, uint32_t process)
|
||||||
|
{
|
||||||
|
WRITE_REG(HSEMx->R[Semaphore], (HSEM_R_LOCK | LL_HSEM_COREID | process));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the lock with 2-step lock.
|
||||||
|
* @rmtoll R LOCK LL_HSEM_2StepLock
|
||||||
|
* @rmtoll R COREID LL_HSEM_2StepLock
|
||||||
|
* @rmtoll R PROCID LL_HSEM_2StepLock
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
|
||||||
|
* @param process Process id. Value between Min_Data=0 and Max_Data=255
|
||||||
|
* @retval 1 lock fail, 0 lock successful or already locked by same process and core
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_2StepLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore, uint32_t process)
|
||||||
|
{
|
||||||
|
WRITE_REG(HSEMx->R[Semaphore], (HSEM_R_LOCK | LL_HSEM_COREID | process));
|
||||||
|
return ((HSEMx->R[Semaphore] != (HSEM_R_LOCK | LL_HSEM_COREID | process)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the lock with 1-step lock.
|
||||||
|
* @rmtoll RLR LOCK LL_HSEM_1StepLock
|
||||||
|
* @rmtoll RLR COREID LL_HSEM_1StepLock
|
||||||
|
* @rmtoll RLR PROCID LL_HSEM_1StepLock
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
|
||||||
|
* @retval 1 lock fail, 0 lock successful or already locked by same core
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_1StepLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
|
||||||
|
{
|
||||||
|
return ((HSEMx->RLR[Semaphore] != (HSEM_R_LOCK | LL_HSEM_COREID)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Release the lock of the semaphore.
|
||||||
|
* @note In case of LL_HSEM_1StepLock usage to lock a semaphore, the process is 0.
|
||||||
|
* @rmtoll R LOCK LL_HSEM_ReleaseLock
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
|
||||||
|
* @param process Process number. Value between Min_Data=0 and Max_Data=255
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_HSEM_ReleaseLock(HSEM_TypeDef *HSEMx, uint32_t Semaphore, uint32_t process)
|
||||||
|
{
|
||||||
|
WRITE_REG(HSEMx->R[Semaphore], (LL_HSEM_COREID | process));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the lock status of the semaphore.
|
||||||
|
* @rmtoll R LOCK LL_HSEM_GetStatus
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param Semaphore Semaphore number. Value between Min_Data=0 and Max_Data=31
|
||||||
|
* @retval 0 semaphore is free, 1 semaphore is locked */
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_GetStatus(HSEM_TypeDef *HSEMx, uint32_t Semaphore)
|
||||||
|
{
|
||||||
|
return ((HSEMx->R[Semaphore] != 0U) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set the key.
|
||||||
|
* @rmtoll KEYR KEY LL_HSEM_SetKey
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param key Key value.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_HSEM_SetKey(HSEM_TypeDef *HSEMx, uint32_t key)
|
||||||
|
{
|
||||||
|
WRITE_REG(HSEMx->KEYR, key << HSEM_KEYR_KEY_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the key.
|
||||||
|
* @rmtoll KEYR KEY LL_HSEM_GetKey
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @retval key to unlock all semaphore from the same core
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_GetKey(HSEM_TypeDef *HSEMx)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(HSEMx->KEYR, HSEM_KEYR_KEY) >> HSEM_KEYR_KEY_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Release all semaphore with the same core id.
|
||||||
|
* @rmtoll CR KEY LL_HSEM_ResetAllLock
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param key Key value.
|
||||||
|
* @param core This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_HSEM_COREID_CPU1
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_HSEM_ResetAllLock(HSEM_TypeDef *HSEMx, uint32_t key, uint32_t core)
|
||||||
|
{
|
||||||
|
WRITE_REG(HSEMx->CR, (key << HSEM_CR_KEY_Pos) | core);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HSEM_LL_EF_IT_Management IT_Management
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable interrupt.
|
||||||
|
* @rmtoll C1IER ISEM LL_HSEM_EnableIT_C1IER
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param SemaphoreMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_0
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_1
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_2
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_3
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_4
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_5
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_6
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_7
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_8
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_9
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_10
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_11
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_12
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_13
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_14
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_15
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_16
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_17
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_18
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_19
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_20
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_21
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_22
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_23
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_24
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_25
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_26
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_27
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_28
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_29
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_30
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_31
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_ALL
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_HSEM_EnableIT_C1IER(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
|
||||||
|
{
|
||||||
|
SET_BIT(HSEMx->C1IER, SemaphoreMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable interrupt.
|
||||||
|
* @rmtoll C1IER ISEM LL_HSEM_DisableIT_C1IER
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param SemaphoreMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_0
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_1
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_2
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_3
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_4
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_5
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_6
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_7
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_8
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_9
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_10
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_11
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_12
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_13
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_14
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_15
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_16
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_17
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_18
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_19
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_20
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_21
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_22
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_23
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_24
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_25
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_26
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_27
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_28
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_29
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_30
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_31
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_ALL
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_HSEM_DisableIT_C1IER(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
|
||||||
|
{
|
||||||
|
CLEAR_BIT(HSEMx->C1IER, SemaphoreMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if interrupt is enabled.
|
||||||
|
* @rmtoll C1IER ISEM LL_HSEM_IsEnabledIT_C1IER
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param SemaphoreMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_0
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_1
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_2
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_3
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_4
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_5
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_6
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_7
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_8
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_9
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_10
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_11
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_12
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_13
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_14
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_15
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_16
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_17
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_18
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_19
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_20
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_21
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_22
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_23
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_24
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_25
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_26
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_27
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_28
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_29
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_30
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_31
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_ALL
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_IsEnabledIT_C1IER(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(HSEMx->C1IER, SemaphoreMask) == (SemaphoreMask)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup HSEM_LL_EF_FLAG_Management FLAG_Management
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear interrupt status.
|
||||||
|
* @rmtoll C1ICR ISEM LL_HSEM_ClearFlag_C1ICR
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param SemaphoreMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_0
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_1
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_2
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_3
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_4
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_5
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_6
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_7
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_8
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_9
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_10
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_11
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_12
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_13
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_14
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_15
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_16
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_17
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_18
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_19
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_20
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_21
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_22
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_23
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_24
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_25
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_26
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_27
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_28
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_29
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_30
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_31
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_ALL
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_HSEM_ClearFlag_C1ICR(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
|
||||||
|
{
|
||||||
|
WRITE_REG(HSEMx->C1ICR, SemaphoreMask);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get interrupt status from ISR register.
|
||||||
|
* @rmtoll C1ISR ISEM LL_HSEM_IsActiveFlag_C1ISR
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param SemaphoreMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_0
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_1
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_2
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_3
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_4
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_5
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_6
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_7
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_8
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_9
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_10
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_11
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_12
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_13
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_14
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_15
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_16
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_17
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_18
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_19
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_20
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_21
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_22
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_23
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_24
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_25
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_26
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_27
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_28
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_29
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_30
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_31
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_ALL
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_IsActiveFlag_C1ISR(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(HSEMx->C1ISR, SemaphoreMask) == (SemaphoreMask)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get interrupt status from MISR register.
|
||||||
|
* @rmtoll C1MISR ISEM LL_HSEM_IsActiveFlag_C1MISR
|
||||||
|
* @param HSEMx HSEM Instance.
|
||||||
|
* @param SemaphoreMask This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_0
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_1
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_2
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_3
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_4
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_5
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_6
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_7
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_8
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_9
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_10
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_11
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_12
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_13
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_14
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_15
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_16
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_17
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_18
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_19
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_20
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_21
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_22
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_23
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_24
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_25
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_26
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_27
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_28
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_29
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_30
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_31
|
||||||
|
* @arg @ref LL_HSEM_SEMAPHORE_ALL
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_HSEM_IsActiveFlag_C1MISR(HSEM_TypeDef *HSEMx, uint32_t SemaphoreMask)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(HSEMx->C1MISR, SemaphoreMask) == (SemaphoreMask)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* defined(HSEM) */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __STM32MP1xx_LL_HSEM_H */
|
||||||
+732
@@ -0,0 +1,732 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_ll_ipcc.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of IPCC LL module.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_LL_IPCC_H
|
||||||
|
#define STM32MP1xx_LL_IPCC_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_LL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if defined(IPCC)
|
||||||
|
|
||||||
|
/** @defgroup IPCC_LL IPCC
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/** @defgroup IPCC_LL_Exported_Constants IPCC Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_LL_EC_GET_FLAG Get Flags Defines
|
||||||
|
* @brief Flags defines which can be used with LL_IPCC_ReadReg function
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_IPCC_C1TOC2SR_CH1F IPCC_C1TOC2SR_CH1F_Msk /*!< C1 transmit to C2 receive Channel1 status flag before masking */
|
||||||
|
#define LL_IPCC_C1TOC2SR_CH2F IPCC_C1TOC2SR_CH2F_Msk /*!< C1 transmit to C2 receive Channel2 status flag before masking */
|
||||||
|
#define LL_IPCC_C1TOC2SR_CH3F IPCC_C1TOC2SR_CH3F_Msk /*!< C1 transmit to C2 receive Channel3 status flag before masking */
|
||||||
|
#define LL_IPCC_C1TOC2SR_CH4F IPCC_C1TOC2SR_CH4F_Msk /*!< C1 transmit to C2 receive Channel4 status flag before masking */
|
||||||
|
#define LL_IPCC_C1TOC2SR_CH5F IPCC_C1TOC2SR_CH5F_Msk /*!< C1 transmit to C2 receive Channel5 status flag before masking */
|
||||||
|
#define LL_IPCC_C1TOC2SR_CH6F IPCC_C1TOC2SR_CH6F_Msk /*!< C1 transmit to C2 receive Channel6 status flag before masking */
|
||||||
|
#define LL_IPCC_C2TOC1SR_CH1F IPCC_C2TOC1SR_CH1F_Msk /*!< C2 transmit to C1 receive Channel1 status flag before masking */
|
||||||
|
#define LL_IPCC_C2TOC1SR_CH2F IPCC_C2TOC1SR_CH2F_Msk /*!< C2 transmit to C1 receive Channel2 status flag before masking */
|
||||||
|
#define LL_IPCC_C2TOC1SR_CH3F IPCC_C2TOC1SR_CH3F_Msk /*!< C2 transmit to C1 receive Channel3 status flag before masking */
|
||||||
|
#define LL_IPCC_C2TOC1SR_CH4F IPCC_C2TOC1SR_CH4F_Msk /*!< C2 transmit to C1 receive Channel4 status flag before masking */
|
||||||
|
#define LL_IPCC_C2TOC1SR_CH5F IPCC_C2TOC1SR_CH5F_Msk /*!< C2 transmit to C1 receive Channel5 status flag before masking */
|
||||||
|
#define LL_IPCC_C2TOC1SR_CH6F IPCC_C2TOC1SR_CH6F_Msk /*!< C2 transmit to C1 receive Channel6 status flag before masking */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_LL_EC_Channel Channel
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_IPCC_CHANNEL_1 (0x00000001U) /*!< IPCC Channel 1 */
|
||||||
|
#define LL_IPCC_CHANNEL_2 (0x00000002U) /*!< IPCC Channel 2 */
|
||||||
|
#define LL_IPCC_CHANNEL_3 (0x00000004U) /*!< IPCC Channel 3 */
|
||||||
|
#define LL_IPCC_CHANNEL_4 (0x00000008U) /*!< IPCC Channel 4 */
|
||||||
|
#define LL_IPCC_CHANNEL_5 (0x00000010U) /*!< IPCC Channel 5 */
|
||||||
|
#define LL_IPCC_CHANNEL_6 (0x00000020U) /*!< IPCC Channel 6 */
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
/** @defgroup IPCC_LL_Exported_Macros IPCC Exported Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_LL_EM_WRITE_READ Common Write and read registers Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Write a value in IPCC register
|
||||||
|
* @param __INSTANCE__ IPCC Instance
|
||||||
|
* @param __REG__ Register to be written
|
||||||
|
* @param __VALUE__ Value to be written in the register
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
#define LL_IPCC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Read a value in IPCC register
|
||||||
|
* @param __INSTANCE__ IPCC Instance
|
||||||
|
* @param __REG__ Register to be read
|
||||||
|
* @retval Register value
|
||||||
|
*/
|
||||||
|
#define LL_IPCC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup IPCC_LL_Exported_Functions IPCC Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_LL_EF_IT_Management IT_Management
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable Transmit channel free interrupt for processor 1.
|
||||||
|
* @rmtoll C1CR TXFIE LL_C1_IPCC_EnableIT_TXF
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_EnableIT_TXF(IPCC_TypeDef *IPCCx)
|
||||||
|
{
|
||||||
|
SET_BIT(IPCCx->C1CR, IPCC_C1CR_TXFIE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable Transmit channel free interrupt for processor 1.
|
||||||
|
* @rmtoll C1CR TXFIE LL_C1_IPCC_DisableIT_TXF
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_DisableIT_TXF(IPCC_TypeDef *IPCCx)
|
||||||
|
{
|
||||||
|
CLEAR_BIT(IPCCx->C1CR, IPCC_C1CR_TXFIE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if Transmit channel free interrupt for processor 1 is enabled.
|
||||||
|
* @rmtoll C1CR TXFIE LL_C1_IPCC_IsEnabledIT_TXF
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C1_IPCC_IsEnabledIT_TXF(IPCC_TypeDef const *const IPCCx)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C1CR, IPCC_C1CR_TXFIE) == (IPCC_C1CR_TXFIE)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable Receive channel occupied interrupt for processor 1.
|
||||||
|
* @rmtoll C1CR RXOIE LL_C1_IPCC_EnableIT_RXO
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_EnableIT_RXO(IPCC_TypeDef *IPCCx)
|
||||||
|
{
|
||||||
|
SET_BIT(IPCCx->C1CR, IPCC_C1CR_RXOIE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable Receive channel occupied interrupt for processor 1.
|
||||||
|
* @rmtoll C1CR RXOIE LL_C1_IPCC_DisableIT_RXO
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_DisableIT_RXO(IPCC_TypeDef *IPCCx)
|
||||||
|
{
|
||||||
|
CLEAR_BIT(IPCCx->C1CR, IPCC_C1CR_RXOIE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if Receive channel occupied interrupt for processor 1 is enabled.
|
||||||
|
* @rmtoll C1CR RXOIE LL_C1_IPCC_IsEnabledIT_RXO
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C1_IPCC_IsEnabledIT_RXO(IPCC_TypeDef const *const IPCCx)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C1CR, IPCC_C1CR_RXOIE) == (IPCC_C1CR_RXOIE)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable Transmit channel free interrupt for processor 2.
|
||||||
|
* @rmtoll C2CR TXFIE LL_C2_IPCC_EnableIT_TXF
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_EnableIT_TXF(IPCC_TypeDef *IPCCx)
|
||||||
|
{
|
||||||
|
SET_BIT(IPCCx->C2CR, IPCC_C2CR_TXFIE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable Transmit channel free interrupt for processor 2.
|
||||||
|
* @rmtoll C2CR TXFIE LL_C2_IPCC_DisableIT_TXF
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_DisableIT_TXF(IPCC_TypeDef *IPCCx)
|
||||||
|
{
|
||||||
|
CLEAR_BIT(IPCCx->C2CR, IPCC_C2CR_TXFIE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if Transmit channel free interrupt for processor 2 is enabled.
|
||||||
|
* @rmtoll C2CR TXFIE LL_C2_IPCC_IsEnabledIT_TXF
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C2_IPCC_IsEnabledIT_TXF(IPCC_TypeDef const *const IPCCx)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C2CR, IPCC_C2CR_TXFIE) == (IPCC_C2CR_TXFIE)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Enable Receive channel occupied interrupt for processor 2.
|
||||||
|
* @rmtoll C2CR RXOIE LL_C2_IPCC_EnableIT_RXO
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_EnableIT_RXO(IPCC_TypeDef *IPCCx)
|
||||||
|
{
|
||||||
|
SET_BIT(IPCCx->C2CR, IPCC_C2CR_RXOIE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disable Receive channel occupied interrupt for processor 2.
|
||||||
|
* @rmtoll C2CR RXOIE LL_C2_IPCC_DisableIT_RXO
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_DisableIT_RXO(IPCC_TypeDef *IPCCx)
|
||||||
|
{
|
||||||
|
CLEAR_BIT(IPCCx->C2CR, IPCC_C2CR_RXOIE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if Receive channel occupied interrupt for processor 2 is enabled.
|
||||||
|
* @rmtoll C2CR RXOIE LL_C2_IPCC_IsEnabledIT_RXO
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C2_IPCC_IsEnabledIT_RXO(IPCC_TypeDef const *const IPCCx)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C2CR, IPCC_C2CR_RXOIE) == (IPCC_C2CR_RXOIE)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_LL_EF_Configuration Configuration
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Unmask transmit channel free interrupt for processor 1.
|
||||||
|
* @rmtoll C1MR CH1FM LL_C1_IPCC_EnableTransmitChannel\n
|
||||||
|
* C1MR CH2FM LL_C1_IPCC_EnableTransmitChannel\n
|
||||||
|
* C1MR CH3FM LL_C1_IPCC_EnableTransmitChannel\n
|
||||||
|
* C1MR CH4FM LL_C1_IPCC_EnableTransmitChannel\n
|
||||||
|
* C1MR CH5FM LL_C1_IPCC_EnableTransmitChannel\n
|
||||||
|
* C1MR CH6FM LL_C1_IPCC_EnableTransmitChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_EnableTransmitChannel(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
CLEAR_BIT(IPCCx->C1MR, Channel << IPCC_C1MR_CH1FM_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mask transmit channel free interrupt for processor 1.
|
||||||
|
* @rmtoll C1MR CH1FM LL_C1_IPCC_DisableTransmitChannel\n
|
||||||
|
* C1MR CH2FM LL_C1_IPCC_DisableTransmitChannel\n
|
||||||
|
* C1MR CH3FM LL_C1_IPCC_DisableTransmitChannel\n
|
||||||
|
* C1MR CH4FM LL_C1_IPCC_DisableTransmitChannel\n
|
||||||
|
* C1MR CH5FM LL_C1_IPCC_DisableTransmitChannel\n
|
||||||
|
* C1MR CH6FM LL_C1_IPCC_DisableTransmitChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_DisableTransmitChannel(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
SET_BIT(IPCCx->C1MR, Channel << IPCC_C1MR_CH1FM_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if Transmit channel free interrupt for processor 1 is masked.
|
||||||
|
* @rmtoll C1MR CH1FM LL_C1_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C1MR CH2FM LL_C1_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C1MR CH3FM LL_C1_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C1MR CH4FM LL_C1_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C1MR CH5FM LL_C1_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C1MR CH6FM LL_C1_IPCC_IsEnabledTransmitChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C1_IPCC_IsEnabledTransmitChannel(IPCC_TypeDef const *const IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C1MR, Channel << IPCC_C1MR_CH1FM_Pos) != (Channel << IPCC_C1MR_CH1FM_Pos)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Unmask receive channel occupied interrupt for processor 1.
|
||||||
|
* @rmtoll C1MR CH1OM LL_C1_IPCC_EnableReceiveChannel\n
|
||||||
|
* C1MR CH2OM LL_C1_IPCC_EnableReceiveChannel\n
|
||||||
|
* C1MR CH3OM LL_C1_IPCC_EnableReceiveChannel\n
|
||||||
|
* C1MR CH4OM LL_C1_IPCC_EnableReceiveChannel\n
|
||||||
|
* C1MR CH5OM LL_C1_IPCC_EnableReceiveChannel\n
|
||||||
|
* C1MR CH6OM LL_C1_IPCC_EnableReceiveChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_EnableReceiveChannel(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
CLEAR_BIT(IPCCx->C1MR, Channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mask receive channel occupied interrupt for processor 1.
|
||||||
|
* @rmtoll C1MR CH1OM LL_C1_IPCC_DisableReceiveChannel\n
|
||||||
|
* C1MR CH2OM LL_C1_IPCC_DisableReceiveChannel\n
|
||||||
|
* C1MR CH3OM LL_C1_IPCC_DisableReceiveChannel\n
|
||||||
|
* C1MR CH4OM LL_C1_IPCC_DisableReceiveChannel\n
|
||||||
|
* C1MR CH5OM LL_C1_IPCC_DisableReceiveChannel\n
|
||||||
|
* C1MR CH6OM LL_C1_IPCC_DisableReceiveChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_DisableReceiveChannel(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
SET_BIT(IPCCx->C1MR, Channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if Receive channel occupied interrupt for processor 1 is masked.
|
||||||
|
* @rmtoll C1MR CH1OM LL_C1_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C1MR CH2OM LL_C1_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C1MR CH3OM LL_C1_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C1MR CH4OM LL_C1_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C1MR CH5OM LL_C1_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C1MR CH6OM LL_C1_IPCC_IsEnabledReceiveChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C1_IPCC_IsEnabledReceiveChannel(IPCC_TypeDef const *const IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C1MR, Channel) != (Channel)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Unmask transmit channel free interrupt for processor 2.
|
||||||
|
* @rmtoll C2MR CH1FM LL_C2_IPCC_EnableTransmitChannel\n
|
||||||
|
* C2MR CH2FM LL_C2_IPCC_EnableTransmitChannel\n
|
||||||
|
* C2MR CH3FM LL_C2_IPCC_EnableTransmitChannel\n
|
||||||
|
* C2MR CH4FM LL_C2_IPCC_EnableTransmitChannel\n
|
||||||
|
* C2MR CH5FM LL_C2_IPCC_EnableTransmitChannel\n
|
||||||
|
* C2MR CH6FM LL_C2_IPCC_EnableTransmitChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_EnableTransmitChannel(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
CLEAR_BIT(IPCCx->C2MR, Channel << IPCC_C2MR_CH1FM_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mask transmit channel free interrupt for processor 2.
|
||||||
|
* @rmtoll C2MR CH1FM LL_C2_IPCC_DisableTransmitChannel\n
|
||||||
|
* C2MR CH2FM LL_C2_IPCC_DisableTransmitChannel\n
|
||||||
|
* C2MR CH3FM LL_C2_IPCC_DisableTransmitChannel\n
|
||||||
|
* C2MR CH4FM LL_C2_IPCC_DisableTransmitChannel\n
|
||||||
|
* C2MR CH5FM LL_C2_IPCC_DisableTransmitChannel\n
|
||||||
|
* C2MR CH6FM LL_C2_IPCC_DisableTransmitChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_DisableTransmitChannel(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
SET_BIT(IPCCx->C2MR, Channel << (IPCC_C2MR_CH1FM_Pos));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if Transmit channel free interrupt for processor 2 is masked.
|
||||||
|
* @rmtoll C2MR CH1FM LL_C2_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C2MR CH2FM LL_C2_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C2MR CH3FM LL_C2_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C2MR CH4FM LL_C2_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C2MR CH5FM LL_C2_IPCC_IsEnabledTransmitChannel\n
|
||||||
|
* C2MR CH6FM LL_C2_IPCC_IsEnabledTransmitChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C2_IPCC_IsEnabledTransmitChannel(IPCC_TypeDef const *const IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C2MR, Channel << IPCC_C2MR_CH1FM_Pos) != (Channel << IPCC_C2MR_CH1FM_Pos)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Unmask receive channel occupied interrupt for processor 2.
|
||||||
|
* @rmtoll C2MR CH1OM LL_C2_IPCC_EnableReceiveChannel\n
|
||||||
|
* C2MR CH2OM LL_C2_IPCC_EnableReceiveChannel\n
|
||||||
|
* C2MR CH3OM LL_C2_IPCC_EnableReceiveChannel\n
|
||||||
|
* C2MR CH4OM LL_C2_IPCC_EnableReceiveChannel\n
|
||||||
|
* C2MR CH5OM LL_C2_IPCC_EnableReceiveChannel\n
|
||||||
|
* C2MR CH6OM LL_C2_IPCC_EnableReceiveChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_EnableReceiveChannel(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
CLEAR_BIT(IPCCx->C2MR, Channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Mask receive channel occupied interrupt for processor 1.
|
||||||
|
* @rmtoll C2MR CH1OM LL_C2_IPCC_DisableReceiveChannel\n
|
||||||
|
* C2MR CH2OM LL_C2_IPCC_DisableReceiveChannel\n
|
||||||
|
* C2MR CH3OM LL_C2_IPCC_DisableReceiveChannel\n
|
||||||
|
* C2MR CH4OM LL_C2_IPCC_DisableReceiveChannel\n
|
||||||
|
* C2MR CH5OM LL_C2_IPCC_DisableReceiveChannel\n
|
||||||
|
* C2MR CH6OM LL_C2_IPCC_DisableReceiveChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_DisableReceiveChannel(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
SET_BIT(IPCCx->C2MR, Channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Check if Receive channel occupied interrupt for processor 2 is masked.
|
||||||
|
* @rmtoll C2MR CH1OM LL_C2_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C2MR CH2OM LL_C2_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C2MR CH3OM LL_C2_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C2MR CH4OM LL_C2_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C2MR CH5OM LL_C2_IPCC_IsEnabledReceiveChannel\n
|
||||||
|
* C2MR CH6OM LL_C2_IPCC_IsEnabledReceiveChannel
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C2_IPCC_IsEnabledReceiveChannel(IPCC_TypeDef const *const IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C2MR, Channel) != (Channel)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup IPCC_LL_EF_FLAG_Management FLAG_Management
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear IPCC receive channel status for processor 1.
|
||||||
|
* @note Associated with IPCC_C2TOC1SR.CHxF
|
||||||
|
* @rmtoll C1SCR CH1C LL_C1_IPCC_ClearFlag_CHx\n
|
||||||
|
* C1SCR CH2C LL_C1_IPCC_ClearFlag_CHx\n
|
||||||
|
* C1SCR CH3C LL_C1_IPCC_ClearFlag_CHx\n
|
||||||
|
* C1SCR CH4C LL_C1_IPCC_ClearFlag_CHx\n
|
||||||
|
* C1SCR CH5C LL_C1_IPCC_ClearFlag_CHx\n
|
||||||
|
* C1SCR CH6C LL_C1_IPCC_ClearFlag_CHx
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_ClearFlag_CHx(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
WRITE_REG(IPCCx->C1SCR, Channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set IPCC transmit channel status for processor 1.
|
||||||
|
* @note Associated with IPCC_C1TOC2SR.CHxF
|
||||||
|
* @rmtoll C1SCR CH1S LL_C1_IPCC_SetFlag_CHx\n
|
||||||
|
* C1SCR CH2S LL_C1_IPCC_SetFlag_CHx\n
|
||||||
|
* C1SCR CH3S LL_C1_IPCC_SetFlag_CHx\n
|
||||||
|
* C1SCR CH4S LL_C1_IPCC_SetFlag_CHx\n
|
||||||
|
* C1SCR CH5S LL_C1_IPCC_SetFlag_CHx\n
|
||||||
|
* C1SCR CH6S LL_C1_IPCC_SetFlag_CHx
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C1_IPCC_SetFlag_CHx(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
WRITE_REG(IPCCx->C1SCR, Channel << IPCC_C1SCR_CH1S_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get channel status for processor 1.
|
||||||
|
* @rmtoll C1TOC2SR CH1F LL_C1_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C1TOC2SR CH2F LL_C1_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C1TOC2SR CH3F LL_C1_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C1TOC2SR CH4F LL_C1_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C1TOC2SR CH5F LL_C1_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C1TOC2SR CH6F LL_C1_IPCC_IsActiveFlag_CHx
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C1_IPCC_IsActiveFlag_CHx(IPCC_TypeDef const *const IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C1TOC2SR, Channel) == (Channel)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Clear IPCC receive channel status for processor 2.
|
||||||
|
* @note Associated with IPCC_C1TOC2SR.CHxF
|
||||||
|
* @rmtoll C2SCR CH1C LL_C2_IPCC_ClearFlag_CHx\n
|
||||||
|
* C2SCR CH2C LL_C2_IPCC_ClearFlag_CHx\n
|
||||||
|
* C2SCR CH3C LL_C2_IPCC_ClearFlag_CHx\n
|
||||||
|
* C2SCR CH4C LL_C2_IPCC_ClearFlag_CHx\n
|
||||||
|
* C2SCR CH5C LL_C2_IPCC_ClearFlag_CHx\n
|
||||||
|
* C2SCR CH6C LL_C2_IPCC_ClearFlag_CHx
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_ClearFlag_CHx(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
WRITE_REG(IPCCx->C2SCR, Channel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Set IPCC transmit channel status for processor 2.
|
||||||
|
* @note Associated with IPCC_C2TOC1SR.CHxF
|
||||||
|
* @rmtoll C2SCR CH1S LL_C2_IPCC_SetFlag_CHx\n
|
||||||
|
* C2SCR CH2S LL_C2_IPCC_SetFlag_CHx\n
|
||||||
|
* C2SCR CH3S LL_C2_IPCC_SetFlag_CHx\n
|
||||||
|
* C2SCR CH4S LL_C2_IPCC_SetFlag_CHx\n
|
||||||
|
* C2SCR CH5S LL_C2_IPCC_SetFlag_CHx\n
|
||||||
|
* C2SCR CH6S LL_C2_IPCC_SetFlag_CHx
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be a combination of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_C2_IPCC_SetFlag_CHx(IPCC_TypeDef *IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
WRITE_REG(IPCCx->C2SCR, Channel << IPCC_C2SCR_CH1S_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get channel status for processor 2.
|
||||||
|
* @rmtoll C2TOC1SR CH1F LL_C2_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C2TOC1SR CH2F LL_C2_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C2TOC1SR CH3F LL_C2_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C2TOC1SR CH4F LL_C2_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C2TOC1SR CH5F LL_C2_IPCC_IsActiveFlag_CHx\n
|
||||||
|
* C2TOC1SR CH6F LL_C2_IPCC_IsActiveFlag_CHx
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @param Channel This parameter can be one of the following values:
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_1
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_2
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_3
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_4
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_5
|
||||||
|
* @arg @ref LL_IPCC_CHANNEL_6
|
||||||
|
* @retval State of bit (1 or 0).
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_C2_IPCC_IsActiveFlag_CHx(IPCC_TypeDef const *const IPCCx, uint32_t Channel)
|
||||||
|
{
|
||||||
|
return ((READ_BIT(IPCCx->C2TOC1SR, Channel) == (Channel)) ? 1UL : 0UL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the number of supported channels.
|
||||||
|
* @rmtoll HWCFGR CHANNELS LL_IPCC_GetChannelNumber
|
||||||
|
* @param IPCCx IPCC Instance.
|
||||||
|
* @retval Number of supported channels.
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_IPCC_GetChannelNumber(IPCC_TypeDef *IPCCx)
|
||||||
|
{
|
||||||
|
return READ_BIT(IPCCx->HWCFGR, IPCC_HWCFGR_CHANNELS) >> IPCC_HWCFGR_CHANNELS_Pos;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif /* defined(IPCC) */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_LL_IPCC_H */
|
||||||
|
|
||||||
+1186
File diff suppressed because it is too large
Load Diff
+6020
File diff suppressed because it is too large
Load Diff
+1237
File diff suppressed because it is too large
Load Diff
+397
@@ -0,0 +1,397 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file stm32mp1xx_ll_utils.h
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief Header file of UTILS LL module.
|
||||||
|
@verbatim
|
||||||
|
==============================================================================
|
||||||
|
##### How to use this driver #####
|
||||||
|
==============================================================================
|
||||||
|
[..]
|
||||||
|
The LL UTILS driver contains a set of generic APIs that can be
|
||||||
|
used by user:
|
||||||
|
(+) Device electronic signature
|
||||||
|
(+) Timing functions
|
||||||
|
(+) PLL configuration functions
|
||||||
|
|
||||||
|
@endverbatim
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2019 STMicroelectronics.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This software is licensed under terms that can be found in the LICENSE file
|
||||||
|
* in the root directory of this software component.
|
||||||
|
* If no LICENSE file comes with this software, it is provided AS-IS.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
|
#ifndef STM32MP1xx_LL_UTILS_H
|
||||||
|
#define STM32MP1xx_LL_UTILS_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Includes ------------------------------------------------------------------*/
|
||||||
|
#include "stm32mp1xx.h"
|
||||||
|
|
||||||
|
/** @addtogroup STM32MP1xx_LL_Driver
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup UTILS_LL UTILS
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
/* Private variables ---------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Private constants ---------------------------------------------------------*/
|
||||||
|
/** @defgroup UTILS_LL_Private_Constants UTILS Private Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Max delay can be used in LL_mDelay */
|
||||||
|
#define LL_MAX_DELAY 0xFFFFFFFFU
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Unique device ID register base address
|
||||||
|
*/
|
||||||
|
#define UID_BASE_ADDRESS UID_BASE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Package data register base address
|
||||||
|
*/
|
||||||
|
#define PACKAGE_BASE_ADDRESS PACKAGE_BASE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Private macros ------------------------------------------------------------*/
|
||||||
|
/** @defgroup UTILS_LL_Private_Macros UTILS Private Macros
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
/** @defgroup UTILS_LL_ES_INIT UTILS Exported structures
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* @brief UTILS PLL structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t PLLM; /*!< Division factor for PLL VCO input clock.
|
||||||
|
This parameter can be a value between 1 and 64 */
|
||||||
|
|
||||||
|
uint32_t PLLN; /*!< Multiplication factor for PLL VCO output clock.
|
||||||
|
This parameter must be a number between 4 and 512 */
|
||||||
|
|
||||||
|
uint32_t PLLP; /*!< Division for the P divider
|
||||||
|
This parameter can be a value between 1 and 128
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary
|
||||||
|
functions @ref LL_RCC_PLL1_SetP, @ref LL_RCC_PLL2_SetP,
|
||||||
|
@ref LL_RCC_PLL3_SetP and @ref LL_RCC_PLL4_SetP */
|
||||||
|
|
||||||
|
uint32_t PLLQ; /*!< Division for the Q divider
|
||||||
|
This parameter can be a value between 1 and 128
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary
|
||||||
|
functions @ref LL_RCC_PLL2_SetQ, @ref LL_RCC_PLL3_SetQ
|
||||||
|
and @ref LL_RCC_PLL4_SetQ*/
|
||||||
|
|
||||||
|
uint32_t PLLR; /*!< Division for the R divider
|
||||||
|
This parameter can be a value between 1 and 128
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary
|
||||||
|
functions @ref LL_RCC_PLL2_SetR, @ref LL_RCC_PLL3_SetR
|
||||||
|
and @ref LL_RCC_PLL4_SetR */
|
||||||
|
|
||||||
|
uint32_t PLLFRACV; /*!< Fractional part of the multiplication factor for PLLx VCO.
|
||||||
|
This parameter can be a value between 0 and 8191 (0x1FFF) */
|
||||||
|
} LL_UTILS_PLLTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief UTILS PLLs system structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
LL_UTILS_PLLTypeDef PLL1; /*!< PLL1 structure parameters */
|
||||||
|
|
||||||
|
LL_UTILS_PLLTypeDef PLL2; /*!< PLL2 structure parameters */
|
||||||
|
|
||||||
|
LL_UTILS_PLLTypeDef PLL3; /*!< PLL3 structure parameters */
|
||||||
|
|
||||||
|
LL_UTILS_PLLTypeDef PLL4; /*!< PLL4 structure parameters */
|
||||||
|
|
||||||
|
} LL_UTILS_PLLsInitTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief UTILS System, AHB and APB buses clock configuration structure definition
|
||||||
|
*/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t MPUDivider; /*!< The MPU divider. This clock is derived from the CK_PLL1_P clock.
|
||||||
|
This parameter can be a value of @ref RCC_LL_EC_MPU_DIV
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary function
|
||||||
|
@ref LL_RCC_SetMPUPrescaler(). */
|
||||||
|
|
||||||
|
uint32_t AXIDivider; /*!< The AXI divider. This clock is derived from the AXISSRC clock.
|
||||||
|
This parameter can be a value of @ref RCC_LL_EC_AXI_DIV
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary function
|
||||||
|
@ref LL_RCC_SetACLKPrescaler(). */
|
||||||
|
|
||||||
|
uint32_t MCUDivider; /*!< The MCU divider. This clock is derived from the MCUSSRC muxer.
|
||||||
|
This parameter can be a value of @ref RCC_LL_EC_MCU_DIV
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary function
|
||||||
|
@ref LL_RCC_SetMLHCLKPrescaler(). */
|
||||||
|
|
||||||
|
uint32_t APB1CLKDivider; /*!< The APB1 clock (PCLK1) divider. This clock is derived from the MCU divider.
|
||||||
|
This parameter can be a value of @ref RCC_LL_EC_APB1_DIV
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary function
|
||||||
|
@ref LL_RCC_SetAPB1Prescaler(). */
|
||||||
|
|
||||||
|
uint32_t APB2CLKDivider; /*!< The APB2 clock (PCLK2) divider. This clock is derived from the MCU divider.
|
||||||
|
This parameter can be a value of @ref RCC_LL_EC_APB2_DIV
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary function
|
||||||
|
@ref LL_RCC_SetAPB2Prescaler(). */
|
||||||
|
|
||||||
|
uint32_t APB3CLKDivider; /*!< The APB2 clock (PCLK3) divider. This clock is derived from the MCU divider.
|
||||||
|
This parameter can be a value of @ref RCC_LL_EC_APB3_DIV
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary function
|
||||||
|
@ref LL_RCC_SetAPB3Prescaler(). */
|
||||||
|
|
||||||
|
uint32_t APB4CLKDivider; /*!< The APB4 clock (PCLK4) divider. This clock is derived from the AXIDIV divider.
|
||||||
|
This parameter can be a value of @ref RCC_LL_EC_APB4_DIV
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary function
|
||||||
|
@ref LL_RCC_SetAPB4Prescaler(). */
|
||||||
|
|
||||||
|
uint32_t APB5CLKDivider; /*!< The APB5 clock (PCLK5) divider. This clock is derived from the AXIDIV divider.
|
||||||
|
This parameter can be a value of @ref RCC_LL_EC_APB5_DIV
|
||||||
|
|
||||||
|
This feature can be modified afterwards using unitary function
|
||||||
|
@ref LL_RCC_SetAPB5Prescaler(). */
|
||||||
|
} LL_UTILS_ClkInitTypeDef;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
/** @defgroup UTILS_LL_Exported_Constants UTILS Exported Constants
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup UTILS_EC_HSE_BYPASS HSE Bypass activation
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_UTILS_HSEBYPASS_OFF 0x00000000U /*!< HSE Bypass is disabled */
|
||||||
|
#define LL_UTILS_HSEBYPASS_ON RCC_OCENSETR_HSEBYP /*!< HSE Bypass is enabled */
|
||||||
|
#define LL_UTILS_HSEBYPASSDIG_ON RCC_OCENSETR_DIGBYP /*!< HSE Bypass Digital is enabled */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup UTILS_EC_PACKAGETYPE PACKAGE TYPE
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_UTILS_PACKAGETYPE_TFBGA257 1U /*!< TFBGA257 package type */
|
||||||
|
#define LL_UTILS_PACKAGETYPE_TFBGA361 2U /*!< TFBGA361 package type */
|
||||||
|
#define LL_UTILS_PACKAGETYPE_LFBGA354 3U /*!< LFBGA354 package type */
|
||||||
|
#define LL_UTILS_PACKAGETYPE_LFBGA448 4U /*!< LFBGA448 package type */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup UTILS_EC_RPN DEVICE PART NUMBER
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_UTILS_RPN_STM32MP157Cxx 0U /*!< STM32MP157Cxx Part Number */
|
||||||
|
#define LL_UTILS_RPN_STM32MP157Axx 1U /*!< STM32MP157Axx Part Number */
|
||||||
|
#define LL_UTILS_RPN_STM32MP157Fxx 128U /*!< STM32MP157Fxx Part Number */
|
||||||
|
#define LL_UTILS_RPN_STM32MP157Dxx 129U /*!< STM32MP157Dxx Part Number */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup UTILS_EC_DV DEVICE ID VERSION
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#define LL_UTILS_DV_ID_STM32MP15xxx 0x500U /*!< STM32MP15xxx Device ID */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Exported macro ------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* Exported functions --------------------------------------------------------*/
|
||||||
|
/** @defgroup UTILS_LL_Exported_Functions UTILS Exported Functions
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup UTILS_EF_DEVICE_ELECTRONIC_SIGNATURE DEVICE ELECTRONIC SIGNATURE
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get Word0 of the unique device identifier (UID based on 96 bits)
|
||||||
|
* @retval UID[31:0]
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GetUID_Word0(void)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_REG(*((uint32_t *)UID_BASE_ADDRESS)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get Word1 of the unique device identifier (UID based on 96 bits)
|
||||||
|
* @retval UID[63:32]
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GetUID_Word1(void)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 4U))));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get Word2 of the unique device identifier (UID based on 96 bits)
|
||||||
|
* @retval UID[95:64]
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GetUID_Word2(void)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_REG(*((uint32_t *)(UID_BASE_ADDRESS + 8U))));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get Package type
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_UTILS_PACKAGETYPE_TFBGA257
|
||||||
|
* @arg @ref LL_UTILS_PACKAGETYPE_TFBGA361
|
||||||
|
* @arg @ref LL_UTILS_PACKAGETYPE_LFBGA354
|
||||||
|
* @arg @ref LL_UTILS_PACKAGETYPE_LFBGA448
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GetPackageType(void)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(*(uint32_t *)PACKAGE_BASE_ADDRESS, PKG_ID) >> PKG_ID_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get Device Part Number
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_UTILS_RPN_STM32MP157Cxx
|
||||||
|
* @arg @ref LL_UTILS_RPN_STM32MP157Axx
|
||||||
|
* @arg @ref LL_UTILS_RPN_STM32MP157Fxx
|
||||||
|
* @arg @ref LL_UTILS_RPN_STM32MP157Dxx
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GetDevicePartNumber(void)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(*(uint32_t *)RPN_BASE, RPN_ID) >> RPN_ID_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get Device Version ID
|
||||||
|
* @retval Returned value can be one of the following values:
|
||||||
|
* @arg @ref LL_UTILS_DV_ID_STM32MP15xxx
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GetDeviceVersionDevID(void)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(*(uint32_t *)DV_BASE, DV_DEV_ID) >> DV_DEV_ID_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get Device Version Rev ID
|
||||||
|
* @retval Returned value is Silicon version
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE uint32_t LL_GetDeviceVersionRevID(void)
|
||||||
|
{
|
||||||
|
return (uint32_t)(READ_BIT(*(uint32_t *)DV_BASE, DV_REV_ID) >> DV_REV_ID_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup UTILS_LL_EF_DELAY DELAY
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
#if defined(CORE_CM4)
|
||||||
|
/**
|
||||||
|
* @brief This function configures the Cortex-M SysTick source of the time base.
|
||||||
|
* @param CPU_Frequency Core frequency in Hz. It can be calculated thanks to RCC
|
||||||
|
* helper macro or function @ref LL_RCC_GetSystemClocksFreq
|
||||||
|
* - Use MCU_Frequency structure element returned by function above
|
||||||
|
* @note When a RTOS is used, it is recommended to avoid changing the SysTick
|
||||||
|
* configuration by calling this function, for a delay use rather osDelay RTOS service.
|
||||||
|
* @param Ticks Number of ticks
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
__STATIC_INLINE void LL_InitTick(uint32_t CPU_Frequency, uint32_t Ticks)
|
||||||
|
{
|
||||||
|
/* Configure the SysTick to have interrupt in 1ms time base */
|
||||||
|
SysTick->LOAD = (uint32_t)((CPU_Frequency / Ticks) - 1UL); /* set reload register */
|
||||||
|
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
|
||||||
|
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
|
||||||
|
SysTick_CTRL_ENABLE_Msk; /* Enable the Systick Timer */
|
||||||
|
}
|
||||||
|
|
||||||
|
void LL_Init1msTick(uint32_t CPU_Frequency);
|
||||||
|
void LL_mDelay(uint32_t Delay);
|
||||||
|
#endif /* CORE_CM4 */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @defgroup UTILS_EF_SYSTEM SYSTEM
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
void LL_SetSystemCoreClock(uint32_t CPU_Frequency);
|
||||||
|
ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency,
|
||||||
|
uint32_t HSEBypass,
|
||||||
|
LL_UTILS_PLLsInitTypeDef *UTILS_PLLInitStruct,
|
||||||
|
LL_UTILS_ClkInitTypeDef *UTILS_ClkInitStruct);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* STM32MP1xx_LL_UTILS_H */
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user