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.

21 lines
376 B

9 years ago
#include "systick.h"
void systick_setup(uint32_t prescaller)
{
SysTick_CSR = (SysTick_CSR & ~SysTick_CSR_CLKSOURCE) | SysTick_CSR_CLKSOURCE_CORE;
SysTick_RELOAD = prescaller;
SysTick_CSR |= SysTick_CSR_TICKINT | SysTick_CSR_ENABLE;
}
void systick_enable(void)
{
SysTick_CSR |= SysTick_CSR_ENABLE;
}
void systick_disable(void)
{
SysTick_CSR &= ~SysTick_CSR_ENABLE;
}