Basic vanilla C boilerplate for STM32L100xC (Discovery L100C). Uses GCC. This was some class project without much practical use
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#include <common.h>
|
|
|
|
|
|
|
|
#include "utils/usart.h"
|
|
|
|
#include "utils/timebase.h"
|
|
|
|
|
|
|
|
#include "init.h"
|
|
|
|
|
|
|
|
|
|
|
|
void blink(void) {
|
|
|
|
GPIOC_ODR ^= BIT9;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** Called before main() */
|
|
|
|
void SystemInit(void)
|
|
|
|
{
|
|
|
|
init_clock();
|
|
|
|
init_systick();
|
|
|
|
init_gpios();
|
|
|
|
init_usart();
|
|
|
|
|
|
|
|
schedule_timed_task(blink, 500);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
while (1) {
|
|
|
|
delay_ms(1000);
|
|
|
|
GPIOC_ODR ^= BIT8;
|
|
|
|
|
|
|
|
usart_tx_string(USART3, "HELLO\r\n");
|
|
|
|
}
|
|
|
|
}
|