Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wovo committed Mar 25, 2019
1 parent d9bd3d2 commit f114fcf
Show file tree
Hide file tree
Showing 68 changed files with 107 additions and 146 deletions.
Binary file modified demo/arduino-uno/.codelite/__codelite.tags
Binary file not shown.
Binary file modified demo/arduino-uno/.codelite/refactoring.db
Binary file not shown.
46 changes: 20 additions & 26 deletions demo/arduino-uno/__codelite.workspace
Original file line number Diff line number Diff line change
@@ -1,69 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<CodeLite_Workspace Name="example code" Database="" Version="10.0.0">
<Project Name="uno #0010 - empty" Path="uno #0010 - empty/_codelite.project" Active="No"/>
<Project Name="uno-#0010-empty" Path="uno-#0010-empty/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0010 - empty" ConfigName="Release"/>
<Project Name="uno-#0010-empty" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0020 - two" Path="uno #0020 - two/_codelite.project" Active="No"/>
<Project Name="uno-#0020-two" Path="uno-#0020-two/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0020 - two" ConfigName="Release"/>
<Project Name="uno-#0020-two" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0030 - blink - direct" Path="uno #0030 - blink - direct/_codelite.project" Active="No"/>
<Project Name="uno-#0030-blink-direct" Path="uno-#0030-blink-direct/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0030 - blink - direct" ConfigName="Release"/>
<Project Name="uno-#0030-blink-direct" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0040 - blink - gpio" Path="uno #0040 - blink - gpio/_codelite.project" Active="No"/>
<Project Name="uno-#0040-blink-gpio" Path="uno-#0040-blink-gpio/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0040 - blink - gpio" ConfigName="Release"/>
<Project Name="uno-#0040-blink-gpio" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0050 - blink - blink" Path="uno #0050 - blink - blink/_codelite.project" Active="No"/>
<Project Name="uno-#0050-blink-blink" Path="uno-#0050-blink-blink/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0050 - blink - blink" ConfigName="Release"/>
<Project Name="uno-#0050-blink-blink" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0060 - uart - input" Path="uno #0060 - uart - input/_codelite.project" Active="No"/>
<Project Name="uno-#0060-uart-input" Path="uno-#0060-uart-input/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0060 - uart - input" ConfigName="Release"/>
<Project Name="uno-#0060-uart-input" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0070 - lcd - x" Path="uno #0070 - lcd - x/_codelite.project" Active="No"/>
<Project Name="uno-#0070-lcd-16x2" Path="uno-#0070-lcd-16x2/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0070 - lcd - x" ConfigName="Release"/>
<Project Name="uno-#0070-lcd-16x2" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0080 - lcd - x" Path="uno #0080 - lcd - x/_codelite.project" Active="Yes"/>
<Project Name="uno-#0080-lcd-scrolling-message" Path="uno-#0080-lcd-scrolling-message/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0080 - lcd - x" ConfigName="Release"/>
<Project Name="uno-#0080-lcd-scrolling-message" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0090 - lcd - scrolling message" Path="uno #0090 - lcd - scrolling message/_codelite.project" Active="No"/>
<Project Name="uno-#0090-lcd-keypad-shield" Path="uno-#0090-lcd-keypad-shield/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0090 - lcd - scrolling message" ConfigName="Release"/>
<Project Name="uno-#0090-lcd-keypad-shield" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0100 - lcd - keypad - shield" Path="uno #0100 - lcd - keypad - shield/_codelite.project" Active="No"/>
<Project Name="uno-#0100-pcfa8574a-lcd-16x2" Path="uno-#0100-pcfa8574a-lcd-16x2/_codelite.project" Active="Yes"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0100 - lcd - keypad - shield" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
<Project Name="uno #0110 - pcfa - lcd - x" Path="uno #0110 - pcfa - lcd - x/_codelite.project" Active="No"/>
<BuildMatrix>
<WorkspaceConfiguration Name="Release" Selected="yes">
<Project Name="uno #0110 - pcfa - lcd - x" ConfigName="Release"/>
<Project Name="uno-#0100-pcfa8574a-lcd-16x2" ConfigName="Release"/>
</WorkspaceConfiguration>
</BuildMatrix>
</CodeLite_Workspace>
2 changes: 1 addition & 1 deletion demo/arduino-uno/uno-#0060-uart-input/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ int main( void ){
hwlib::cout
<< "Type a character : " << hwlib::flush;

char c = hwlib::cin.getc();
char c = 'a'; // hwlib::cin.getc();

hwlib::cout
<< "\n "
Expand Down
2 changes: 1 addition & 1 deletion demo/arduino-uno/uno-#0090-lcd-keypad-shield/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int main( void ){
// select the LCD size.
// the shield has a 2 x 16 LCD
// auto lcd = hwlib::hd44780( rs, e, d, 1, 16 );
auto lcd = hwlib::hd44780( rs, e, d, 2, 16 );
auto lcd = hwlib::hd44780( rs, e, d, hwlib::xy( 16, 2 ) );
// auto lcd = hwlib::hd44780( rs, e, d, 4, 20 );
// auto lcd = hwlib::hd44780( rs, e, d, 2, 40 );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,24 @@ int main( void ){
auto p19 = hwlib::target::pin_out( 1, 9 );
auto p18 = hwlib::target::pin_out( 1, 8 );
auto p15 = hwlib::target::pin_out( 1, 5 );
auto pa = all( p19, p18, p15 );

