mirror of https://github.com/ARMmbed/mbed-os.git
STM32L1 : targets restructuration
- alignment with other STM32 familiespull/14337/head
parent
95ebb3d7b6
commit
6b57fd48a8
|
|
@ -1,9 +1,11 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_subdirectory(TARGET_MOTE_L152RC EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_NUCLEO_L152RE EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_XDOT_L151CC EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_STM32L151xC EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_STM32L152xC EXCLUDE_FROM_ALL)
|
||||
add_subdirectory(TARGET_STM32L152xE EXCLUDE_FROM_ALL)
|
||||
|
||||
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)
|
||||
|
||||
add_library(mbed-stm32l1 INTERFACE)
|
||||
|
||||
|
|
@ -16,73 +18,11 @@ target_sources(mbed-stm32l1
|
|||
pwmout_device.c
|
||||
serial_device.c
|
||||
spi_api.c
|
||||
|
||||
device/stm32l1xx_hal.c
|
||||
device/stm32l1xx_hal_adc.c
|
||||
device/stm32l1xx_hal_adc_ex.c
|
||||
device/stm32l1xx_hal_comp.c
|
||||
device/stm32l1xx_hal_cortex.c
|
||||
device/stm32l1xx_hal_crc.c
|
||||
device/stm32l1xx_hal_cryp.c
|
||||
device/stm32l1xx_hal_cryp_ex.c
|
||||
device/stm32l1xx_hal_dac.c
|
||||
device/stm32l1xx_hal_dac_ex.c
|
||||
device/stm32l1xx_hal_dma.c
|
||||
device/stm32l1xx_hal_flash.c
|
||||
device/stm32l1xx_hal_flash_ex.c
|
||||
device/stm32l1xx_hal_flash_ramfunc.c
|
||||
device/stm32l1xx_hal_gpio.c
|
||||
device/stm32l1xx_hal_i2c.c
|
||||
device/stm32l1xx_hal_i2s.c
|
||||
device/stm32l1xx_hal_irda.c
|
||||
device/stm32l1xx_hal_iwdg.c
|
||||
device/stm32l1xx_hal_lcd.c
|
||||
device/stm32l1xx_hal_nor.c
|
||||
device/stm32l1xx_hal_opamp.c
|
||||
device/stm32l1xx_hal_opamp_ex.c
|
||||
device/stm32l1xx_hal_pcd.c
|
||||
device/stm32l1xx_hal_pcd_ex.c
|
||||
device/stm32l1xx_hal_pwr.c
|
||||
device/stm32l1xx_hal_pwr_ex.c
|
||||
device/stm32l1xx_hal_rcc.c
|
||||
device/stm32l1xx_hal_rcc_ex.c
|
||||
device/stm32l1xx_hal_rtc.c
|
||||
device/stm32l1xx_hal_rtc_ex.c
|
||||
device/stm32l1xx_hal_sd.c
|
||||
device/stm32l1xx_hal_smartcard.c
|
||||
device/stm32l1xx_hal_spi.c
|
||||
device/stm32l1xx_hal_spi_ex.c
|
||||
device/stm32l1xx_hal_sram.c
|
||||
device/stm32l1xx_hal_tim.c
|
||||
device/stm32l1xx_hal_tim_ex.c
|
||||
device/stm32l1xx_hal_uart.c
|
||||
device/stm32l1xx_hal_usart.c
|
||||
device/stm32l1xx_hal_wwdg.c
|
||||
device/stm32l1xx_ll_adc.c
|
||||
device/stm32l1xx_ll_comp.c
|
||||
device/stm32l1xx_ll_crc.c
|
||||
device/stm32l1xx_ll_dac.c
|
||||
device/stm32l1xx_ll_dma.c
|
||||
device/stm32l1xx_ll_exti.c
|
||||
device/stm32l1xx_ll_fsmc.c
|
||||
device/stm32l1xx_ll_gpio.c
|
||||
device/stm32l1xx_ll_i2c.c
|
||||
device/stm32l1xx_ll_opamp.c
|
||||
device/stm32l1xx_ll_pwr.c
|
||||
device/stm32l1xx_ll_rcc.c
|
||||
device/stm32l1xx_ll_rtc.c
|
||||
device/stm32l1xx_ll_sdmmc.c
|
||||
device/stm32l1xx_ll_spi.c
|
||||
device/stm32l1xx_ll_tim.c
|
||||
device/stm32l1xx_ll_usart.c
|
||||
device/stm32l1xx_ll_utils.c
|
||||
device/system_stm32l1xx.c
|
||||
)
|
||||
|
||||
target_include_directories(mbed-stm32l1
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-stm32l1 INTERFACE mbed-stm)
|
||||
target_link_libraries(mbed-stm32l1 INTERFACE mbed-stm mbed-stm32l1cube-fw)
|
||||
|
|
|
|||
|
|
@ -48,8 +48,12 @@ typedef enum {
|
|||
UART_1 = (int)USART1_BASE,
|
||||
UART_2 = (int)USART2_BASE,
|
||||
UART_3 = (int)USART3_BASE,
|
||||
#if defined UART4_BASE
|
||||
UART_4 = (int)UART4_BASE,
|
||||
#endif
|
||||
#if defined UART5_BASE
|
||||
UART_5 = (int)UART5_BASE
|
||||
#endif
|
||||
} UARTName;
|
||||
|
||||
#define DEVICE_SPI_COUNT 3
|
||||
|
|
@ -1,7 +1,9 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
target_sources(mbed-core
|
||||
add_library(mbed-stm32l1cube-fw INTERFACE)
|
||||
|
||||
target_sources(mbed-stm32l1cube-fw
|
||||
INTERFACE
|
||||
STM32L1xx_HAL_Driver/stm32l1xx_hal.c
|
||||
STM32L1xx_HAL_Driver/stm32l1xx_hal_adc.c
|
||||
|
|
@ -65,7 +67,7 @@ target_sources(mbed-core
|
|||
system_stm32l1xx.c
|
||||
)
|
||||
|
||||
target_include_directories(mbed-core
|
||||
target_include_directories(mbed-stm32l1cube-fw
|
||||
INTERFACE
|
||||
.
|
||||
CMSIS
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32l152xc.S)
|
||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32L152XC.ld)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32l152xc.S)
|
||||
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32l152rc.sct)
|
||||
endif()
|
||||
|
||||
add_library(mbed-mote-l152rc INTERFACE)
|
||||
|
||||
target_sources(mbed-mote-l152rc
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
device/system_clock.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
target_include_directories(mbed-mote-l152rc
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-mote-l152rc ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-mote-l152rc INTERFACE mbed-stm32l1)
|
||||
|
|
@ -1,79 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2014, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef MBED_PERIPHERALNAMES_H
|
||||
#define MBED_PERIPHERALNAMES_H
|
||||
|
||||
#include "cmsis.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
ADC_1 = (int)ADC1_BASE
|
||||
} ADCName;
|
||||
|
||||
typedef enum {
|
||||
DAC_1 = (int)DAC_BASE
|
||||
} DACName;
|
||||
|
||||
typedef enum {
|
||||
UART_1 = (int)USART1_BASE,
|
||||
UART_2 = (int)USART2_BASE,
|
||||
UART_3 = (int)USART3_BASE
|
||||
} UARTName;
|
||||
|
||||
#define DEVICE_SPI_COUNT 3
|
||||
typedef enum {
|
||||
SPI_1 = (int)SPI1_BASE,
|
||||
SPI_2 = (int)SPI2_BASE,
|
||||
SPI_3 = (int)SPI3_BASE
|
||||
} SPIName;
|
||||
|
||||
typedef enum {
|
||||
I2C_1 = (int)I2C1_BASE,
|
||||
I2C_2 = (int)I2C2_BASE
|
||||
} I2CName;
|
||||
|
||||
typedef enum {
|
||||
PWM_2 = (int)TIM2_BASE,
|
||||
PWM_3 = (int)TIM3_BASE,
|
||||
PWM_4 = (int)TIM4_BASE,
|
||||
PWM_5 = (int)TIM5_BASE,
|
||||
PWM_9 = (int)TIM9_BASE,
|
||||
PWM_10 = (int)TIM10_BASE,
|
||||
PWM_11 = (int)TIM11_BASE
|
||||
} PWMName;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2014, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_NVIC_H
|
||||
#define MBED_CMSIS_NVIC_H
|
||||
|
||||
// STM32L152RC
|
||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
||||
// MCU Peripherals: 57 vectors = 228 bytes from 0x40 to 0x123
|
||||
// Total: 73 vectors = 292 bytes (0x124) to be reserved in RAM
|
||||
#define NVIC_NUM_VECTORS 73
|
||||
#define NVIC_RAM_VECTOR_ADDRESS 0x20000000 // Vectors positioned at start of RAM
|
||||
|
||||
#endif
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2016, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef MBED_OBJECTS_H
|
||||
#define MBED_OBJECTS_H
|
||||
|
||||
#include "cmsis.h"
|
||||
#include "PortNames.h"
|
||||
#include "PeripheralNames.h"
|
||||
#include "PinNames.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct gpio_irq_s {
|
||||
IRQn_Type irq_n;
|
||||
uint32_t irq_index;
|
||||
uint32_t event;
|
||||
PinName pin;
|
||||
};
|
||||
|
||||
struct port_s {
|
||||
PortName port;
|
||||
uint32_t mask;
|
||||
PinDirection direction;
|
||||
__IO uint32_t *reg_in;
|
||||
__IO uint32_t *reg_out;
|
||||
};
|
||||
|
||||
#define GPIO_IP_WITHOUT_BRR
|
||||
#include "common_objects.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32l152xe.S)
|
||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32L152XE.ld)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32l152xe.S)
|
||||
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32l152re.sct)
|
||||
endif()
|
||||
|
||||
add_library(mbed-nucleo-l152re INTERFACE)
|
||||
|
||||
target_sources(mbed-nucleo-l152re
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
device/system_clock.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
target_include_directories(mbed-nucleo-l152re
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-nucleo-l152re ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-nucleo-l152re INTERFACE mbed-stm32l1)
|
||||
|
|
@ -1,63 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2016, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef MBED_OBJECTS_H
|
||||
#define MBED_OBJECTS_H
|
||||
|
||||
#include "cmsis.h"
|
||||
#include "PortNames.h"
|
||||
#include "PeripheralNames.h"
|
||||
#include "PinNames.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct gpio_irq_s {
|
||||
IRQn_Type irq_n;
|
||||
uint32_t irq_index;
|
||||
uint32_t event;
|
||||
PinName pin;
|
||||
};
|
||||
|
||||
struct port_s {
|
||||
PortName port;
|
||||
uint32_t mask;
|
||||
PinDirection direction;
|
||||
__IO uint32_t *reg_in;
|
||||
__IO uint32_t *reg_out;
|
||||
};
|
||||
|
||||
#include "common_objects.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
* 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
|
||||
*
|
||||
* 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 __US_TICKER_DATA_H
|
||||
#define __US_TICKER_DATA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l1xx.h"
|
||||
#include "stm32l1xx_ll_tim.h"
|
||||
#include "cmsis_nvic.h"
|
||||
|
||||
#define TIM_MST TIM5
|
||||
#define TIM_MST_IRQ TIM5_IRQn
|
||||
#define TIM_MST_RCC __TIM5_CLK_ENABLE()
|
||||
#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5()
|
||||
|
||||
#define TIM_MST_RESET_ON __TIM5_FORCE_RESET()
|
||||
#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET()
|
||||
|
||||
#define TIM_MST_BIT_WIDTH 32 // 16 or 32
|
||||
|
||||
#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __US_TICKER_DATA_H
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_subdirectory(TARGET_XDOT_L151CC EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32l151xc.S)
|
||||
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32l151xc.ld)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32l151xc.S)
|
||||
set(LINKER_FILE TOOLCHAIN_ARM/stm32l151xc.sct)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
|
||||
set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32l151xc.S)
|
||||
set(LINKER_FILE TOOLCHAIN_IAR/stm32l151xc.icf)
|
||||
endif()
|
||||
|
||||
add_library(mbed-stm32l151xc INTERFACE)
|
||||
|
||||
target_include_directories(mbed-stm32l151xc
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-stm32l151xc
|
||||
INTERFACE
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-stm32l151xc ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-stm32l151xc INTERFACE mbed-stm32l1)
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-xdot-l151cc INTERFACE)
|
||||
|
||||
target_sources(mbed-xdot-l151cc
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
system_clock.c
|
||||
xdot_eeprom.c
|
||||
xdot_low_power.c
|
||||
)
|
||||
|
||||
target_include_directories(mbed-xdot-l151cc
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-xdot-l151cc INTERFACE mbed-stm32l151xc)
|
||||
|
|
@ -190,6 +190,10 @@ typedef enum {
|
|||
NC = (int)0xFFFFFFFF
|
||||
} PinName;
|
||||
|
||||
#define STDIO_UART_TX PA_2
|
||||
#define STDIO_UART_RX PA_3
|
||||
#define STDIO_UART UART_2
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,19 +1,17 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2017 ARM Limited
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (c) 2016-2020 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file configures the system clock as follows:
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/* mbed Microcontroller Library
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_NVIC_H
|
||||
#define MBED_CMSIS_NVIC_H
|
||||
|
||||
#if !defined(MBED_ROM_START)
|
||||
#define MBED_ROM_START 0x8000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x40000 // 256 KB
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x20000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_SIZE)
|
||||
#define MBED_RAM_SIZE 0x8000 // 32 KB
|
||||
#endif
|
||||
|
||||
#define NVIC_NUM_VECTORS 73
|
||||
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_subdirectory(TARGET_MOTE_L152RC EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32l152xc.S)
|
||||
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32l152xc.ld)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32l152xc.S)
|
||||
set(LINKER_FILE TOOLCHAIN_ARM/stm32l152xc.sct)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "IAR")
|
||||
set(STARTUP_FILE TOOLCHAIN_IAR/startup_stm32l152xc.S)
|
||||
set(LINKER_FILE TOOLCHAIN_IAR/stm32l152xc.icf)
|
||||
endif()
|
||||
|
||||
add_library(mbed-stm32l152xc INTERFACE)
|
||||
|
||||
target_include_directories(mbed-stm32l152xc
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-stm32l152xc
|
||||
INTERFACE
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-stm32l152xc ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-stm32l152xc INTERFACE mbed-stm32l1)
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-mote-l152rc INTERFACE)
|
||||
|
||||
target_sources(mbed-mote-l152rc
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
system_clock.c
|
||||
)
|
||||
|
||||
target_include_directories(mbed-mote-l152rc
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-mote-l152rc INTERFACE mbed-stm32l152xc)
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
/* mbed Microcontroller Library
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2016-2020 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_NVIC_H
|
||||
#define MBED_CMSIS_NVIC_H
|
||||
|
||||
#if !defined(MBED_ROM_START)
|
||||
#define MBED_ROM_START 0x8000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_ROM_SIZE)
|
||||
#define MBED_ROM_SIZE 0x40000 // 256 KB
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_START)
|
||||
#define MBED_RAM_START 0x20000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_RAM_SIZE)
|
||||
#define MBED_RAM_SIZE 0x8000 // 32 KB
|
||||
#endif
|
||||
|
||||
#define NVIC_NUM_VECTORS 73
|
||||
#define NVIC_RAM_VECTOR_ADDRESS MBED_RAM_START
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_subdirectory(TARGET_NUCLEO_L152RE EXCLUDE_FROM_ALL)
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32l152xe.S)
|
||||
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32l152xe.ld)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32l152xe.S)
|
||||
set(LINKER_FILE TOOLCHAIN_ARM/stm32l152xe.sct)
|
||||
endif()
|
||||
|
||||
add_library(mbed-stm32l152xe INTERFACE)
|
||||
|
||||
target_include_directories(mbed-stm32l152xe
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_sources(mbed-stm32l152xe
|
||||
INTERFACE
|
||||
${STARTUP_FILE}
|
||||
system_clock.c
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-stm32l152xe ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-stm32l152xe INTERFACE mbed-stm32l1)
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
add_library(mbed-nucleo-l152re INTERFACE)
|
||||
|
||||
target_sources(mbed-nucleo-l152re
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
)
|
||||
|
||||
target_include_directories(mbed-nucleo-l152re
|
||||
INTERFACE
|
||||
.
|
||||
)
|
||||
|
||||
target_link_libraries(mbed-nucleo-l152re INTERFACE mbed-stm32l152xe)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
;********************* (C) COPYRIGHT 2017 STMicroelectronics ********************
|
||||
;******************** (C) COPYRIGHT 2017 STMicroelectronics ********************
|
||||
;* File Name : startup_stm32l152xe.s
|
||||
;* Author : MCD Application Team
|
||||
;* Version : 21-April-2017
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
;* This module performs:
|
||||
;* - Set the initial SP
|
||||
;* - Set the initial PC == Reset_Handler
|
||||
;* - Set the vector table entries with the exceptions ISR
|
||||
;* - Set the vector table entries with the exceptions ISR
|
||||
;* address.
|
||||
;* - Configure the system clock
|
||||
;* - Branches to __main in the C library (which eventually
|
||||
|
|
@ -51,9 +51,9 @@
|
|||
EXPORT __Vectors
|
||||
EXPORT __Vectors_End
|
||||
EXPORT __Vectors_Size
|
||||
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
|
||||
|
||||
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
|
||||
IMPORT |Image$$ARM_LIB_STACK$$ZI$$Limit|
|
||||
__Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
|
||||
DCD Reset_Handler ; Reset Handler
|
||||
DCD NMI_Handler ; NMI Handler
|
||||
DCD HardFault_Handler ; Hard Fault Handler
|
||||
|
|
@ -128,7 +128,7 @@ __Vectors DCD |Image$$ARM_LIB_STACK$$ZI$$Limit| ; Top of Stack
|
|||
DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5
|
||||
DCD 0 ; Reserved
|
||||
DCD COMP_ACQ_IRQHandler ; Comparator Channel Acquisition
|
||||
|
||||
|
||||
__Vectors_End
|
||||
|
||||
__Vectors_Size EQU __Vectors_End - __Vectors
|
||||
|
|
@ -138,10 +138,10 @@ __Vectors_Size EQU __Vectors_End - __Vectors
|
|||
; Reset handler routine
|
||||
Reset_Handler PROC
|
||||
EXPORT Reset_Handler [WEAK]
|
||||
IMPORT __main
|
||||
IMPORT SystemInit
|
||||
IMPORT __main
|
||||
IMPORT SystemInit
|
||||
LDR R0, =SystemInit
|
||||
BLX R0
|
||||
BLX R0
|
||||
LDR R0, =__main
|
||||
BX R0
|
||||
ENDP
|
||||
|
|
@ -237,7 +237,7 @@ Default_Handler PROC
|
|||
EXPORT USB_FS_WKUP_IRQHandler [WEAK]
|
||||
EXPORT TIM6_IRQHandler [WEAK]
|
||||
EXPORT TIM7_IRQHandler [WEAK]
|
||||
EXPORT TIM5_IRQHandler [WEAK]
|
||||
EXPORT TIM5_IRQHandler [WEAK]
|
||||
EXPORT SPI3_IRQHandler [WEAK]
|
||||
EXPORT UART4_IRQHandler [WEAK]
|
||||
EXPORT UART5_IRQHandler [WEAK]
|
||||
|
|
@ -309,6 +309,11 @@ COMP_ACQ_IRQHandler
|
|||
ENDP
|
||||
|
||||
ALIGN
|
||||
END
|
||||
|
||||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
|
||||
;*******************************************************************************
|
||||
; User Stack and Heap initialization
|
||||
;*******************************************************************************
|
||||
|
||||
END
|
||||
|
||||
;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE*****
|
||||
|
|
@ -25,13 +25,13 @@
|
|||
#define MBED_APP_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
|
||||
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
|
||||
# if defined(MBED_BOOT_STACK_SIZE)
|
||||
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
|
||||
# else
|
||||
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
|
||||
# endif
|
||||
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
|
||||
#if defined(MBED_BOOT_STACK_SIZE)
|
||||
#define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
|
||||
#else
|
||||
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Round up VECTORS_SIZE to 8 bytes */
|
||||
|
|
@ -57,6 +57,10 @@ 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
|
||||
|
||||
.equ BootRAM, 0xF108F85F
|
||||
/**
|
||||
|
|
@ -72,8 +76,6 @@ defined in linker script */
|
|||
.weak Reset_Handler
|
||||
.type Reset_Handler, %function
|
||||
Reset_Handler:
|
||||
ldr r0, =_estack
|
||||
mov sp, r0 /* set stack pointer */
|
||||
|
||||
/* Copy the data segment initializers from flash to SRAM */
|
||||
movs r1, #0
|
||||
|
|
@ -91,19 +93,23 @@ LoopCopyDataInit:
|
|||
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
|
||||
/* Call static constructors */
|
||||
//bl __libc_init_array
|
||||
/* Call the application's entry point.*/
|
||||
//bl main
|
||||
bl _start
|
||||
|
||||
LoopForever:
|
||||
b LoopForever
|
||||
|
||||
|
||||
bl _start
|
||||
bx lr
|
||||
bx lr
|
||||
.size Reset_Handler, .-Reset_Handler
|
||||
|
||||
/**
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
;********************* (C) COPYRIGHT 2017 STMicroelectronics ********************
|
||||
;/******************** (C) COPYRIGHT 2017 STMicroelectronics ********************
|
||||
;* File Name : startup_stm32l152xe.s
|
||||
;* Author : MCD Application Team
|
||||
;* Version : 21-April-2017
|
||||
|
|
@ -32,7 +32,7 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
|||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
|
||||
/* This value is normally defined by the tools
|
||||
/* This value is normally defined by the tools
|
||||
to 0x1000 for bare metal and 0x400 for RTOS */
|
||||
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
|
||||
}
|
||||
|
|
@ -1,19 +1,17 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2017 ARM Limited
|
||||
* 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
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
******************************************************************************
|
||||
*
|
||||
* Copyright (c) 2016-2020 STMicroelectronics.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file configures the system clock as follows:
|
||||
|
|
@ -45,15 +43,7 @@ uint8_t SetSysClock_PLL_HSI(void);
|
|||
#endif /* ((CLOCK_SOURCE) & USE_PLL_HSI) */
|
||||
|
||||
|
||||
/**
|
||||
* @brief Configures the System clock source, PLL Multiplier and Divider factors,
|
||||
* AHB/APBx prescalers and Flash settings
|
||||
* @note This function should be called only once the RCC clock configuration
|
||||
* is reset to the default reset state (done in SystemInit() function).
|
||||
* @param None
|
||||
* @retval None
|
||||
*/
|
||||
void SetSysClock(void)
|
||||
MBED_WEAK void SetSysClock(void)
|
||||
{
|
||||
#if ((CLOCK_SOURCE) & USE_PLL_HSE_EXTC)
|
||||
/* 1- Try to start with HSE and external clock */
|
||||
|
|
@ -85,7 +75,7 @@ void SetSysClock(void)
|
|||
/******************************************************************************/
|
||||
/* PLL (clocked by HSE) used as System clock source */
|
||||
/******************************************************************************/
|
||||
uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
|
||||
MBED_WEAK uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
|
||||
{
|
||||
RCC_ClkInitTypeDef RCC_ClkInitStruct;
|
||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
# Copyright (c) 2020 ARM Limited. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
|
||||
set(STARTUP_FILE device/TOOLCHAIN_GCC_ARM/startup_stm32l151xc.S)
|
||||
set(LINKER_FILE device/TOOLCHAIN_GCC_ARM/STM32L151XC.ld)
|
||||
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
|
||||
set(STARTUP_FILE device/TOOLCHAIN_ARM/startup_stm32l151xc.S)
|
||||
set(LINKER_FILE device/TOOLCHAIN_ARM/stm32l151rc.sct)
|
||||
endif()
|
||||
|
||||
add_library(mbed-xdot-l151cc INTERFACE)
|
||||
|
||||
target_sources(mbed-xdot-l151cc
|
||||
INTERFACE
|
||||
PeripheralPins.c
|
||||
device/system_clock.c
|
||||
xdot_eeprom.c
|
||||
xdot_low_power.c
|
||||
${STARTUP_FILE}
|
||||
)
|
||||
|
||||
target_include_directories(mbed-xdot-l151cc
|
||||
INTERFACE
|
||||
.
|
||||
device
|
||||
)
|
||||
|
||||
mbed_set_linker_script(mbed-xdot-l151cc ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
|
||||
|
||||
target_link_libraries(mbed-xdot-l151cc INTERFACE mbed-stm32l1)
|
||||
|
||||
|
||||
# Same target as XDOT_L151CC
|
||||
add_library(mbed-ff1705-l151cc INTERFACE)
|
||||
|
||||
target_link_libraries(mbed-ff1705-l151cc INTERFACE mbed-xdot-l151cc)
|
||||
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2015, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef MBED_PERIPHERALNAMES_H
|
||||
#define MBED_PERIPHERALNAMES_H
|
||||
|
||||
#include "cmsis.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
ADC_1 = (int)ADC1_BASE
|
||||
} ADCName;
|
||||
|
||||
typedef enum {
|
||||
DAC_1 = (int)DAC_BASE
|
||||
} DACName;
|
||||
|
||||
typedef enum {
|
||||
UART_1 = (int)USART1_BASE,
|
||||
UART_2 = (int)USART2_BASE,
|
||||
UART_3 = (int)USART3_BASE
|
||||
} UARTName;
|
||||
|
||||
#define STDIO_UART_TX PA_2
|
||||
#define STDIO_UART_RX PA_3
|
||||
#define STDIO_UART UART_2
|
||||
|
||||
#define DEVICE_SPI_COUNT 3
|
||||
typedef enum {
|
||||
SPI_1 = (int)SPI1_BASE,
|
||||
SPI_2 = (int)SPI2_BASE,
|
||||
SPI_3 = (int)SPI3_BASE
|
||||
} SPIName;
|
||||
|
||||
typedef enum {
|
||||
I2C_1 = (int)I2C1_BASE,
|
||||
I2C_2 = (int)I2C2_BASE
|
||||
} I2CName;
|
||||
|
||||
typedef enum {
|
||||
PWM_2 = (int)TIM2_BASE,
|
||||
PWM_3 = (int)TIM3_BASE,
|
||||
PWM_4 = (int)TIM4_BASE,
|
||||
PWM_5 = (int)TIM5_BASE,
|
||||
PWM_9 = (int)TIM9_BASE,
|
||||
PWM_10 = (int)TIM10_BASE,
|
||||
PWM_11 = (int)TIM11_BASE
|
||||
} PWMName;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,41 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2015, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef MBED_CMSIS_NVIC_H
|
||||
#define MBED_CMSIS_NVIC_H
|
||||
|
||||
// STM32L151CC
|
||||
// CORE: 16 vectors = 64 bytes from 0x00 to 0x3F
|
||||
// MCU Peripherals: 57 vectors = 228 bytes from 0x40 to 0x123
|
||||
// Total: 73 vectors = 292 bytes (0x124) to be reserved in RAM
|
||||
#define NVIC_NUM_VECTORS 73
|
||||
#define NVIC_RAM_VECTOR_ADDRESS 0x20000000 // Vectors positioned at start of RAM
|
||||
|
||||
#endif
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
*******************************************************************************
|
||||
* Copyright (c) 2016, STMicroelectronics
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef MBED_OBJECTS_H
|
||||
#define MBED_OBJECTS_H
|
||||
|
||||
#include "cmsis.h"
|
||||
#include "PortNames.h"
|
||||
#include "PeripheralNames.h"
|
||||
#include "PinNames.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct gpio_irq_s {
|
||||
IRQn_Type irq_n;
|
||||
uint32_t irq_index;
|
||||
uint32_t event;
|
||||
PinName pin;
|
||||
};
|
||||
|
||||
struct port_s {
|
||||
PortName port;
|
||||
uint32_t mask;
|
||||
PinDirection direction;
|
||||
__IO uint32_t *reg_in;
|
||||
__IO uint32_t *reg_out;
|
||||
};
|
||||
|
||||
#define GPIO_IP_WITHOUT_BRR
|
||||
#include "common_objects.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2006-2018 ARM Limited
|
||||
* 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
|
||||
*
|
||||
* 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 __US_TICKER_DATA_H
|
||||
#define __US_TICKER_DATA_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "stm32l1xx.h"
|
||||
#include "stm32l1xx_ll_tim.h"
|
||||
#include "cmsis_nvic.h"
|
||||
|
||||
#define TIM_MST TIM5
|
||||
#define TIM_MST_IRQ TIM5_IRQn
|
||||
#define TIM_MST_RCC __TIM5_CLK_ENABLE()
|
||||
#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5()
|
||||
|
||||
#define TIM_MST_RESET_ON __TIM5_FORCE_RESET()
|
||||
#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET()
|
||||
|
||||
#define TIM_MST_BIT_WIDTH 32 // 16 or 32
|
||||
|
||||
#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __US_TICKER_DATA_H
|
||||
|
||||
|
|
@ -27,13 +27,14 @@
|
|||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef MBED_COMMON_OBJECTS_H
|
||||
#define MBED_COMMON_OBJECTS_H
|
||||
#ifndef MBED_OBJECTS_H
|
||||
#define MBED_OBJECTS_H
|
||||
|
||||
#include "cmsis.h"
|
||||
#include "PortNames.h"
|
||||
#include "PeripheralNames.h"
|
||||
#include "PinNames.h"
|
||||
|
||||
#include "stm32l1xx_ll_usart.h"
|
||||
#include "stm32l1xx_ll_tim.h"
|
||||
#include "stm32l1xx_ll_pwr.h"
|
||||
|
|
@ -44,7 +45,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// temporary workaround
|
||||
#define HAL_I2C_Master_Seq_Receive_IT HAL_I2C_Master_Sequential_Receive_IT
|
||||
#define HAL_I2C_Master_Seq_Transmit_IT HAL_I2C_Master_Sequential_Transmit_IT
|
||||
|
|
@ -52,6 +52,22 @@ extern "C" {
|
|||
#define HAL_I2C_Slave_Seq_Transmit_IT HAL_I2C_Slave_Sequential_Transmit_IT
|
||||
|
||||
|
||||
struct gpio_irq_s {
|
||||
IRQn_Type irq_n;
|
||||
uint32_t irq_index;
|
||||
uint32_t event;
|
||||
PinName pin;
|
||||
};
|
||||
|
||||
struct port_s {
|
||||
PortName port;
|
||||
uint32_t mask;
|
||||
PinDirection direction;
|
||||
__IO uint32_t *reg_in;
|
||||
__IO uint32_t *reg_out;
|
||||
};
|
||||
|
||||
|
||||
struct pwmout_s {
|
||||
PWMName pwm;
|
||||
PinName pin;
|
||||
|
|
@ -141,6 +157,11 @@ struct analogin_s {
|
|||
uint8_t channel;
|
||||
};
|
||||
|
||||
|
||||
#ifndef GPIO_BRR_BR_0
|
||||
#define GPIO_IP_WITHOUT_BRR
|
||||
#endif
|
||||
|
||||
#include "gpio_object.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
@ -148,4 +169,3 @@ struct analogin_s {
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -3410,6 +3410,9 @@
|
|||
"MCU_STM32L1"
|
||||
],
|
||||
"public": false,
|
||||
"extra_labels_add": [
|
||||
"STM32L151xC"
|
||||
],
|
||||
"macros_add": [
|
||||
"STM32L151xC"
|
||||
]
|
||||
|
|
@ -3448,6 +3451,9 @@
|
|||
"MCU_STM32L1"
|
||||
],
|
||||
"public": false,
|
||||
"extra_labels_add": [
|
||||
"STM32L152xC"
|
||||
],
|
||||
"macros_add": [
|
||||
"STM32L152xC"
|
||||
]
|
||||
|
|
@ -3475,6 +3481,9 @@
|
|||
"MCU_STM32L1"
|
||||
],
|
||||
"public": false,
|
||||
"extra_labels_add": [
|
||||
"STM32L152xE"
|
||||
],
|
||||
"macros_add": [
|
||||
"STM32L152xE"
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in New Issue