Code Monkey home page Code Monkey logo

picaso-serial-c-interface's Introduction

Picaso Serial C Interface

Unofficial C library implementation for 4D Systems Serial Environment for Picaso based modules.

For official implementations look for 4D Systems github page.

This library contains only function parts that will turn parameters to correct byte sequences using provided macros for sending and receiving bytes over serial line. Thus this library should be usable in multiple environments and actual libraries.

This implementation also allows to namespace these library functions as user likes to or to use different serial implementations or interfaces. Though, for now asyncronous use is not tested or thought about, but syncronous should work in multiple instances.

NOTE: Only some functions are implemented so far. Feel free to create PR to fill in.

Installation and usage

Copy or use git submodule to get this library into e.g. subfolder "lib" of your project/library. Create 2 files based on 4d_pse2_example.h and 4d_pse2_example.c in your project and make sure the include directives work correctly. You can use relative paths or add this library to gcc search path.

The idea is that you will compile the file you created instead of anything from this library directly. This is so we can compile against any functions you define for the write and read methods.

Check next section and the example files to find out how to use the library.

Macros you can and need to define

L4D_PSE2_PUTCHAR required: Define this to be the function name (or callable macro) of function that writes byte to the serial interface. This function/macro doesn't return anything and takes single byte as an argument.

L4D_PSE2_GETCHAR required: Define this to be the function name (or callable macro) of function that reads byte from the serial interface. This function/macro doesn't take argument, but returns 16 bit int (int16_t) and takes no arguments. Negative value means error. Positive is presumed to be single byte (uint8_t).

L4D_PSE2_PUTWORD: You can have more optimal defition to writing word than calling L4D_PSE2_PUTCHAR twice (which is done if this is not defined).

L4D_PSE2_GETWORD: Similar to above. Word implementation of L4D_PSE2_GETCHAR. FIXME: this should be able to return error.

L4D_PSE2_PREFIX: Prefix for all of the types and functions defined in this library. Default prefix is l4d_pse2_. If you define this to be empty, no prefix is added.

picaso-serial-c-interface's People

Watchers

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