TikuOS: Simple. Ubiquitous. Intelligence, Everywhere.

An open-source operating system for microwatt computers.
Deploy-and-forget embedded systems that run for years on a coin cell or indefinitely on harvested energy.

Core Kernel API Reference

This reference documents the public API surface of the TikuOS kernel. All declarations live in header files under kernel/; include tiku.h to pull in the full platform configuration, then include individual module headers as needed.

The API is organized into five modules, each covering a distinct responsibility of the kernel. Follow the cards below to dive into a specific area.

Modules

Conventions

  • Prefix — all public identifiers use the tiku_ prefix (or TIKU_ for macros and constants).
  • Naming — functions follow tiku_<module>_<action>(); types use the _t suffix; header guards use TIKU_<MODULE>_H_.
  • Memory — everything is statically allocated. There is no heap; all buffers are caller-provided.
  • Return codes — most functions return 0/positive for success, -1 or a negative enum for error. Predicate functions return 0 or 1.
  • ISR safety — functions that must only be called from interrupt context are flagged explicitly in each module's documentation.

Minimal Example

The smallest useful program: a process that blinks an LED once per second using a software timer.

#include "tiku.h"

TIKU_PROCESS(blink_process, "Blink");

static struct tiku_timer timer;

TIKU_PROCESS_THREAD(blink_process, ev, data)
{
    TIKU_PROCESS_BEGIN();

    tiku_common_led1_init();
    tiku_timer_set_event(&timer, TIKU_CLOCK_SECOND);

    while (1) {
        TIKU_PROCESS_WAIT_EVENT_UNTIL(ev == TIKU_EVENT_TIMER);
        tiku_common_led1_toggle();
        tiku_timer_reset(&timer);
    }

    TIKU_PROCESS_END();
}

TIKU_AUTOSTART_PROCESSES(&blink_process);