StratifyLib Documentation

This is the Stratify Application Library documentation. If you consider yourself an expert, you can check out the Stratify OS documentation.


Stratify Lib is a library for Stratify OS applications that makes it easy to access hardware and other system functions (you can also use standard POSIX and C Standard Library functions if that is your style).

If you are new, it would be highly beneficial to quickly read through the naming conventions:

Here are some useful namespaces to check out:

  • hal - Hardware Abstraction Layer
  • calc - Useful software algorithms
  • draw - Drawing on an LCD
  • fmt - Common file formats
  • sys - Access to timers and files and such
  • var - Variable storage in data and strings

Here are a couple of examples to give you an idea about how things work. These are the objects used in the examples.

#include <stfy/hal.hpp> //this will include all namespace classes and add the namespace i.e. "using namespace hal;"
#include <stfy/sys.hpp>
int main(int argc, char * argv[]){
Pin p(2, 10);
Pin button(2,9);
p.init(Pin::OUTPUT); //open the port and configure pin 10 as an output
button.init(Pin::INPUT | Pin::PULLUP); //pin 9 is an input (pulled high)
//toggle p until the button is pressed
while( button.value() != 0 ){
p = false;
p = true;
return 0;

Here is an example of a UART loop back routine.

#include <stfy/hal.hpp>
#include <stfy/var.hpp>
int main(int argc, char * argv[]){
Uart uart(0);
int ret;
String exitCommand = "exit\n";
bool done = false;
char buffer[64];
//loopback UART until exit is entered
while( done == false ){
if( (ret =,64)) > 0 ){
if( exitCommand == buffer ){
done = true;
uart.write(buffer, ret);
return 0;

The best way to learn is to get started: