Bare-metal configuration for a Bluepill board.

Warning

It does not work with the Mbed Online Compiler.

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

mbed import https://os.mbed.com/users/hudakz/code/Baremetal_Blinky_Bluepill
mbed compile -t GCC_ARM -m bluepill
Committer:
hudakz
Date:
Thu Jun 04 21:46:13 2020 +0000
Revision:
3:90a9ecd02b47
Parent:
0:a04710facbb6
Bare-metal blinky on Bluepill.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hudakz 0:a04710facbb6 1 /* mbed Microcontroller Library
hudakz 0:a04710facbb6 2 *******************************************************************************
hudakz 0:a04710facbb6 3 * Copyright (c) 2016, STMicroelectronics
hudakz 0:a04710facbb6 4 * All rights reserved.
hudakz 0:a04710facbb6 5 *
hudakz 0:a04710facbb6 6 * Redistribution and use in source and binary forms, with or without
hudakz 0:a04710facbb6 7 * modification, are permitted provided that the following conditions are met:
hudakz 0:a04710facbb6 8 *
hudakz 0:a04710facbb6 9 * 1. Redistributions of source code must retain the above copyright notice,
hudakz 0:a04710facbb6 10 * this list of conditions and the following disclaimer.
hudakz 0:a04710facbb6 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
hudakz 0:a04710facbb6 12 * this list of conditions and the following disclaimer in the documentation
hudakz 0:a04710facbb6 13 * and/or other materials provided with the distribution.
hudakz 0:a04710facbb6 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
hudakz 0:a04710facbb6 15 * may be used to endorse or promote products derived from this software
hudakz 0:a04710facbb6 16 * without specific prior written permission.
hudakz 0:a04710facbb6 17 *
hudakz 0:a04710facbb6 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
hudakz 0:a04710facbb6 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
hudakz 0:a04710facbb6 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
hudakz 0:a04710facbb6 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
hudakz 0:a04710facbb6 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
hudakz 0:a04710facbb6 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
hudakz 0:a04710facbb6 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
hudakz 0:a04710facbb6 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
hudakz 0:a04710facbb6 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
hudakz 0:a04710facbb6 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
hudakz 0:a04710facbb6 28 *******************************************************************************
hudakz 0:a04710facbb6 29 */
hudakz 0:a04710facbb6 30 #ifndef MBED_OBJECTS_H
hudakz 0:a04710facbb6 31 #define MBED_OBJECTS_H
hudakz 0:a04710facbb6 32
hudakz 0:a04710facbb6 33 #include "cmsis.h"
hudakz 0:a04710facbb6 34 #include "PortNames.h"
hudakz 0:a04710facbb6 35 #include "PeripheralNames.h"
hudakz 0:a04710facbb6 36 #include "PinNames.h"
hudakz 0:a04710facbb6 37
hudakz 0:a04710facbb6 38 #ifdef __cplusplus
hudakz 0:a04710facbb6 39 extern "C" {
hudakz 0:a04710facbb6 40 #endif
hudakz 0:a04710facbb6 41
hudakz 0:a04710facbb6 42 struct gpio_irq_s {
hudakz 0:a04710facbb6 43 IRQn_Type irq_n;
hudakz 0:a04710facbb6 44 uint32_t irq_index;
hudakz 0:a04710facbb6 45 uint32_t event;
hudakz 0:a04710facbb6 46 PinName pin;
hudakz 0:a04710facbb6 47 };
hudakz 0:a04710facbb6 48
hudakz 0:a04710facbb6 49 struct port_s {
hudakz 0:a04710facbb6 50 PortName port;
hudakz 0:a04710facbb6 51 uint32_t mask;
hudakz 0:a04710facbb6 52 PinDirection direction;
hudakz 0:a04710facbb6 53 __IO uint32_t *reg_in;
hudakz 0:a04710facbb6 54 __IO uint32_t *reg_out;
hudakz 0:a04710facbb6 55 };
hudakz 0:a04710facbb6 56
hudakz 0:a04710facbb6 57 #include "common_objects.h"
hudakz 0:a04710facbb6 58
hudakz 0:a04710facbb6 59 #ifdef __cplusplus
hudakz 0:a04710facbb6 60 }
hudakz 0:a04710facbb6 61 #endif
hudakz 0:a04710facbb6 62
hudakz 0:a04710facbb6 63 #endif