objc

Modules | Macros | Functions
System Runtime

The "system runtime" layer provides low-level functionality specific to the platform. More...

Collaboration diagram for System Runtime:

Modules

 Date and Time
 Methods for manipulating time and date.
 
 Environment
 System methods for reading information about the environment.
 
 Events
 Defines event queue functionality for producer/consumer patterns.
 
 Hashes
 Methods for hash generation, sometimes with hardware acceleration.
 
 Hash Tables
 Methods for hash table creation, insertion, deletion, and lookup.
 
 Memory Management
 Functions for managing and manipulating memory.
 
 String Formatting
 Methods for creating and outputting formatted strings.
 
 Random Number Generation
 System methods for generating random numbers, sometimes using hardware to provide better entropy.
 
 Synchronization Primitives
 Implements various synchronization methods for thread-safe operations.
 
 Threading
 Managing threads and program execution.
 
 Timers
 Periodic and one-shot timers for scheduling tasks.
 
 Pixels
 Managing pixel data, framebuffers, and drawing operations.
 
 Hardware Interfaces
 Managing hardware resources, peripherals, and low-level operations.
 
 Network Interfaces
 Managing network resources, protocols, and low-level operations.
 
 Hardware Devices
 Drivers for external hardware devices.
 

Macros

#define sys_assert(condition)
 Asserts that a condition is true. More...
 

Functions

void sys_init (void)
 Initializes the system on startup. More...
 
void sys_exit (void)
 Cleans up the system on shutdown. More...
 

Detailed Description

The "system runtime" layer provides low-level functionality specific to the platform.

The system runtime includes memory, process and thread management, synchronization primitives, hashes, string formatting, random numbers and timers. When developing for a new platform, you will need to implement the functions in these modules. The implementation will depend on the specific platform's capabilities and requirements.

When using this module, you should include this header file and link against the appropriate implementation for your platform. In your entrypoint file, you should call sys_init() to initialize the system, and sys_exit() to clean up resources before exiting.

There is a set of tests that can be run to verify the functionality of the system runtime. These tests can be found in the tests directory.

Macro Definition Documentation

◆ sys_assert

#define sys_assert (   condition)
Value:
if (!(condition)) { \
sys_panicf("ASSERT FAIL: %s", #condition); \
}

Asserts that a condition is true.

Parameters
conditionThe condition to check.

If the condition is false, it will call panicf with an assertion failure message, including the condition, file name, and line number.

Examples:
examples/Network/ntp/main.m.

Definition at line 25 of file assert.h.

Function Documentation

◆ sys_exit()

void sys_exit ( void  )

Cleans up the system on shutdown.

This function should be called at the end of the program to perform any necessary cleanup tasks, such as releasing resources and shutting down subsystems. It prepares the system for termination.

Examples:
clock/main.c, examples/runtime/gpio/main.c, examples/runtime/infrared/main.c, examples/runtime/led/main.c, examples/runtime/ntp/main.c, examples/runtime/watchdog/main.c, examples/runtime/wificonnect/main.c, and examples/runtime/wifiscan/main.c.

◆ sys_init()

void sys_init ( void  )

Initializes the system on startup.

This function must be called at the start of the program to initialize the system environment, including standard input/output streams and any necessary subsystems. It prepares the system for normal operation. It may include platform-specific initialization steps.

Examples:
clock/main.c, examples/runtime/gpio/main.c, examples/runtime/infrared/main.c, examples/runtime/led/main.c, examples/runtime/ntp/main.c, examples/runtime/watchdog/main.c, examples/runtime/wificonnect/main.c, and examples/runtime/wifiscan/main.c.