Bare-metal configuration with EventQueue for a Bluepill board.

Warning

It does not work with the Mbed Online Compiler.

Follow these steps to import and compile it with Mbed CLI:

mbed import https://os.mbed.com/users/hudakz/code/Baremetal_EventQue_Bluepill
mbed compile -t GCC_ARM -m bluepill
Committer:
hudakz
Date:
Thu May 14 05:27:57 2020 +0000
Revision:
0:2cf53c219693
Bare-metal configuration with EventQueue for a Bluepill board.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 0:2cf53c219693 1 /* mbed Microcontroller Library
hudakz 0:2cf53c219693 2 *******************************************************************************
hudakz 0:2cf53c219693 3 * Copyright (c) 2014, STMicroelectronics
hudakz 0:2cf53c219693 4 * All rights reserved.
hudakz 0:2cf53c219693 5 *
hudakz 0:2cf53c219693 6 * Redistribution and use in source and binary forms, with or without
hudakz 0:2cf53c219693 7 * modification, are permitted provided that the following conditions are met:
hudakz 0:2cf53c219693 8 *
hudakz 0:2cf53c219693 9 * 1. Redistributions of source code must retain the above copyright notice,
hudakz 0:2cf53c219693 10 * this list of conditions and the following disclaimer.
hudakz 0:2cf53c219693 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
hudakz 0:2cf53c219693 12 * this list of conditions and the following disclaimer in the documentation
hudakz 0:2cf53c219693 13 * and/or other materials provided with the distribution.
hudakz 0:2cf53c219693 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
hudakz 0:2cf53c219693 15 * may be used to endorse or promote products derived from this software
hudakz 0:2cf53c219693 16 * without specific prior written permission.
hudakz 0:2cf53c219693 17 *
hudakz 0:2cf53c219693 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
hudakz 0:2cf53c219693 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
hudakz 0:2cf53c219693 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
hudakz 0:2cf53c219693 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
hudakz 0:2cf53c219693 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
hudakz 0:2cf53c219693 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
hudakz 0:2cf53c219693 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
hudakz 0:2cf53c219693 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
hudakz 0:2cf53c219693 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
hudakz 0:2cf53c219693 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
hudakz 0:2cf53c219693 28 *******************************************************************************
hudakz 0:2cf53c219693 29 */
hudakz 0:2cf53c219693 30 #ifndef MBED_PERIPHERALNAMES_H
hudakz 0:2cf53c219693 31 #define MBED_PERIPHERALNAMES_H
hudakz 0:2cf53c219693 32
hudakz 0:2cf53c219693 33 #include "cmsis.h"
hudakz 0:2cf53c219693 34
hudakz 0:2cf53c219693 35 #ifdef __cplusplus
hudakz 0:2cf53c219693 36 extern "C" {
hudakz 0:2cf53c219693 37 #endif
hudakz 0:2cf53c219693 38
hudakz 0:2cf53c219693 39 typedef enum {
hudakz 0:2cf53c219693 40 ADC_1 = (int)ADC1_BASE
hudakz 0:2cf53c219693 41 } ADCName;
hudakz 0:2cf53c219693 42
hudakz 0:2cf53c219693 43 typedef enum {
hudakz 0:2cf53c219693 44 UART_1 = (int)USART1_BASE,
hudakz 0:2cf53c219693 45 UART_2 = (int)USART2_BASE,
hudakz 0:2cf53c219693 46 UART_3 = (int)USART3_BASE
hudakz 0:2cf53c219693 47 } UARTName;
hudakz 0:2cf53c219693 48
hudakz 0:2cf53c219693 49 #define DEVICE_SPI_COUNT 2
hudakz 0:2cf53c219693 50 typedef enum {
hudakz 0:2cf53c219693 51 SPI_1 = (int)SPI1_BASE,
hudakz 0:2cf53c219693 52 SPI_2 = (int)SPI2_BASE
hudakz 0:2cf53c219693 53 } SPIName;
hudakz 0:2cf53c219693 54
hudakz 0:2cf53c219693 55 typedef enum {
hudakz 0:2cf53c219693 56 I2C_1 = (int)I2C1_BASE,
hudakz 0:2cf53c219693 57 I2C_2 = (int)I2C2_BASE
hudakz 0:2cf53c219693 58 } I2CName;
hudakz 0:2cf53c219693 59
hudakz 0:2cf53c219693 60 typedef enum {
hudakz 0:2cf53c219693 61 PWM_1 = (int)TIM1_BASE,
hudakz 0:2cf53c219693 62 PWM_2 = (int)TIM2_BASE,
hudakz 0:2cf53c219693 63 PWM_3 = (int)TIM3_BASE,
hudakz 0:2cf53c219693 64 PWM_4 = (int)TIM4_BASE
hudakz 0:2cf53c219693 65 } PWMName;
hudakz 0:2cf53c219693 66
hudakz 0:2cf53c219693 67 typedef enum {
hudakz 0:2cf53c219693 68 CAN_1 = (int)CAN1_BASE
hudakz 0:2cf53c219693 69 } CANName;
hudakz 0:2cf53c219693 70
hudakz 0:2cf53c219693 71 #ifdef __cplusplus
hudakz 0:2cf53c219693 72 }
hudakz 0:2cf53c219693 73 #endif
hudakz 0:2cf53c219693 74
hudakz 0:2cf53c219693 75 #endif