Giter Site home page Giter Site logo

entropyos's Introduction

EntropyOS ๐ŸŒ

Minimalistic OS for embedded devices

Content ๐Ÿ“‹

Apps ๐Ÿ”ฎ

  • Clock โฐ
  • Calendar ๐Ÿ“…
  • Calculator ๐Ÿ“ฑ
  • Notes ๐Ÿ“
  • Tasks ๐Ÿ“‘
  • Game Center ๐Ÿ•น๏ธ
  • Welcome ๐ŸŽฉ
  • Settings โš™๏ธ

Libraries โš’๏ธ

App Framework ๐Ÿ”‹

Core component of the operating system. Contains user interface abstractions called "widgets" and other useful components.

Button

#include <AppFramework.hpp>
// Initialization
ButtonWidget btn(
  uint16_t positionX,    // Horizontal position of the widget
  uint16_t positionY,    // Vertical position of the widget
  uint16_t width,        // Width of the widget
  uint16_t height,       // Height of the widget
  uint16_t cornerRadius, // Radius of the widget border corners
  uint8_t textAnchorV,   // Vertical postion of the text (1 - top, 2 - center, 3 - bottom)
  uint8_t textAnchorH    // Horizontal position of the text (1 - left, 2 - center, 3 - right)
);

// Widget positioning
btn.setPosition(positionX, positionY); // Set position of the widget
btn.setPositionX(positionX); // Set horizontal position of the widget
btn.setPositionY(positionY); // Set vertical position of the widget

// Widget size configuration
btn.setSize(width, height); // Set size of the widget
btn.setWidth(width);        // Set width of the widget
btn.setHeight(height);      // Set height of the widget

// Widget text positioning
btn.setTextAnchor(textAnchorV, textAnchorH);
btn.setTextAnchorV(textAnchorV); // Set vertical text position of the widget
btn.setTextAnchorH(textAnchorH); // Set horizontal text position of the widget

// Widget state
btn.setFocus(state);         // Set focus state (if true, content color of the widget will be inverted)
btn.setCornerRadius(number); // Set corner radius of the widget border

// Draw widget
btn.draw(const char * text);

TextLabel

#include <AppFramework.hpp>
// Initialization
TextLabelWidget label(
  uint16_t positionX,  // Horizontal position of the widget 
  uint16_t positionY,  // Vertical position of the widget
  uint16_t width,      // Width of the widget
  uint16_t height,     // Height of the widget 
  uint8_t textAnchorV, // Vertical postion of the text (1 - top, 2 - center, 3 - bottom)
  uint8_t textAnchorH  // Horizontal position of the text (1 - left, 2 - center, 3 - right)
);

// Widget positioning
label.setPosition(positionX, positionY); // Set position of the widget
label.setPositionX(positionX); // Set horizontal position of the widget
label.setPositionY(positionY); // Set vertical position of the widget

// Widget size configuration
label.setSize(width, height); // Set size of the widget
label.setWidth(width);        // Set width of the widget
label.setHeight(height);      // Set height of the widget

// Widget text positioning
label.setTextAnchor(textAnchorV, textAnchorH); // Set text position of the widget 
label.setTextAnchorV(textAnchorV); // Set vertical text position of the widget
label.setTextAnchorH(textAnchorH); // Set horizontal text position of the widget

// Draw widget
label.draw(const char * text);

Icon

#include <AppFramework.hpp>
// Initialization
IconWidget icon(
  uint16_t positionX,    // Horizontal position of the widget
  uint16_t positionY,    // Vertical position of the widget
  uint16_t width,        // Width of the widget
  uint16_t height,       // Height of the widget
  bool isBordered,       // Border state. If true, a border will be drawn
  uint16_t cornerRadius, // Radius of the widget border corners
  uint16_t borderPadding // Padding between the border and the widget content
);

// Widget positioning
btn.setPosition(positionX, positionY); // Set position of the widget
btn.setPositionX(positionX); // Set horizontal position of the widget
btn.setPositionY(positionY); // Set vertical position of the widget

// Widget size configuration
btn.setSize(width, height); // Set size of the widget
btn.setWidth(width);        // Set width of the widget
btn.setHeight(height);      // Set height of the widget

// Widget border
btn.setBorder(state);         // Set border state (if true, a border will be drawn)
btn.setCornerRadius(number);  // Set corner radius of the widget border
btn.setBorderPadding(number); // Set the padding between the border and the widget content

// Draw widget
btn.draw(unsigned char xbmImage[]);

Timer โฑ๏ธ

Millis-based ligthweight timer.

// Initialization
Timer tmr(
  uint32_t periodMs, // Timer period in milliseconds
  bool isTimer,      // Timer mode. If true, the timer will stop after one round
  bool isRunning     // Timer state. If true, the timer will start after initialization 
);

// Timer methods
tmr.start();   // Start the timer
tmr.stop();    // Stop the timer
tmr.pause();   // Pause the timer
tmr.resume();  // Resume the timer
tmr.setMode(); // Set the timer mode
tmr.tick();    // Get the timer status

DS1307 โฐ

Dallas Semiconductor DS1307 chip control library.

Usage

#include <DS1307.h>
// Initialization
DS1307 clockChip;

clockChip.read(); // Read data from the chip

clockChip.getSecond();     // Get current second value
clockChip.getMinute();     // Get current minute value
clockChip.getHour();       // Get current hour value
clockChip.getDayOfWeek();  // Get current dayOfWeek value
clockChip.getDayOfMonth(); // Get current dayOfMonth value
clockChip.getMonth();      // Get current month value
clockChip.getYear();       // Get current year value

// Set current time and date data
clockChip.set(
  uint8_t second,     // Seconds (0 - 59)
  uint8_t minute,     // Minutes (0 - 59)
  uint8_t hour,       // Hours (0 - 23)
  uint8_t dayOfWeek,  // Day of week (0 - Sunday, 6 - Saturday)
  uint8_t dayOfMonth, // Day of month (0 - 28/29/30/31)
  uint8_t month,      // Month (1 - 12)
  uint8_t year        // Year (xx00 - xx99);
);

FastString โšก

Static alternative for Arduino String.

Usage

#include <FastString.h>
// Initialization
FastString<BUFFER_SIZE> str;

// Initialization with a value (const char * only)
FastString<BUFFER_SIZE> strValue = "Nothing";

// Buffer operations
str.clearBuffer(); // Clear the buffer
str.getLength();   // Get the string length
str.getCapacity(); // Get the maximum string length (buffer size)
str.getBuffer();   // Get the buffer (char[])

// Addition
str.add(char / char * / const char * / (unsigned) (short, long, long long) int / FastString);
str += char / char * / const char * / (unsigned) (short, long, long long)  int/ FastString;
str = char / char * / const char * / (unsigned) (short, long, long long) int / FastString;
str = str + char / char * / const char * / (unsigned) (short, long, long long) int / FastString;

// Buffer access
// Set a char
str[index] = '1';
str.setCharAt(index, '1');

// Get a char
char chr = str[index];
char chr = str.getCharAt(index, '1');

// Buffer modification
// Remove data with a shift
str.erase(index, '1')
str.erase(index, "value");

// Insert data with a shift
str.insert(index, '1');
str.insert(index, "value");

// Replace data
str.replace(index, '1');
str.replace(index, "value");

entropyos's People

Contributors

xcybercode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.