From 75e16dc06c435b25bb058b1eb58ff00e7726ff23 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Mon, 12 Feb 2018 15:10:00 +0100 Subject: [PATCH] initial commit --- COPYING | 29 +++++ README.rst | 5 + riotgen.egg-info/PKG-INFO | 22 ++++ riotgen.egg-info/SOURCES.txt | 10 ++ riotgen.egg-info/dependency_links.txt | 1 + riotgen.egg-info/entry_points.txt | 3 + riotgen.egg-info/requires.txt | 1 + riotgen.egg-info/top_level.txt | 1 + riotgen/__init__.py | 14 ++ riotgen/__pycache__/__init__.cpython-35.pyc | Bin 0 -> 468 bytes .../__pycache__/application.cpython-35.pyc | Bin 0 -> 2543 bytes riotgen/__pycache__/board.cpython-35.pyc | Bin 0 -> 576 bytes riotgen/__pycache__/driver.cpython-35.pyc | Bin 0 -> 710 bytes riotgen/__pycache__/generator.cpython-35.pyc | Bin 0 -> 696 bytes riotgen/__pycache__/helpers.cpython-35.pyc | Bin 0 -> 2057 bytes riotgen/__pycache__/test.cpython-35.pyc | Bin 0 -> 984 bytes riotgen/application.py | 120 ++++++++++++++++++ riotgen/board.py | 12 ++ riotgen/driver.py | 14 ++ riotgen/generator.py | 23 ++++ riotgen/helpers.py | 64 ++++++++++ riotgen/templates/application/Makefile | 20 +++ riotgen/templates/application/README.md | 9 ++ riotgen/templates/application/main.c | 26 ++++ riotgen/templates/board/Makefile | 0 riotgen/templates/board/Makefile.dep | 0 riotgen/templates/board/Makefile.features | 0 riotgen/templates/board/Makefile.include | 0 riotgen/templates/board/board.c | 0 riotgen/templates/board/board.h | 46 +++++++ riotgen/templates/board/periph_conf.h | 0 riotgen/templates/driver/Makefile | 0 riotgen/templates/driver/driver.c | 0 riotgen/templates/driver/driver.h | 0 riotgen/templates/driver/driver_params.h | 0 riotgen/templates/test/Makefile | 0 riotgen/templates/test/README.md | 0 riotgen/templates/test/main.c | 0 riotgen/test.py | 20 +++ setup.py | 86 +++++++++++++ 40 files changed, 526 insertions(+) create mode 100644 COPYING create mode 100644 README.rst create mode 100644 riotgen.egg-info/PKG-INFO create mode 100644 riotgen.egg-info/SOURCES.txt create mode 100644 riotgen.egg-info/dependency_links.txt create mode 100644 riotgen.egg-info/entry_points.txt create mode 100644 riotgen.egg-info/requires.txt create mode 100644 riotgen.egg-info/top_level.txt create mode 100644 riotgen/__init__.py create mode 100644 riotgen/__pycache__/__init__.cpython-35.pyc create mode 100644 riotgen/__pycache__/application.cpython-35.pyc create mode 100644 riotgen/__pycache__/board.cpython-35.pyc create mode 100644 riotgen/__pycache__/driver.cpython-35.pyc create mode 100644 riotgen/__pycache__/generator.cpython-35.pyc create mode 100644 riotgen/__pycache__/helpers.cpython-35.pyc create mode 100644 riotgen/__pycache__/test.cpython-35.pyc create mode 100644 riotgen/application.py create mode 100644 riotgen/board.py create mode 100644 riotgen/driver.py create mode 100644 riotgen/generator.py create mode 100644 riotgen/helpers.py create mode 100644 riotgen/templates/application/Makefile create mode 100644 riotgen/templates/application/README.md create mode 100644 riotgen/templates/application/main.c create mode 100644 riotgen/templates/board/Makefile create mode 100644 riotgen/templates/board/Makefile.dep create mode 100644 riotgen/templates/board/Makefile.features create mode 100644 riotgen/templates/board/Makefile.include create mode 100644 riotgen/templates/board/board.c create mode 100644 riotgen/templates/board/board.h create mode 100644 riotgen/templates/board/periph_conf.h create mode 100644 riotgen/templates/driver/Makefile create mode 100644 riotgen/templates/driver/driver.c create mode 100644 riotgen/templates/driver/driver.h create mode 100644 riotgen/templates/driver/driver_params.h create mode 100644 riotgen/templates/test/Makefile create mode 100644 riotgen/templates/test/README.md create mode 100644 riotgen/templates/test/main.c create mode 100644 riotgen/test.py create mode 100644 setup.py diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..25e63ef --- /dev/null +++ b/COPYING @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2018, Inria. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..357a192 --- /dev/null +++ b/README.rst @@ -0,0 +1,5 @@ +RIOT generator +============== + +RIOT generator provides a command line interface for generating RIOT source +files for new applications, board support, drivers and tests. \ No newline at end of file diff --git a/riotgen.egg-info/PKG-INFO b/riotgen.egg-info/PKG-INFO new file mode 100644 index 0000000..6749893 --- /dev/null +++ b/riotgen.egg-info/PKG-INFO @@ -0,0 +1,22 @@ +Metadata-Version: 1.1 +Name: riotgen +Version: 0.1.0.dev0 +Summary: riotgen: generator for RIOT application/driver/board code +Home-page: https://github.com/aabadie/riot-generator +Author: Alexandre Abadie +Author-email: alexandre.abadie@inria.fr +License: UNKNOWN +Description-Content-Type: UNKNOWN +Description: UNKNOWN +Keywords: generator code +Platform: any +Classifier: Development Status :: 3 - Alpha +Classifier: Environment :: Console +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: Science/Research +Classifier: License :: OSI Approved :: BSD License +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3.4 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Topic :: Utilities diff --git a/riotgen.egg-info/SOURCES.txt b/riotgen.egg-info/SOURCES.txt new file mode 100644 index 0000000..e45efe1 --- /dev/null +++ b/riotgen.egg-info/SOURCES.txt @@ -0,0 +1,10 @@ +README.rst +riotgen/__init__.py +riotgen/application.py +riotgen/generator.py +riotgen.egg-info/PKG-INFO +riotgen.egg-info/SOURCES.txt +riotgen.egg-info/dependency_links.txt +riotgen.egg-info/entry_points.txt +riotgen.egg-info/requires.txt +riotgen.egg-info/top_level.txt \ No newline at end of file diff --git a/riotgen.egg-info/dependency_links.txt b/riotgen.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/riotgen.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/riotgen.egg-info/entry_points.txt b/riotgen.egg-info/entry_points.txt new file mode 100644 index 0000000..bcb0a6b --- /dev/null +++ b/riotgen.egg-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +riotgen = riotgen:cli + diff --git a/riotgen.egg-info/requires.txt b/riotgen.egg-info/requires.txt new file mode 100644 index 0000000..dca9a90 --- /dev/null +++ b/riotgen.egg-info/requires.txt @@ -0,0 +1 @@ +click diff --git a/riotgen.egg-info/top_level.txt b/riotgen.egg-info/top_level.txt new file mode 100644 index 0000000..b04ab70 --- /dev/null +++ b/riotgen.egg-info/top_level.txt @@ -0,0 +1 @@ +riotgen diff --git a/riotgen/__init__.py b/riotgen/__init__.py new file mode 100644 index 0000000..1b63325 --- /dev/null +++ b/riotgen/__init__.py @@ -0,0 +1,14 @@ +"""RIOT generator is a helper library for bootstraping RIOT code. + +It can be used to generate: +- a new board support with the default structure +- a new driver support +- a new application +- a new test +""" + +__version__ = '0.1.0-dev0' + +import os.path + +from .generator import cli diff --git a/riotgen/__pycache__/__init__.cpython-35.pyc b/riotgen/__pycache__/__init__.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9004c9c5e182cce6895bfc87614c6309e541dfe6 GIT binary patch literal 468 zcmYk2u};G<6h&XsHZ6f}NUUBf(WI;h0V@kgz?8*ufHGnJt9fIyb8A8?r-3L8@ zvJa~PWCIBJ;b{`>-XHHCp2ZR?bc(DK#tS71ENgV4G;^oiRxH?`TT7mts!g>NhfHoY zCUJa6B3G4|qi8&8LG}-Zm+_QY6>d1JoEE;RYwJjC3>AV36dD(*DM>K5$*FPJ1++73 z{=jddvsGP}CRb!^)p>-T;$1vTE|S?)<9fE|65xK%CBYm#5BHI>@w3A4Z;1 cDNSWa%B0@5qpOwGO^Me(OdqjCVHBQ(-~BU+F#rGn literal 0 HcmV?d00001 diff --git a/riotgen/__pycache__/application.cpython-35.pyc b/riotgen/__pycache__/application.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d4ca930c49b8ff7302993b17facc81d87c38d7c GIT binary patch literal 2543 zcmZuy&2rpC5N>JpyVlxkJ8=>c!a_J?53w&?NVzBiajH^9Ot4LbQiW22c_mAIy4nJQ5_#0Y3 z59u%Qt^UD*0faajz)YAJ5SmN617T-LTM$~nkhNf9L*_u}K;}Z|fBu!$O7Wv?W=Ul|H5QD5> z(+S^xgBgMSHwKPFQ}v<~E~9D1MHZ)%7MsTz9~!E6wD;ucHxG{X4x@*U56~cp1dmyi z6!|DUQ6EI5D6&!_pJhcJrTM79m1yULcAy`9EquSmx9Z~{0qW&>V6=zB&c1Rho{*JV zX*oYMgoFC%hBrzloLu@7#0rZ3{c7j5$oNhiAIB`^J5@1~)lMan9g!AN5BDx2*DP{7 zt);ii*Xnu`N=v#3t4E%iIDjFDPKcx*h2r9?L-`Ad6kx6c8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p}j_v=jd8|EYW240FRI#xdl)FQ_HX) zWH`=PuqR_F3b+dG%RYEFvM%a880iMGYZ@-v;F^ozsq9bR46g|$f(4V$b;5WS^bbBu z-Ff$rpr|nunrc?^JVyy^%GO=3tPL;f&=dx;R_>h`i8r0O`w7Csc7!Rz6`f!UEe(LL^qiqo!SFY%v(^wIgmH}08p;**Eu EKdzav&;S4c literal 0 HcmV?d00001 diff --git a/riotgen/__pycache__/generator.cpython-35.pyc b/riotgen/__pycache__/generator.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0fb0c6477e5eea4d0c84d2a8a038b06d99bc107e GIT binary patch literal 696 zcmYk4F>ll`7=~Xbajti{Q-KA<)TL5yXd@&L3qlnIv7jy$ix=dJeIbV(pX{^}osi0( zVPoZAFlS}zPk@QfIk=u3zj>d}&S!sC9?oWy??1kX-wgPLoyN(Z(g;6E6g>L;@B$gGpgih;+joCWFl&vJK}j9F{|HFb%A7s1c$WLG3|}af4)-Aei8W z_8CJntjN>m1=JK@F~ke#0;?%>5|RCbbQiK+-~&)07xURIRfY3gsv2|F7jnHeO(na= zwS;`(q*r8e<(n(*$z`1mUC)ia(x%Us&Rf}CKR-N@q3Rl|=i%V^;P9xGWS>0Uz_50R zJlh1U4nfwm_WHhWTvzM%gogIAbH0k_`QPHH&S->;gzo-g&d$HVkBRQ&&uRJ5SzSuG zkgCyTaLX=~!B=HWKFIMl{eVQ}HgdB5+^3ak_TxSY2@+qB&Szp|TwOP9EjZ0rpL|MT zACKbWPvLVCQ7mL=sx#Lvo4V((-@JPNR*Y-iy`xXH@AH^~-n{niay=v#g;eT8<*b#h px+`PjCX}<^dtsfrH2P(%KRhOxvT1UU4Ly0lM#+Bqh|gH;e*uVInj8QC literal 0 HcmV?d00001 diff --git a/riotgen/__pycache__/helpers.cpython-35.pyc b/riotgen/__pycache__/helpers.cpython-35.pyc new file mode 100644 index 0000000000000000000000000000000000000000..328a21a5e5884820fb0b13b64e0ac286c442499a GIT binary patch literal 2057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J^4S*O!tU%pRS4d4$PJZ;>+!BzZ5A@F0608H=q z45kbuz`_CHz!udSNCt~KY{70CAZmmY=z^$&Km<1)Y#mmCK8PlW7KkSYU>ii|5%?6u z(IfEK2JC|9fjGfjjyR>HKY;Q+{-z#vF&>=##g^c@JXdk9Bbg0xNyT-phFTWd)Jc}D zARzmU7qWB$Wn7u9*IXI@_T$au>T>+PYz9G^i&Y{EJdhecT_rkRCUQc)OCH|w$eNa< z&n4F@W%YUK1;H%mN|?sg&E@So;|V$E=xyAL>v%0gmny`Ee(Sj2;wpZk(8xHWHZ}m~ z*dnU{oI;Iev9Yr_v>@?2i=D=y#ZHKPaAxd5G#56F2Y?5g>I7be@xZ?>dmnbB#aYxR zzWOhU^7wN>YDEem&dYw;-JyFz2(F+#Cj^~LxQe9K6u@#r;OWkF&v-x15FONvo8(a> zm1zh$TScb6$m49_DhCNN{(fr4s|qpxKDY7rDNVyB`30(rPX8`OU-MLsIG=G5%TbZf zbulVbIHF)y1oxN3s;G^q?cws9P3zHs=syE~mp!*{mkoU5QKi_EX@p4}-kB!$_{kQp znt0fFVV + * + * @}} + */ + +#include + +int main(void) +{{ + puts("A generated RIOT application"); + return 0; +}} \ No newline at end of file diff --git a/riotgen/templates/board/Makefile b/riotgen/templates/board/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/board/Makefile.dep b/riotgen/templates/board/Makefile.dep new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/board/Makefile.features b/riotgen/templates/board/Makefile.features new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/board/Makefile.include b/riotgen/templates/board/Makefile.include new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/board/board.c b/riotgen/templates/board/board.c new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/board/board.h b/riotgen/templates/board/board.h new file mode 100644 index 0000000..a201cf3 --- /dev/null +++ b/riotgen/templates/board/board.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) {year} {copyright_group} + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @defgroup boards_{board} {board_name} + * @ingroup boards + * @brief Support for the {board_name} board. + * @{ + * + * @file + * @brief Board specific definitions for the {board_name} + * + * @author Alexandre Abadie + */ + +#ifndef BOARD_H +#define BOARD_H + +#include "cpu.h" +#include "periph_conf.h" +#include "periph_cpu.h" + +#ifdef __cplusplus +extern "C" { +#endif + +{xtimer_config} +{led_defs} +{btn_defs} + +/** + * @brief Initialize board specific hardware + */ +void board_init(void); + +#ifdef __cplusplus +} +#endif + +#endif /* BOARD_H */ +/** @} */ \ No newline at end of file diff --git a/riotgen/templates/board/periph_conf.h b/riotgen/templates/board/periph_conf.h new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/driver/Makefile b/riotgen/templates/driver/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/driver/driver.c b/riotgen/templates/driver/driver.c new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/driver/driver.h b/riotgen/templates/driver/driver.h new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/driver/driver_params.h b/riotgen/templates/driver/driver_params.h new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/test/Makefile b/riotgen/templates/test/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/test/README.md b/riotgen/templates/test/README.md new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/templates/test/main.c b/riotgen/templates/test/main.c new file mode 100644 index 0000000..e69de29 diff --git a/riotgen/test.py b/riotgen/test.py new file mode 100644 index 0000000..a1f21a8 --- /dev/null +++ b/riotgen/test.py @@ -0,0 +1,20 @@ +import logging +import click + +logger = logging.getLogger("riotgen.generator.test") + + +@click.command() +@click.argument('test') +@click.option('--riotbase', '-r', envvar='RIOTBASE') +@click.option('--modules', '-m', multiple=True) +@click.option('--packages', '-p', multiple=True) +@click.option('--features', '-f', multiple=True) +@click.option('--board', envvar='BOARD', default='native') +def test(test, riotbase, modules, packages, features, board): + logger.debug('Generating test %s' % test) + logger.debug('Using modules %s' % ', '.join(modules)) + logger.debug('Using packages %s' % ', '.join(packages)) + logger.debug('Using features %s' % ', '.join(features)) + logger.debug('Targetting board %s' % board) + logger.debug('Using RIOTBASE in %s' % riotbase) diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..f2648b1 --- /dev/null +++ b/setup.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python + +from setuptools import setup +# To use a consistent encoding +from codecs import open +from os import path + +PACKAGE = 'riotgen' + + +def get_long_description(): + # Get the long description from the README file + with open('README.rst', encoding='utf-8') as f: + return f.read() + + +def get_version(): + """Get the version from package __init__.py file.""" + with open(path.join(PACKAGE, '__init__.py'), encoding='utf-8') as f: + for line in f: + if line.startswith('__version__'): + return eval(line.split('=')[-1]) + +setup( + name=PACKAGE, + version=get_version(), + + description='riotgen: generator for RIOT application/driver/board code', + long_description=get_long_description(), + + url='https://github.com/aabadie/riot-generator', + + author='Alexandre Abadie', + author_email='alexandre.abadie@inria.fr', + + license='', + + # See https://pypi.python.org/pypi?%3Aaction=list_classifiers + classifiers=[ + # How mature is this project? Common values are + # 3 - Alpha + # 4 - Beta + # 5 - Production/Stable + 'Development Status :: 3 - Alpha', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: BSD License', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Topic :: Utilities', + ], + + keywords='generator code', + platforms='any', + packages=[PACKAGE], + package_data={'templates': ['riotgen/templates/*']}, + # package_data={'templates': ['templates/application/Makefile', + # 'templates/application/main.c', + # 'templates/application/README.md', + + # 'templates/board/Makefile', + # 'templates/board/Makefile.dep', + # 'templates/board/Makefile.features', + # 'templates/board/Makefile.include', + # 'templates/board/board.h', + # 'templates/board/periph_conf.h', + + # 'templates/driver/Makefile', + # 'templates/driver/driver.h', + # 'templates/driver/driver.c', + # 'templates/driver/driver_params.h', + + # 'templates/test/Makefile', + # 'templates/test/main.c', + # 'templates/test/README.md', + # ]}, + install_requires=['click'], + entry_points={ + 'console_scripts': [ + '{}=riotgen:cli'.format(PACKAGE), + ], + }, +) \ No newline at end of file