Sample program for STM32F103 variants library. (Bluepill, Maple Mini, Nucleo F103 with external 8MHz crystal.)

Dependencies:   STM32F103variants mbed-dev

stm32f103variants_main.cpp

Committer:
vargham
Date:
2017-02-24
Revision:
0:a8f641de0e6c
Child:
1:56dc19b2d617

File content as of revision 0:a8f641de0e6c:

#define USE_BOARD USE_OTHER //Use this for unmodified Nucleo-F103 and other boards. The library will do nothing and there will be no compile errors.
//#define USE_BOARD USE_BLUEPILL //Use this for STM32F103C8T6 board AKA the Bluepill.
//#define USE_BOARD USE_MAPLE_MINI //Use this for STM32F103CBT6 board AKA the Maple Mini.
//#define USE_BOARD USE_NUCLEO_EXTOSC //Use this for modified Nucleo-F103. (Added 8MHz crystal)

#include "stm32f103variants.h"
#include "mbed.h"

DigitalOut led1(LED1);
Serial serialPc(PA_9, PA_10);  //Tx, Rx

int main()
{
    confSysClock();
    serialPc.baud(460800);
    serialPc.printf("This is a STM32F103 test.\r\n");
    serialPc.printf("Selected board: %d\r\n", USE_BOARD);
    serialPc.printf("CPU SystemCoreClock is %d Hz\r\n", SystemCoreClock);
    
    while (true)
    {
        led1 != led1;
        wait(1.0);
    }
}