Skip to content

Commit

Permalink
Update samples
Browse files Browse the repository at this point in the history
  • Loading branch information
ohmtech-rdi committed Jan 2, 2024
1 parent 4a2e04b commit 27892ca
Show file tree
Hide file tree
Showing 15 changed files with 1,763 additions and 187 deletions.
2 changes: 2 additions & 0 deletions samples/custom/Custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ void Custom::init ()
filter.set_sample_freq (erb_SAMPLE_RATE);
filter.set_type_low_pass ();
filter.set_resonance (1.f);

ui.antenna.blink ();
}


Expand Down
12 changes: 10 additions & 2 deletions samples/custom/Custom.erbui
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import "manufacturer/ElectroDemo.erbui"

module Custom {
width 12hp
material aluminum
material pcb
header { label "CUSTOM" }

board {
Expand All @@ -14,14 +14,16 @@ module Custom {
sch "board/board.kicad_sch"
width 12hp
pin P1 Pot { bind "p(0)" }
pin LD1 Led { type gpio bind "ld(0)" }
pin AI1 AudioIn { bind "ai(0)" }
pin AO1 AudioOut { bind "ao(0)" }
}

manufacturer ElectroDemo
route manual

image "Custom.svg"
image "silkscreen.svg"
image "translucence.svg" { layer translucence }

control freq Pot {
position 6hp, 34mm
Expand All @@ -30,6 +32,12 @@ module Custom {
pin P1
}

control antenna Led {
position 35mm, 77mm
style red, behind
pin LD1
}

control audio_in AudioIn {
position 6hp, 96mm
label "IN"
Expand Down
177 changes: 0 additions & 177 deletions samples/custom/Custom.svg

This file was deleted.

15 changes: 15 additions & 0 deletions samples/custom/board/BoardFirmware.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ class Board
inline const erb::Buffer &
ai (size_t i) { return _audio_inputs [i]; }

// Digital Outputs
inline uint8_t &
ld (size_t i) { return _digital_outputs [i]; }

// Audio Outputs
inline erb::Buffer &
ao (size_t i) { return _audio_outputs [i]; }
Expand All @@ -42,6 +46,9 @@ class Board
struct AudioInPin { size_t index; };
static constexpr AudioInPin AI1 = {0};

struct GpoPin { size_t index; };
static constexpr GpoPin LD1 = {0};

struct AudioOutPin { size_t index; };
static constexpr AudioOutPin AO1 = {0};

Expand All @@ -50,6 +57,7 @@ class Board
inline void impl_preprocess (AdcPin pin);
inline void impl_preprocess (AudioInPin pin);

inline void impl_postprocess (GpoPin pin);
inline void impl_postprocess (AudioOutPin pin);
inline void impl_postprocess () {}

Expand All @@ -68,6 +76,8 @@ class Board
std::array <erb::Buffer, 1>
_audio_inputs;

std::array <uint8_t, 1>
_digital_outputs;
std::array <erb::Buffer, 1>
_audio_outputs;

Expand All @@ -80,6 +90,11 @@ class Board
{erb::SubmoduleDaisyPatchSm::D9}
}
};

std::array <erb::GpioOutputDaisy, 1>
_gpio_outputs = {{
{erb::SubmoduleDaisyPatchSm::B5}, // LD1
}};
};


Expand Down
7 changes: 7 additions & 0 deletions samples/custom/board/BoardFirmware.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ void Board::impl_preprocess (AudioInPin pin)
}


void Board::impl_postprocess (GpoPin pin)
{
_gpio_outputs [pin.index].write (_digital_outputs [pin.index]);
}



