Get started¶
Download library¶
Library is primarly hosted on Github.
Download latest release from releases area on Github
Clone develop branch for latest development
Download from releases¶
All releases are available on Github releases releases area.
Clone from Github¶
First-time clone¶
Download and install
git
if not alreadyOpen console and navigate to path in the system to clone repository to. Use command
cd your_path
Clone repository with one of available
3
optionsRun
git clone --recurse-submodules https://github.com/MaJerle/onewire-uart
command to clone entire repository, including submodulesRun
git clone --recurse-submodules --branch develop https://github.com/MaJerle/onewire-uart
to clone development branch, including submodulesRun
git clone --recurse-submodules --branch master https://github.com/MaJerle/onewire-uart
to clone latest stable branch, including submodules
Navigate to
examples
directory and run favourite example
Update cloned to latest version¶
Open console and navigate to path in the system where your resources repository is. Use command
cd your_path
Run
git pull origin master --recurse-submodules
command to pull latest changes and to fetch latest changes from submodulesRun
git submodule foreach git pull origin master
to update & merge all submodules
Note
This is preferred option to use when you want to evaluate library and run prepared examples. Repository consists of multiple submodules which can be automatically downloaded when cloning and pulling changes from root repository.
Add library to project¶
At this point it is assumed that you have successfully download library, either cloned it or from releases page.
Copy
onewire_uart
folder to your projectAdd
onewire_uart/src/include
folder to include path of your toolchainAdd source files from
onewire_uart/src/
folder to toolchain buildCopy
onewire_uart/src/include/ow/ow_config_template.h
to project folder and rename it toow_config.h
Implement device drivers for UART hardware
Build the project
Configuration file¶
Library comes with template config file, which can be modified according to needs.
This file shall be named ow_config.h
and its default template looks like the one below:
Tip
Check Configuration section for possible configuration settings
/**
* \file ow_config_template.h
* \brief OneWire configuration file
*/
/*
* Copyright (c) 2019 Tilen MAJERLE
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restriction,
* including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* This file is part of OneWire-UART library.
*
* Author: Tilen MAJERLE <tilen@majerle.eu>
* Version: v2.0.0
*/
#ifndef OW_HDR_CONFIG_H
#define OW_HDR_CONFIG_H
/* Rename this file to "ow_config.h" for your application */
/*
* Open "include/ow/ow_config_default.h" and
* copy & replace here settings you want to change values
*/
/* After user configuration, call default config to merge config together */
#include "ow/ow_config_default.h"
#endif /* OW_HDR_CONFIG_H */