Package: calvos
CalvOS ProjectOpen Source SW Utilities for Embedded Systemshttps://github.com/calcore-io/calvosOverviewCalvOS system is an open-source (GPL v3 license) set of software utilities for the development of embedded systems in C programming language. CalvOS generates C-code based on user defined inputs for "middleware" SW layers sitting above Hardware Abstraction Layer (HAL) and below Application Layer. This in order to speed up the development of embedded SW applications.MotivationSome level of HAL layers are typically provided by microcontroller manufacturers (e.g., ConfigTools by NXP) or via third party suppliers (e.g., Arduino via "wire" libraries) easing the configuration of MCU features/peripherals or board support packages for development kits, etc. However, is not common to find open source/free SW utilities sitting above such HAL layers.Hence, the motivation for calvos is to provide a set of SW utilities that cover some aspects of those layers above HAL in order to ease the implementation of final embedded SW applications.ScopeThe initial scope of calvos is an "interaction layer" (IL) generator for the Controller Area Network (CAN) communication protocol which is widely used in the automotive industry.This interaction layer automatically generates C-code with APIs and functions to ease the reading/writting, reception/transmission of signals in an user defined CAN network (a template for the definition such CAN network is provided).The generated code is aimed to be easily ported by providing a set of APIs where the user needs to instrument code for the integration of the interaction layer into the target's MCU HAL. Also, the generated code provides APIs for direct interaction with CAN signals of the defined network by the application layers.Initial version of the CAN IL is available (beta version).Future developments will follow in this intended order:SW TimersDe-bouncing for digital inputs/signalsBasic filtering for analog inputsLocal Interconnect (LIN) protocol interaction layerGeneric UART interaction layerCAN Transport ProtocolBasic set of UDS Diagnostics (ISO 14229)User DefinitionsCurrently, the user needs to provide its definitions to the calvos-engine (generator of C-code) using a set of spreadsheet templates (ODS format by default) and then create a calvos project (an XML file).Calvos-engine is organized in components each in charge of determined feature. For example, the component in charge of the CAN interaction layer generation is named "comgen.CAN" and an specific ODS template is provided for the user to design the required CAN network.Future plans include the development of an user interface (for example in the form of an Eclipse IDE plugin or an standalone GUI) for easing the creation of projects.CalvOS SystemCalvOS system will be composed by two main components: calvOS Engine and calvOS User Interface (UI). Now only calvOS Engine is implemented which is controlled via command-line arguments.CalvOS Engine: is the main component processing the user inputs and auto-generating the corresponding C-code. It is mainly developed in python and as such it is a python package named “calvos”.CalvOS UI: will provide an user friendly interface for creating and customizing projects that will, in turn, be processed by the calvOS Engine. CalvOS UI is planned to be an Eclipse IDE plug-in.UsageInstalling CalvosFrom PyPiCalvos engine python package is indexed at PyPi and, therefore, can be installed with apipcommand from python:python -m pip install calvosAlternatively, it can be installed "manually" by downloading the code and installing it locally. See section below.Manual InstallationHere we'll exemplify the installation of a calvos under MS Windows.Ensure python v3.7 or greater is installedCreate a temporal folderc:\calvos(you can use any drive letter and folder name as desired).Get source code fromhttps://github.com/calcore-io/calvosUnzip (if zip was downloaded) and copy the downloaded files to the temporal folderc:\calvos.Folder structure should look as follows (not all contents are shown, just an example)...c:\calvos
+-- calvos-engine
|   +-- calvos
|       +-- comgen
|       +-- common
|       +-- doc
|       +-- __init__.py
|       +-- __main__.py
|   +-- .project
|   +-- .pydevproject
|   +-- README.md
+-- doc
+-- project_example
+-- LICENSE
+-- README.mdGet into thecalvos/calvos-enginefolderc:\>cd calvos\calvos-engineRun python setup.py install command:c:\calvos\calvos-engine>python setup.py installVerify calvos was installed properly by getting the calvos version.c:\>python -m calvos -vVersion should like like:calvos v0.0.4Command Line ArgumentsCalvos accepts the following command-line arguments:ArgumentUsage-h, --helpshow help message and exit.-d DEMO, --demo DEMOWill provide an example calvos project with user input templates in the given DEMO path and will process it. Argument -p is ignored if this argument is provided.-p PROJECT, --project PROJECTRequired (if -d was not provided). Full path with file name of the calvos project to be processed.-l LOG_LEVEL, --log LOG_LEVELOptional. LOG_LEVEL: 0 - Debug, 1 - Info, 2 - Warning, 3 - Error. Default is 1 - Info.-e EXPORT, --export EXPORTOptional. Generated C-code will be exported (copied) into the provided EXPORT path.-b BACKUP, --backup BACKUPOptional. Backups of the overwritten C-code during an export operation will be placed in the provided BACKUP path. This is only used if -e argument was provided.-V, --versionshow program's version number and exit-v, --vershow program's version number and exitDemonstration ProjectAs a starting point, a demonstration project can be generated by the calvos system and exported to a given path. This is achieved by using the line argument-das in the example below:python -m calvos -d c:\demo_projectThis will create the following files:calvos_project.xml: XML project filelocation:c:\demo_project\calvos_project.xmltemplate - CAN Network Definition.ods: Template for CAN Network definitionlocation:c:\demo_project\usr_in\template - CAN Network Definition.odslog.log: Log filelocation:c:\demo_project\log.logFolder "out": Contains the generated C source code for the demo projectIt is useful to get this demo project since by doing so, also the template for the CAN network definition is exported.In order to generate the code of the demo project, run the following command:python -m calvos -p c:\demo_project\calvos_project.xmlIf everything went Ok then the generated source code shall be located in the default output folder:c:\demo_project\outInformation about the project processing and possible warnings/errors found during the processing can be consulted in the generated log file located in the project'srootfolder:c:\demo_project\log.logCAN Interaction Layer User GuideRefer to document "comgen_CAN - Integration Manual.md" for user guide on the integration of a CAN IL with Calvos.