AKOS  v1.0.0
Documentation
Loading...
Searching...
No Matches
port.h File Reference

Cortex-M3 port API for AKOS. More...

#include <stdint.h>
#include <stddef.h>
Include dependency graph for port.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define port_disable_interrupts   { __asm inline("CPSID I \n"); }
#define port_enable_interrupts   { __asm inline("CPSIE I \n"); }
#define port_setup_PendSV()
#define port_trigger_PendSV()
#define port_SVCHandler
#define port_PendSVHandler
#define port_SysTickHandler   SysTick_Handler

Functions

void akos_port_systick_init_freq (uint32_t cpu_freq)
 Configure SysTick to generate 1ms OS ticks.
void akos_port_start_first_task (void)
 Start the first thread by restoring the initial exception context.
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.

Detailed Description

Cortex-M3 port API for AKOS.

Author
Snoopy3921 - AK Foundation
Date
2026/05/08

Definition in file port.h.

Macro Definition Documentation

◆ port_disable_interrupts

#define port_disable_interrupts   { __asm inline("CPSID I \n"); }

Definition at line 47 of file port.h.

◆ port_enable_interrupts

#define port_enable_interrupts   { __asm inline("CPSIE I \n"); }

Definition at line 48 of file port.h.

◆ port_PendSVHandler

#define port_PendSVHandler ( void)
Value:
PendSV_Handler

Definition at line 55 of file port.h.

◆ port_setup_PendSV

#define port_setup_PendSV ( )
Value:
(*(uint32_t volatile *)0xE000ED20 |= (0xFFU << 16))

Definition at line 51 of file port.h.

◆ port_SVCHandler

#define port_SVCHandler ( void)
Value:
SVC_Handler

Definition at line 54 of file port.h.

◆ port_SysTickHandler

#define port_SysTickHandler   SysTick_Handler

Definition at line 56 of file port.h.

◆ port_trigger_PendSV

#define port_trigger_PendSV ( )
Value:
(*(uint32_t volatile *)0xE000ED04 = (1U << 28))

Definition at line 52 of file port.h.

Function Documentation

◆ akos_port_start_first_task()

void akos_port_start_first_task ( void )

Start the first thread by restoring the initial exception context.

Definition at line 42 of file port.c.

◆ akos_port_systick_init_freq()

void akos_port_systick_init_freq ( uint32_t cpu_freq)

Configure SysTick to generate 1ms OS ticks.

Parameters
cpu_freqCore clock frequency in Hz.

Configure SysTick to generate 1ms OS ticks.

Parameters
cpu_freqCore clock frequency in Hz.

Definition at line 25 of file port.c.

◆ akos_port_task_stack_init()

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.

Parameters
p_stackBase stack buffer.
stack_sizeStack size in 32-bit words.
pf_taskThread entry function.
p_argThread argument.
Returns
Initial top-of-stack pointer.
Parameters
p_stackBase stack buffer.
stack_sizeStack size in 32-bit words.
pf_taskThread entry function.
p_argTask argument.
Returns
Initial top-of-stack pointer.

Definition at line 67 of file port.c.