Skip to content

Commit c1f9f29

Browse files
Merge branch 'dev'
2 parents 1c750f4 + 22f67d1 commit c1f9f29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+4350
-305
lines changed

.travis.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
language: C
2+
dist: trusty
3+
env:
4+
global:
5+
- CI40_SDK="OpenWrt-SDK-0.10.4-pistachio-marduk_gcc-5.3.0_musl-1.1.14.Linux-x86_64"
6+
- CI40_SDK_URL="https://downloads.creatordev.io/pistachio/marduk/"
7+
before_install:
8+
- sudo apt-get -qq update
9+
- sudo apt-get install -y gnupg git-core build-essential libssl-dev libncurses5-dev unzip gawk subversion mercurial
10+
script:
11+
- mkdir -p $HOME/build/letmecreatefeed/letmecreate && ln -s $TRAVIS_BUILD_DIR $HOME/build/letmecreatefeed/letmecreate/LetMeCreate
12+
- cp $TRAVIS_BUILD_DIR/miscellaneous/Makefile.devel $HOME/build/letmecreatefeed/letmecreate/Makefile
13+
- cp $TRAVIS_BUILD_DIR/miscellaneous/Config.in.devel $HOME/build/letmecreatefeed/letmecreate/Config.in
14+
- export CI40_FILE_URL="$CI40_SDK_URL$CI40_SDK.tar.bz2"
15+
- echo $CI40_FILE_URL
16+
- cd $HOME/build && wget $CI40_FILE_URL && tar xfj $CI40_SDK.tar.bz2
17+
- cd $CI40_SDK && echo src-link custom $HOME/build/letmecreatefeed/ >> feeds.conf.default
18+
- ./scripts/feeds update -a && ./scripts/feeds install -a
19+
- make package/letmecreate/compile -j1 V=s

CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
cmake_minimum_required(VERSION 2.8)
22

3-
project(LetMeCreate C)
3+
project(LetMeCreate)
44

55

66
set(LETMECREATE_MAJOR_VERSION 1)
7-
set(LETMECREATE_MINOR_VERSION 1)
7+
set(LETMECREATE_MINOR_VERSION 2)
88
set(LETMECREATE_PATCH_VERSION 0)
99
set(LETMECREATE_VERSION ${LETMECREATE_MAJOR_VERSION}.${LETMECREATE_MINOR_VERSION}.${LETMECREATE_PATCH_VERSION})
1010
set(PROJECT_VERSION ${LETMECREATE_VERSION})
@@ -25,8 +25,16 @@ add_library(letmecreate_core SHARED ${core_srcs} ${core_hdrs})
2525
add_library(letmecreate_click SHARED ${click_srcs} ${click_hdrs})
2626
target_link_libraries(letmecreate_click letmecreate_core)
2727

28-
target_compile_definitions(letmecreate_core PUBLIC "LETMECREATE_CORE_DEBUG=$<CONFIG:Debug>")
29-
target_compile_definitions(letmecreate_click PUBLIC "LETMECREATE_CLICK_DEBUG=$<CONFIG:Debug>")
28+
# Export symbols
29+
include(GenerateExportHeader)
30+
generate_export_header(letmecreate_core EXPORT_FILE_NAME "include/letmecreate/core/export.h")
31+
generate_export_header(letmecreate_click EXPORT_FILE_NAME "include/letmecreate/click/export.h")
32+
set_target_properties(letmecreate_core PROPERTIES C_VISIBILITY_PRESET hidden)
33+
set_target_properties(letmecreate_click PROPERTIES C_VISIBILITY_PRESET hidden)
34+
35+
# Enable warnings
36+
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -ggdb3")
37+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wextra -O2")
3038

3139

