Mark3 Realtime Kernel
portcfg.h File Reference

Mark3 Port Configuration. More...

Go to the source code of this file.

Macros

#define KERNEL_NUM_PRIORITIES   (16)
 
#define KERNEL_TIMERS_THREAD_PRIORITY   (KERNEL_NUM_PRIORITIES - 1)
 
#define THREAD_QUANTUM_DEFAULT   (4)
 
#define KERNEL_STACK_GUARD_DEFAULT   (32)
 
#define PORT_COROUTINE_PRIORITIES   (8)
 
#define AVR   (1)
 
#define K_WORD   uint8_t
 Size of a data word. More...
 
#define K_ADDR   uint16_t
 Size of an address (pointer size) More...
 
#define K_INT   int32_t
 
#define PORT_PRIO_TYPE   uint8_t
 Type used for bitmap in the PriorityMap class. More...
 
#define PORT_PRIO_MAP_WORD_SIZE   (1)
 size of PORT_PRIO_TYPE in bytes More...
 
#define PORT_SYSTEM_FREQ   ((uint32_t)16000000)
 CPU Frequency in Hz. More...
 
#define PORT_TIMER_FREQ   ((uint32_t)(PORT_SYSTEM_FREQ / 1000))
 Fixed timer interrupt frequency. More...
 
#define PORT_KERNEL_DEFAULT_STACK_SIZE   ((K_ADDR)384)
 
#define PORT_KERNEL_TIMERS_THREAD_STACK   ((K_ADDR)384)
 
#define PORT_TIMER_COUNT_TYPE   uint16_t
 Timer counter type. More...
 
#define PORT_MIN_TIMER_TICKS   (0)
 
#define PORT_OVERLOAD_NEW   (1)
 
#define PORT_STACK_GROWS_DOWN   (1)
 
#define PORT_USE_HW_CLZ   (1)
 

Detailed Description

Mark3 Port Configuration.

This file is used to configure the kernel for your specific target CPU in order to provide the optimal set of features for a given use case.

!! NOTE: This file must ONLY be included from mark3cfg.h

Definition in file portcfg.h.

Macro Definition Documentation

◆ AVR

#define AVR   (1)

Define a macro indicating the CPU architecture for which this port belongs.

This may also be set by the toolchain, but that's not guaranteed.

Definition at line 55 of file portcfg.h.

◆ K_ADDR

#define K_ADDR   uint16_t

Size of an address (pointer size)

Definition at line 63 of file portcfg.h.

◆ K_INT

#define K_INT   int32_t

Definition at line 64 of file portcfg.h.

◆ K_WORD

#define K_WORD   uint8_t

◆ KERNEL_NUM_PRIORITIES

#define KERNEL_NUM_PRIORITIES   (16)

Define the number of thread priorities that the kernel's scheduler will support. The number of thread priorities is limited only by the memory of the host CPU, as a ThreadList object is statically-allocated for each thread priority.

In practice, systems rarely need more than 32 priority levels, with the most complex having the capacity for 256.

Definition at line 35 of file portcfg.h.

◆ KERNEL_STACK_GUARD_DEFAULT

#define KERNEL_STACK_GUARD_DEFAULT   (32)

Definition at line 41 of file portcfg.h.

◆ KERNEL_TIMERS_THREAD_PRIORITY

#define KERNEL_TIMERS_THREAD_PRIORITY   (KERNEL_NUM_PRIORITIES - 1)

Definition at line 37 of file portcfg.h.

◆ PORT_COROUTINE_PRIORITIES

#define PORT_COROUTINE_PRIORITIES   (8)

Set the number of priorities supported by the coroutine scheduler. The number of coroutine priorities is limited by the memory of the host CPU.

Definition at line 47 of file portcfg.h.

◆ PORT_KERNEL_DEFAULT_STACK_SIZE

◆ PORT_KERNEL_TIMERS_THREAD_STACK

#define PORT_KERNEL_TIMERS_THREAD_STACK   ((K_ADDR)384)

Define the size of the kernel-timer thread stack (if one is configured)

Definition at line 101 of file portcfg.h.

◆ PORT_MIN_TIMER_TICKS

#define PORT_MIN_TIMER_TICKS   (0)

Minimum number of timer ticks for any delay or sleep, required to ensure that a timer cannot be initialized to a negative value.

Definition at line 112 of file portcfg.h.

◆ PORT_OVERLOAD_NEW

#define PORT_OVERLOAD_NEW   (1)

Set this to 1 to overload the system's New/Free functions with the kernel's allocator functions. A user must configure the Kernel's allocator functions to point to a real heap implementation backed with real memory in order to use dynamic object creation.

Definition at line 119 of file portcfg.h.

◆ PORT_PRIO_MAP_WORD_SIZE

#define PORT_PRIO_MAP_WORD_SIZE   (1)

size of PORT_PRIO_TYPE in bytes

Definition at line 74 of file portcfg.h.

◆ PORT_PRIO_TYPE

#define PORT_PRIO_TYPE   uint8_t

Type used for bitmap in the PriorityMap class.

Set a base datatype used to represent each element of the scheduler's priority bitmap.

PORT_PRIO_MAP_WORD_SIZE should map to the size of an element of type PORT_PROI_TYPE.

Definition at line 73 of file portcfg.h.

◆ PORT_STACK_GROWS_DOWN

#define PORT_STACK_GROWS_DOWN   (1)

Set this to 1 if the stack grows down in the target architecture, or 0 if the stack grows up

Definition at line 124 of file portcfg.h.

◆ PORT_SYSTEM_FREQ

#define PORT_SYSTEM_FREQ   ((uint32_t)16000000)

CPU Frequency in Hz.

Define the running CPU frequency. This may be an integer constant, or an alias for another variable which holds the CPU's current running frequency.

Definition at line 81 of file portcfg.h.

◆ PORT_TIMER_COUNT_TYPE

#define PORT_TIMER_COUNT_TYPE   uint16_t

Timer counter type.

Define the native type corresponding to the kernel timer hardware's counter register.

Definition at line 106 of file portcfg.h.

◆ PORT_TIMER_FREQ

#define PORT_TIMER_FREQ   ((uint32_t)(PORT_SYSTEM_FREQ / 1000))

Fixed timer interrupt frequency.

Set the timer frequency. If running in tickless mode, this is simply the frequency at which the free-running kernel timer increments.

In tick-based mode, this is the frequency at which the fixed-frequency kernel tick interrupt occurs.

Definition at line 91 of file portcfg.h.

◆ PORT_USE_HW_CLZ

#define PORT_USE_HW_CLZ   (1)

Set this to 1 if the target CPU/toolchain supports an optimized Count-leading-zeros instruction, or count-leading-zeros intrinsic. If such functionality is not available, a general-purpose implementation will be used.

Definition at line 131 of file portcfg.h.

◆ THREAD_QUANTUM_DEFAULT

#define THREAD_QUANTUM_DEFAULT   (4)

Definition at line 39 of file portcfg.h.