void Board::impl_postprocess (AudioOutPin pin)
{
erb::scale (
Expand Down
6 changes: 5 additions & 1 deletion samples/custom/board/BoardSimulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct Board
{
inline Board () : erb::BoardGeneric (
0, 1, 1, // digital/analog/audio inputs
0, 0, 1 // digital/analog/audio outputs
1, 0, 1 // digital/analog/audio outputs
) {}
virtual ~Board () override = default;

Expand All @@ -22,6 +22,10 @@ struct Board
inline const erb::Buffer &
ai (size_t i) { return _audio_inputs [i]; }

// Digital Outputs
inline uint8_t &
ld (size_t i) { return _digital_outputs [i]; }

// Audio Outputs
inline erb::Buffer &
ao (size_t i) { return _audio_outputs [i]; }
Expand Down
87 changes: 81 additions & 6 deletions samples/custom/board/board.kicad_pcb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
(net 15 "unconnected-(A1-PadA8)")
(net 16 "unconnected-(A1-PadA9)")
(net 17 "unconnected-(A1-PadB1)")
(net 18 "unconnected-(A1-PadB5)")
(net 18 "Net-(A1-PadB5)")
(net 19 "unconnected-(A1-PadB6)")
(net 20 "unconnected-(A1-PadB7)")
(net 21 "unconnected-(A1-PadB8)")
Expand All @@ -110,6 +110,7 @@
(net 40 "unconnected-(A1-PadD7)")
(net 41 "unconnected-(A1-PadD8)")
(net 42 "unconnected-(A1-PadD10)")
(net 43 "LD1")

(footprint "TestPoint:TestPoint_Pad_D1.5mm" (layer "F.Cu")
(tedit 5A0F774F) (tstamp 00000000-0000-0000-0000-00006236089c)
Expand All @@ -118,8 +119,9 @@
(tags "test point SMD pad")
(property "Sheetfile" "board.kicad_sch")
(property "Sheetname" "")
(property "exclude_from_bom" "")
(path "/00000000-0000-0000-0000-00006236dfda")
(attr exclude_from_pos_files)
(attr exclude_from_pos_files exclude_from_bom)
(fp_text reference "AI1" (at 0 -1.648) (layer "F.SilkS") hide
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 64e26ebe-92c0-4642-a11b-f3799fdbd0fa)
Expand All @@ -145,8 +147,9 @@
(tags "test point SMD pad")
(property "Sheetfile" "board.kicad_sch")
(property "Sheetname" "")
(property "exclude_from_bom" "")
(path "/00000000-0000-0000-0000-00006236f4a6")
(attr exclude_from_pos_files)
(attr exclude_from_pos_files exclude_from_bom)
(fp_text reference "AO1" (at 0 -1.648) (layer "F.SilkS") hide
(effects (font (size 1 1) (thickness 0.15)))
(tstamp d3019862-1aea-48d5-aaa7-1a498191e234)
Expand Down Expand Up @@ -467,7 +470,7 @@
(pad "B4" thru_hole circle locked (at 29.397 10.46 90) (size 1.8796 1.8796) (drill 1.016) (layers *.Cu *.Mask)
(net 5 "AI1") (pinfunction "AUDIO_IN_L") (pintype "bidirectional") (solder_mask_margin 0.0762) (tstamp aec92cf5-0b4a-4f05-b070-6f695e3325a6))
(pad "B5" thru_hole circle locked (at 29.143 7.92 90) (size 1.8796 1.8796) (drill 1.016) (layers *.Cu *.Mask)
(net 18 "unconnected-(A1-PadB5)") (pinfunction "GATE_OUT_1") (pintype "bidirectional+no_connect") (solder_mask_margin 0.0762) (tstamp 123fb9ac-cf35-4061-a814-392be6223a01))
(net 18 "Net-(A1-PadB5)") (pinfunction "GATE_OUT_1") (pintype "bidirectional") (solder_mask_margin 0.0762) (tstamp 123fb9ac-cf35-4061-a814-392be6223a01))
(pad "B6" thru_hole circle locked (at 26.603 7.92 90) (size 1.8796 1.8796) (drill 1.016) (layers *.Cu *.Mask)
(net 19 "unconnected-(A1-PadB6)") (pinfunction "GATE_OUT_2") (pintype "bidirectional+no_connect") (solder_mask_margin 0.0762) (tstamp 832e3b0e-3aea-4336-b26e-bcbcdd797c06))
(pad "B7" thru_hole circle locked (at 26.857 10.46 90) (size 1.8796 1.8796) (drill 1.016) (layers *.Cu *.Mask)
Expand Down Expand Up @@ -821,8 +824,9 @@
(tags "test point SMD pad")
(property "Sheetfile" "board.kicad_sch")
(property "Sheetname" "")
(property "exclude_from_bom" "")
(path "/00000000-0000-0000-0000-0000626b9c4c")
(attr exclude_from_pos_files)
(attr exclude_from_pos_files exclude_from_bom)
(fp_text reference "P1" (at 0 -1.648) (layer "F.SilkS") hide
(effects (font (size 1 1) (thickness 0.15)))
(tstamp d03d5ec9-dac8-416b-ba71-5ee4910d6dc7)
Expand All @@ -841,13 +845,84 @@
(net 7 "P1") (pinfunction "1") (pintype "passive") (tstamp fa8d2771-f895-41e8-98dc-60e361c7eae2))
)

(footprint "TestPoint:TestPoint_Pad_D1.5mm" (layer "F.Cu")
(tedit 5A0F774F) (tstamp 4b07d944-a6eb-4239-aa32-1dc65efe5d2e)
(at 35 77)
(descr "SMD pad as test Point, diameter 1.5mm")
(tags "test point SMD pad")
(property "Sheetfile" "board.kicad_sch")
(property "Sheetname" "")
(property "exclude_from_bom" "")
(path "/6aebd36f-fc54-4bea-a1d0-326f1f26bddb")
(attr exclude_from_pos_files exclude_from_bom)
(fp_text reference "LD1" (at 0 -1.648) (layer "F.SilkS")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 7642fc6e-4e08-4451-8e87-867ef3d518e4)
)
(fp_text value "TestPoint" (at 0 1.75) (layer "F.Fab")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp cd290ceb-8988-4d79-bcba-ceb982adea2c)
)
(fp_text user "${REFERENCE}" (at 0 -1.65) (layer "F.Fab")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp bf0de00e-78c9-4828-91a3-5e3b3934dea4)
)
(fp_circle (center 0 0) (end 0 0.95) (layer "F.SilkS") (width 0.12) (fill none) (tstamp e186c76a-f32c-4b28-976f-59f9239a18aa))
(fp_circle (center 0 0) (end 1.25 0) (layer "F.CrtYd") (width 0.05) (fill none) (tstamp ced8551d-9ea5-4ed6-99f9-77fcb2aa2b92))
(pad "1" smd circle (at 0 0) (size 1.5 1.5) (layers "F.Cu" "F.Mask")
(net 43 "LD1") (pinfunction "1") (pintype "passive") (tstamp fe13d099-bd6b-4dab-b352-9d3eb48e777a))
)

(footprint "Resistor_SMD:R_0603_1608Metric" (layer "F.Cu")
(tedit 5F68FEEE) (tstamp bd37ec5c-2863-493a-b563-5d39dbc67cdd)
(at 34.18 72.26)
(descr "Resistor SMD 0603 (1608 Metric), square (rectangular) end terminal, IPC_7351 nominal, (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator")
(tags "resistor")
(property "Sheetfile" "board.kicad_sch")
(property "Sheetname" "")
(path "/f6b970a7-861f-420c-ab7b-bc8781073ab4")
(attr smd)
(fp_text reference "R1" (at 0 -1.43) (layer "F.SilkS")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 13be8c90-2a30-49b7-99e6-dc8dda7abecb)
)
(fp_text value "1k" (at 0 1.43) (layer "F.Fab")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 79df905d-9dd7-4803-bcf9-9f15d989c2c4)
)
(fp_text user "${REFERENCE}" (at 0 0) (layer "F.Fab")
(effects (font (size 0.4 0.4) (thickness 0.06)))
(tstamp 122afaec-c9ce-49b6-9c43-c549b7d25236)
)
(fp_line (start -0.237258 0.5225) (end 0.237258 0.5225) (layer "F.SilkS") (width 0.12) (tstamp 94a3109d-5e1e-48a6-8fe6-317e275aa71c))
(fp_line (start -0.237258 -0.5225) (end 0.237258 -0.5225) (layer "F.SilkS") (width 0.12) (tstamp e6438594-19ad-41ee-a87c-42cc4ae6e2fa))
(fp_line (start 1.48 -0.73) (end 1.48 0.73) (layer "F.CrtYd") (width 0.05) (tstamp 0030a47d-5dbe-4e5f-a81a-f0d761f07116))
(fp_line (start -1.48 -0.73) (end 1.48 -0.73) (layer "F.CrtYd") (width 0.05) (tstamp bbbb64b6-4787-47a7-84b6-3e2b9614907c))
(fp_line (start -1.48 0.73) (end -1.48 -0.73) (layer "F.CrtYd") (width 0.05) (tstamp cd828054-d956-4dfa-82a8-fae2dcba9044))
(fp_line (start 1.48 0.73) (end -1.48 0.73) (layer "F.CrtYd") (width 0.05) (tstamp e79a9012-62ef-4b69-af21-94b200794c7b))
(fp_line (start 0.8 -0.4125) (end 0.8 0.4125) (layer "F.Fab") (width 0.1) (tstamp 36b96cf3-3987-4db1-b8b2-ab3ce4abc409))
(fp_line (start 0.8 0.4125) (end -0.8 0.4125) (layer "F.Fab") (width 0.1) (tstamp 6315a4f0-36bc-4be9-94e2-8fe9e20e45b2))
(fp_line (start -0.8 0.4125) (end -0.8 -0.4125) (layer "F.Fab") (width 0.1) (tstamp 9b389b29-bf84-4798-ba95-05a161bafd8d))
(fp_line (start -0.8 -0.4125) (end 0.8 -0.4125) (layer "F.Fab") (width 0.1) (tstamp f095c80e-a874-481e-a442-51518f594e0b))
(pad "1" smd roundrect (at -0.825 0) (size 0.8 0.95) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
(net 18 "Net-(A1-PadB5)") (pintype "passive") (tstamp 181721ed-e18c-44da-a426-0d80e83a5151))
(pad "2" smd roundrect (at 0.825 0) (size 0.8 0.95) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25)
(net 43 "LD1") (pintype "passive") (tstamp a8adcace-6dd8-4c5b-8e74-911a5c90221d))
(model "${KICAD6_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0603_1608Metric.wrl"
(offset (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)

(footprint "Logo_Erb:ErbLog.15mm" (layer "B.Cu")
(tedit 0) (tstamp 00000000-0000-0000-0000-000060d67864)
(at 50.7 115 180)
(property "Sheetfile" "board.kicad_sch")
(property "Sheetname" "")
(property "exclude_from_bom" "")
(path "/00000000-0000-0000-0000-0000609ea577")
(attr through_hole)
(attr through_hole exclude_from_bom)
(fp_text reference "H1" (at 0 0) (layer "B.SilkS") hide
(effects (font (size 1.524 1.524) (thickness 0.3)) (justify mirror))
(tstamp 74747e53-468f-4639-90c1-0f8789564ec4)
Expand Down
Loading

0 comments on commit 27892ca

Please sign in to comment.