3240
target_include_directories(

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = "LetMeCreate"
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 1.1.0
41+
PROJECT_NUMBER = 1.2.0
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

Readme.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# LetMeCreate library
22

3+
## Build status
4+
5+
Master
6+
[![Build Status](https://travis-ci.org/francois-berder/LetMeCreate.svg?branch=master)](https://travis-ci.org/francois-berder/LetMeCreate)
7+
8+
9+
Dev
10+
[![Build Status](https://travis-ci.org/francois-berder/LetMeCreate.svg?branch=dev)](https://travis-ci.org/francois-berder/LetMeCreate)
11+
12+
## Introduction
13+
314
This library is a collection of small wrappers for some interfaces of the Ci40. It aims at making easier to develop on this platform. Also, it provides some wrappers for a few clicks. Notice that you cannot compile the library on Ci40 because cmake cannot run on it.
415

516
Interface supported:
@@ -13,23 +24,27 @@ Interface supported:
1324
- ADC
1425

1526
MikroClick board supported:
16-
- Thermo3
17-
- Proximity
18-
- Motion
19-
- Relay (partial support)
20-
- Relay2
21-
- Joystick
22-
- Air quality
23-
- Accel
27+
- 7Seg
2428
- 8x8R (Led Matrix)
29+
- Accel
30+
- ADC
31+
- Air quality
2532
- Alcohol
26-
- IR eclipse
27-
- IR distance
33+
- Bargraph
34+
- CO
2835
- Color
2936
- Color2
30-
- Bargraph
31-
- 7Seg
32-
- ADC
37+
- EVE
38+
- IR distance
39+
- IR eclipse
40+
- Joystick
41+
- Motion
42+
- Opto
43+
- Proximity
44+
- Relay (partial support)
45+
- Relay2
46+
- Relay4 (partial support)
47+
- Thermo3
3348

3449
Examples are installed in /usr/bin/letmecreate_examples.
3550
Tests are installed in /usr/bin/letmecreate_tests.

examples/7seg/main.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/**
2+
* This example shows how to use the 7Seg Click wrapper of the LetMeCreate library.
3+
* It displays number from 0 to 99 in 10seconds.
4+
* It assumes that the 7Seg Click is inserted in Mikrobus 1.
5+
*/
6+
7+
18
#include <letmecreate/letmecreate.h>
29
#include "examples/common.h"
310

examples/CMakeLists.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,19 @@ install(TARGETS letmecreate_7seg_example RUNTIME DESTINATION bin)
5757
add_executable(letmecreate_adc_example adc/main.c)
5858
target_link_libraries(letmecreate_adc_example letmecreate_click letmecreate_core)
5959
install(TARGETS letmecreate_adc_example RUNTIME DESTINATION bin)
60+
61+
add_executable(letmecreate_eve_1_example eve/main.c)
62+
target_link_libraries(letmecreate_eve_1_example letmecreate_click letmecreate_core)
63+
install(TARGETS letmecreate_eve_1_example RUNTIME DESTINATION bin)
64+
65+
add_executable(letmecreate_eve_2_example eve/main2.c)
66+
target_link_libraries(letmecreate_eve_2_example letmecreate_click letmecreate_core)
67+
install(TARGETS letmecreate_eve_2_example RUNTIME DESTINATION bin)
68+
69+
add_executable(letmecreate_eve_3_example eve/main3.c)
70+
target_link_libraries(letmecreate_eve_3_example letmecreate_click letmecreate_core)
71+
install(TARGETS letmecreate_eve_3_example RUNTIME DESTINATION bin)
72+
73+
add_executable(letmecreate_eve_4_example eve/main4.c)
74+
target_link_libraries(letmecreate_eve_4_example letmecreate_click letmecreate_core)
75+
install(TARGETS letmecreate_eve_4_example RUNTIME DESTINATION bin)

examples/accel/main.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/**
2+
* This example shows how to use the Accel Click wrapper of the LetMeCreate to
3+
* obtain 3-axis accelerometer data.
4+
*
5+
* It continuously displays latest accelerometer measurements with at a rate
6+
* of 10Hz. The user has to interrupt the program to exit it by pressing Ctrl+C.
7+
*
8+
* The Accel Click must be inserted in Mikrobus 1 before running this program.
9+
*/
10+
11+
112
#include <linux/spi/spidev.h>
213
#include <signal.h>
314
#include <stdbool.h>
@@ -7,12 +18,11 @@
718

819
static volatile bool running = true;
920

10-
static void exit_program(int signo)
21+
static void exit_program(int __attribute__ ((unused))signo)
1122
{
1223
running = false;
1324
}
1425

15-
1626
int main(void)
1727
{
1828
/* Set signal handler to exit program when Ctrl+c is pressed */

examples/adc/main.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/**
2+
* This example shows how to use the ADC Click wrapper of the LetMeCreate
3+
* library.
4+
*
5+
* It reads ADC values from the four channels. Each value should be in range
6+
* 0..4095. If no wires are connected to the channels of the ADC Click, then
7+
* the values should be random.
8+
*
9+
* The ADC Click must be inserted in Mikrobus 1 before running the program.
10+
*/
11+
112
#include <stdio.h>
213
#include <letmecreate/letmecreate.h>
314

@@ -8,7 +19,7 @@ int main(void)
819
int i = 0;
920

1021
spi_init();
11-
for (; i < 4; ++i) {
22+
for (; i < ADC_CLICK_CHANNEL_COUNT; ++i) {
1223
adc_click_get_raw_value(i, &value);
1324
printf("channel %d value: %u\n", i, value);
1425
}

examples/bargraph/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* This example shows how to use the BarGraph Click wrapper of the LetMeCreate
3+
* library.
4+
*
5+
* It turns on gradually all the LED's from left to right in 2 seconds.
6+
*
7+
* The BarGraph Click must be inserted in Mikrobus 1 before running this program.
8+
*/
9+
110
#include <letmecreate/letmecreate.h>
211
#include "examples/common.h"
312

examples/buzz/main.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
/**
2+
* This example shows a use case of the PWM wrapper of the LetMeCreate library
3+
* to make noise using a Buzz Click.
4+
*
5+
* It does three beeps of 100ms each.
6+
*
7+
* The Buzz Click must be inserted in Mikrobus 1 before running this program.
8+
*/
9+
110
#include <letmecreate/letmecreate.h>
211
#include "examples/common.h"
312

0 commit comments

Comments
 (0)