auto p14 = hwlib::target::pin_out( 1, 4 );

auto p13 = hwlib::target::pin_out( 1, 3 );
auto p12 = hwlib::target::pin_out( 1, 2 );
auto pb = all( p14, p13, p12 );

auto p11 = hwlib::target::pin_out( 1, 1 );
auto p10 = hwlib::target::pin_out( 1, 0 );

auto p07 = hwlib::target::pin_out( 0, 7 );
auto pc = all( p11, p10, p07 );

auto p06 = hwlib::target::pin_out( 0, 6 );
auto sda = hwlib::target::pin_out{ 0, 5 };
auto scl = hwlib::target::pin_out{ 0, 4 };
auto pd = all( p06, sda, scl );

auto leds = hwlib::port_out_from(
p19, p18, p15, p14,
p13, p12, p11, p10,
p07, p06, sda, scl
);
auto leds = hwlib::port_out_from( pa, pb, pc, pd );

hwlib::kitt( leds, 50 );
}
2 changes: 2 additions & 0 deletions doxyfiles/texts/hwlib-doxygen-#0160-notes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
/// - check SPI for flush
/// - check 595 buffering
/// - add blue-pill documentation & picture
/// - char stream mux / demux
/// - ostream has format data *inside*: shouild be separate. raw_ostream?
///

/*
Expand Down
9 changes: 9 additions & 0 deletions library/char-io/hwlib-istream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,14 @@ class istream {
}

}; // class istream

/*
* class stream_demux : public istream {
istream & left;
istream & right;
public:
};
*/

}; // namespace hwlib
4 changes: 2 additions & 2 deletions library/char-io/hwlib-ostream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ constexpr _flush flush;
/// Most formatting features of std::ostream are supported.
/// Floating point values are not supported.
///
/// This class is abstract: a concrete subclass must implement putc()
/// and, flush().
/// This class is abstract: a concrete subclass
/// must implement putc() and flush().
class ostream {
private:

Expand Down
60 changes: 60 additions & 0 deletions library/char-io/hwlib-stream-mux.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// ==========================================================================
//
// File : hwlib-stream-mux.hpp
// Part of : C++ hwlib library for close-to-the-hardware OO programming
// Copyright : [email protected] 2017-2019
//
// 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)
//
// ==========================================================================

// included only via hwlib.hpp, hence no multiple-include guard is needed

// this file contains Doxygen lines
/// @file

namespace hwlib {

class ostream_prefix : ostream {
private:

ostream & minion;
const char marker;

public:

ostream_mux( ostream & minion, char marker ):
minion( minion ), marker( marker )
{}

void putc( char c ) override {
minion.putc( marker );
minion.putc( c );
}

void flush() override {
minion.flush();
}

}; // class ostream_prefix

class istream_mux : ostream {
private:

ostream & minion;

public:

ostream_mux( ostream & minion ): minion( minion ){}

void putc( char x ) override {
}

void flush() override {
}

}; // class ostream_mux

}; // namespace hwlib
6 changes: 3 additions & 3 deletions library/core/hwlib-spi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ class spi_bus {

spi_bus & bus;

pin_out & sel;
pin_direct_from_out_t sel;

spi_transaction( spi_bus & bus, pin_out & sel ):
bus( bus ), sel( sel )
spi_transaction( spi_bus & bus, pin_out & _sel ):
bus( bus ), sel( direct( _sel ))
{
sel.write( 0 );
}
Expand Down
2 changes: 1 addition & 1 deletion library/peripherals/hwlib-hc595.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class hc595 : public port_out {
}

void flush() override {
bus.transaction( sel ).write_and_read( 1, &write_buffer, nullptr );
bus.transaction( sel ).write( write_buffer );
}

/// the output pins of the chip
Expand Down
1 change: 0 additions & 1 deletion test/native/separate/hwlib-adc.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-common.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-console.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-dac.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-decorators.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-defines.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-demo.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-font-default-16x16.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-font-default-8x8.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-glcd-5510.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-glcd-oled.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-graphics.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-hc595.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-hd44780.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-i2c.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-ostream.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-panic.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-pcf8574a.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-pcf8591.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-pin-decorators.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-pin-dummies.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-pin.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-port-decorators.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-port-from-pins.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-port.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-spi.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-string.cpp

This file was deleted.

1 change: 0 additions & 1 deletion test/native/separate/hwlib-wait.cpp

This file was deleted.

25 changes: 0 additions & 25 deletions test/native/separate/main.cpp

This file was deleted.

Loading

0 comments on commit f114fcf

Please sign in to comment.