From 02eb962c234c3934c0d14423ab27955c8affca3d Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Tue, 30 Jul 2019 11:37:38 +0200 Subject: [PATCH] Add readme. --- Makefile | 6 ++--- README.md | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 README.md diff --git a/Makefile b/Makefile index 0574509..e214b0f 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ CROSS_COMPILE ?= -TARGET_FILE ?= distance_app +TARGET_FILE ?= voltage_app CC = $(CROSS_COMPILE)gcc CPP = $(CROSS_COMPILE)cpp @@ -16,7 +16,7 @@ UNIT_TEST_SRC_DIR = test/unit UNIT_TEST_OBJ_DIR = $(OBJ_DIR)/$(UNIT_TEST_SRC_DIR) PREFIX ?= /usr -BIN_INSTALL_DIR ?= $(PREFIX)/bin/$(TARGET_FILE) +BIN_INSTALL_DIR = $(PREFIX)/bin INCLUDES := inc INCLUDES += $(PREFIX)/include/ @@ -57,7 +57,7 @@ all: $(TARGET) install: all install -d $(BIN_INSTALL_DIR) - install -m 0644 $(TARGET) $(BIN_INSTALL_DIR) + install -m 0666 $(TARGET) $(BIN_INSTALL_DIR) uninstall: rm -f $(BIN_INSTALL_DIR)/$(TARGET_FILE) diff --git a/README.md b/README.md new file mode 100644 index 0000000..d1f1516 --- /dev/null +++ b/README.md @@ -0,0 +1,67 @@ +# Voltage app + +Application to read out voltages from ads1115 adc-i2c ad converter. + +## Dependencies + +* `gpio_sys`: +* `i2c_bb`: +* `ads1115`: + +## Installation + +```shell +make install +``` + +Installs `voltage_app` into the directory `$(PREFIX)/bin/`. The default value for `PREFIX` is: `PREFIX=/usr`. To use another location for installation changing the value of the `PREFIX` variable is needed. E.g.: + +```shell +PREFIX=/usr/local/ make install +``` + +## Uninstallation + +```shell +make uninstall +``` + +Removes the files installed with the `install` make target. +> **NOTE:** If `PREFIX` variable was changed during installation process the same value needs to be set for uninstallation. E.g.: + +```shell +PREFIX=/usr/local/ make uninstall +``` + +## Example + +```shell +$ distance_app +Conversation: 3.196V (0x4293). +Conversation: 3.199V (0x42a7). +Conversation: 3.192V (0x4282). +Conversation: 3.186V (0x4261). +Conversation: 3.183V (0x424e). +Conversation: 3.185V (0x425b). +Conversation: 3.178V (0x4236). +Conversation: 3.178V (0x4235). +Conversation: 3.190V (0x4275). +Conversation: 3.181V (0x4243). +Conversation: 3.178V (0x4235). +^CSignal catched: 2 + Shutting down... +``` + +## Additional make targets + +| Target | Meaning | +| --------------- | ------------------------------------------------- | +| all | Build the code, link the application executable. | +| install | Install the application executable. | +| uninstall | Uninstall the application executable. | +| clean | Clean up build artifacts. | +| distclean | Remove all folders created during any build step. | +| build_unit_test | Build the unit tests. | +| exec_unit_test | Execute the unit tests. | +| coverage | Determine code coverage of the unit tests. | +| check | Static code analysis (cppcheck). |