Actions

EmSys

Tm4clib-systick-functions

From EdWiki

SysTick Functions

systick_clear()

void systick_clear(void)
SysTick Clear counter Value.

The counter value is cleared. Useful for well defined startup.

systick_disable_counter()

void systick_disable_counter(void)
Disable SysTick Counter.

systick_enable_counter()

void systick_enable_counter(void)
Enable SysTick Counter.

systick_get_calib()

uint32_t systick_get_calib(void)
SysTick Get Calibration Value.

Returns
Current calibration value

systick_get_countflag()

uint8_t systick_get_countflag(void)
SysTick Read the Counter Flag.

The count flag is set when the timer count becomes zero, and is cleared when the flag is read.

Returns
Boolean if flag set.

systick_get_reload()

uint32_t systick_get_reload(void)
SysTick Read the Automatic Reload Value.

Returns
24 bit reload value as uint32_t.

systick_get_value()

uint32_t systick_get_value(void)
Get the current SysTick counter value.

Returns
24 bit current value as uint32_t.

systick_disable_interrupt()

void systick_disable_interrupt(void)
Disable SysTick Interrupt.

systick_enable_interrupt()

void systick_enable_interrupt(void)
Enable SysTick Interrupt.

systick_set_clock_source()

void systick_set_clock_source(uint8_t clocksource)
Set the SysTick Clock Source.

The clock source can be either the AHB clock or the same clock divided by 8.

Parameters
[in] clocksource uint8_t. Clock source from Clock source selection.

systick_set_frequency()

bool systick_set_frequency(uint32_t freq, uint32_t ahb)
SysTick Set clock and frequency of overflow.

This function sets the systick to AHB clock source, and the prescaler to generate interrupts with the desired frequency. The function fails, if the frequency is too low.

Parameters
[in] clocksource uint8_t. Clock source from Clock source selection.

Parameters
[in] freq uint32_t The desired frequency in Hz
[in] ahb uint32_t The current AHB frequency in Hz
Returns
true, if success, false if the desired frequency cannot be set.

systick_set_reload()

void systick_set_reload(uint32_t value)
SysTick Set the Automatic Reload Value.

The counter is set to the reload value when the counter starts and after it reaches zero.

Note
The systick counter value might be undefined upon startup. To get predictable behavior, it is a good idea to set or clear the counter after set reload. systick_clear

Parameters
[in] value uint32_t. 24 bit reload value.