AKOS  v1.0.0
Documentation
Loading...
Searching...
No Matches
port.h
Go to the documentation of this file.
1/****************************************************************************/
12
13#ifndef PORT_H
14#define PORT_H
15
16#include <stdint.h>
17#include <stddef.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
27void akos_port_systick_init_freq(uint32_t cpu_freq);
28
33
42uint32_t *akos_port_task_stack_init(uint32_t *p_stack,
43 size_t stack_size,
44 void (*pf_task)(void *),
45 void *p_arg);
46
47#define port_disable_interrupts { __asm inline("CPSID I \n"); }
48#define port_enable_interrupts { __asm inline("CPSIE I \n"); }
49
50/* Make PendSV and SysTick the lowest priority interrupts. */
51#define port_setup_PendSV() (*(uint32_t volatile *)0xE000ED20 |= (0xFFU << 16))
52#define port_trigger_PendSV() (*(uint32_t volatile *)0xE000ED04 = (1U << 28))
53
54#define port_SVCHandler SVC_Handler
55#define port_PendSVHandler PendSV_Handler
56#define port_SysTickHandler SysTick_Handler
57
58#ifdef __cplusplus
59}
60#endif
61
62#endif
uint32_t * akos_port_task_stack_init(uint32_t *p_stack, size_t stack_size, void(*pf_task)(void *), void *p_arg)
Build the initial Cortex-M thread stack frame.
Definition port.c:67
void akos_port_start_first_task(void)
Start the first thread by restoring the initial exception context.
Definition port.c:42
void akos_port_systick_init_freq(uint32_t cpu_freq)
Configure SysTick to generate 1ms OS ticks.
Definition port.c:25