Giter Club home page Giter Club logo

charring's Introduction

CharRing

Doxygen documentation can be found here.

CharRing is a simple character ring/circular buffer designed for microcontrollers.

This was designed with microcontrollers in mind, but it might be useful for other purposes as well.

Installation

The fastest way to get started is to run this in your project directory:

VERSION=v1.0
wget https://raw.githubusercontent.com/thefekete/CharRing/$VERSION/charring.c \
https://raw.githubusercontent.com/thefekete/CharRing/$VERSION/charring.h

You can replace v1.0 with master to get the latest.. but it may not be stable yet!

Then just include the charring.h file in your project and add charring.o to the objects in your makefile.

Basic Usage

#include <stdio.h>
#include "charring.h"  // include the header

int main()
{
    // Create a buffer (64 chars here)
    CharRingBuf *my_buf = CharRing_new(64);

    // Add some chars to it
    CharRing_putchar(my_buf, 'A');
    CharRing_putchar(my_buf, 'B');
    CharRing_putchar(my_buf, 'C');

    // Read them back
    while (CharRing_available(my_buf)) {
        putchar(CharRing_getchar(my_buf));
    }
    putchar('\n');

    // Don't forget this!
    CharRing_free(my_buf);
}

charring's People

Contributors

thefekete avatar

Stargazers

Mustafa Ali avatar

Watchers

 avatar James Cloos 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.