Interfaces


Classes

class  miosix::Console

Files

file  arch_registers.h
file  bsp.h
file  console.h
file  delays.h
file  disk.h
file  gpio.h
file  portability.h

Functions

void miosix::shutdown ()
void miosix::reboot ()
void miosix::delayMs (unsigned int mseconds)
void miosix::delayUs (unsigned int useconds)

Detailed Description

Interfaces between kernel and architecture specific code.

Starting from Miosix 1.53 all calls from kernel to architecture specific code is done through a set of functions, classes and macros grouped in a set of header files in the miosix/interfaces folder. There are multiple implementations of these functions/classes, one for each architecture supported by Miosix. This eases portability since adding a new architecture is done by implementing a well defined set of interfaces.

Some of these functions are not designed to be accessed by user code, for example the functions in portability.h are used by the kernel to create threads and perform context switching, while the Disk class in disk.h is used by the filesystem module to read and write from disk. Such functions are marked as \internal and therefore are not visible by default in this doxygen documentation, because are useless for application developers. If there is the need to port Miosix to another platform it is always possible to build the doxygen documentation manually including \internal functions. Using functions which are marked as \internal in user code might lead to undefined behaviour.


Function Documentation

void miosix::delayMs ( unsigned int  mseconds  ) 

Delay function. Accuracy depends on the underlying implementation which is architecture specific.
Delay time can be inaccurate if interrupts are enabled or the kernel is running due to time spent in interrupts and due to preemption.
It is implemented using busy wait, so can be safely used even when the kernel is paused or interrupts are disabled.
If the kernel is running it is *highly* recomended to use Thread::sleep since it gives CPU time to other threads and/or it puts the CPU in low power mode.

Parameters:
mseconds milliseconds to wait

void miosix::delayUs ( unsigned int  useconds  ) 

Delay function. Accuracy depends on the underlying implementation which is architecture specific.
Delay time can be inaccurate if interrupts are enabled or the kernel is running due to time spent in interrupts and due to preemption.
It is implemented using busy wait, so can be safely used even when the kernel is paused or interrupts are disabled.

Parameters:
useconds microseconds to wait. Only values between 1 and 1000 are allowed. For greater delays use Thread::sleep() or delayMs().

void miosix::reboot (  ) 

The difference between this function and miosix_private::IRQsystem_reboot() is that this function disables filesystem (if enabled), serial port (if enabled) while miosix_private::system_reboot() does not do all these things. miosix_private::IRQsystem_reboot() is designed to reboot the system when an unrecoverable error occurs, and is used primarily in kernel code, reboot() is designed to reboot the system in normal conditions.
This function does not return.
WARNING: close all files before using this function, since it unmounts the filesystem.

void miosix::shutdown (  ) 

This function disables filesystem (if enabled), serial port (if enabled) and shuts down the system, usually by putting the procesor in a deep sleep state.
The action to start a new boot is system-specific, can be for example a reset, powercycle or a special GPIO configured to wakeup the processor from deep sleep.
This function does not return.
WARNING: close all files before using this function, since it unmounts the filesystem.


Generated on Mon Aug 30 00:05:00 2010 for Miosix by  doxygen 1.5.9