Giter Club home page Giter Club logo

libemb's Introduction

libemb
(c) 2011-2012 Stefan Wendler
[email protected]
http://gpio.kaltpost.de/

C-library for ARM-Cortex-M3 based STM32 MCUs and MSP430G2553 MCUs
=================================================================


Introduction
------------

"libemb" is a collection of libraries which try to make things needed in many MCU based projects more convinient. It includes helbers for console output, USART usage, as well es drivers for specific hardware. STM32 version of "libemb" relays on "libopencm3", MSP430 version uses the headers that come with msp430-gcc. 

Currently "libemb" contains the following helper libraries:

* libserial

	- configure default USART to be used as UART for serial communication
	- read-/write to the default UART blocking and non-blocking

* libconio

	- console IO, currently done on the UART configured by "libserial"
	- methods for printing strings and numbers
	- includes tiny version of "printf"

* libshell

	- provide environment needed to build interactive (remote-) shells
	- define commands with descriptions and callback handlers
	- does the argument parsing for you

* libi2c

	- i2c slave 
	- easy I2C command handling (register read/write) from master

And the following driver libraries:

* libnrf24l01

	- API for the Nordic nRF24l01+ wireless module
	- initialization of the SPI bus to communicate with the module
	- helper functions to configure the nRF24l01 into one of its modes: 
		- SB, 
		- ESB
		- ESB with payload
	- helper functions to read/modify the conf-registers of the module


Supported Targets
-----------------

Currently the following ARM-Cortex-M3 targets are supported:

* STM32F100 (tested on the STM32VL Discovery)
* STM32F103 (tested on the IFLAT-32)

And the following MSP430 MCUs are supported:

* MSP430G2553 (tested with TI Launchpad)

MCU/hardware specific stuff is clearly seperated from the rest, so porting to a different target (or base library) should not be a big deal.


Compilation
------------

STM32: "libemb" depends on "libopencm3". The compilation steps described here assume, that you installed "libopencm3" allong with the "summon-arm-toolchain", located in its default location "~/sat". 

MSP430: the project is written for msp430-gcc on Linux (I used v4.5.3 which is available as package on ubuntu). For flashing the "mspdebug" tool was used (also from the Ubuntu package). It is assumed, you installed a working msp430-gcc on your system.


* Compile Libraries for STM32 *

To compile the libraries, change to the toplevel directory "libemb" and issue:

make

* Compile LIbraries for MSP430 *

TARCH=MSP430 make

This will produce the various libraries in the "lib" directory of each of the subprojects.

You could copy the libraries to a location you like, along with the header files under each "src/include" directory of the subprojects, or use the install target as described in the next section.


Installation
------------

* Install for STM32 *

To instal the libraries and headers to the default location which is "$HOME/sat/arm-none-eabi", type the following:

make install

The libraries then go to "$HOME/sat/arm-none-eabi/lib", and the headers go to "$HOME/sat/arm-none-eabi/include/libemb/<subproject>/".


* Install for MSP430 *

To instal the libraries and headers to the default location which is "$HOME/msp430", type the following:

TARCH=MSP430 make install

The libraries then go to "$HOME/msp430/lib", and the headers go to "$HOME/msp430/include/libemb/<subproject>/".


If yout don't like that location specify a different one by setting "INSTDIR":

INSTDIR=<your-location> make install


Compilation of the Tests
------------------------

Within the directory "test", various test firmwares are located (see the README that comes with each test for more information). While compiling the tests, make sure, to do this for the proper target MCU. Currently the targets STM32F103 (which is the default target) and STM32F100 and MSP430 are supported.

To compile the tests for the STM32F100:

TARCH=STM32_100 make test

And to compile the tests for the STM32F103:

TARCH=STM32_103 make test

And for the MSP430G2553:

TARCH=MSP430 make test


To flash a test firmware to your device, you could use the "flash-target" make target which is available in the makefile of each test (not in the toplevel makefile). For more details see the README provided for each test. 


Doxygen Docs
------------

If you installed doxygen on your system, you could generate the HTML-based API documentation by calling:

make gen-docs

This will create the API documentation unter "doc/gen/html" within each subproject.


Tailor to a Different Environment
---------------------------------

If you use a different compiler etc., you could change the settings in the "common_lib.mk" file which is located in the top-level directory of "libemb". To tailor the settings for the test firmwares, edit "common.mk" in the same directory.  


Usage
-----

For usage examples etc. visit the project homepage at: http://gpio.kaltpost.de/

libemb's People

Contributors

wendlers 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.