This repository has been archived by the owner on Sep 1, 2022. It is now read-only.
forked from wovo/hwlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
903 changed files
with
68,255 additions
and
1,574 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ __codelite.workspace | |
*.lst | ||
*.exe | ||
*.html | ||
_dummy.jpg | ||
bmptk_*_stack.c | ||
_push.bat |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This attic contains stuff that I might (re)use in the future, | ||
but is not currently part of the hwlib library. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
No, this is not the library source: | ||
this directory exists only to make HwLib usable as an Arduino library. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// ========================================================================== | ||
// | ||
// blink the LED on an Arduino Uno | ||
// | ||
// (c) Wouter van Ooijen ([email protected]) 2017 | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
// ========================================================================== | ||
|
||
#include "hwlib.hpp" | ||
|
||
int main( void ){ | ||
|
||
auto ds = hwlib::target::pin_out( hwlib::target::pins::a2 ); | ||
auto oe = hwlib::target::pin_out( hwlib::target::pins::a3 ); | ||
auto stcp = hwlib::target::pin_out( hwlib::target::pins::a4 ); | ||
auto shcp = hwlib::target::pin_out( hwlib::target::pins::a5 ); | ||
|
||
oe.set( 0 ); | ||
auto spi = hwlib::spi_bus_bit_banged_sclk_mosi_miso( | ||
shcp, | ||
ds, | ||
hwlib::pin_in_dummy | ||
); | ||
auto hc595 = hwlib::hc595( spi, stcp ); | ||
|
||
auto leds = hwlib::port_out_from_pins( | ||
hc595.p1, | ||
hc595.p2, | ||
hc595.p3, | ||
hc595.p4, | ||
hc595.p5, | ||
hc595.p6, | ||
hc595.p7 | ||
); | ||
|
||
hwlib::kitt( leds ); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#============================================================================ | ||
# | ||
# simple project makefile (just a main file) | ||
# | ||
# (c) Wouter van Ooijen ([email protected]) 2017 | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
# | ||
#============================================================================ | ||
|
||
# source files in this project (main.* is automatically assumed) | ||
SOURCES := | ||
|
||
# header files in this project | ||
HEADERS := | ||
|
||
# other places to look for files for this project | ||
SEARCH := | ||
|
||
RESULTS += main.lss | ||
|
||
# set RELATIVE to the next higher directory | ||
# and defer to the appropriate Makefile.* there | ||
RELATIVE := .. | ||
include $(RELATIVE)/makefile.link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
############################################################################# | ||
# | ||
# Makefile that defers to subdirectories | ||
# | ||
# (c) Wouter van Ooijen (www.voti.nl) 2016 | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
# | ||
############################################################################# | ||
|
||
SUBDIRS += empty | ||
SUBDIRS += blink | ||
SUBDIRS += hello | ||
SUBDIRS += hd44780-shield | ||
|
||
BUILDDIRS = $(SUBDIRS:%=build-%) | ||
CLEANDIRS = $(SUBDIRS:%=clean-%) | ||
NOTABDIRS = $(SUBDIRS:%=notab-%) | ||
|
||
ifeq ($(OS),Windows_NT) | ||
REMOVE := $(BMPTK)/tools/bmptk-rm | ||
MAKE := bmptk-make | ||
else | ||
REMOVE := rm -rf | ||
MAKE := make | ||
endif | ||
|
||
.phony: clean build run error notab (BUILDDIRS) $(CLEANDIRS) $(NOTABDIRS) | ||
|
||
# include the bmptk makefile, and clean this directory | ||
|
||
clean: $(CLEANDIRS) | ||
$(MAKE) -f makefile.link clean | ||
|
||
# defer to the subdirectories | ||
|
||
$(CLEANDIRS): | ||
$(MAKE) -C $(@:clean-%=%) clean | ||
|
||
build: $(BUILDDIRS) | ||
$(BUILDDIRS): | ||
$(MAKE) -C $(@:build-%=%) build | ||
|
||
notab: $(NOTABDIRS) | ||
$(NOTABDIRS): | ||
$(MAKE) -C $(@:notab-%=%) notab | ||
|
||
# user error handling | ||
|
||
run: error | ||
|
||
MSG = You are trying to run in a library directory. | ||
MSG += Make one of the project source files your current editor file. | ||
|
||
error: | ||
$(error $(MSG) ) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
############################################################################# | ||
# | ||
# makefile.link | ||
# | ||
# common settings and uplink for ARduino Due projects | ||
# | ||
# (c) Wouter van Ooijen ([email protected]) 2017 | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
# | ||
############################################################################# | ||
|
||
# common settings for Arduino Uno projects | ||
TARGET ?= arduino_uno | ||
SERIAL_PORT ?= COM4 | ||
CONSOLE_BAUDRATE ?= 2400 | ||
|
||
ifneq ($(OS),Windows_NT) | ||
SERIAL_BAUDRATE ?= ttyUSB0 | ||
endif | ||
|
||
# defer to the next-level makefile | ||
RELATIVE ?= . | ||
RELATIVE := $(RELATIVE)/.. | ||
include $(RELATIVE)/makefile.link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// ========================================================================== | ||
// | ||
// blink the LED on an Arduino Due | ||
// blink the LED on an Arduino Uno | ||
// | ||
// (c) Wouter van Ooijen ([email protected]) 2017 | ||
// | ||
|
@@ -10,15 +10,9 @@ | |
// | ||
// ========================================================================== | ||
|
||
//! [[blink example]] | ||
#include "hwlib-arduino-due.hpp" | ||
#include "hwlib.hpp" | ||
|
||
int main( void ){ | ||
|
||
// kill the watchdog (ATSAM3X8E specific) | ||
WDT->WDT_MR = WDT_MR_WDDIS; | ||
|
||
auto led = hwlib::target::pin_out( 1, 27 ); | ||
auto led = hwlib::target::pin_out( 1, 5 ); | ||
hwlib::blink( led ); | ||
} | ||
//! [[blink example]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#============================================================================ | ||
# | ||
# simple project makefile (just a main file) | ||
# | ||
# (c) Wouter van Ooijen ([email protected]) 2017 | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
# | ||
#============================================================================ | ||
|
||
# source files in this project (main.* is automatically assumed) | ||
SOURCES := | ||
|
||
# header files in this project | ||
HEADERS := | ||
|
||
# other places to look for files for this project | ||
SEARCH := | ||
|
||
RESULTS += main.lss | ||
|
||
# set RELATIVE to the next higher directory | ||
# and defer to the appropriate Makefile.* there | ||
RELATIVE := .. | ||
include $(RELATIVE)/makefile.link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// ========================================================================== | ||
// | ||
// blink the LED on an Arduino Uno | ||
// | ||
// (c) Wouter van Ooijen ([email protected]) 2017 | ||
// | ||
// Distributed under the Boost Software License, Version 1.0. | ||
// (See accompanying file LICENSE_1_0.txt or copy at | ||
// http://www.boost.org/LICENSE_1_0.txt) | ||
// | ||
// ========================================================================== | ||
|
||
#include "hwlib.hpp" | ||
|
||
int main( void ){ | ||
auto led0 = hwlib::target::pin_out( hwlib::target::pins::a0 ); | ||
auto led1 = hwlib::target::pin_out( hwlib::target::pins::a1 ); | ||
auto led2 = hwlib::target::pin_out( hwlib::target::pins::a2 ); | ||
auto led3 = hwlib::target::pin_out( hwlib::target::pins::a3 ); | ||
auto led4 = hwlib::target::pin_out( hwlib::target::pins::a4 ); | ||
auto led5 = hwlib::target::pin_out( hwlib::target::pins::a5 ); | ||
auto leds = hwlib::port_out_from_pins( led0, led1, led2, led3, led4, led5 ); | ||
hwlib::kitt( leds ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#============================================================================ | ||
# | ||
# simple project makefile (just a main file) | ||
# | ||
# (c) Wouter van Ooijen ([email protected]) 2017 | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. | ||
# (See accompanying file LICENSE_1_0.txt or copy at | ||
# http://www.boost.org/LICENSE_1_0.txt) | ||
# | ||
#============================================================================ | ||
|
||
# source files in this project (main.* is automatically assumed) | ||
SOURCES := | ||
|
||
# header files in this project | ||
HEADERS := | ||
|
||
# other places to look for files for this project | ||
SEARCH := | ||
|
||
RESULTS += main.lss | ||
|
||
# set RELATIVE to the next higher directory | ||
# and defer to the appropriate Makefile.* there | ||
RELATIVE := .. | ||
include $(RELATIVE)/makefile.link |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
These directories contain the demo applications for one target. | ||
|
||
The Makefile can clean or build the applications. | ||
|
||
The Makefile.link is included by the makefiles in the subdirectories; | ||
it sets the target-specific things and defers to the | ||
Makefile.link in the parent directory. | ||
|
||
(c) Wouter van Ooijen ([email protected]) 2017 | ||
|
||
Distributed under the Boost Software License, Version 1.0. | ||
(See accompanying file LICENSE_1_0.txt or copy at | ||
http://www.boost.org/LICENSE_1_0.txt) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bmptk-make -f Makefile.link codelite_workspace | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Oops, something went wrong.