242 Commits

Author SHA1 Message Date
Allen Hill eab535db98 fixup 7871e92 2026-08-03 13:30:14 -07:00
Allen Hill f3d0d99ce4 Update Disable_Function_Req response 2026-08-01 13:15:06 -07:00
Allen Hill 76f5da0125 Restore dynamic from device in function change resp 2026-08-01 13:14:38 -07:00
Allen Hill 7871e92dbe Fix Debug builds 2026-07-31 17:53:31 -07:00
Allen Hill fb17b7e75b Update gitignore and silence some tidy warnings 2026-07-25 11:22:33 -07:00
Allen Hill ae539e27f6 Fix some overflow behavior when reading input msgs 2026-07-23 12:41:00 -07:00
Allen Hill a99fe56aae Fix intermittent, early boot short start bit errors 2026-07-21 13:22:19 -07:00
Allen Hill 909915730b Not all error conditions print a message 2026-07-21 12:52:25 -07:00
Allen Hill 5bbbb6c011 Party should be ~private 2026-07-21 12:51:49 -07:00
Allen Hill 8950bd6917 Make b3 const 2026-07-21 12:51:18 -07:00
Allen Hill 56936aed10 Switch to using references where possible 2026-07-17 14:31:54 -07:00
Allen Hill 5208e083f3 Redesign (simplify) top-level avclan interface to use expected/nullable unique_ptr
- Peripheral::read/send now return `expected<unique_ptr<Frame>, Error>`
for a unified success/error interface.
- Peripheral::route returns `expected<unique_ptr<Frame>, Error>` to
distinguish intent: (intentional) non-response vs unable to respond
- Other functions with optional message semantics (handle,poll,react)
return a unique_ptr whose ownership-state indicates response intent
(i.e. send new message)

Bundled necessary changes:
- Switch Frame allocation from global to local (enabled via member
  function new/delete)
- Add new header-library tl::expected to shim avr-libstdcpp

Unrelated: Defensive `continue` added after `route`, to reduce Bus
activity check latency

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 14:47:47 -07:00
Allen Hill 200a225add Unify frame metadata setting (addrs and owning_device) 2026-07-16 13:35:25 -07:00
Allen Hill 568c2af9e6 Only check tracked files and don't print on empty lint 2026-07-16 13:35:06 -07:00
Allen Hill 681450f4ad Update READMEs 2026-07-08 14:37:17 -07:00
Allen Hill 82884c1305 Resolve some const/static-able warnings
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 14:16:38 -07:00
Allen Hill b194a6df2c Improve/expand C phy docs 2026-07-08 13:51:38 -07:00
Allen Hill 2ed6066609 Fix miscellaneous bugs identified by Claude
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 13:15:59 -07:00
Allen Hill cd11501074 Minor reorganization 2026-07-08 09:42:02 -07:00
Allen Hill 52b4b625fb Move Error::Parse enum into avclan.h 2026-07-08 09:41:25 -07:00
Allen Hill 1ac9a14811 Remove unused function 2026-07-08 09:37:50 -07:00
Allen Hill e50bde197d Complete the switch to jnk0le uart lib
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 12:49:01 -07:00
Allen Hill 1d953adaf2 Merge branch 'gen2' into o/jnk0le-uart-lib 2026-07-07 12:48:18 -07:00
Allen Hill f6a0d2d9dc Make sure tshark is installed in container 2026-07-06 20:44:09 -07:00
Allen Hill 642c5ca59e fixup lua tables 2026-07-06 20:43:51 -07:00
Allen Hill 103b595abb Consistently mark frame owners 2026-07-06 20:31:22 -07:00
Allen Hill 0664c1e7bd Fix broadcasting messages and revert Playback_Status reports to broadcast 2026-07-06 20:28:59 -07:00
Allen Hill 9fd8c5636e Finalize C <=> C++ interface 2026-07-06 19:39:49 -07:00
Allen Hill 7ceed80128 Expose Bus mute via Peripheral 2026-07-06 17:13:05 -07:00
Allen Hill b538e07577 Establish the Lua dissector action/device/etc tables as authoritative
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 16:53:13 -07:00
Allen Hill e92d61adca Remove redundant conditional 2026-07-06 16:26:28 -07:00
Allen Hill a6bcecc34f fixup ee620d4 2026-07-06 16:26:01 -07:00
Allen Hill 554fca0582 Shift Device/Action enums to avclan.h 2026-07-06 15:50:09 -07:00
Allen Hill 25e425a601 Remove unused header 2026-07-06 14:42:30 -07:00
Allen Hill 1c0124edcc Shift avclan_bit_t to avclan.h 2026-07-06 13:55:13 -07:00
Allen Hill a0c6601cda Unify Send/Read error enums 2026-07-06 13:36:53 -07:00
Allen Hill 82cbb126a9 Fix (centralize) setting of controller/peripheral addrs 2026-07-06 13:05:58 -07:00
Allen Hill ce8e1dde92 fixup fixup bus send/read parity & acking 2026-07-06 12:00:58 -07:00
Allen Hill ee620d4e77 Fix Initial_Report_Response message (double leading zeros) 2026-07-06 11:52:52 -07:00
Allen Hill 04c492271c fixup error switch flow 2026-07-06 11:31:36 -07:00
Allen Hill 30ad2dc67f fixup bus send/read parity & acking 2026-07-06 11:31:17 -07:00
Allen Hill 6e4812e6b8 fixup dev refs 2026-07-06 11:29:49 -07:00
Allen Hill 1fdd296784 Ref shouldACK in lambda to only set once 2026-07-05 19:40:48 -07:00
Allen Hill 1e416a3457 Misc clang-tidy/comment tweaks 2026-07-05 19:40:17 -07:00
Allen Hill 2400fac7df [fixup] add controller field getter 2026-07-05 19:38:15 -07:00
Allen Hill 950e1e8094 Shift some bus functions definitions out of the header 2026-07-05 19:37:40 -07:00
Allen Hill e878a61313 Port Frame object to C++ 2026-07-05 19:35:58 -07:00
Allen Hill 66bbf8639e Parameterise Peripheral by its Devices and add CDChanger as one 2026-06-27 10:29:34 -07:00
Allen Hill d98cc8acad Add C++ Bus class for the physical layer interface 2026-06-25 20:40:10 -07:00
Allen Hill 67ba8e774c fix some clang-tidy warnings 2026-06-25 18:17:09 -07:00
Allen Hill 1877bb0658 Add C++ Peripheral class 2026-06-25 18:16:38 -07:00
Allen Hill 02b370dd06 Port Queue to C++
Some knock-on changes to keep a simple design:
- Bake the data array into AVCLAN_frame_t
- Bundle the response/reaction with AVCLAN_frame_t
    - (Needed to maintain correct/simple ownership semantics with the
      cache and outgoing/incoming queues)
- Switch status frame update ticks to use a regular
  cache-originating/owned frame
2026-06-25 14:28:19 -07:00
Allen Hill 77ff4652fd Prep for C++ port 2026-06-23 18:29:49 -07:00
Allen Hill 12ddd3d3c0 use out/build for preset build directory 2026-06-23 17:51:47 -07:00
Allen Hill c895034bb2 Update copyright headers to use SPDX id's 2026-06-23 17:51:29 -07:00
Allen Hill 0b0c9335f9 Decouple hardware specific code from generic, agnostic code 2026-06-23 17:29:52 -07:00
Allen Hill fb130559e2 Reorganize code in prep for hardware decoupling and port to C++
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:13:34 -07:00
Allen Hill d4e05a6da9 Update devcontainer startup to consistently chown passed-thru usb devices 2026-06-22 17:33:58 -07:00
Allen Hill 8141bd3f15 update README 2026-06-22 12:16:06 -07:00
Allen Hill d717855a63 reorg hardware folder for v2 dev 2026-06-21 18:31:06 -07:00
Allen Hill 024acdc779 Switch to a python based [streaming] packet capture setup
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 15:23:25 -07:00
Allen Hill 2a195972a8 Add triple-press for skip back 2026-06-21 14:24:02 -07:00
Allen Hill c8a3797b82 Tweak debug play/pause test 2026-06-20 20:32:03 -07:00
Allen Hill d6340d41a3 Stop "playing" after 2 failed status updates 2026-06-20 20:30:52 -07:00
Allen Hill 796c868255 Only play (headset) on after first pause 2026-06-20 20:29:49 -07:00
Allen Hill 355b01964f Properly fix headset functions when there's bus activity 2026-06-21 14:21:35 -07:00
Allen Hill 59b8bd0a54 Delay starting status timer until state has been normalized 2026-06-18 19:58:50 -07:00
Allen Hill 0464261b6e Only "stop playing" if we ARE playing 2026-06-18 19:58:50 -07:00
Allen Hill 8350f1d426 Resolve/unlatch a latched comparator 2026-06-18 19:58:50 -07:00
Allen Hill aefd539715 Improve periodic status reporting (tune interval better, reset count when changing time) 2026-06-18 19:58:50 -07:00
Allen Hill c4648694fe reduce scope/improve locality of response arrays 2026-06-18 19:58:50 -07:00
Allen Hill 981bbb68e3 use direct instead of pointer access for cd track/min/sec 2026-06-18 19:58:50 -07:00
Allen Hill 6f61cf11b3 reorg some functionality 2026-06-18 19:58:50 -07:00
Allen Hill dd3406c056 add more static annotations 2026-06-18 19:58:50 -07:00
Allen Hill 95925b563a Stop playing if nobody's listening 2026-06-18 19:58:50 -07:00
Allen Hill 26b0d6c55f start/stopEvent bodies should be in atomic blocks 2026-06-18 19:58:50 -07:00
Allen Hill d054806567 update ignores 2026-06-18 19:58:50 -07:00
Allen Hill c95ac93ca7 PIT shouldnt start off enabled 2026-06-18 19:58:50 -07:00
Allen Hill fee74e05c8 Add headset function control 2026-06-18 19:58:50 -07:00
Allen Hill e8082fa249 more dissector updates
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-18 19:58:50 -07:00
Allen Hill 0830cf06dc Support fast-forward/rewind 2026-06-18 19:58:50 -07:00
Allen Hill 60d39c1c2f Correctly respond to button actions (CMD_SW state report) 2026-06-18 19:58:50 -07:00
Allen Hill 09782495ab Improve/correct several response bodies 2026-06-18 19:58:50 -07:00
Allen Hill c366454c8f Fix mutebus and improve bool literal hygiene 2026-06-15 12:52:58 -07:00
Allen Hill da17c724d6 Fix track change logic (track is/should be serialized as BCD) 2026-06-15 18:52:21 +00:00
Allen Hill c591e87c98 Tweak/fix(?) Initial/Playback/Loading responses 2026-06-13 19:42:05 +00:00
Allen Hill 6a9b8affa2 Fix some safety/ergonomic issues 2026-06-13 19:28:56 +00:00
Allen Hill 3d0f92c824 Shift state machine from main loop to driver file 2026-06-13 19:27:55 +00:00
Allen Hill 819058c8a0 more dissector improvements 2026-06-13 11:58:47 -07:00
Allen Hill 051d8dbe99 Refactor cmake/presets for easier serial usb device selection 2026-06-11 19:33:06 -07:00
Allen Hill c2440d5118 Refactor frame dissector to improve readability/future expansion
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 19:21:40 -07:00
Allen Hill 83a614ed3b More dissector updates
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 18:31:22 -07:00
Allen Hill 6e108d07a7 update dissector 2026-06-11 17:24:34 -07:00
Allen Hill e8630557d7 chown usb device after creating container 2026-05-16 01:29:52 +00:00
Allen Hill c0bb9c4018 Use bool consistently now that we're on C23 2026-05-15 18:28:54 -07:00
Allen Hill 9fbaa7a55f Flatten msg triage switches to dispatch on first 3 bytes together (as uint32_t) 2026-05-15 18:28:54 -07:00
Allen Hill 79516796d5 Replace iffy bitfield use with uin8_t fields and enums 2026-05-15 18:28:54 -07:00
Allen Hill 4d4b08f67d Remove unused enum 2026-05-15 18:28:54 -07:00
Allen Hill 57d0513d04 Prevent pushing nullptr into queues 2026-05-15 18:28:54 -07:00
Allen Hill d09aa684f8 Make global message templates static const 2026-05-15 18:28:54 -07:00
Allen Hill 83271ef0d2 Use better name for variable 2026-05-15 18:28:54 -07:00
Allen Hill 87f0ddc2d4 Rename field broadcast => is_unicast
Improves readability and logical flow clarity
2026-05-15 18:28:54 -07:00
Allen Hill f68fa5ab60 Manually inline sbi/cbi macros 2026-05-15 18:28:54 -07:00
Allen Hill 877e88fcd0 Use ATOMIC_BLOCK instead of manual cli/sei 2026-05-15 18:28:54 -07:00
Allen Hill 194c3928f9 Use more readable byte access patterns (compiles the same) 2026-05-15 18:28:54 -07:00
Allen Hill 99ca75ce45 Fix missed REPL docs update 2026-05-15 18:28:54 -07:00
Allen Hill 1fa9d63ac5 Add some missing volatile annotations 2026-05-15 18:28:54 -07:00
Allen Hill aefc698fca Mark incrementRead as static inline 2026-05-15 18:28:54 -07:00
Allen Hill e5797b598a Fix binary msg read edge cases 2026-05-15 18:28:54 -07:00
Allen Hill b510eaaef8 Tighten PIT interrupt and avoid some BCD edge-cases 2026-05-15 18:28:54 -07:00
Allen Hill 28ddf2139b Archive old files 2026-05-15 18:28:54 -07:00
Allen Hill 9baa57d6d9 Minor reorg of cmakelists 2026-05-15 18:28:54 -07:00
Allen Hill 263b7c1753 Specify enum size to drop (potentially surprising) enum size compile flag 2026-05-13 18:21:39 -07:00
Allen Hill cc65542842 Add QoL correctness checks (not strictly necessary but behaves better) 2026-05-13 18:20:59 -07:00
Allen Hill 423fafb709 Improve error messaging/handling 2026-05-13 18:19:00 -07:00
Allen Hill 042521a744 Fix incorrect definition/initialization of caches 2026-05-13 18:17:27 -07:00
Allen Hill 551cdaa23c Reduce variable scope (global => local; reduce local var scope size) 2026-05-13 18:16:33 -07:00
Allen Hill 62f755c265 Group pointer increments for better assembly (in recent GCC) 2026-05-12 10:14:15 -07:00
Allen Hill 1e715d1daa Fix bad function call 2026-05-10 18:55:23 -07:00
Allen Hill a0071ea862 Fix incorrect address-of (and rename argument resp => out) 2026-05-10 18:53:42 -07:00
Allen Hill 746551351f store the results of tmp & 1 to avoid recalc 2026-05-10 18:52:43 -07:00
Allen Hill 8caee73765 Reorder error enums for simpler partial success check 2026-05-10 18:50:55 -07:00
Allen Hill 6b45648314 Fix memory leaks from refactor 2026-05-08 15:32:18 -07:00
Allen Hill ceea8b79a0 Cleanup flag setting cases 2026-05-08 13:20:14 -07:00
Allen Hill 4de22e01f3 Substantially refactor ~everything to separate concerns and improve flow clarity
Highlights:
- Remove all use of malloc and friends
- Refactor message handling functions to work with references
- Move core message read => triage => respond logic loop to main
  function
- Improve message triage and support follow-up messages
- Refactor hex byte parsing
- Disable periodic interrupt when not playing
2026-05-08 13:10:14 -07:00
Allen Hill bdb1a8af0d fixup readframe error logs 2026-05-06 13:59:04 -07:00
Allen Hill 18c5a28410 Fix incorrect time updating logic 2026-05-06 13:57:36 -07:00
Allen Hill c904bc2c89 Refactor AVCLAN_parseframe call signature to avoid dynamic allocs 2026-05-05 20:35:05 -07:00
Allen Hill 9b2c71fa6e Add some compiler warnings and fix revealed bugs 2026-05-05 18:17:02 -07:00
Allen Hill a37140a779 Refactor error handling in read/send frame 2026-05-05 14:37:09 -07:00
Allen Hill 67cec49a60 Combine similar sendbit functions 2026-05-05 12:32:43 -07:00
Allen Hill 28db9fb6b5 Refactor canned message setting 2026-05-05 11:32:57 -07:00
Allen Hill 9d044cd1f7 Recognize more actions 2026-05-05 11:27:34 -07:00
Allen Hill 3d67e0a2ca Refactor message handling switch tree 2026-05-05 11:27:09 -07:00
Allen Hill 6adffe1619 Convert some local macros to inline functions 2026-05-04 12:30:45 -07:00
Allen Hill 628ec2de5f Replace use of numeric literals with appropriate enums 2026-05-04 11:47:34 -07:00
Allen Hill d465bb38c7 Update pcap setup 2026-05-04 11:13:59 -07:00
Allen Hill 2d29a9a59d Add normalized brightness value to packet dissection 2025-10-10 12:02:01 -07:00
Allen Hill cbb1c1a30d Improve action/function names and tweak report responses 2025-10-08 21:26:04 -07:00
Allen Hill 6e8d9eb35f Expand Wireshark packet dissector support 2025-10-08 21:21:54 -07:00
Allen Hill 9354fa3ce6 Ignore more files 2024-10-08 13:59:55 -07:00
Allen Hill 3448224939 Remove mistakenly committed file 2024-10-08 13:59:45 -07:00
Allen Hill 448df3c5aa Add copyright year/author 2024-10-08 12:27:44 -07:00
Allen Hill b0d0703234 Update README.md 2024-08-23 12:33:05 -07:00
Allen Hill fe180c008e Add README 2024-08-23 12:27:38 -07:00
Allen Hill 977041bd67 Commit old working changes 2024-08-23 12:26:42 -07:00
Allen Hill b9382b26d7 Update Cmakelists 2024-08-23 12:25:56 -07:00
Allen Hill 8506e3bfb8 Update devcontainer 2024-08-23 12:25:21 -07:00
Allen Hill 1c1b9e961d Add circuit board and wiring harness 2024-08-23 12:21:31 -07:00
Allen Hill e857bbb09f Add Wireshark packet dissector plugin and associated tools 2024-08-23 11:02:40 -07:00
Allen Hill fadd2c4259 Refactor frame handling and response code 2023-10-28 14:41:56 -04:00
Allen Hill 18ae9a48cc Optimize binary printframe (reduce number of RS232_print calls) 2023-10-28 14:38:15 -04:00
Allen Hill 5b97eff725 Rename HU/CD_ID and change to defines (never need to change at runtime) 2023-10-28 14:36:02 -04:00
Allen Hill 326d4ced99 Boost UART speed 2023-10-28 14:31:44 -04:00
Allen Hill f80f2f1376 Remove bad send init commands function 2023-10-26 13:30:33 -04:00
Allen Hill 218b4320dd Reorder avclan functions and rename AVCLAN_SendAnswer to AVCLAN_respond 2023-10-26 13:01:36 -04:00
Allen Hill c656281275 [NFC] Update comments and move a defines 2023-10-25 14:26:09 -04:00
Allen Hill dbe8b8b877 Rename for_me to shouldACK 2023-10-25 14:13:20 -04:00
Allen Hill c4831b1b48 Remove non-functioning variable 2023-10-25 14:12:27 -04:00
Allen Hill b0b3d9f34e Add muteing functionality and avoid unnecessary work when muted 2023-10-25 14:10:42 -04:00
Allen Hill dea335af7f Remove hardcoded length in favor of const evaled sizeof 2023-10-24 17:42:38 -04:00
Allen Hill c906725a0c Move RTC PIT to avclandrv and add CD status struct and answerreq 2023-10-24 16:39:39 -04:00
Allen Hill 6d62fc4095 Remove copy of libc function 2023-10-23 14:13:53 -04:00
Allen Hill 67608e789f Fix binary printframe 2023-10-16 18:56:22 -04:00
Allen Hill 9c0fcb0bcb Fix Event being sent when cd_mode isnt stPlay 2023-10-09 19:41:51 -04:00
Allen Hill 84f426f39f Move readkey var to sniffer 2023-10-09 19:41:06 -04:00
Allen Hill 7352a279e7 Fix remaining build issues and reformat comments in usart_config 2023-10-09 17:01:25 -04:00
Allen Hill 5ce848f7dd Initial adaptations for avrxmega3 2023-09-17 18:08:38 -04:00
Allen Hill 80e971b978 Fix bad reformats 2023-09-17 14:43:59 -04:00
Allen Hill 9880c66c0f Apply formatting rules [nfc] 2023-09-17 12:22:38 -04:00
Allen Hill b809e91d73 Add @jnk0le AVR-UART-lib master 2023-09-17 12:17:57 -04:00
Allen Hill 17f5510b16 Tweak formatting rules 2023-09-17 12:16:14 -04:00
Allen Hill 1d6690a234 Fix printBinary flag 2023-09-16 16:31:08 -04:00
Allen Hill 0fe2f64eed Fix UART 2x speed config 2023-09-16 19:34:45 +00:00
Allen Hill ebb5ec95ca Add binary printing and reading/parsing from serial 2023-09-15 18:43:41 -04:00
Allen Hill cabcd06e67 Rearrange some functions 2023-09-15 18:37:46 -04:00
Allen Hill ff55d7e671 More send related bugfixes 2023-09-14 19:52:11 -04:00
Allen Hill 1cafed82d0 Change serial baud to 500k at double-speed; but add cmake option for serial rxmode 2023-09-14 19:48:39 -04:00
Allen Hill 9fcca0a6fb Rename INPUT_IS_SET/CLEAR to BUS_IS_IDLE 2023-09-13 21:53:53 -04:00
Allen Hill 3c5c1d269e Fix reading functions 2023-09-13 17:16:21 -04:00
Allen Hill de658f1fb7 Update AVCLAN summary 2023-09-13 17:09:11 -04:00
Allen Hill 64cd4b9958 Remove erroneous PUBLIC include_directory 2023-09-12 19:21:43 -04:00
Allen Hill 18202c5264 Add toggleable verbose debugging messages and tweak/improve the serial interface 2023-09-12 19:21:19 -04:00
Allen Hill 08f7fe934d Add printhex12 function 2023-09-12 11:20:21 -04:00
Allen Hill da6a3371fd Update signal measuring and apply new measurements to bit-timings 2023-09-11 22:12:23 -04:00
Allen Hill bcd07d0ffb Refine timing calculations; use for serial baudrate calculation 2023-09-10 16:48:48 -04:00
Allen Hill 4c19f27992 Update/fix pin levels for new transmission design 2023-09-10 16:34:59 -04:00
Allen Hill 012649d156 Remove makefile; use CMake instead 2023-09-10 16:06:26 -04:00
Allen Hill a9ea586ed4 Setup and bugfix programming with avrdude 2023-09-10 16:05:44 -04:00
Allen Hill 7245695bc7 Setup timing better (fuses, clock speed, TCB clock speed) 2023-09-10 16:02:06 -04:00
Allen Hill 09bcd75811 Implement bit-read timing with TCB0 pulse-width measurement 2023-09-10 15:54:24 -04:00
Allen Hill d6d1995ae4 Re-add an AVCLAN summary/diagram 2023-09-03 20:03:22 -04:00
Allen Hill 332fb4545f Rename send/read bits/bytes functions and rearrange 2023-09-03 19:48:33 -04:00
Allen Hill ba40f96d44 Change sendbit timer config to optimize function length (insns) 2023-09-03 19:32:09 -04:00
Allen Hill ba27167b2e Add RelWithDebInfo build preset 2023-09-03 19:29:23 -04:00
Allen Hill d7af6529ef Copy settings to devcontainer 2023-09-03 19:29:09 -04:00
Allen Hill 82ab967b7c Move incBCD to sniffer; only used there 2023-09-03 19:04:08 -04:00
Allen Hill cedad9df9f Remove unused functions 2023-09-03 18:29:13 -04:00
Allen Hill f13ccffa8d Annotate cases 2023-09-03 18:17:25 -04:00
Allen Hill 230709a103 Add compiler explorer extension for optimizing functions 2023-09-03 18:16:45 -04:00
Allen Hill 9c024506c0 Add copyright attribution for louis frigon too 2023-09-03 18:15:50 -04:00
Allen Hill 3fd8c0255b Sort clang-tidy options 2023-09-03 13:50:08 -04:00
Allen Hill 9a47ba77eb Remove unnecessary extern specifier for functions 2023-09-03 13:48:33 -04:00
Allen Hill 064fc01ac6 Update LICENSE and notices in files 2023-09-03 13:43:49 -04:00
Allen Hill b736816de0 Switch master/slave replacements to OSHWA recommended controller/peripheral 2023-09-03 13:42:12 -04:00
Allen Hill 3e008f32eb Tooling updates and modification suggested by clang-tidy 2023-09-03 09:49:03 -04:00
Allen Hill b9bae7a65f More reorganization [nfc] 2023-09-02 22:18:11 -04:00
Allen Hill 9581957eca More cleanly separate specific functionality into the relevant files 2023-09-02 22:09:37 -04:00
Allen Hill 003c4c7f2f Remove non-functional variables 2023-08-31 21:42:45 -04:00
Allen Hill acd6709e73 Refactor send/receive functions to use a new AVCLAN_frame_t type 2023-08-28 21:00:52 -04:00
Allen Hill 70d153f77c Exclude build artifacts from C/C++ extension analysis 2023-08-28 20:46:55 -04:00
Allen Hill 2a5b95c3f5 Add generic dispatch for AVCLAN_sendbits; simplifies calling use for 12 bit words 2023-08-26 21:15:30 -04:00
Allen Hill 208fe2a097 Remove unused variables 2023-08-25 18:38:25 -04:00
Allen Hill e14cbe40c0 Change parity_bit from global to local for read/send functions 2023-08-23 19:51:35 -04:00
Allen Hill 408f648f77 Replace a bunch of defines with an enum 2023-08-23 18:52:09 -04:00
Allen Hill 9226e7e0f8 Enable AC2_OUT for LED 2023-08-23 18:50:08 -04:00
Allen Hill 8a7184a620 Change split 12bit variables to single uint16_t vars 2023-08-23 17:23:53 -04:00
Allen Hill 4952ecb12b Configure unused and/or output only pins 2023-08-23 16:58:40 -04:00
Allen Hill 368ac7cb5f NFC 2023-08-22 17:14:42 -04:00
Allen Hill fb0bbbe3ca Reformat comments 2023-08-22 17:13:50 -04:00
Allen Hill eb93931522 Only download Microchip pack if avr-libc doesnt support ATtiny3216 2023-08-22 11:59:41 -04:00
Allen Hill 23ea7ee463 Adjust for difference between GNU avr-libc IO headers and Atmel IO headers 2023-08-21 20:09:46 -04:00
Allen Hill 5559f38a51 Setup Dev Containers for VS Code (easy toolchain/build setup) 2023-08-21 20:08:04 -04:00
Allen Hill 522fb41290 Switch to CMake 2023-08-21 20:06:30 -04:00
Allen Hill 553dadfdd0 Move source files into src dir 2023-08-21 19:59:06 -04:00
Allen Hill e21f1a979a Fix warning about array subscript [0] outside array bounds 2023-08-20 20:46:01 -04:00
Allen Hill 4fcdf4af36 Replace byte/word typedefs with uintN_t 2023-08-20 20:45:22 -04:00
Allen Hill c4f67378ae Use alternate UART TxD/RxD pins 2023-08-20 20:41:25 -04:00
Allen Hill 48b20a9c5c Indent case labels 2023-08-19 21:41:45 -04:00
Allen Hill c07083423f Switch PROGMEM related uses to regular flash (flat address space in avrxmega3) 2023-08-19 21:40:40 -04:00
Allen Hill 98e371b529 Remove old/irrelevant files 2023-08-19 20:43:02 -04:00
Allen Hill d27250ec11 Add vscode settings 2023-08-19 20:31:31 -04:00
Allen Hill 5ba6e46827 Update makefile 2023-08-19 20:08:46 -04:00
Allen Hill 14bf33bb97 Fix compiler complaint about VPORTA_OUT in asm 2023-08-19 20:02:46 -04:00
Allen Hill 84fa2fdebc Remove LED functionality 2023-08-19 20:01:59 -04:00
Allen Hill 1da1a52c68 Reformat using clang format 2023-08-19 20:01:10 -04:00
Allen Hill e8d7f5b297 File cleaning 2023-08-17 18:06:02 -04:00
Allen Hill 241b7cf50a Rename HexInc -> incBCD; comment out unused decrement functions 2023-08-06 20:52:29 -04:00
Allen Hill 66633db24e Update serial registers 2023-08-06 20:48:45 -04:00
Allen Hill feccda9e69 Update to use attiny1616 AC2 and TCB1
- Change AVC output enable/disable to only change input/output of pin 7;
  only one pin should need to be used to send (i.e. actual differential
  signaling isn't being used, therefore, we can achieve the necessary
  (single-ended) differential voltage using only one pin, leaving the
  other outputting low)
- Use virtual ports to enable setting output status with single
  instruction
2023-08-03 11:01:45 -04:00
Allen Hill 0a9bd4d988 Replace Timer1 with periodic interrupt timer from the RTC 2023-08-02 21:56:59 -04:00
Allen Hill 49ceb1e5e8 Uncommitted changes from 8 years ago 2023-07-16 15:46:01 -04:00
126 changed files with 203947 additions and 32576 deletions
+10
View File
@@ -0,0 +1,10 @@
---
BasedOnStyle: LLVM
UseCRLF: false
BreakBeforeBraces: Attach
AllowShortBlocksOnASingleLine: Empty
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
AlignConsecutiveMacros: Consecutive
AllowShortCaseLabelsOnASingleLine: true
...
+305
View File
@@ -0,0 +1,305 @@
---
Checks: |
-*,
bugprone-*,
cppcoreguidelines-
clang-diagnostic-*,
clang-analyzer-*,
misc-*,
modernize-*,
performance-*,
readability-*,
-clang-analyzer-core.NullDereference,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-readability-braces-around-statements,
-modernize-avoid-c-arrays,
-modernize-use-std-print,
-readability-magic-numbers,
-readability-function-cognitive-complexity,
-misc-non-private-member-variables-in-classes
WarningsAsErrors: ""
ExcludeHeaderFilterRegex: 'out/build'
HeaderFilterRegex: '^src/.*'
SystemHeaders: false
# AnalyzeTemporaryDtors: false
FormatStyle: none
CheckOptions:
- key: readability-magic-numbers.IgnorePowersOf2IntegerValues
value: "true"
- key: readability-magic-numbers.IgnoredIntegerValues
value: "3;10;0x80;0xc0;0xFF;0x7f;0xf"
- key: readability-identifier-length.IgnoredVariableNames
value: "(in|to|id)"
- key: readability-identifier-length.IgnoredParameterNames
value: "(in|to|x)"
- key: bugprone-argument-comment.CommentBoolLiterals
value: "0"
- key: bugprone-argument-comment.CommentCharacterLiterals
value: "0"
- key: bugprone-argument-comment.CommentFloatLiterals
value: "0"
- key: bugprone-argument-comment.CommentIntegerLiterals
value: "0"
- key: bugprone-argument-comment.CommentNullPtrs
value: "0"
- key: bugprone-argument-comment.CommentStringLiterals
value: "0"
- key: bugprone-argument-comment.CommentUserDefinedLiterals
value: "0"
- key: bugprone-argument-comment.IgnoreSingleArgument
value: "0"
- key: bugprone-argument-comment.StrictMode
value: "0"
- key: bugprone-assert-side-effect.AssertMacros
value: assert,NSAssert,NSCAssert
- key: bugprone-assert-side-effect.CheckFunctionCalls
value: "false"
- key: bugprone-assert-side-effect.IgnoredFunctions
value: __builtin_expect
- key: bugprone-dangling-handle.HandleClasses
value: "std::basic_string_view;std::experimental::basic_string_view"
- key: bugprone-easily-swappable-parameters.IgnoredParameterNames
value: '"";iterator;Iterator;begin;Begin;end;End;first;First;last;Last;lhs;LHS;rhs;RHS'
- key: bugprone-easily-swappable-parameters.IgnoredParameterTypeSuffixes
value: "bool;Bool;_Bool;it;It;iterator;Iterator;inputit;InputIt;forwardit;ForwardIt;bidirit;BidirIt;constiterator;const_iterator;Const_Iterator;Constiterator;ConstIterator;RandomIt;randomit;random_iterator;ReverseIt;reverse_iterator;reverse_const_iterator;ConstReverseIterator;Const_Reverse_Iterator;const_reverse_iterator;Constreverseiterator;constreverseiterator"
- key: bugprone-easily-swappable-parameters.MinimumLength
value: "2"
- key: bugprone-easily-swappable-parameters.ModelImplicitConversions
value: "true"
- key: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold
value: "1"
- key: bugprone-easily-swappable-parameters.QualifiersMix
value: "false"
- key: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether
value: "true"
- key: bugprone-exception-escape.FunctionsThatShouldNotThrow
value: ""
- key: bugprone-exception-escape.IgnoredExceptions
value: ""
- key: bugprone-implicit-widening-of-multiplication-result.IncludeStyle
value: llvm
- key: bugprone-implicit-widening-of-multiplication-result.UseCXXHeadersInCppSources
value: "true"
- key: bugprone-implicit-widening-of-multiplication-result.UseCXXStaticCastsInCppSources
value: "true"
- key: bugprone-misplaced-widening-cast.CheckImplicitCasts
value: "false"
- key: bugprone-narrowing-conversions.IgnoreConversionFromTypes
value: ""
- key: bugprone-narrowing-conversions.PedanticMode
value: "false"
- key: bugprone-narrowing-conversions.WarnOnEquivalentBitWidth
value: "true"
- key: bugprone-narrowing-conversions.WarnOnFloatingPointNarrowingConversion
value: "true"
- key: bugprone-narrowing-conversions.WarnOnIntegerNarrowingConversion
value: "false"
- key: bugprone-narrowing-conversions.WarnOnIntegerToFloatingPointNarrowingConversion
value: "true"
- key: bugprone-narrowing-conversions.WarnWithinTemplateInstantiation
value: "false"
- key: bugprone-not-null-terminated-result.WantToUseSafeFunctions
value: "true"
- key: bugprone-reserved-identifier.AggressiveDependentMemberLookup
value: "false"
- key: bugprone-reserved-identifier.AllowedIdentifiers
value: ""
- key: bugprone-reserved-identifier.Invert
value: "false"
- key: bugprone-signal-handler.AsyncSafeFunctionSet
value: POSIX
- key: bugprone-signed-char-misuse.CharTypdefsToIgnore
value: ""
- key: bugprone-signed-char-misuse.DiagnoseSignedUnsignedCharComparisons
value: "true"
- key: bugprone-sizeof-expression.WarnOnSizeOfCompareToConstant
value: "true"
- key: bugprone-sizeof-expression.WarnOnSizeOfConstant
value: "true"
- key: bugprone-sizeof-expression.WarnOnSizeOfIntegerExpression
value: "false"
- key: bugprone-sizeof-expression.WarnOnSizeOfThis
value: "true"
- key: bugprone-string-constructor.LargeLengthThreshold
value: "8388608"
- key: bugprone-string-constructor.StringNames
value: "::std::basic_string;::std::basic_string_view"
- key: bugprone-string-constructor.WarnOnLargeLength
value: "true"
- key: bugprone-stringview-nullptr.IncludeStyle
value: llvm
- key: bugprone-suspicious-enum-usage.StrictMode
value: "false"
- key: bugprone-suspicious-missing-comma.MaxConcatenatedTokens
value: "5"
- key: bugprone-suspicious-missing-comma.RatioThreshold
value: "0.200000"
- key: bugprone-suspicious-missing-comma.SizeThreshold
value: "5"
- key: bugprone-suspicious-string-compare.StringCompareLikeFunctions
value: ""
- key: bugprone-suspicious-string-compare.WarnOnImplicitComparison
value: "true"
- key: bugprone-suspicious-string-compare.WarnOnLogicalNotComparison
value: "false"
- key: bugprone-too-small-loop-variable.MagnitudeBitsUpperLimit
value: "16"
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField
value: "true"
- key: bugprone-unused-return-value.CheckedFunctions
value: "::std::async;::std::launder;::std::remove;::std::remove_if;::std::unique;::std::unique_ptr::release;::std::basic_string::empty;::std::vector::empty;::std::back_inserter;::std::distance;::std::find;::std::find_if;::std::inserter;::std::lower_bound;::std::make_pair;::std::map::count;::std::map::find;::std::map::lower_bound;::std::multimap::equal_range;::std::multimap::upper_bound;::std::set::count;::std::set::find;::std::setfill;::std::setprecision;::std::setw;::std::upper_bound;::std::vector::at;::bsearch;::ferror;::feof;::isalnum;::isalpha;::isblank;::iscntrl;::isdigit;::isgraph;::islower;::isprint;::ispunct;::isspace;::isupper;::iswalnum;::iswprint;::iswspace;::isxdigit;::memchr;::memcmp;::strcmp;::strcoll;::strncmp;::strpbrk;::strrchr;::strspn;::strstr;::wcscmp;::access;::bind;::connect;::difftime;::dlsym;::fnmatch;::getaddrinfo;::getopt;::htonl;::htons;::iconv_open;::inet_addr;::isascii;::isatty;::mmap;::newlocale;::openat;::pathconf;::pthread_equal;::pthread_getspecific;::pthread_mutex_trylock;::readdir;::readlink;::recvmsg;::regexec;::scandir;::semget;::setjmp;::shm_open;::shmget;::sigismember;::strcasecmp;::strsignal;::ttyname"
- key: cert-dcl16-c.NewSuffixes
value: "L;LL;LU;LLU"
- key: cert-err33-c.CheckedFunctions
value: "::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;"
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: "false"
- key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons
value: "false"
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: "true"
- key: google-readability-braces-around-statements.ShortStatementLines
value: "1"
- key: google-readability-function-size.StatementThreshold
value: "800"
- key: google-readability-namespace-comments.ShortNamespaceLines
value: "10"
- key: google-readability-namespace-comments.SpacesBeforeComments
value: "2"
- key: llvm-else-after-return.WarnOnConditionVariables
value: "false"
- key: llvm-else-after-return.WarnOnUnfixable
value: "false"
- key: llvm-qualified-auto.AddConstToQualified
value: "false"
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: "false"
- key: misc-non-private-member-variables-in-classes.IgnorePublicMemberVariables
value: "false"
- key: misc-throw-by-value-catch-by-reference.CheckThrowTemporaries
value: "true"
- key: misc-throw-by-value-catch-by-reference.WarnOnLargeObject
value: "false"
- key: misc-uniqueptr-reset-release.IncludeStyle
value: llvm
- key: misc-unused-parameters.StrictMode
value: "false"
- key: modernize-avoid-bind.PermissiveParameterList
value: "false"
- key: modernize-loop-convert.IncludeStyle
value: llvm
- key: modernize-loop-convert.MakeReverseRangeFunction
value: ""
- key: modernize-loop-convert.MakeReverseRangeHeader
value: ""
- key: modernize-loop-convert.MaxCopySize
value: "16"
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: modernize-loop-convert.UseCxx20ReverseRanges
value: "true"
- key: modernize-make-shared.IgnoreDefaultInitialization
value: "true"
- key: modernize-make-shared.IgnoreMacros
value: "true"
- key: modernize-make-shared.IncludeStyle
value: llvm
- key: modernize-make-shared.MakeSmartPtrFunction
value: "std::make_shared"
- key: modernize-make-shared.MakeSmartPtrFunctionHeader
value: "<memory>"
- key: modernize-make-unique.IgnoreDefaultInitialization
value: "true"
- key: modernize-make-unique.IgnoreMacros
value: "true"
- key: modernize-make-unique.IncludeStyle
value: llvm
- key: modernize-make-unique.MakeSmartPtrFunction
value: "std::make_unique"
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
value: "<memory>"
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: modernize-pass-by-value.ValuesOnly
value: "false"
- key: modernize-raw-string-literal.DelimiterStem
value: lit
- key: modernize-raw-string-literal.ReplaceShorterLiterals
value: "false"
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: modernize-replace-disallow-copy-and-assign-macro.MacroName
value: DISALLOW_COPY_AND_ASSIGN
- key: modernize-replace-random-shuffle.IncludeStyle
value: llvm
- key: modernize-use-auto.MinTypeNameLength
value: "5"
- key: modernize-use-auto.RemoveStars
value: "false"
- key: modernize-use-bool-literals.IgnoreMacros
value: "true"
- key: modernize-use-default-member-init.IgnoreMacros
value: "true"
- key: modernize-use-default-member-init.UseAssignment
value: "false"
- key: modernize-use-emplace.ContainersWithPushBack
value: "::std::vector;::std::list;::std::deque"
- key: modernize-use-emplace.IgnoreImplicitConstructors
value: "false"
- key: modernize-use-emplace.SmartPointers
value: "::std::shared_ptr;::std::unique_ptr;::std::auto_ptr;::std::weak_ptr"
- key: modernize-use-emplace.TupleMakeFunctions
value: "::std::make_pair;::std::make_tuple"
- key: modernize-use-emplace.TupleTypes
value: "::std::pair;::std::tuple"
- key: modernize-use-equals-default.IgnoreMacros
value: "true"
- key: modernize-use-equals-delete.IgnoreMacros
value: "true"
- key: modernize-use-noexcept.ReplacementString
value: ""
- key: modernize-use-noexcept.UseNoexceptFalse
value: "true"
- key: modernize-use-nullptr.NullMacros
value: "NULL"
- key: modernize-use-override.AllowOverrideAndFinal
value: "false"
- key: modernize-use-override.FinalSpelling
value: final
- key: modernize-use-override.IgnoreDestructors
value: "false"
- key: modernize-use-override.OverrideSpelling
value: override
- key: modernize-use-transparent-functors.SafeMode
value: "false"
- key: modernize-use-using.IgnoreMacros
value: "true"
- key: performance-faster-string-find.StringLikeClasses
value: "::std::basic_string;::std::basic_string_view"
- key: performance-for-range-copy.AllowedTypes
value: ""
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: "false"
- key: performance-inefficient-string-concatenation.StrictMode
value: "false"
- key: performance-inefficient-vector-operation.EnableProto
value: "false"
- key: performance-inefficient-vector-operation.VectorLikeClasses
value: "::std::vector"
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: "true"
- key: performance-no-automatic-move.AllowedTypes
value: ""
- key: performance-type-promotion-in-math-fn.IncludeStyle
value: llvm
- key: performance-unnecessary-copy-initialization.AllowedTypes
value: ""
- key: performance-unnecessary-copy-initialization.ExcludedContainerTypes
value: ""
- key: performance-unnecessary-value-param.AllowedTypes
value: ""
- key: performance-unnecessary-value-param.IncludeStyle
value: llvm
+44
View File
@@ -0,0 +1,44 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/alpine
{
"name": "AVR toolchain",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:alpine-3.22",
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bash scripts/install-toolchain.sh",
"postAttachCommand": "bash scripts/chown-usb.sh",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools-extension-pack",
"rockcat.avr-support",
"harikrishnan94.cxx-compiler-explorer"
],
"settings": {
"editor.formatOnSave": true,
"C_Cpp.codeAnalysis.clangTidy.checks.disabled": [
"clang-analyzer-core.NullDereference"
],
"C_Cpp.files.exclude": {
"build/**": true
},
"files.associations": {
"*.S": "avr"
},
"cmake.configureOnOpen": true,
"compilerexplorer.compilationDirectory": "${workspaceFolder}/build"
}
}
}
// "runArgs": [
// "--device=/dev/ttyUSB0",
// "--device=/dev/ttyUSB1"
// ]
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
# Pre-commit: keep the C++ Device/Action enums in sync with the Lua dissector
# (scripts/sync_avclan_enums.py in its default lint + drift-check mode). A
# non-zero exit blocks the commit; fix with `scripts/sync_avclan_enums.py --fix`.
#
# Installed by the top-level CMake configure step, which points core.hooksPath
# at this directory. Bypass a single commit with `git commit --no-verify`.
set -euo pipefail
repo_root="$(git rev-parse --show-toplevel)"
exec python3 "$repo_root/scripts/sync_avclan_enums.py"
+12
View File
@@ -1,3 +1,15 @@
*.o *.o
*.elf *.elf
*.hex *.hex
*.zip
*.db
*.bak
out/
build/
_autosave*
fp-info-cache
__pycache__/
~*
\#*
/CMakeUserPresets.json
.cache/
+17
View File
@@ -0,0 +1,17 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "${default}",
"compilerArgs": [],
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}
+14
View File
@@ -0,0 +1,14 @@
{
"editor.formatOnSave": true,
"C_Cpp.codeAnalysis.clangTidy.checks.disabled": [
"clang-analyzer-core.NullDereference"
],
"C_Cpp.files.exclude": {
"build/**": true
},
"files.associations": {
"*.S": "avr"
},
"cmake.configureOnOpen": true,
"compilerexplorer.compilationDirectory": "${workspaceFolder}/build",
}
+170
View File
@@ -0,0 +1,170 @@
cmake_minimum_required(VERSION 3.24)
project(avclan-mockingboard VERSION 1.1 LANGUAGES C CXX)
set(CMAKE_C_STANDARD 23)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
add_compile_options(
-Wall -Wswitch-enum -Werror
$<$<COMPILE_LANGUAGE:CXX>:-fno-threadsafe-statics>
$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
# Debug must not be -O0: both the vendored usart.h and avr-libc's
# <util/delay.h> #warning when __OPTIMIZE__ is undefined, and -Werror makes
# that fatal.
$<$<CONFIG:Debug>:-Og>
$<$<CONFIG:Debug>:-fanalyzer>
$<$<CONFIG:Debug>:-Wno-analyzer-use-of-uninitialized-value>)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13")
message(FATAL_ERROR "This project requires at least GCC v13")
endif()
endif()
# Install the repository's git hooks (see .githooks/) by pointing core.hooksPath
# at them at configure time.
# Opt out with -DINSTALL_GIT_HOOKS=OFF; a custom core.hooksPath is left untouched,
# and `git commit --no-verify` bypasses a single commit.
option(INSTALL_GIT_HOOKS "Point git core.hooksPath at .githooks/" ON)
if(INSTALL_GIT_HOOKS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
find_program(GIT_EXECUTABLE git)
if(GIT_EXECUTABLE)
execute_process(
COMMAND "${GIT_EXECUTABLE}" config --get core.hooksPath
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
OUTPUT_VARIABLE _git_hooks_path
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(_git_hooks_path STREQUAL "" OR _git_hooks_path STREQUAL ".githooks")
execute_process(
COMMAND "${GIT_EXECUTABLE}" config core.hooksPath .githooks
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "git hooks: core.hooksPath -> .githooks")
else()
message(STATUS "git hooks: core.hooksPath already '${_git_hooks_path}'; leaving as-is")
endif()
endif()
endif()
# Hardware target (port) selection. The chosen target/<name>/ directory supplies
# the port implementation sources, the per-target include path, and all
# hardware-specific build configuration (compile defs/options, device-pack
# handling, flashing) via its own CMakeLists, pulled in with add_subdirectory
# below. The matching cross-compiler is selected separately by a toolchain file
# (e.g. cmake/avr-gcc-toolchain.cmake) named in a CMake preset. Adding a new
# board = a sibling target/ directory + a toolchain file + a preset wiring them.
set(AVCLAN_TARGET avr-attiny3216 CACHE STRING "Hardware target (port) to build")
# The AVC-LAN stack as a static library: the target-agnostic generic core (no
# <avr/...>, no register access). The selected target's port sources and flags
# are contributed by its subdirectory.
add_library(avclan STATIC
src/avclan/frame.cc
src/avclan/cdchanger.cc
src/avclan/bus.cc
)
# avclan exports its public generic headers (src/avclan) to consumers and
# reaches into src/ for sibling headers (stdio.h, board.h) during its own
# build. The selected target adds its own per-target include path.
target_include_directories(avclan PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src/avclan)
add_executable(mockingboard
src/sniffer.cc
)
target_link_libraries(mockingboard avclan)
# Report firmware section sizes on every build, when the toolchain provides a
# size tool (CMAKE_SIZE). A standalone custom target (rather than a POST_BUILD
# command on mockingboard) so it prints even when the link is up to date:
# custom targets with no output are always considered stale and re-run.
# add_dependencies orders it after the link.
if(CMAKE_SIZE)
add_custom_target(mockingboard-size ALL
COMMAND ${CMAKE_SIZE} $<TARGET_FILE:mockingboard>
COMMENT "Section sizes: mockingboard firmware"
VERBATIM
)
add_dependencies(mockingboard-size mockingboard)
endif()
# Pull in the selected hardware target: its port sources, per-target headers,
# hardware-specific compile options/definitions, device-pack handling, and the
# flashing target. Added after the targets above so it can extend them.
add_subdirectory(src/avclan/target/${AVCLAN_TARGET})
# --- Polyfill headers for std facilities the toolchain may lack -------------
# tl::expected / tl::optional back-fill std::expected / std::optional (with
# C++23 monadic ops) when the build's stdlib predates them. Runs after the port
# subdirectory to provide a port-supplied freestanding stdlib via
# CMAKE_REQUIRED_INCLUDES, if necessary.
include(CheckCXXSourceCompiles)
include(FetchContent)
find_program(GIT_EXECUTABLE git REQUIRED)
if(TARGET libstdcpp)
get_target_property(_stdlib_incs libstdcpp INTERFACE_INCLUDE_DIRECTORIES)
set(CMAKE_REQUIRED_INCLUDES ${_stdlib_incs})
endif()
check_cxx_source_compiles("
#include <version>
#if !defined(__cpp_lib_expected) || __cpp_lib_expected < 202211L
#error no std::expected
#endif
int main() { return 0; }" HAVE_STD_EXPECTED)
# check_cxx_source_compiles("
# #include <version>
# #if !defined(__cpp_lib_optional) || __cpp_lib_optional < 202110L
# #error no C++23 std::optional
# #endif
# int main() { return 0; }" HAVE_STD_OPTIONAL)
unset(CMAKE_REQUIRED_INCLUDES)
if(NOT HAVE_STD_EXPECTED)
FetchContent_Declare(
tl_expected
GIT_REPOSITORY https://github.com/TartanLlama/expected.git
GIT_TAG 1770e3559f2f6ea4a5fb4f577ad22aeb30fbd8e4
PATCH_COMMAND ${CMAKE_COMMAND}
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
-DPATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/tl-expected-no-exception-header.patch
-P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/apply-patch.cmake
SYSTEM
)
set(EXPECTED_BUILD_TESTS OFF)
set(EXPECTED_BUILD_PACKAGE OFF)
FetchContent_MakeAvailable(tl_expected)
add_library(tl_expected_hdr INTERFACE)
target_include_directories(tl_expected_hdr
INTERFACE ${tl_expected_SOURCE_DIR}/include)
target_link_libraries(avclan PUBLIC tl_expected_hdr)
endif()
# std/tl::optional not currently used
# if(NOT HAVE_STD_OPTIONAL)
# FetchContent_Declare(
# tl_optional
# GIT_REPOSITORY https://github.com/TartanLlama/optional.git
# GIT_TAG 3a1209de8370bf5fe16362934956144b49591565
# PATCH_COMMAND ${CMAKE_COMMAND}
# -DGIT_EXECUTABLE=${GIT_EXECUTABLE}
# -DPATCH_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/tl-optional-no-exception-header.patch
# -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/apply-patch.cmake
# SYSTEM
# )
# set(OPTIONAL_BUILD_TESTS OFF)
# set(OPTIONAL_BUILD_PACKAGE OFF)
# FetchContent_MakeAvailable(tl_optional)
# add_library(tl_optional_hdr INTERFACE)
# target_include_directories(tl_optional_hdr
# INTERFACE ${tl_optional_SOURCE_DIR}/include)
# target_link_libraries(avclan PUBLIC tl_optional_hdr)
# endif()
+105
View File
@@ -0,0 +1,105 @@
{
"version": 3,
"configurePresets": [
{
"name": "usb0",
"hidden": true,
"description": "Program over /dev/ttyUSB0",
"cacheVariables": {
"AVRDUDE_PORT": "/dev/ttyUSB0"
}
},
{
"name": "usb1",
"hidden": true,
"description": "Program over /dev/ttyUSB1",
"cacheVariables": {
"AVRDUDE_PORT": "/dev/ttyUSB1"
}
},
{
"name": "avr-attiny3216",
"hidden": true,
"description": "AVR ATtiny3216 cross-compile toolchain + matching port",
"toolchainFile": "${sourceDir}/cmake/avr-gcc-toolchain.cmake",
"binaryDir": "${sourceDir}/out/build/avr-attiny3216",
"cacheVariables": {
"AVCLAN_TARGET": "avr-attiny3216",
"FREQSEL": "20MHz",
"TCB_CLKSEL": "TCB_CLKSEL_CLKDIV1_gc",
"USART_RXMODE": "DOUBLE_SPEED"
}
},
{
"name": "debug-base",
"hidden": true,
"description": "Debug build settings",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "relwithdebinfo-base",
"hidden": true,
"description": "RelWithDebInfo build settings",
"inherits": "debug-base",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "attiny3216-relwithdebinfo",
"hidden": true,
"description": "ATtiny3216 RelWithDebInfo build,",
"inherits": [
"avr-attiny3216",
"relwithdebinfo-base"
]
},
{
"name": "attiny3216-debug",
"hidden": true,
"description": "ATtiny3216 Debug build",
"inherits": [
"avr-attiny3216",
"debug-base"
]
},
{
"name": "attiny3216-relwithdebinfo-usb0",
"displayName": "ATtiny3216 RelWithDebInfo (ttyUSB0)",
"description": "ATtiny3216 RelWithDebInfo build, program over /dev/ttyUSB0",
"inherits": [
"attiny3216-relwithdebinfo",
"usb0"
]
},
{
"name": "attiny3216-relwithdebinfo-usb1",
"displayName": "ATtiny3216 RelWithDebInfo (ttyUSB1)",
"description": "ATtiny3216 RelWithDebInfo build, program over /dev/ttyUSB1",
"inherits": [
"attiny3216-relwithdebinfo",
"usb1"
]
},
{
"name": "attiny3216-debug-usb0",
"displayName": "ATtiny3216 Debug (ttyUSB0)",
"description": "ATtiny3216 Debug build, program over /dev/ttyUSB0",
"inherits": [
"attiny3216-debug",
"usb0"
]
},
{
"name": "attiny3216-debug-usb1",
"displayName": "ATtiny3216 Debug (ttyUSB1)",
"description": "ATtiny3216 Debug build, program over /dev/ttyUSB1",
"inherits": [
"attiny3216-debug",
"usb1"
]
}
]
}
-37
View File
@@ -1,37 +0,0 @@
/*
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------
this file is a part of the TOYOTA Corolla MP3 Player Project
-----------------------------------------------------------------------
http://www.softservice.com.pl/corolla/avc
May 28 / 2009 - version 2
*/
#include "GlobalDef.h"
//------------------------------------------------------------------------------
// max 10 events in fifo
byte EventCount;
byte EventCmd[10];
byte Event;
byte showLog;
byte showLog2;
-85
View File
@@ -1,85 +0,0 @@
/*--------------------------------------------------------------------------------------------------
Name : GlobalDef.h
Description : Global definitions.
History : 2004/04/06 - Created by Louis Frigon.
--------------------------------------------------------------------------------------------------*/
#ifndef _GLOBALDEF_H_
#define _GLOBALDEF_H_
#include <avr/io.h>
/*--------------------------------------------------------------------------------------------------
Constants
--------------------------------------------------------------------------------------------------*/
#define FALSE 0
#define TRUE (!FALSE)
// AVC LAN bus directly connected to internal analog comparator (PD6/7)
// PD6 AIN0 +
// PD7 AIN1 -
#define DATAIN_PIN ACSR
#define DATAIN ACO
#define INPUT_IS_SET ( bit_is_set( DATAIN_PIN, DATAIN ) )
#define INPUT_IS_CLEAR ( bit_is_clear( DATAIN_PIN, DATAIN ) )
#define LED_DDR DDRB
#define LED_PORT PORTB
#define LEDOUT _BV(PORT5)
#define sbi(port, bit) (port) |= (1 << (bit)) // Set bit (i.e. to 1)
#define cbi(port, bit) (port) &= ~(1 << (bit)) // Clear bit (i.e. set bit to 0)
/*--------------------------------------------------------------------------------------------------
Type definitions
--------------------------------------------------------------------------------------------------*/
typedef unsigned char byte;
typedef unsigned int word;
/*--------------------------------------------------------------------------------------------------
Prototypes
--------------------------------------------------------------------------------------------------*/
inline void LedOff( void );
inline void LedOn( void );
/*--------------------------------------------------------------------------------------------------
From Marcin's "const.h"
--------------------------------------------------------------------------------------------------*/
// max 10 events in fifo
extern byte EventCount;
extern byte EventCmd[10];
extern byte Event;
#define EV_NOTHING 0
#define EV_DISPLAY 1
#define EV_STATUS 4
//------------------------------------------------------------------------------
// const
#define smYear 1
#define smMonth 2
#define smDay 3
#define smHour 4
#define smMin 5
#define smWDay 6
//#define STOPEvent cbi(TIMSK, TOIE1); cbi(UCSRB, RXCIE);
//#define STARTEvent sbi(TIMSK, TOIE1); sbi(UCSRB, RXCIE);
extern byte showLog;
extern byte showLog2;
#endif // _GLOBALDEF_H_
/*--------------------------------------------------------------------------------------------------
End of file.
--------------------------------------------------------------------------------------------------*/
+669 -17
View File
@@ -1,22 +1,674 @@
The MIT License (MIT) GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (c) 2015 halleysfifthinc Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Permission is hereby granted, free of charge, to any person obtaining a copy Preamble
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all The GNU General Public License is a free, copyleft license for
copies or substantial portions of the Software. software and other kinds of works.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR The licenses for most software and other practical works are designed
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, to take away your freedom to share and change the works. By contrast,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE the GNU General Public License is intended to guarantee your freedom to
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER share and change all versions of a program--to make sure it remains free
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, software for all its users. We, the Free Software Foundation, use the
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE GNU General Public License for most of our software; it applies also to
SOFTWARE. any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
-39
View File
@@ -1,39 +0,0 @@
CC=avr-g++
CFLAGS=-c -g -Os -Wall -mmcu=atmega328p
CFLAGS+=-fno-exceptions -fpermissive -ffunction-sections -fdata-sections -fno-threadsafe-statics
DEFS= -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_DUEMILANOVE -DARDUINO_ARCH_AVR
LFLAGS=-g -MMD -mmcu=atmega328p
all: sniffer.hex
sniffer.hex: sniffer.elf
avr-objcopy -j .text -j .data -O ihex sniffer.elf sniffer.hex
sniffer.elf: sniffer.o com232.o avclandrv.o GlobalDef.o
$(CC) $(LFLAGS) $(DEFS) -o sniffer.elf sniffer.o com232.o avclandrv.o GlobalDef.o
sniffer.o: sniffer.c GlobalDef.h com232.h avclandrv.h
$(CC) $(CFLAGS) $(DEFS) sniffer.c
com232.o: com232.c com232.h GlobalDef.h
$(CC) $(CFLAGS) $(DEFS) com232.c
avclandrv.o: avclandrv.c GlobalDef.h com232.h avclandrv.h
$(CC) $(CFLAGS) $(DEFS) avclandrv.c
GlobalDef.o: GlobalDef.c GlobalDef.h
$(CC) $(CFLAGS) $(DEFS) GlobalDef.c
clean::
@rm -f *.o *.hex *.elf
.PHONY: upload connect size
upload: sniffer.hex
avrdude -C/home/allen/Programs/arduino-1.6.5/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/arduino -b57600 -D -Uflash:w:sniffer.hex:i
connect:
@picocom --nolock -b 115200 /dev/arduino ||:
size:
avr-size -C --mcu=atmega328p sniffer.elf
+91
View File
@@ -0,0 +1,91 @@
# AVCLAN Mockingboard
<img src="./hardware/pcbv1.png" width=500\>
This project adds an aux in to the stock head unit of compatible Toyota vehicles by emulating an external CD changer. The Mockingboard communicates with the head unit over the AVC-LAN bus, Toyota's name for their messaging protocol over the NEC (now Renesas) IEBus. Also included is a Wireshark dissector for IEBus and AVC-LAN. AVC-LAN is sparsely documented publicly; this dissector collects what's known from prior art alongside my own findings.
# Features:
- Select/switch between internal CD player and mockingboard by pressing the "CD" button (repeated presses toggle between internal and external CD players)
- Generally complete handling of physical interface (track next/prev, fast-forward/rewind, track/disk repeat and random; "scan" button and change disc buttons are currently unimplemented for lack of use/purpose)
- Play/pause, next/prev control of connected phones via headset functions (mimicing the button press on a wired headset; requires phone support and connection using a TRRS aux cable)
## Future plans (Mockingboard v2)
- Bluetooth functionality
- "Scan" button repurposed to enter bluetooth pairing mode
- Button actions (play/pause, track skip, ff/rw, \[disc\] repeat/shuffle) mapped to AVRCP
- Song info/status (time, etc) relayed to head-unit (i.e. time display matches actual song/audio time)
- Redesigned hardware based on RPi Pico 2W (RP2350 + Bluetooth)
- PIO used to implement:
- AVCLAN comms
- I2S audio
- Dual audio input options (aux in, bluetooth)
- Switched audio jack to sense aux plug presence
- Audio codec with differential output (better rejection of electrical noise, e.g. from adjacent AVCLAN bus lines)
- Switching regulator (easier assembly)
- CAN transceiver
- TX/RX connected to different diodes (or different pads of a single dual/multicolor LED package) for observability
# Helpful links/prior art:
- IEBus/AVCLAN decoder and message dumps (inc. a CD changer) for Sigrok
- https://github.com/sigrokproject/sigrok-test/pull/22
- https://github.com/sigrokproject/sigrok-dumps/pull/43
- https://github.com/sigrokproject/libsigrokdecode/pull/106
- https://web.archive.org/web/20230319000356/http://softservice.com.pl/corolla/avc/avclan.php
- https://web.archive.org/web/20040617005106/http://www.interfacebus.com/Design_Connector_IEbus.html
- https://web.archive.org/web/2/https://old.pinouts.ru/Car-Stereo-Toyota-Lexus/Toyota_1990-2002_CD_Chang_pinout.shtml
- https://web.archive.org/web/20240519043021/https://pop.fsck.pl/hardware/toyota-corolla.html
- https://github.com/GadgetNutt/AVC-LAN-Module-Builder
# Firmware
### Building
#### With VS Code:
1. Install VS Code and Docker
- Required extensions: Dev Containers
2. Open repo in VS code and wait for notification asking to re-open in dev container.
- Wait for container to build and extensions to install
3. Select CMake build configuration
4. Start developing!
#### Natively/without VS Code Dev Containers
1. Install avr-gcc >= v13.1, binutils >= v2.39, cmake >= v3.24
2. Configure cmake with a hardware-target preset, `cmake --list-presets` to discover options
- Trigger builds with e.g. `cmake --build out/build/attiny3216`
3. Start developing!
# Hardware
## First generation
See [here](hardware/mockingboard-v1/README.md) for details.
## Second generation
Under development!
# Protocol reverse-engineering
The "scripts/packet-analysis" folder contains a [Wireshark](https://www.wireshark.org/) [Lua plugin](https://www.wireshark.org/docs/wsdg_html_chunked/wsluarm.html) that defines a dissector for IEBUS and AVC-LAN messages.
The dissector's `known_devices` / `known_actions` tables are the source of truth
for AVC-LAN device and action names. `scripts/sync_avclan_enums.py` reconciles
the firmware's C++ `Device` / `Action` enums (and every reference under `src/`)
against them, matching by value so renamed values are propagated. It runs as a
pre-commit hook — the top-level CMake configure step points `core.hooksPath` at
`.githooks/`, so `cmake --preset …` activates it automatically (opt out with
`-DINSTALL_GIT_HOOKS=OFF`; `git commit --no-verify` bypasses one commit). The
hook only reports drift; run `scripts/sync_avclan_enums.py --fix` to apply, and
`--lint` to check that the dissector's own names are valid identifiers.
# License
The firmware for this project is licensed under the [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.html). The AVR-Attiny3216 hardware target depends on a vendored [MIT](https://spdx.org/licenses/MIT) licensed [UART library](https://github.com/jnk0le/AVR-UART-lib), and the [MPL-2.0](https://www.mozilla.org/MPL/2.0/) licensed [avr-libstdcpp](https://github.com/modm-io/avr-libstdcpp/) C++ STL subset.
The hardware is licensed under the [Solderpad Hardware License v2.1](http://solderpad.org/licenses/SHL-2.1/), a
wraparound license to the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0.txt).
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

-996
View File
@@ -1,996 +0,0 @@
/*
Copyright (C) 2015 Allen Hill <allenofthehills@gmail.com>.
Portions of the following source code are:
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------
this file is a part of the TOYOTA Corolla MP3 Player Project
-----------------------------------------------------------------------
http://www.softservice.com.pl/corolla/avc
May 28 / 2009 - version 2
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "avclandrv.h"
#include "com232.h"
#include "GlobalDef.h"
//------------------------------------------------------------------------------
#define AVC_OUT_EN() sbi(PORTD, 6); sbi(DDRD, 6); sbi(DDRD, 7); sbi(ACSR, ACD);
#define AVC_OUT_DIS() cbi(PORTD, 6); cbi(DDRD, 6); cbi(DDRD, 7); cbi(ACSR, ACD);
#define AVC_SET_1() sbi(PORTD, 6);
#define AVC_SET_0() cbi(PORTD, 6);
byte CD_ID_1;
byte CD_ID_2;
byte HU_ID_1;
byte HU_ID_2;
byte parity_bit;
byte repeatMode;
byte randomMode;
byte playMode;
byte cd_Disc;
byte cd_Track;
byte cd_Time_Min;
byte cd_Time_Sec;
byte answerReq;
cd_modes CD_Mode;
byte broadcast;
byte master1;
byte master2;
byte slave1;
byte slave2;
byte message_len;
byte message[MAXMSGLEN];
byte data_control;
byte data_len;
byte data[MAXMSGLEN];
// we need check answer (to avclan check) timeout
// when is more then 1 min, FORCE answer.
byte check_timeout;
#define SW_ID 0x11 // 11 For my stereo
// commands
const byte stat1[] = { 0x4, 0x00, 0x00, 0x01, 0x0A };
const byte stat2[] = { 0x4, 0x00, 0x00, 0x01, 0x08 };
const byte stat3[] = { 0x4, 0x00, 0x00, 0x01, 0x0D };
const byte stat4[] = { 0x4, 0x00, 0x00, 0x01, 0x0C };
// broadcast
const byte lan_stat1[] = { 0x3, 0x00, 0x01, 0x0A };
const byte lan_reg[] = { 0x3, SW_ID, 0x01, 0x00 };
const byte lan_init[] = { 0x3, SW_ID, 0x01, 0x01 };
const byte lan_check[] = { 0x3, SW_ID, 0x01, 0x20 };
const byte lan_playit[] = { 0x4, SW_ID, 0x01, 0x45, 0x63 };
const byte play_req1[] = { 0x4, 0x00, 0x25, 0x63, 0x80 };
#ifdef __AVENSIS__
const byte play_req2[] = { 0x6, 0x00, SW_ID, 0x63, 0x42 };
#else
const byte play_req2[] = { 0x6, 0x00, SW_ID, 0x63, 0x42, 0x01, 0x00 };
#endif
const byte play_req3[] = { 0x6, 0x00, SW_ID, 0x63, 0x42, 0x41, 0x00 };
const byte stop_req[] = { 0x5, 0x00, SW_ID, 0x63, 0x43, 0x01 };
const byte stop_req2[] = { 0x5, 0x00, SW_ID, 0x63, 0x43, 0x41 };
// answers
const byte CMD_REGISTER[] = {0x1, 0x05, 0x00, 0x01, SW_ID, 0x10, 0x63 };
const byte CMD_STATUS1[] = {0x1, 0x04, 0x00, 0x01, 0x00, 0x1A };
const byte CMD_STATUS2[] = {0x1, 0x04, 0x00, 0x01, 0x00, 0x18 };
const byte CMD_STATUS3[] = {0x1, 0x04, 0x00, 0x01, 0x00, 0x1D };
const byte CMD_STATUS4[] = {0x1, 0x05, 0x00, 0x01, 0x00, 0x1C, 0x00 };
byte CMD_CHECK[] = {0x1, 0x06, 0x00, 0x01, SW_ID, 0x30, 0x00, 0x00 };
const byte CMD_STATUS5[] = {0x1, 0x05, 0x00, 0x5C, 0x12, 0x53, 0x02 };
const byte CMD_STATUS5A[] = {0x0, 0x05, 0x5C, 0x31, 0xF1, 0x00, 0x00 };
const byte CMD_STATUS6[] = {0x1, 0x06, 0x00, 0x5C, 0x32, 0xF0, 0x02, 0x00 };
const byte CMD_PLAY_OK1[] = {0x1, 0x05, 0x00, 0x63, SW_ID, 0x50, 0x01 };
const byte CMD_PLAY_OK2[] = {0x1, 0x05, 0x00, 0x63, SW_ID, 0x52, 0x01 };
const byte CMD_PLAY_OK3[] = {0x0, 0x0B, 0x63, 0x31, 0xF1, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0xFF, 0x00, 0x80 };
byte CMD_PLAY_OK4[] = {0x0, 0x0B, 0x63, 0x31, 0xF1, 0x01, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 };
const byte CMD_STOP1[] = {0x1, 0x05, 0x00, 0x63, SW_ID, 0x53, 0x01 };
byte CMD_STOP2[] = {0x0, 0x0B, 0x63, 0x31, 0xF1, 0x00, 0x30, 0x00, 0x00,0x00, 0x00, 0x00, 0x80 };
const byte CMD_BEEP[] = {0x1, 0x05, 0x00, 0x63, 0x29, 0x60, 0x02 };
//------------------------------------------------------------------------------
// DONE: Timing adjusted, however refactoring may make code more clear/efficient
//------------------------------------------------------------------------------
void AVC_HoldLine()
{
STOPEvent;
// wait for free line
byte line_busy = 1;
TCNT0 = 0;
do {
while (INPUT_IS_CLEAR) {
/* The comparison value was originally 25 with CK64 (tick period of 4.34 us)
at a clock frequency 14.7456MHz.
For a more accurate tick period of .5 us at 16MHz, the value should be approximately 225*/
if (TCNT0 >= 225) break;
}
if (TCNT0 > 216) line_busy=0;
} while (line_busy);
// switch to out mode
AVC_OUT_EN();
AVC_SET_1();
STARTEvent;
}
// DONE: No changes necessary
//------------------------------------------------------------------------------
void AVC_ReleaseLine()
{
AVC_SET_0();
AVC_OUT_DIS();
}
//------------------------------------------------------------------------------
// DONE: No changes necessary
//------------------------------------------------------------------------------
void AVCLan_Init()
{
// OUTPUT ( set as input for comparator )
cbi(PORTD, 6);
cbi(DDRD, 6);
// INPUT
cbi(PORTD, 7);
cbi(DDRD, 7);
// Analog comparator
cbi(ADCSRB, ACME); // Analog Comparator Multiplexer Enable - NO
/*
cbi(ACSR, ACBG); // Analog Comparator Bandgap Select
// ACI: Analog Comparator Interrupt Flag
cbi(ACSR, ACIE); // Analog Comparator Interrupt Enable - NO
cbi(ACSR, ACIC); // Analog Comparator Input Capture Enable - NO
*/
cbi(ACSR, ACIS1); // Analog Comparator Interrupt Mode Select
cbi(ACSR, ACIS0); // Comparator Interrupt on Output Toggle
cbi(ACSR, ACD); // Analog Comparator Disable - NO
TCCR0B = _BV(CS01); // Timer 0 prescaler = 8 ( 2 count / us )
message_len = 0;
answerReq = cmNull;
check_timeout = 0;
cd_Disc = 1;
cd_Track = 1;
cd_Time_Min = 0;
cd_Time_Sec = 0;
repeatMode = 0;
randomMode = 0;
playMode = 0;
CD_Mode = stStop;
}
// DONE: Timing adjusted, however refactoring may make code more clear/efficient
//------------------------------------------------------------------------------
byte AVCLan_Read_Byte(byte length)
{
byte bite = 0;
while (1) {
while (INPUT_IS_CLEAR);
TCNT0 = 0;
while (INPUT_IS_SET); // If input was set for less than a
if ( TCNT0 < 52 ) { // generous half period, bit was a 1
bite++;
parity_bit++;
}
length--;
if (!length) return bite;
bite = bite << 1;
}
}
// DONE: Timing adjusted
//------------------------------------------------------------------------------
byte AVCLan_Send_StartBit()
{
AVC_SET_1();
TCNT0 = 0;
while( TCNT0 < 255 );
TCNT0 = 0;
while( TCNT0 < 76 );
AVC_SET_0();
TCNT0 = 0;
while( TCNT0 < 61 );
return 1;
}
// DONE: Timing adjusted. Comparison values are timer ticks, not us.
//------------------------------------------------------------------------------
void AVCLan_Send_Bit1()
{
AVC_SET_1();
TCNT0 = 0;
while( TCNT0 < 41 );
AVC_SET_0();
TCNT0 = 0;
while( TCNT0 < 38 ); // 12-21 us
}
// DONE: Timing adjusted
//------------------------------------------------------------------------------
void AVCLan_Send_Bit0()
{
AVC_SET_1();
TCNT0 = 0;
while( TCNT0 < 65 ); // 28-37 us
AVC_SET_0();
TCNT0 = 0;
while( TCNT0 < 15 ); // 00-09 us
}
// DONE: Timing adjusted.
//------------------------------------------------------------------------------
byte AVCLan_Read_ACK()
{
AVC_SET_1();
TCNT0 = 0;
while( TCNT0 < 39 );
AVC_SET_0();
TCNT0 = 0;
while( TCNT0 < 4 ); // Replace with AVC_ReleaseLine?
AVC_OUT_DIS(); // switch to read mode
TCNT0 = 1;
while(1) {
if (INPUT_IS_SET && (TCNT0 > 5)) break; // Make sure INPUT is not still set from us
// Line of experimentation: Try changing TCNT0 comparison value or remove check entirely
if (TCNT0 > 174 ) return 1; // Not sure if this fix is intent correct
}
while(INPUT_IS_SET);
AVC_OUT_EN(); // back to write mode
return 0;
}
// DONE: Timing adjusted.
//------------------------------------------------------------------------------
byte AVCLan_Send_ACK()
{
TCNT0 = 0;
while (INPUT_IS_CLEAR) {
if (TCNT0 >= 225) return 0; // max wait time
}
AVC_OUT_EN();
AVC_SET_1();
TCNT0 = 0;
while( TCNT0 < 65 ); //28-37
AVC_SET_0();
TCNT0 = 0;
while( TCNT0 < 15 ); //00-09
AVC_OUT_DIS();
return 1;
}
// DONE: var 'byte' adjusted to 'bite' to avoid reserved word conflict
//------------------------------------------------------------------------------
byte AVCLan_Send_Byte(byte bite, byte len)
{
byte b;
if (len==8) {
b = bite;
} else {
b = bite << (8-len);
}
while (1) {
if ( (b & 128)!=0 ) {
AVCLan_Send_Bit1();
parity_bit++;
} else {
AVCLan_Send_Bit0();
}
len--;
if (!len) {
//if (INPUT_IS_SET) RS232_Print_P(PSTR("SBER\n")); // Send Bit ERror
return 1;
}
b = b << 1;
}
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte AVCLan_Send_ParityBit()
{
if ( (parity_bit & 1)!=0 ) {
AVCLan_Send_Bit1();
//parity_bit++;
} else {
AVCLan_Send_Bit0();
}
parity_bit=0;
return 1;
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte CheckCmd(byte *cmd)
{
byte i;
byte *c;
byte l;
c = cmd;
l = *c++;
for (i=0; i<l; i++) {
if (message[i] != *c) return 0;
c++;
}
return 1;
}
// DONE: Timing adjusted.
//------------------------------------------------------------------------------
byte AVCLan_Read_Message()
{
STOPEvent; // disable timer1 interrupt
byte i;
byte for_me = 0;
//RS232_Print_P(PSTR("$ "));
// TCCR1B |= (1 << CS11)|(1 << CS10); // Timer1 prescaler at 64
// TCNT1 = 0;
// TCNT0 = 0;
// while (INPUT_IS_SET) {
// if ( TCNT0 > 255 ) { // 170 us
// // TCCR1B = 0;
// // TCCR1B |= (1 << WGM12)|(1 << CS12); // Set CTC, prescaler at 256
// STARTEvent;
// RS232_Print_P(PSTR("LAN>T1\n"));
// return 0;
// }
// }
//
// if ( TCNT0 < 20 ) { // 20 us
// // TCCR1B = 0;
// // TCCR1B |= (1 << WGM12)|(1 << CS12);
// STARTEvent;
// RS232_Print_P(PSTR("LAN>T2\n"));
// return 0;
// }
AVCLan_Read_Byte(1);
broadcast = AVCLan_Read_Byte(1);
parity_bit = 0;
master1 = AVCLan_Read_Byte(4);
master2 = AVCLan_Read_Byte(8);
if ((parity_bit&1)!=AVCLan_Read_Byte(1)) {
STARTEvent;
return 0;
}
parity_bit = 0;
slave1 = AVCLan_Read_Byte(4);
slave2 = AVCLan_Read_Byte(8);
if ((parity_bit&1)!=AVCLan_Read_Byte(1)) {
STARTEvent;
return 0;
}
// is this command for me ?
if ((slave1==CD_ID_1)&&(slave2==CD_ID_2)) {
for_me=1;
}
if (for_me) AVCLan_Send_ACK();
else AVCLan_Read_Byte(1);
parity_bit = 0;
AVCLan_Read_Byte(4); // control - always 0xF
if ((parity_bit&1)!=AVCLan_Read_Byte(1)) {
STARTEvent;
return 0;
}
if (for_me) AVCLan_Send_ACK();
else AVCLan_Read_Byte(1);
parity_bit = 0;
message_len = AVCLan_Read_Byte(8);
if ((parity_bit&1)!=AVCLan_Read_Byte(1)) {
STARTEvent;
return 0;
}
if (for_me) AVCLan_Send_ACK();
else AVCLan_Read_Byte(1);
if (message_len > MAXMSGLEN) {
// RS232_Print_P(PSTR("LAN> Command error"));
STARTEvent;
return 0;
}
for (i=0; i<message_len; i++) {
parity_bit = 0;
message[i] = AVCLan_Read_Byte(8);
if ((parity_bit&1)!=AVCLan_Read_Byte(1)) {
STARTEvent;
return 0;
}
if (for_me) {
AVCLan_Send_ACK();
} else {
AVCLan_Read_Byte(1);
}
}
STARTEvent;
if (showLog) ShowInMessage();
if (for_me) {
if (CheckCmd((byte*)stat1)) { answerReq = cmStatus1; return 1; }
if (CheckCmd((byte*)stat2)) { answerReq = cmStatus2; return 1; }
if (CheckCmd((byte*)stat3)) { answerReq = cmStatus3; return 1; }
if (CheckCmd((byte*)stat4)) { answerReq = cmStatus4; return 1; }
// if (CheckCmd((byte*)stat5)) { answerReq = cmStatus5; return 1; }
if (CheckCmd((byte*)play_req1)) { answerReq = cmPlayReq1; return 1; }
if (CheckCmd((byte*)play_req2)) { answerReq = cmPlayReq2; return 1; }
if (CheckCmd((byte*)play_req3)) { answerReq = cmPlayReq3; return 1; }
if (CheckCmd((byte*)stop_req)) { answerReq = cmStopReq; return 1; }
if (CheckCmd((byte*)stop_req2)) { answerReq = cmStopReq2; return 1; }
} else { // broadcast check
if (CheckCmd((byte*)lan_playit)) { answerReq = cmPlayIt; return 1; }
if (CheckCmd((byte*)lan_check)) {
answerReq = cmCheck;
CMD_CHECK[6]=message[3];
return 1;
}
if (CheckCmd((byte*)lan_reg)) { answerReq = cmRegister; return 1; }
if (CheckCmd((byte*)lan_init)) { answerReq = cmInit; return 1; }
if (CheckCmd((byte*)lan_stat1)) { answerReq = cmStatus1; return 1; }
}
answerReq = cmNull;
return 1;
}
// DONE: Timing adjusted.
//------------------------------------------------------------------------------
byte AVCLan_SendData()
{
byte i;
STOPEvent;
// wait for free line
byte line_busy = 1;
TCNT0 = 0;
do {
while (INPUT_IS_CLEAR) {
if ( TCNT0 >= 225 ) break;
}
if ( TCNT0 > 216 ) line_busy=0;
} while (line_busy);
// switch to output mode
AVC_OUT_EN();
AVCLan_Send_StartBit();
AVCLan_Send_Byte(0x1, 1); // regular communication
parity_bit = 0;
AVCLan_Send_Byte(CD_ID_1, 4); // CD Changer ID as master
AVCLan_Send_Byte(CD_ID_2, 8);
AVCLan_Send_ParityBit();
AVCLan_Send_Byte(HU_ID_1, 4); // HeadUnit ID as slave
AVCLan_Send_Byte(HU_ID_2, 8);
AVCLan_Send_ParityBit();
if (AVCLan_Read_ACK()) {
AVC_OUT_DIS();
STARTEvent;
RS232_Print_P(PSTR("Error ACK 1 (Transmission ACK)\n"));
return 1;
}
AVCLan_Send_Byte(0xF, 4); // 0xf - control -> COMMAND WRITE
AVCLan_Send_ParityBit();
if (AVCLan_Read_ACK()) {
AVC_OUT_DIS();
STARTEvent;
RS232_Print_P(PSTR("Error ACK 2 (COMMMAND WRITE)\n"));
return 2;
}
AVCLan_Send_Byte(data_len, 8);// data length
AVCLan_Send_ParityBit();
if (AVCLan_Read_ACK()) {
AVC_OUT_DIS();
STARTEvent;
RS232_Print_P(PSTR("Error ACK 3 (Data Length)\n"));
return 3;
}
for (i=0;i<data_len;i++) {
AVCLan_Send_Byte(data[i], 8);// data byte
AVCLan_Send_ParityBit();
if (AVCLan_Read_ACK()) {
AVC_OUT_DIS();
STARTEvent;
RS232_Print_P(PSTR("Error ACK 4 (Data Byte: "));
RS232_PrintDec(i);
RS232_Print_P(PSTR(")\n"));
return 4;
}
}
// back to read mode
AVC_OUT_DIS();
STARTEvent;
if (showLog) ShowOutMessage();
return 0;
}
// DONE: Timing adjusted.
//------------------------------------------------------------------------------
byte AVCLan_SendDataBroadcast()
{
byte i;
STOPEvent;
// wait for free line
byte line_busy = 1;
TCNT0 = 0;
do {
while (INPUT_IS_CLEAR) {
if ( TCNT0 >= 225 ) break;
}
if ( TCNT0 > 216 ) line_busy=0;
} while (line_busy);
AVC_OUT_EN();
AVCLan_Send_StartBit();
AVCLan_Send_Byte(0x0, 1); // broadcast
parity_bit = 0;
AVCLan_Send_Byte(CD_ID_1, 4); // CD Changer ID as master
AVCLan_Send_Byte(CD_ID_2, 8);
AVCLan_Send_ParityBit();
AVCLan_Send_Byte(0x1, 4); // all audio devices
AVCLan_Send_Byte(0xFF, 8);
AVCLan_Send_ParityBit();
AVCLan_Send_Bit1();
AVCLan_Send_Byte(0xF, 4); // 0xf - control -> COMMAND WRITE
AVCLan_Send_ParityBit();
AVCLan_Send_Bit1();
AVCLan_Send_Byte(data_len, 8); // data lenght
AVCLan_Send_ParityBit();
AVCLan_Send_Bit1();
for (i=0;i<data_len;i++) {
AVCLan_Send_Byte(data[i], 8); // data byte
AVCLan_Send_ParityBit();
AVCLan_Send_Bit1();
}
AVC_OUT_DIS();
STARTEvent;
if (showLog) ShowOutMessage();
return 0;
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte AVCLan_SendAnswerFrame(byte *cmd)
{
byte i;
byte *c;
byte b;
c = cmd;
b = *c++;
data_control = 0xF;
data_len = *c++;
for (i=0; i<data_len; i++) {
data[i]= *c++;
}
if (b)
return AVCLan_SendData();
else
return AVCLan_SendDataBroadcast();
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte AVCLan_SendMyData(byte *data_tmp, byte s_len)
{
byte i;
byte *c;
c = data_tmp;
data_control = 0xF;
data_len = s_len;
for (i=0; i<data_len; i++) {
data[i]= *c++;
}
return AVCLan_SendData();
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte AVCLan_SendMyDataBroadcast(byte *data_tmp, byte s_len)
{
byte i;
byte *c;
c = data_tmp;
data_control = 0xF;
data_len = s_len;
for (i=0; i<data_len; i++) {
data[i]= *c++;
}
return AVCLan_SendDataBroadcast();
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte AVCLan_SendInitCommands()
{
byte r;
const byte c1[] = { 0x0, 0x0B, 0x63, 0x31, 0xF1, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x80 };
const byte c2[] = { 0x0, 0x0A, 0x63, 0x31, 0xF3, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x02 };
const byte c3[] = { 0x0, 0x0A, 0x63, 0x31, 0xF3, 0x00, 0x3F, 0x00, 0x01, 0x00, 0x01, 0x02 };
const byte c4[] = { 0x0, 0x0A, 0x63, 0x31, 0xF3, 0x00, 0x3D, 0x00, 0x01, 0x00, 0x01, 0x02 };
const byte c5[] = { 0x0, 0x0A, 0x63, 0x31, 0xF3, 0x00, 0x39, 0x00, 0x01, 0x00, 0x01, 0x02 };
const byte c6[] = { 0x0, 0x0A, 0x63, 0x31, 0xF3, 0x00, 0x31, 0x00, 0x01, 0x00, 0x01, 0x02 };
const byte c7[] = { 0x0, 0x0A, 0x63, 0x31, 0xF3, 0x00, 0x21, 0x00, 0x01, 0x00, 0x01, 0x02 };
const byte c8[] = { 0x0, 0x0B, 0x63, 0x31, 0xF1, 0x00, 0x90, 0x01, 0xFF, 0xFF, 0xFF, 0x00, 0x80 };
const byte c9[] = { 0x0, 0x0A, 0x63, 0x31, 0xF3, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x02 };
const byte cA[] = { 0x0, 0x0B, 0x63, 0x31, 0xF1, 0x00, 0x30, 0x01, 0xFF, 0xFF, 0xFF, 0x00, 0x80 };
r = AVCLan_SendAnswerFrame((byte*)c1);
if (!r) r = AVCLan_SendAnswerFrame((byte*)c2);
if (!r) r = AVCLan_SendAnswerFrame((byte*)c3);
if (!r) r = AVCLan_SendAnswerFrame((byte*)c4);
if (!r) r = AVCLan_SendAnswerFrame((byte*)c5);
if (!r) r = AVCLan_SendAnswerFrame((byte*)c6);
if (!r) r = AVCLan_SendAnswerFrame((byte*)c7);
if (!r) r = AVCLan_SendAnswerFrame((byte*)c8);
if (!r) r = AVCLan_SendAnswerFrame((byte*)c9);
if (!r) r = AVCLan_SendAnswerFrame((byte*)cA);
//const byte c1[] = { 0x0, 0x0B, 0x63, 0x31, 0xF1, 0x00, 0x80, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x80 };
//r = AVCLan_SendAnswerFrame((byte*)c1);
return r;
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
void AVCLan_Send_Status()
{
// disc track t_min t_sec
byte STATUS[] = {0x0, 0x0B, 0x63, 0x31, 0xF1, 0x01, 0x10, 0x01, 0x01, 0x00, 0x00, 0x00, 0x80 };
STATUS[7] = cd_Disc;
STATUS[8] = cd_Track;
STATUS[9] = cd_Time_Min;
STATUS[10] = cd_Time_Sec;
STATUS[11] = 0;
AVCLan_SendAnswerFrame((byte*)STATUS);
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte AVCLan_SendAnswer()
{
byte r = 0 ;
switch (answerReq) {
case cmStatus1: r = AVCLan_SendAnswerFrame((byte*)CMD_STATUS1);
break;
case cmStatus2: r = AVCLan_SendAnswerFrame((byte*)CMD_STATUS2);
break;
case cmStatus3: r = AVCLan_SendAnswerFrame((byte*)CMD_STATUS3);
break;
case cmStatus4: r = AVCLan_SendAnswerFrame((byte*)CMD_STATUS4);
break;
case cmRegister: r = AVCLan_SendAnswerFrame((byte*)CMD_REGISTER);
break;
case cmInit: //RS232_Print_P(PSTR("INIT\n"));
r = AVCLan_SendInitCommands();
break;
case cmCheck: r = AVCLan_SendAnswerFrame((byte*)CMD_CHECK);
check_timeout = 0;
CMD_CHECK[6]++;
RS232_Print_P(PSTR("AVCCHK\n"));
break;
case cmPlayReq1: playMode = 0;
r = AVCLan_SendAnswerFrame((byte*)CMD_PLAY_OK1);
break;
case cmPlayReq2:
case cmPlayReq3: playMode = 0;
r = AVCLan_SendAnswerFrame((byte*)CMD_PLAY_OK2);
if (!r) r = AVCLan_SendAnswerFrame((byte*)CMD_PLAY_OK3);
CD_Mode = stPlay;
break;
case cmPlayIt: playMode = 1;
RS232_Print_P(PSTR("PLAY\n"));
CMD_PLAY_OK4[7]=cd_Disc;
CMD_PLAY_OK4[8]=cd_Track;
CMD_PLAY_OK4[9]=cd_Time_Min;
CMD_PLAY_OK4[10]=cd_Time_Sec;
r = AVCLan_SendAnswerFrame((byte*)CMD_PLAY_OK4);
if (!r) AVCLan_Send_Status();
CD_Mode = stPlay;
break;
case cmStopReq:
case cmStopReq2: CD_Mode = stStop;
playMode = 0;
r = AVCLan_SendAnswerFrame((byte*)CMD_STOP1);
CMD_STOP2[7]=cd_Disc;
CMD_STOP2[8]=cd_Track;
CMD_STOP2[9]=cd_Time_Min;
CMD_STOP2[10]=cd_Time_Sec;
r = AVCLan_SendAnswerFrame((byte*)CMD_STOP2);
break;
case cmBeep: AVCLan_SendAnswerFrame((byte*)CMD_BEEP);
break;
}
answerReq = cmNull;
return r;
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
void AVCLan_Register()
{
RS232_Print_P(PSTR("REG_ST\n"));
AVCLan_SendAnswerFrame((byte*)CMD_REGISTER);
RS232_Print_P(PSTR("REG_END\n"));
//AVCLan_Command( cmRegister );
AVCLan_Command( cmInit );
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte AVCLan_Command(byte command)
{
byte r;
answerReq = command;
r = AVCLan_SendAnswer();
/*
RS232_Print_P(PSTR("ret="));
RS232_PrintHex8(r);
RS232_Print_P(PSTR("\n"));
*/
return r;
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte HexInc(byte data)
{
if ((data & 0x9)==0x9)
return (data + 7);
return (data+1);
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
byte HexDec(byte data)
{
if ((data & 0xF)==0)
return (data - 7);
return (data-1);
}
// DONE: Nothing needed.
//------------------------------------------------------------------------------
// encode decimal valute to 'toyota' format :-)
// ex. 42 (dec) = 0x42 (toy)
byte Dec2Toy(byte data)
{
byte d,d1;
d = (unsigned int)data/(unsigned int)10;
d1 = d * 16;
d = d1 + (data - 10*d);
return d;
}
// DONE: No timing adjustment needed.
//------------------------------------------------------------------------------
void ShowInMessage()
{
if (message_len==0) return;
AVC_HoldLine();
RS232_Print_P(PSTR("HU < ("));
if (broadcast==0) RS232_Print_P(PSTR("bro) "));
else RS232_Print_P(PSTR("dir) "));
RS232_PrintHex4(master1);
RS232_PrintHex8(master2);
RS232_Print_P(PSTR("| "));
RS232_PrintHex4(slave1);
RS232_PrintHex8(slave2);
RS232_Print_P(PSTR("| "));
byte i;
for (i=0;i<message_len;i++) {
RS232_PrintHex8(message[i]);
RS232_Print_P(PSTR(" "));
}
RS232_Print_P(PSTR("\n"));
AVC_ReleaseLine();
}
//------------------------------------------------------------------------------
void ShowOutMessage()
{
byte i;
AVC_HoldLine();
RS232_Print_P(PSTR("out > "));
for (i=0; i<data_len; i++) {
RS232_PrintHex8(data[i]);
RS232_SendByte(' ');
}
RS232_Print_P(PSTR("\n"));
AVC_ReleaseLine();
}
void AVCLan_Measure()
{
STOPEvent;
word tmp, tmp1, tmp2, bit0, bit1;
word n = 0;
cbi(TCCR1B,CS12);
TCCR1B = _BV(CS10);
while ( n < 1000 )
{
while(INPUT_IS_CLEAR);
TCNT1 = 0;
while(INPUT_IS_SET);
tmp = TCNT1;
while(INPUT_IS_CLEAR);
tmp1 = TCNT1;
while(INPUT_IS_SET);
tmp2 = TCNT1;
bit0 = tmp1-tmp;
bit1 = tmp2-tmp1;
RS232_Print_P(PSTR("1,"));
RS232_PrintDec(bit1);
RS232_Print_P(PSTR("\n"));
RS232_Print_P(PSTR("0,"));
RS232_PrintDec(bit0);
RS232_Print_P(PSTR("\n"));
n++;
}
RS232_Print_P(PSTR("Done.\n"));
cbi(TCCR1B,CS10);
TCCR1B = _BV(CS12);
STARTEvent;
}
//------------------------------------------------------------------------------
-136
View File
@@ -1,136 +0,0 @@
/*
Copyright (C) 2015 Allen Hill <allenofthehills@gmail.com>.
Portions of the following source code are:
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------
this file is a part of the TOYOTA Corolla MP3 Player Project
-----------------------------------------------------------------------
http://www.softservice.com.pl/corolla/avc
May 28 / 2009 - version 2
*/
#ifndef __AVCLANDRV_H
#define __AVCLANDRV_H
//------------------------------------------------------------------------------
#include "GlobalDef.h"
#define STOPEvent cbi(TIMSK1, TOIE1); cbi(UCSR0B, RXCIE0);
#define STARTEvent sbi(TIMSK1, TOIE1); sbi(UCSR0B, RXCIE0);
#define CHECK_AVC_LINE if (INPUT_IS_SET) AVCLan_Read_Message();
void AVC_HoldLine();
void AVC_ReleaseLine();
#define MAXMSGLEN 32
// Head Unid ID
extern byte HU_ID_1; // 0x01
extern byte HU_ID_2; // 0x40
extern byte CD_ID_1; // 0x03
extern byte CD_ID_2; // 0x60
// DVD CHANGER
//#define CD_ID_1 0x02
//#define CD_ID_2 0x50
#define cmNull 0
#define cmStatus1 1
#define cmStatus2 2
#define cmStatus3 3
#define cmStatus4 4
#define cmRegister 100
#define cmInit 101
#define cmCheck 102
#define cmPlayIt 103
#define cmBeep 110
#define cmNextTrack 120
#define cmPrevTrack 121
#define cmNextDisc 122
#define cmPrevDisc 123
#define cmScanModeOn 130
#define cmScanModeOff 131
#define cmPlayReq1 5
#define cmPlayReq2 6
#define cmPlayReq3 7
#define cmStopReq 8
#define cmStopReq2 9
typedef enum { stStop=0, stPlay=1 } cd_modes;
extern cd_modes CD_Mode;
extern byte broadcast;
extern byte master1;
extern byte master2;
extern byte slave1;
extern byte slave2;
extern byte message_len;
extern byte message[MAXMSGLEN];
extern byte data_control;
extern byte data_len;
extern byte data[MAXMSGLEN];
byte AVCLan_Read_Message();
void AVCLan_Send_Status();
void AVCLan_Init();
void AVCLan_Register();
byte AVCLan_SendData();
byte AVCLan_SendAnswer();
byte AVCLan_SendDataBroadcast();
byte AVCLan_Command(byte command);
byte HexInc(byte data);
byte HexDec(byte data);
byte Dec2Toy(byte data);
extern byte check_timeout;
extern byte cd_Disc;
extern byte cd_Track;
extern byte cd_Time_Min;
extern byte cd_Time_Sec;
extern byte playMode;
byte AVCLan_SendMyData(byte *data_tmp, byte s_len);
byte AVCLan_SendMyDataBroadcast(byte *data_tmp, byte s_len);
void ShowInMessage();
void ShowOutMessage();
void AVCLan_Measure();
//------------------------------------------------------------------------------
extern byte answerReq;
//------------------------------------------------------------------------------
#endif
+18
View File
@@ -0,0 +1,18 @@
# Idempotent patch driver for FetchContent PATCH_COMMAND steps.
#
# Usage: cmake -DGIT_EXECUTABLE=<git> -DPATCH_FILE=<patch> -P apply-patch.cmake
# (run with CWD = the populated source directory, as PATCH_COMMAND does).
#
# FetchContent re-runs PATCH_COMMAND after its update step on reconfigure, so a
# bare `git apply` fails the second time around. Skip if the patch is already
# applied (the reverse-apply dry run succeeds); otherwise apply it for real.
execute_process(
COMMAND "${GIT_EXECUTABLE}" apply --reverse --check --ignore-whitespace
"${PATCH_FILE}"
RESULT_VARIABLE _already_applied
OUTPUT_QUIET ERROR_QUIET)
if(NOT _already_applied EQUAL 0)
execute_process(
COMMAND "${GIT_EXECUTABLE}" apply --ignore-whitespace "${PATCH_FILE}"
COMMAND_ERROR_IS_FATAL ANY)
endif()
+37
View File
@@ -0,0 +1,37 @@
##########################################################################
# AVR cross-compilation toolchain (ATtiny-0/1/2 series, UPDI programming).
#
# Originally based on Matthias Kleemann's avr-cmake module
# (<dev@layer128.net>, "THE ANY BEVERAGE-WARE LICENSE"), but slimmed to just
# the cross-compiler definition, the AVR-wide compile/link flags, and the
# avrdude configuration the `flash` target needs.
#
##########################################################################
##########################################################################
# Cross-compiler definition
##########################################################################
find_program(AVR_CC avr-gcc REQUIRED)
find_program(AVR_CXX avr-g++ REQUIRED)
# Section-size reporter; consumed by an optional POST_BUILD in the top-level
# CMakeLists (left unset -> no size report) so the top level stays HW-agnostic.
find_program(CMAKE_SIZE avr-size)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR avr)
set(CMAKE_C_COMPILER ${AVR_CC})
set(CMAKE_CXX_COMPILER ${AVR_CXX})
set(AVR_MCU attiny3216 CACHE STRING "Target AVR device" FORCE)
set(CMAKE_C_FLAGS_INIT "-mmcu=${AVR_MCU}")
set(CMAKE_CXX_FLAGS_INIT "-mmcu=${AVR_MCU}")
set(CMAKE_ASM_FLAGS_INIT "-mmcu=${AVR_MCU}")
set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--gc-sections -mrelax")
##########################################################################
# Bypass the link step in CMake's compiler sanity check (and the
# libc-version try_compile): this is a cross compiler, so a full executable
# link would fail. See https://stackoverflow.com/q/53633705
##########################################################################
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY")
+17
View File
@@ -0,0 +1,17 @@
#if __has_include(<component-version.h>)
#include <component-version.h>
#if ((COMPONENT_VERSION_MAJOR == 1) && (COMPONENT_VERSION_MINOR == 2) && \
(BUILD_NUMBER < 118))
#error \
"Microchip pack component version greater than 1.2.118 required to support ATtiny3216"
#endif
#else
#include <avr/version.h>
#if !(__AVR_LIBC_VERSION__ > 20100UL)
#error "AVR LibC version greater than 2.1 does support ATtiny3216"
#endif
#endif
#include <avr/io.h>
int main() { return 0; }
@@ -0,0 +1,36 @@
diff --git a/include/tl/expected.hpp b/include/tl/expected.hpp
index 59e59aa..75857bd 100644
--- a/include/tl/expected.hpp
+++ b/include/tl/expected.hpp
@@ -20,7 +20,7 @@
#define TL_EXPECTED_VERSION_MINOR 3
#define TL_EXPECTED_VERSION_PATCH 1
-#include <exception>
+#include <cstdlib>
#include <functional>
#include <type_traits>
#include <utility>
@@ -222,7 +222,7 @@ static constexpr unexpect_t unexpect{};
#ifdef TL_EXPECTED_EXCEPTIONS_ENABLED
#define TL_EXPECTED_THROW_EXCEPTION(e) throw((e));
#else
-#define TL_EXPECTED_THROW_EXCEPTION(e) std::terminate();
+#define TL_EXPECTED_THROW_EXCEPTION(e) std::abort();
#endif
namespace detail {
@@ -1249,11 +1249,11 @@ template <class T, class E> struct expected_default_ctor_base<T, E, false> {
};
} // namespace detail
-template <class E> class bad_expected_access : public std::exception {
+template <class E> class bad_expected_access {
public:
explicit bad_expected_access(E e) : m_val(std::move(e)) {}
- virtual const char *what() const noexcept override {
+ virtual const char *what() const noexcept {
return "Bad expected access";
}
@@ -0,0 +1,21 @@
diff --git a/include/tl/optional.hpp b/include/tl/optional.hpp
index e9c59c2..1ff3d4a 100644
--- a/include/tl/optional.hpp
+++ b/include/tl/optional.hpp
@@ -21,7 +21,6 @@
#define TL_OPTIONAL_VERSION_MINOR 1
#define TL_OPTIONAL_VERSION_PATCH 0
-#include <exception>
#include <functional>
#include <new>
#include <type_traits>
@@ -664,7 +663,7 @@ struct nullopt_t {
static constexpr nullopt_t nullopt{nullopt_t::do_not_use{},
nullopt_t::do_not_use{}};
-class bad_optional_access : public std::exception {
+class bad_optional_access {
public:
bad_optional_access() = default;
const char *what() const noexcept { return "Optional has no value"; }
-129
View File
@@ -1,129 +0,0 @@
/*
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------
this file is a part of the TOYOTA Corolla MP3 Player Project
-----------------------------------------------------------------------
http://www.softservice.com.pl/corolla/avc
May 28 / 2009 - version 2
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "com232.h"
byte RS232_RxCharBuffer[25], RS232_RxCharBegin, RS232_RxCharEnd;
byte readkey;
//------------------------------------------------------------------------------
void RS232_Init(void)
{
// init LED
sbi(DDRB, 5);
cbi(PORTB, 5);
RS232_RxCharBegin = RS232_RxCharEnd = 0;
UCSR0A = 0;
UCSR0B = ((1<<RXCIE0) | (1<<RXEN0) | (1<<TXEN0)); // enable RxD/TxD and interrupts
UCSR0C = ((1<<UCSZ01)|(1<<UCSZ00)); // 8N1
UBRR0L = 8; // Baud Rate 9600 (3 for 250000)
// 103 => 9600
// 51 => 19200
// 25 => 38400
// 8 => 115200
// 3 => 250000
}
//------------------------------------------------------------------------------
ISR(USART_RX_vect)
{
RS232_RxCharBuffer[RS232_RxCharEnd] = UDR0; // Store received character to the End of Buffer
RS232_RxCharEnd++;
}
//------------------------------------------------------------------------------
void RS232_SendByte(byte Data)
{
while ((UCSR0A & _BV(UDRE0)) != _BV(UDRE0)); // wait for UART to become available
UDR0 = Data; // send character
}
//------------------------------------------------------------------------------
void RS232_Print_P(const char * str_addr)
{
register byte c;
while ( (c = pgm_read_byte(str_addr++) ) )
{
if (c == '\n')
RS232_SendByte('\r');
RS232_SendByte(c);
}
}
//------------------------------------------------------------------------------
void RS232_Print(const char *pBuf)
{
register byte c;
while ((c = *pBuf++))
{
if (c == '\n')
RS232_SendByte('\r');
RS232_SendByte(c);
}
}
//------------------------------------------------------------------------------
void RS232_PrintHex4(byte Data)
{
byte Character = Data & 0x0f;
Character += '0';
if (Character > '9')
Character += 'A' - '0' - 10;
RS232_SendByte(Character);
}
//------------------------------------------------------------------------------
void RS232_PrintHex8(byte Data)
{
RS232_PrintHex4(Data >> 4);
RS232_PrintHex4(Data);
}
//------------------------------------------------------------------------------
void RS232_PrintDec(byte Data)
{
if (Data>99) {
RS232_SendByte('*');
return;
}
if (Data<10) {
RS232_SendByte('0'+Data);
return;
}
byte c;
unsigned short v,v1;
v = Data;
v1 = v/10;
c = '0' + (v-v1*10);
RS232_SendByte('0'+v1);
RS232_SendByte(c);
}
//------------------------------------------------------------------------------
void RS232_PrintDec2(byte Data)
{
if (Data<10) RS232_SendByte('0');
RS232_PrintDec(Data);
}
//------------------------------------------------------------------------------
-54
View File
@@ -1,54 +0,0 @@
/*
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------
this file is a part of the TOYOTA Corolla MP3 Player Project
-----------------------------------------------------------------------
http://www.softservice.com.pl/corolla/avc
May 28 / 2009 - version 2
*/
#ifndef __COM232_H
#define __COM232_H
//------------------------------------------------------------------------------
#include "GlobalDef.h"
//------------------------------------------------------------------------------
extern byte RS232_RxCharBuffer[25], RS232_RxCharBegin, RS232_RxCharEnd;
extern byte readkey;
//------------------------------------------------------------------------------
void RS232_Init(void);
extern void RS232_Print_P(const char * str_addr);
extern void RS232_SendByte(byte Data);
extern void RS232_Print(const char *pBuf);
extern void RS232_PrintHex4(byte Data);
extern void RS232_PrintHex8(byte Data);
extern void RS232_PrintDec(byte Data);
extern void RS232_PrintDec2(byte Data);
//------------------------------------------------------------------------------
// LED
#define LED_ON() cbi(PORTB, 5)
#define LED_OFF() sbi(PORTB, 5)
//------------------------------------------------------------------------------
#endif
+43
View File
@@ -0,0 +1,43 @@
Solderpad Hardware License v2.1
This license operates as a wraparound license to the Apache License Version 2.0 (the “Apache License”) and incorporates the terms and conditions of the Apache License (which can be found here: http://apache.org/licenses/LICENSE-2.0), with the following additions and modifications. It must be read in conjunction with the Apache License. Section 1 below modifies definitions and terminology in the Apache License and Section 2 below replaces Section 2 of the Apache License. The Appendix replaces the Appendix in the Apache License. You may, at your option, choose to treat any Work released under this license as released under the Apache License (thus ignoring all sections written below entirely).
1. Terminology in the Apache License is supplemented or modified as follows:
“Authorship”: any reference to authorship shall be taken to read “authorship or design”.
“Copyright owner”: any reference to copyright owner shall be taken to read “Rights owner”.
“Copyright statement”: the reference to copyright statement shall be taken to read copyright or other statement pertaining to Rights.
The following new definition shall be added to the Definitions section of the Apache License:
“Rights” means copyright and any similar right including design right (whether registered or unregistered), rights in semiconductor topographies (mask works) and database rights (but excluding Patents and Trademarks).
The following definitions shall replace the corresponding definitions in the Apache License:
“License” shall mean this Solderpad Hardware License version 2.1, being the terms and conditions for use, manufacture, instantiation, adaptation, reproduction, and distribution as defined by Sections 1 through 9 of this document.
“Licensor” shall mean the owner of the Rights or entity authorized by the owner of the Rights that is granting the License.
“Derivative Works” shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship or design. For the purposes of this License, Derivative Works shall not include works that remain reversibly separable from, or merely link (or bind by name) or physically connect to or interoperate with the Work and Derivative Works thereof.
“Object” form shall mean any form resulting from mechanical transformation or translation of a Source form or the application of a Source form to physical material, including but not limited to compiled object code, generated documentation, the instantiation of a hardware design or physical object or material and conversions to other media types, including intermediate forms such as bytecodes, FPGA bitstreams, moulds, artwork and semiconductor topographies (mask works).
“Source” form shall mean the preferred form for making modifications, including but not limited to source code, net lists, board layouts, CAD files, documentation source, and configuration files.
“Work” shall mean the work of authorship or design, whether in Source or Object form, made available under the License, as indicated by a notice relating to Rights that is included in or attached to the work (an example is provided in the Appendix below).
2. Grant of License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable license under the Rights to reproduce, prepare Derivative Works of, make, adapt, repair, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form and do anything in relation to the Work as if the Rights did not exist.
APPENDIX
Copyright 2023 Allen Hill
SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file except in compliance with the License, or, at your option, the Apache License version 2.0. You may obtain a copy of the License at
https://solderpad.org/licenses/SHL-2.1/
Unless required by applicable law or agreed to in writing, any work distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+289
View File
@@ -0,0 +1,289 @@
(footprint "LOGO" (version 20221018) (generator pcbnew)
(layer "F.Cu")
(fp_text reference "G***" (at 0 2.65176) (layer "F.SilkS") hide
(effects (font (size 0.22606 0.22606) (thickness 0.04318)))
(tstamp f5008734-4f8c-480e-9150-6066c4d15e62)
)
(fp_text value "LOGO" (at 0 -2.65176) (layer "F.SilkS") hide
(effects (font (size 0.22606 0.22606) (thickness 0.04318)))
(tstamp d485c02f-25a5-4145-a68b-5c44bbcce627)
)
(fp_poly
(pts
(xy -1.51384 2.24536)
(xy -1.48844 2.23012)
(xy -1.43002 2.19456)
(xy -1.3462 2.13868)
(xy -1.24714 2.07264)
(xy -1.14808 2.0066)
(xy -1.0668 1.95326)
(xy -1.01092 1.91516)
(xy -0.98552 1.90246)
(xy -0.97282 1.90754)
(xy -0.9271 1.9304)
(xy -0.85852 1.96596)
(xy -0.81788 1.98628)
(xy -0.75692 2.01168)
(xy -0.7239 2.0193)
(xy -0.71882 2.00914)
(xy -0.69596 1.96088)
(xy -0.6604 1.8796)
(xy -0.61468 1.77038)
(xy -0.5588 1.64338)
(xy -0.50292 1.50876)
(xy -0.4445 1.36906)
(xy -0.38862 1.23444)
(xy -0.34036 1.11506)
(xy -0.29972 1.01854)
(xy -0.27432 0.94996)
(xy -0.26416 0.92202)
(xy -0.2667 0.9144)
(xy -0.29972 0.88392)
(xy -0.35306 0.84328)
(xy -0.47244 0.74676)
(xy -0.58928 0.60198)
(xy -0.6604 0.43688)
(xy -0.68326 0.25146)
(xy -0.66294 0.08128)
(xy -0.5969 -0.08128)
(xy -0.4826 -0.2286)
(xy -0.3429 -0.33782)
(xy -0.18034 -0.4064)
(xy 0 -0.42926)
(xy 0.17272 -0.40894)
(xy 0.34036 -0.3429)
(xy 0.48768 -0.23114)
(xy 0.55118 -0.16002)
(xy 0.63754 -0.01016)
(xy 0.6858 0.14732)
(xy 0.69088 0.18796)
(xy 0.68326 0.36322)
(xy 0.63246 0.5334)
(xy 0.53848 0.68326)
(xy 0.40894 0.80772)
(xy 0.3937 0.81788)
(xy 0.33528 0.8636)
(xy 0.29464 0.89408)
(xy 0.26416 0.91948)
(xy 0.48768 1.45796)
(xy 0.52324 1.54178)
(xy 0.5842 1.6891)
(xy 0.63754 1.8161)
(xy 0.68072 1.9177)
(xy 0.7112 1.98374)
(xy 0.7239 2.01168)
(xy 0.7239 2.01422)
(xy 0.74422 2.01676)
(xy 0.78486 2.00152)
(xy 0.86106 1.96596)
(xy 0.90932 1.94056)
(xy 0.96774 1.91262)
(xy 0.99314 1.90246)
(xy 1.016 1.91516)
(xy 1.06934 1.95072)
(xy 1.15062 2.00406)
(xy 1.24714 2.06756)
(xy 1.33858 2.13106)
(xy 1.4224 2.18694)
(xy 1.48336 2.22504)
(xy 1.51384 2.24282)
(xy 1.51892 2.24282)
(xy 1.54432 2.22758)
(xy 1.59258 2.18694)
(xy 1.66624 2.11836)
(xy 1.77038 2.01422)
(xy 1.78562 1.99898)
(xy 1.87198 1.91262)
(xy 1.94056 1.83896)
(xy 1.98628 1.78816)
(xy 2.00406 1.7653)
(xy 1.98882 1.73482)
(xy 1.95072 1.67386)
(xy 1.89484 1.5875)
(xy 1.82626 1.48844)
(xy 1.64846 1.22936)
(xy 1.74498 0.98552)
(xy 1.77546 0.90932)
(xy 1.81356 0.82042)
(xy 1.8415 0.75438)
(xy 1.85674 0.72644)
(xy 1.88214 0.71628)
(xy 1.95072 0.70104)
(xy 2.04724 0.68072)
(xy 2.16154 0.6604)
(xy 2.2733 0.64008)
(xy 2.37236 0.61976)
(xy 2.44348 0.60706)
(xy 2.4765 0.59944)
(xy 2.48412 0.59436)
(xy 2.49174 0.57912)
(xy 2.49428 0.5461)
(xy 2.49682 0.48514)
(xy 2.49936 0.39116)
(xy 2.49936 0.25146)
(xy 2.49936 0.23622)
(xy 2.49682 0.10668)
(xy 2.49428 0)
(xy 2.49174 -0.06604)
(xy 2.48666 -0.09398)
(xy 2.45618 -0.1016)
(xy 2.38506 -0.11684)
(xy 2.286 -0.13462)
(xy 2.16662 -0.15748)
(xy 2.159 -0.16002)
(xy 2.04216 -0.18288)
(xy 1.9431 -0.2032)
(xy 1.87198 -0.21844)
(xy 1.84404 -0.2286)
(xy 1.83642 -0.23622)
(xy 1.81356 -0.28194)
(xy 1.78054 -0.3556)
(xy 1.7399 -0.4445)
(xy 1.7018 -0.53848)
(xy 1.66878 -0.6223)
(xy 1.64592 -0.68326)
(xy 1.6383 -0.7112)
(xy 1.64084 -0.71374)
(xy 1.65862 -0.74168)
(xy 1.69926 -0.80264)
(xy 1.75514 -0.88646)
(xy 1.82372 -0.98806)
(xy 1.8288 -0.99568)
(xy 1.89738 -1.09474)
(xy 1.95326 -1.1811)
(xy 1.98882 -1.23952)
(xy 2.00406 -1.26746)
(xy 2.00406 -1.27)
(xy 1.9812 -1.30048)
(xy 1.9304 -1.35636)
(xy 1.85674 -1.43256)
(xy 1.77038 -1.52146)
(xy 1.74244 -1.54686)
(xy 1.64338 -1.64338)
(xy 1.57734 -1.70434)
(xy 1.53416 -1.73736)
(xy 1.51384 -1.74498)
(xy 1.48336 -1.7272)
(xy 1.41986 -1.68656)
(xy 1.33604 -1.62814)
(xy 1.23444 -1.55956)
(xy 1.22682 -1.55448)
(xy 1.12776 -1.4859)
(xy 1.04394 -1.43002)
(xy 0.98552 -1.38938)
(xy 0.95758 -1.37414)
(xy 0.95504 -1.37414)
(xy 0.9144 -1.38684)
(xy 0.84328 -1.41224)
(xy 0.75438 -1.44526)
(xy 0.66294 -1.48336)
(xy 0.57912 -1.51892)
(xy 0.51562 -1.54686)
(xy 0.48514 -1.56464)
(xy 0.47498 -1.6002)
(xy 0.4572 -1.6764)
(xy 0.43688 -1.778)
(xy 0.41148 -1.89992)
(xy 0.40894 -1.92024)
(xy 0.38608 -2.03962)
(xy 0.3683 -2.13868)
(xy 0.35306 -2.20726)
(xy 0.34544 -2.2352)
(xy 0.3302 -2.23774)
(xy 0.27178 -2.24282)
(xy 0.18288 -2.24536)
(xy 0.07366 -2.24536)
(xy -0.0381 -2.24536)
(xy -0.14732 -2.24282)
(xy -0.2413 -2.24028)
(xy -0.30988 -2.2352)
(xy -0.33782 -2.23012)
(xy -0.33782 -2.22758)
(xy -0.34798 -2.18948)
(xy -0.36576 -2.11582)
(xy -0.38608 -2.01168)
(xy -0.40894 -1.88976)
(xy -0.41402 -1.8669)
(xy -0.43688 -1.75006)
(xy -0.4572 -1.651)
(xy -0.4699 -1.58496)
(xy -0.47752 -1.55702)
(xy -0.49022 -1.55194)
(xy -0.53848 -1.53162)
(xy -0.61722 -1.4986)
(xy -0.71628 -1.45796)
(xy -0.94488 -1.36652)
(xy -1.22682 -1.55702)
(xy -1.25222 -1.5748)
(xy -1.35382 -1.64338)
(xy -1.4351 -1.69926)
(xy -1.49352 -1.73736)
(xy -1.51638 -1.75006)
(xy -1.51892 -1.75006)
(xy -1.54686 -1.72466)
(xy -1.60274 -1.67132)
(xy -1.67894 -1.59766)
(xy -1.76784 -1.5113)
(xy -1.83134 -1.44526)
(xy -1.91008 -1.36652)
(xy -1.95834 -1.31318)
(xy -1.98628 -1.28016)
(xy -1.9939 -1.25984)
(xy -1.99136 -1.2446)
(xy -1.97358 -1.21666)
(xy -1.93294 -1.1557)
(xy -1.87452 -1.06934)
(xy -1.80594 -0.97028)
(xy -1.75006 -0.88646)
(xy -1.6891 -0.79248)
(xy -1.651 -0.72644)
(xy -1.63576 -0.69342)
(xy -1.64084 -0.68072)
(xy -1.65862 -0.62484)
(xy -1.69418 -0.54102)
(xy -1.73482 -0.44196)
(xy -1.83388 -0.22098)
(xy -1.97866 -0.19304)
(xy -2.06756 -0.17526)
(xy -2.18948 -0.1524)
(xy -2.30886 -0.12954)
(xy -2.49174 -0.09398)
(xy -2.49936 0.58166)
(xy -2.47142 0.59436)
(xy -2.44348 0.60198)
(xy -2.3749 0.61722)
(xy -2.27838 0.63754)
(xy -2.16154 0.65786)
(xy -2.06502 0.67564)
(xy -1.96596 0.69596)
(xy -1.89484 0.70866)
(xy -1.86436 0.71628)
(xy -1.8542 0.72644)
(xy -1.83134 0.7747)
(xy -1.79578 0.8509)
(xy -1.75514 0.94234)
(xy -1.71704 1.03632)
(xy -1.68148 1.12522)
(xy -1.65862 1.19126)
(xy -1.64846 1.22428)
(xy -1.66116 1.25222)
(xy -1.69926 1.31064)
(xy -1.7526 1.39192)
(xy -1.82118 1.49098)
(xy -1.88722 1.5875)
(xy -1.94564 1.67132)
(xy -1.98374 1.73228)
(xy -2.00152 1.76022)
(xy -1.99136 1.778)
(xy -1.95326 1.82626)
(xy -1.8796 1.90246)
(xy -1.76784 2.01168)
(xy -1.75006 2.02946)
(xy -1.6637 2.11328)
(xy -1.59004 2.18186)
(xy -1.5367 2.22758)
(xy -1.51384 2.24536)
)
(stroke (width 0.00254) (type solid)) (fill solid) (layer "F.SilkS") (tstamp 52e078f1-f855-4e08-8c35-aff7775e153a))
)
+293
View File
@@ -0,0 +1,293 @@
PCBNEW-LibModule-V1
$INDEX
LOGO
$EndINDEX
#
# LOGO
# pixmap w = 400, h = 400
#
$MODULE LOGO
Po 0 0 0 15 00000000 00000000 ~~
Li LOGO
T0 0 1044 89 89 0 17 N I 21 N "G***"
T1 0 -1044 89 89 0 17 N I 21 N "LOGO"
DP 0 0 0 0 277 1 21
Dl -596 884
Dl -586 878
Dl -563 864
Dl -530 842
Dl -491 816
Dl -452 790
Dl -420 769
Dl -398 754
Dl -388 749
Dl -383 751
Dl -365 760
Dl -338 774
Dl -322 782
Dl -298 792
Dl -285 795
Dl -283 791
Dl -274 772
Dl -260 740
Dl -242 697
Dl -220 647
Dl -198 594
Dl -175 539
Dl -153 486
Dl -134 439
Dl -118 401
Dl -108 374
Dl -104 363
Dl -105 360
Dl -118 348
Dl -139 332
Dl -186 294
Dl -232 237
Dl -260 172
Dl -269 99
Dl -261 32
Dl -235 -32
Dl -190 -90
Dl -135 -133
Dl -71 -160
Dl 0 -169
Dl 68 -161
Dl 134 -135
Dl 192 -91
Dl 217 -63
Dl 251 -4
Dl 270 58
Dl 272 74
Dl 269 143
Dl 249 210
Dl 212 269
Dl 161 318
Dl 155 322
Dl 132 340
Dl 116 352
Dl 104 362
Dl 192 574
Dl 206 607
Dl 230 665
Dl 251 715
Dl 268 755
Dl 280 781
Dl 285 792
Dl 285 793
Dl 293 794
Dl 309 788
Dl 339 774
Dl 358 764
Dl 381 753
Dl 391 749
Dl 400 754
Dl 421 768
Dl 453 789
Dl 491 814
Dl 527 839
Dl 560 861
Dl 584 876
Dl 596 883
Dl 598 883
Dl 608 877
Dl 627 861
Dl 656 834
Dl 697 793
Dl 703 787
Dl 737 753
Dl 764 724
Dl 782 704
Dl 789 695
Dl 789 695
Dl 783 683
Dl 768 659
Dl 746 625
Dl 719 586
Dl 649 484
Dl 687 388
Dl 699 358
Dl 714 323
Dl 725 297
Dl 731 286
Dl 741 282
Dl 768 276
Dl 806 268
Dl 851 260
Dl 895 252
Dl 934 244
Dl 962 239
Dl 975 236
Dl 978 234
Dl 981 228
Dl 982 215
Dl 983 191
Dl 984 154
Dl 984 99
Dl 984 93
Dl 983 42
Dl 982 0
Dl 981 -26
Dl 979 -37
Dl 979 -37
Dl 967 -40
Dl 939 -46
Dl 900 -53
Dl 853 -62
Dl 850 -63
Dl 804 -72
Dl 765 -80
Dl 737 -86
Dl 726 -90
Dl 723 -93
Dl 714 -111
Dl 701 -140
Dl 685 -175
Dl 670 -212
Dl 657 -245
Dl 648 -269
Dl 645 -280
Dl 646 -281
Dl 653 -292
Dl 669 -316
Dl 691 -349
Dl 718 -389
Dl 720 -392
Dl 747 -431
Dl 769 -465
Dl 783 -488
Dl 789 -499
Dl 789 -500
Dl 780 -512
Dl 760 -534
Dl 731 -564
Dl 697 -599
Dl 686 -609
Dl 647 -647
Dl 621 -671
Dl 604 -684
Dl 596 -687
Dl 596 -687
Dl 584 -680
Dl 559 -664
Dl 526 -641
Dl 486 -614
Dl 483 -612
Dl 444 -585
Dl 411 -563
Dl 388 -547
Dl 377 -541
Dl 376 -541
Dl 360 -546
Dl 332 -556
Dl 297 -569
Dl 261 -584
Dl 228 -598
Dl 203 -609
Dl 191 -616
Dl 191 -616
Dl 187 -630
Dl 180 -660
Dl 172 -700
Dl 162 -748
Dl 161 -756
Dl 152 -803
Dl 145 -842
Dl 139 -869
Dl 136 -880
Dl 130 -881
Dl 107 -883
Dl 72 -884
Dl 29 -884
Dl -15 -884
Dl -58 -883
Dl -95 -882
Dl -122 -880
Dl -133 -878
Dl -133 -877
Dl -137 -862
Dl -144 -833
Dl -152 -792
Dl -161 -744
Dl -163 -735
Dl -172 -689
Dl -180 -650
Dl -185 -624
Dl -188 -613
Dl -193 -611
Dl -212 -603
Dl -243 -590
Dl -282 -574
Dl -372 -538
Dl -483 -613
Dl -493 -620
Dl -533 -647
Dl -565 -669
Dl -588 -684
Dl -597 -689
Dl -598 -689
Dl -609 -679
Dl -631 -658
Dl -661 -629
Dl -696 -595
Dl -721 -569
Dl -752 -538
Dl -771 -517
Dl -782 -504
Dl -785 -496
Dl -784 -490
Dl -777 -479
Dl -761 -455
Dl -738 -421
Dl -711 -382
Dl -689 -349
Dl -665 -312
Dl -650 -286
Dl -644 -273
Dl -646 -268
Dl -653 -246
Dl -667 -213
Dl -683 -174
Dl -722 -87
Dl -779 -76
Dl -814 -69
Dl -862 -60
Dl -909 -51
Dl -981 -37
Dl -984 229
Dl -973 234
Dl -962 237
Dl -935 243
Dl -897 251
Dl -851 259
Dl -813 266
Dl -774 274
Dl -746 279
Dl -734 282
Dl -730 286
Dl -721 305
Dl -707 335
Dl -691 371
Dl -676 408
Dl -662 443
Dl -653 469
Dl -649 482
Dl -654 493
Dl -669 516
Dl -690 548
Dl -717 587
Dl -743 625
Dl -766 658
Dl -781 682
Dl -788 693
Dl -784 700
Dl -769 719
Dl -740 749
Dl -696 792
Dl -689 799
Dl -655 832
Dl -626 859
Dl -605 877
Dl -596 884
$EndMODULE LOGO
$EndLIBRARY
+7
View File
@@ -0,0 +1,7 @@
# Hardware
## Cable harness
I ordered a [cable harness](https://www.amazon.com/dp/B01EUZ8CFU) from Amazon to acquire the head-unit side connector. I then cut the male end off a DB9 cable and connected the wires according to the following cable harness diagram:
![cable diagram](./hardware/harness/harness.png)
+40
View File
@@ -0,0 +1,40 @@
EESchema-LIBRARY Version 2.3
#encoding utf-8
#(c) SnapEDA 2016 (snapeda.com)
#This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA) with Design Exception 1.0
#
# SJ-43514
#
DEF SJ-43514 J 0 40 Y N 1 L N
F0 "J" -300 330 50 H V L BNN
F1 "SJ-43514" -300 -400 50 H V L BNN
F2 "CUI_SJ-43514" 0 0 50 H I L BNN
F3 "" 0 0 50 H I L BNN
F4 "CUI INC" 0 0 50 H I L BNN "MANUFACTURER"
F5 "1.04" 0 0 50 H I L BNN "PART_REV"
F6 "MANUFACTURER RECOMMENDATIONS" 0 0 50 H I L BNN "STANDARD"
DRAW
P 2 0 0 10 -240 85 -240 -95 N
P 2 0 0 10 -240 -95 -160 -95 N
P 2 0 0 10 -160 -95 -160 85 N
P 2 0 0 10 -160 85 -240 85 N
P 2 0 0 10 -90 200 -40 130 N
P 2 0 0 10 -40 130 10 200 N
P 2 0 0 10 85 -100 300 -100 N
P 2 0 0 10 -15 -100 35 -30 N
P 2 0 0 10 35 -30 85 -100 N
P 2 0 0 10 15 200 300 200 N
P 2 0 0 10 195 100 300 100 N
P 2 0 0 10 95 100 145 40 N
P 2 0 0 10 145 40 195 100 N
P 2 0 0 10 -200 -100 -200 -200 N
P 2 0 0 10 -200 -200 300 -200 N
S -300 -300 300 300 0 0 10 f
X ~ 4 400 200 100 L 40 40 0 0 P
X ~ 1 400 -200 100 L 40 40 0 0 P
X ~ 2 400 100 100 L 40 40 0 0 P
X ~ 3 400 -100 100 L 40 40 0 0 P
ENDDRAW
ENDDEF
#
# End Library
+4
View File
@@ -0,0 +1,4 @@
Id Description Qty Unit Designators
1 Cable, 9 x 24 AWG 1.5 ft W1
2 Connector, CN701, female, 11 pins 1 Y1
3 Connector, D-Sub, female, 9 pins 1 X1
1 Id Description Qty Unit Designators
2 1 Cable, 9 x 24 AWG 1.5 ft W1
3 2 Connector, CN701, female, 11 pins 1 Y1
4 3 Connector, D-Sub, female, 9 pins 1 X1
+403
View File
@@ -0,0 +1,403 @@
<!DOCTYPE html>
<html lang="en"><head>
<meta charset="UTF-8">
<meta name="generator" content="WireViz 0.4.1 - https://github.com/wireviz/WireViz">
<title>harness</title>
<style>
#bom table, th, td {
border: 1px solid black;
border-collapse: collapse;
}
#bom th, td {
padding: 4px;
text-align: left;
}
.bom_col_qty {
text-align: right;
}
</style>
</head><body style="font-family:arial;background-color:#ffffff">
<h1>harness</h1>
<h2>Diagram</h2>
<div id="description">
<!-- %description% -->
</div>
<div id="diagram">
<!-- XML and DOCTYPE declarations from SVG file removed -->
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="935pt" height="340pt"
viewBox="0.00 0.00 935.00 340.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 336)">
<title>%3</title>
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-336 931,-336 931,4 -4,4"/>
<!-- X1 -->
<g id="node1" class="node">
<title>X1</title>
<polygon fill="#ffffff" stroke="black" points="136,-296.5 0,-296.5 0,-43.5 136,-43.5 136,-296.5"/>
<polygon fill="none" stroke="black" points="0,-273 0,-296 136,-296 136,-273 0,-273"/>
<text text-anchor="start" x="59.5" y="-280.8" font-family="arial" font-size="14.00">X1</text>
<polygon fill="none" stroke="black" points="0,-250 0,-273 47,-273 47,-250 0,-250"/>
<text text-anchor="start" x="4" y="-257.8" font-family="arial" font-size="14.00">D&#45;Sub</text>
<polygon fill="none" stroke="black" points="47,-250 47,-273 97,-273 97,-250 47,-250"/>
<text text-anchor="start" x="51" y="-257.8" font-family="arial" font-size="14.00">female</text>
<polygon fill="none" stroke="black" points="97,-250 97,-273 136,-273 136,-250 97,-250"/>
<text text-anchor="start" x="101" y="-257.8" font-family="arial" font-size="14.00">9&#45;pin</text>
<polygon fill="none" stroke="black" points="0,-227 0,-250 84,-250 84,-227 0,-227"/>
<text text-anchor="start" x="25.5" y="-234.8" font-family="arial" font-size="14.00">+12V</text>
<polygon fill="none" stroke="black" points="84,-227 84,-250 136,-250 136,-227 84,-227"/>
<text text-anchor="start" x="106" y="-234.8" font-family="arial" font-size="14.00">1</text>
<polygon fill="none" stroke="black" points="0,-204 0,-227 84,-227 84,-204 0,-204"/>
<text text-anchor="start" x="29" y="-211.8" font-family="arial" font-size="14.00">TX+</text>
<polygon fill="none" stroke="black" points="84,-204 84,-227 136,-227 136,-204 84,-204"/>
<text text-anchor="start" x="106" y="-211.8" font-family="arial" font-size="14.00">2</text>
<polygon fill="none" stroke="black" points="0,-181 0,-204 84,-204 84,-181 0,-181"/>
<text text-anchor="start" x="26.5" y="-188.8" font-family="arial" font-size="14.00">GND</text>
<polygon fill="none" stroke="black" points="84,-181 84,-204 136,-204 136,-181 84,-181"/>
<text text-anchor="start" x="106" y="-188.8" font-family="arial" font-size="14.00">3</text>
<polygon fill="none" stroke="black" points="0,-158 0,-181 84,-181 84,-158 0,-158"/>
<text text-anchor="start" x="34.5" y="-165.8" font-family="arial" font-size="14.00">R&#45;</text>
<polygon fill="none" stroke="black" points="84,-158 84,-181 136,-181 136,-158 84,-158"/>
<text text-anchor="start" x="106" y="-165.8" font-family="arial" font-size="14.00">4</text>
<polygon fill="none" stroke="black" points="0,-135 0,-158 84,-158 84,-135 0,-135"/>
<text text-anchor="start" x="32.5" y="-142.8" font-family="arial" font-size="14.00">R+</text>
<polygon fill="none" stroke="black" points="84,-135 84,-158 136,-158 136,-135 84,-135"/>
<text text-anchor="start" x="106" y="-142.8" font-family="arial" font-size="14.00">5</text>
<polygon fill="none" stroke="black" points="0,-112 0,-135 84,-135 84,-112 0,-112"/>
<text text-anchor="start" x="22" y="-119.8" font-family="arial" font-size="14.00">MUTE</text>
<polygon fill="none" stroke="black" points="84,-112 84,-135 136,-135 136,-112 84,-112"/>
<text text-anchor="start" x="106" y="-119.8" font-family="arial" font-size="14.00">6</text>
<polygon fill="none" stroke="black" points="0,-89 0,-112 84,-112 84,-89 0,-89"/>
<text text-anchor="start" x="31" y="-96.8" font-family="arial" font-size="14.00">TX&#45;</text>
<polygon fill="none" stroke="black" points="84,-89 84,-112 136,-112 136,-89 84,-89"/>
<text text-anchor="start" x="106" y="-96.8" font-family="arial" font-size="14.00">7</text>
<polygon fill="none" stroke="black" points="0,-66 0,-89 84,-89 84,-66 0,-66"/>
<text text-anchor="start" x="35.5" y="-73.8" font-family="arial" font-size="14.00">L&#45;</text>
<polygon fill="none" stroke="black" points="84,-66 84,-89 136,-89 136,-66 84,-66"/>
<text text-anchor="start" x="106" y="-73.8" font-family="arial" font-size="14.00">8</text>
<polygon fill="none" stroke="black" points="0,-43 0,-66 84,-66 84,-43 0,-43"/>
<text text-anchor="start" x="34" y="-50.8" font-family="arial" font-size="14.00">L+</text>
<polygon fill="none" stroke="black" points="84,-43 84,-66 136,-66 136,-43 84,-43"/>
<text text-anchor="start" x="106" y="-50.8" font-family="arial" font-size="14.00">9</text>
</g>
<!-- W1 -->
<g id="node3" class="node">
<title>W1</title>
<polygon fill="#ffffff" stroke="black" points="637,-332 280,-332 280,0 637,0 637,-332"/>
<polygon fill="none" stroke="black" points="280.5,-309 280.5,-332 637.5,-332 637.5,-309 280.5,-309"/>
<text text-anchor="start" x="448" y="-316.8" font-family="arial" font-size="14.00">W1</text>
<polygon fill="none" stroke="black" points="280.5,-286 280.5,-309 382.5,-309 382.5,-286 280.5,-286"/>
<text text-anchor="start" x="324" y="-293.8" font-family="arial" font-size="14.00">9x</text>
<polygon fill="none" stroke="black" points="382.5,-286 382.5,-309 520.5,-309 520.5,-286 382.5,-286"/>
<text text-anchor="start" x="425.5" y="-293.8" font-family="arial" font-size="14.00">24 AWG</text>
<polygon fill="none" stroke="black" points="520.5,-286 520.5,-309 637.5,-309 637.5,-286 520.5,-286"/>
<text text-anchor="start" x="563.5" y="-293.8" font-family="arial" font-size="14.00">1.5 ft</text>
<text text-anchor="start" x="338.5" y="-272.8" font-family="arial" font-size="14.00"> </text>
<text text-anchor="start" x="308.5" y="-253.8" font-family="arial" font-size="14.00">X1:1:+12V</text>
<text text-anchor="start" x="427" y="-253.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;1:RD &#160;&#160;&#160;</text>
<text text-anchor="start" x="546" y="-253.8" font-family="arial" font-size="14.00">Y1:5:+12V</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-246 280.5,-248 637.5,-248 637.5,-246 280.5,-246"/>
<polygon fill="#ff0000" stroke="transparent" points="280.5,-244 280.5,-246 637.5,-246 637.5,-244 280.5,-244"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-242 280.5,-244 637.5,-244 637.5,-242 280.5,-242"/>
<text text-anchor="start" x="311.5" y="-228.8" font-family="arial" font-size="14.00">X1:2:TX+</text>
<text text-anchor="start" x="425" y="-228.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;2:WH &#160;&#160;&#160;</text>
<text text-anchor="start" x="545.5" y="-228.8" font-family="arial" font-size="14.00">Y1:10:TX+</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-221 280.5,-223 637.5,-223 637.5,-221 280.5,-221"/>
<polygon fill="#ffffff" stroke="transparent" points="280.5,-219 280.5,-221 637.5,-221 637.5,-219 280.5,-219"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-217 280.5,-219 637.5,-219 637.5,-217 280.5,-217"/>
<text text-anchor="start" x="309" y="-203.8" font-family="arial" font-size="14.00">X1:3:GND</text>
<text text-anchor="start" x="427.5" y="-203.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;3:YE &#160;&#160;&#160;</text>
<text text-anchor="start" x="546.5" y="-203.8" font-family="arial" font-size="14.00">Y1:8:GND</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-196 280.5,-198 637.5,-198 637.5,-196 280.5,-196"/>
<polygon fill="#ffff00" stroke="transparent" points="280.5,-194 280.5,-196 637.5,-196 637.5,-194 280.5,-194"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-192 280.5,-194 637.5,-194 637.5,-192 280.5,-192"/>
<text text-anchor="start" x="317.5" y="-178.8" font-family="arial" font-size="14.00">X1:4:R&#45;</text>
<text text-anchor="start" x="426" y="-178.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;4:GN &#160;&#160;&#160;</text>
<text text-anchor="start" x="555" y="-178.8" font-family="arial" font-size="14.00">Y1:6:R&#45;</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-171 280.5,-173 637.5,-173 637.5,-171 280.5,-171"/>
<polygon fill="#00ff00" stroke="transparent" points="280.5,-169 280.5,-171 637.5,-171 637.5,-169 280.5,-169"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-167 280.5,-169 637.5,-169 637.5,-167 280.5,-167"/>
<text text-anchor="start" x="315.5" y="-153.8" font-family="arial" font-size="14.00">X1:5:R+</text>
<text text-anchor="start" x="425.5" y="-153.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;5:OG &#160;&#160;&#160;</text>
<text text-anchor="start" x="553" y="-153.8" font-family="arial" font-size="14.00">Y1:1:R+</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-146 280.5,-148 637.5,-148 637.5,-146 280.5,-146"/>
<polygon fill="#ff8000" stroke="transparent" points="280.5,-144 280.5,-146 637.5,-146 637.5,-144 280.5,-144"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-142 280.5,-144 637.5,-144 637.5,-142 280.5,-142"/>
<text text-anchor="start" x="305" y="-128.8" font-family="arial" font-size="14.00">X1:6:MUTE</text>
<text text-anchor="start" x="427.5" y="-128.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;6:BU &#160;&#160;&#160;</text>
<text text-anchor="start" x="542.5" y="-128.8" font-family="arial" font-size="14.00">Y1:4:MUTE</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-121 280.5,-123 637.5,-123 637.5,-121 280.5,-121"/>
<polygon fill="#0066ff" stroke="transparent" points="280.5,-119 280.5,-121 637.5,-121 637.5,-119 280.5,-119"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-117 280.5,-119 637.5,-119 637.5,-117 280.5,-117"/>
<text text-anchor="start" x="313.5" y="-103.8" font-family="arial" font-size="14.00">X1:7:TX&#45;</text>
<text text-anchor="start" x="428" y="-103.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;7:VT &#160;&#160;&#160;</text>
<text text-anchor="start" x="551" y="-103.8" font-family="arial" font-size="14.00">Y1:9:TX&#45;</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-96 280.5,-98 637.5,-98 637.5,-96 280.5,-96"/>
<polygon fill="#8000ff" stroke="transparent" points="280.5,-94 280.5,-96 637.5,-96 637.5,-94 280.5,-94"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-92 280.5,-94 637.5,-94 637.5,-92 280.5,-92"/>
<text text-anchor="start" x="318.5" y="-78.8" font-family="arial" font-size="14.00">X1:8:L&#45;</text>
<text text-anchor="start" x="427.5" y="-78.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;8:BN &#160;&#160;&#160;</text>
<text text-anchor="start" x="556" y="-78.8" font-family="arial" font-size="14.00">Y1:7:L&#45;</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-71 280.5,-73 637.5,-73 637.5,-71 280.5,-71"/>
<polygon fill="#895956" stroke="transparent" points="280.5,-69 280.5,-71 637.5,-71 637.5,-69 280.5,-69"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-67 280.5,-69 637.5,-69 637.5,-67 280.5,-67"/>
<text text-anchor="start" x="316.5" y="-53.8" font-family="arial" font-size="14.00">X1:9:L+</text>
<text text-anchor="start" x="427.5" y="-53.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;9:BK &#160;&#160;&#160;</text>
<text text-anchor="start" x="554" y="-53.8" font-family="arial" font-size="14.00">Y1:2:L+</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-46 280.5,-48 637.5,-48 637.5,-46 280.5,-46"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-44 280.5,-46 637.5,-46 637.5,-44 280.5,-44"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-42 280.5,-44 637.5,-44 637.5,-42 280.5,-42"/>
<text text-anchor="start" x="338.5" y="-28.8" font-family="arial" font-size="14.00"> </text>
<polygon fill="none" stroke="black" points="280.5,0 280.5,-23 637.5,-23 637.5,0 280.5,0"/>
<text text-anchor="start" x="284.5" y="-7.8" font-family="arial" font-size="14.00">(colors of DSub cable; colors of CN701 harness may vary)</text>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge1" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-237C200.76,-237.13 216.65,-243.13 280,-243"/>
<path fill="none" stroke="#ff0000" stroke-width="2" d="M136,-239C200.06,-239 215.94,-245 280,-245"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-241C199.35,-240.87 215.24,-246.87 280,-247"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge3" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-214C200.51,-214.06 216.46,-218.06 280,-218"/>
<path fill="none" stroke="#ffffff" stroke-width="2" d="M136,-216C200.02,-216 215.98,-220 280,-220"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-218C199.54,-217.94 215.49,-221.94 280,-222"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge5" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-191C200.25,-191.02 216.24,-193.02 280,-193"/>
<path fill="none" stroke="#ffff00" stroke-width="2" d="M136,-193C200.01,-193 215.99,-195 280,-195"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-195C199.76,-194.98 215.75,-196.98 280,-197"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge7" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-167C200.13,-167 216.12,-168 280,-168"/>
<path fill="none" stroke="#00ff00" stroke-width="2" d="M136,-169C200,-169 216,-170 280,-170"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-171C199.88,-171 215.87,-172 280,-172"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge9" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-144C199.88,-144 215.87,-143 280,-143"/>
<path fill="none" stroke="#ff8000" stroke-width="2" d="M136,-146C200,-146 216,-145 280,-145"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-148C200.13,-148 216.12,-147 280,-147"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge11" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-121C199.64,-121.03 215.62,-118.03 280,-118"/>
<path fill="none" stroke="#0066ff" stroke-width="2" d="M136,-123C200.01,-123 215.99,-120 280,-120"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-125C200.38,-124.97 216.36,-121.97 280,-122"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge13" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-98C199.44,-98.09 215.36,-93.09 280,-93"/>
<path fill="none" stroke="#8000ff" stroke-width="2" d="M136,-100C200.04,-100 215.96,-95 280,-95"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-102C200.64,-101.91 216.56,-96.91 280,-97"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge15" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-75C199.27,-75.17 215.12,-68.17 280,-68"/>
<path fill="none" stroke="#895956" stroke-width="2" d="M136,-77C200.08,-77 215.92,-70 280,-70"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-79C200.88,-78.83 216.73,-71.83 280,-72"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge17" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-52C199.13,-52.26 214.88,-43.26 280,-43"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-54C200.12,-54 215.88,-45 280,-45"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-56C201.12,-55.74 216.87,-46.74 280,-47"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge19" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-191C200.25,-191.02 216.24,-193.02 280,-193"/>
<path fill="none" stroke="#ffff00" stroke-width="2" d="M136,-193C200.01,-193 215.99,-195 280,-195"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-195C199.76,-194.98 215.75,-196.98 280,-197"/>
</g>
<!-- Y1 -->
<g id="node2" class="node">
<title>Y1</title>
<polygon fill="#ffffff" stroke="black" points="927,-317.5 781,-317.5 781,-18.5 927,-18.5 927,-317.5"/>
<polygon fill="none" stroke="black" points="781,-294 781,-317 927,-317 927,-294 781,-294"/>
<text text-anchor="start" x="845.5" y="-301.8" font-family="arial" font-size="14.00">Y1</text>
<polygon fill="none" stroke="black" points="781,-271 781,-294 832,-294 832,-271 781,-271"/>
<text text-anchor="start" x="785" y="-278.8" font-family="arial" font-size="14.00">CN701</text>
<polygon fill="none" stroke="black" points="832,-271 832,-294 882,-294 882,-271 832,-271"/>
<text text-anchor="start" x="836" y="-278.8" font-family="arial" font-size="14.00">female</text>
<polygon fill="none" stroke="black" points="882,-271 882,-294 927,-294 927,-271 882,-271"/>
<text text-anchor="start" x="886" y="-278.8" font-family="arial" font-size="14.00">11&#45;pin</text>
<polygon fill="none" stroke="black" points="781,-248 781,-271 842,-271 842,-248 781,-248"/>
<text text-anchor="start" x="807.5" y="-255.8" font-family="arial" font-size="14.00">1</text>
<polygon fill="none" stroke="black" points="842,-248 842,-271 927,-271 927,-248 842,-248"/>
<text text-anchor="start" x="875" y="-255.8" font-family="arial" font-size="14.00">R+</text>
<polygon fill="none" stroke="black" points="781,-225 781,-248 842,-248 842,-225 781,-225"/>
<text text-anchor="start" x="807.5" y="-232.8" font-family="arial" font-size="14.00">2</text>
<polygon fill="none" stroke="black" points="842,-225 842,-248 927,-248 927,-225 842,-225"/>
<text text-anchor="start" x="876.5" y="-232.8" font-family="arial" font-size="14.00">L+</text>
<polygon fill="none" stroke="black" points="781,-202 781,-225 842,-225 842,-202 781,-202"/>
<text text-anchor="start" x="807.5" y="-209.8" font-family="arial" font-size="14.00">3</text>
<polygon fill="none" stroke="black" points="842,-202 842,-225 927,-225 927,-202 842,-202"/>
<text text-anchor="start" x="864.5" y="-209.8" font-family="arial" font-size="14.00">SGND</text>
<polygon fill="none" stroke="black" points="781,-179 781,-202 842,-202 842,-179 781,-179"/>
<text text-anchor="start" x="807.5" y="-186.8" font-family="arial" font-size="14.00">4</text>
<polygon fill="none" stroke="black" points="842,-179 842,-202 927,-202 927,-179 842,-179"/>
<text text-anchor="start" x="864.5" y="-186.8" font-family="arial" font-size="14.00">MUTE</text>
<polygon fill="none" stroke="black" points="781,-156 781,-179 842,-179 842,-156 781,-156"/>
<text text-anchor="start" x="807.5" y="-163.8" font-family="arial" font-size="14.00">5</text>
<polygon fill="none" stroke="black" points="842,-156 842,-179 927,-179 927,-156 842,-156"/>
<text text-anchor="start" x="868" y="-163.8" font-family="arial" font-size="14.00">+12V</text>
<polygon fill="none" stroke="black" points="781,-133 781,-156 842,-156 842,-133 781,-133"/>
<text text-anchor="start" x="807.5" y="-140.8" font-family="arial" font-size="14.00">6</text>
<polygon fill="none" stroke="black" points="842,-133 842,-156 927,-156 927,-133 842,-133"/>
<text text-anchor="start" x="877" y="-140.8" font-family="arial" font-size="14.00">R&#45;</text>
<polygon fill="none" stroke="black" points="781,-110 781,-133 842,-133 842,-110 781,-110"/>
<text text-anchor="start" x="807.5" y="-117.8" font-family="arial" font-size="14.00">7</text>
<polygon fill="none" stroke="black" points="842,-110 842,-133 927,-133 927,-110 842,-110"/>
<text text-anchor="start" x="878" y="-117.8" font-family="arial" font-size="14.00">L&#45;</text>
<polygon fill="none" stroke="black" points="781,-87 781,-110 842,-110 842,-87 781,-87"/>
<text text-anchor="start" x="807.5" y="-94.8" font-family="arial" font-size="14.00">8</text>
<polygon fill="none" stroke="black" points="842,-87 842,-110 927,-110 927,-87 842,-87"/>
<text text-anchor="start" x="869" y="-94.8" font-family="arial" font-size="14.00">GND</text>
<polygon fill="none" stroke="black" points="781,-64 781,-87 842,-87 842,-64 781,-64"/>
<text text-anchor="start" x="807.5" y="-71.8" font-family="arial" font-size="14.00">9</text>
<polygon fill="none" stroke="black" points="842,-64 842,-87 927,-87 927,-64 842,-64"/>
<text text-anchor="start" x="873.5" y="-71.8" font-family="arial" font-size="14.00">TX&#45;</text>
<polygon fill="none" stroke="black" points="781,-41 781,-64 842,-64 842,-41 781,-41"/>
<text text-anchor="start" x="803.5" y="-48.8" font-family="arial" font-size="14.00">10</text>
<polygon fill="none" stroke="black" points="842,-41 842,-64 927,-64 927,-41 842,-41"/>
<text text-anchor="start" x="871.5" y="-48.8" font-family="arial" font-size="14.00">TX+</text>
<polygon fill="none" stroke="black" points="781,-18 781,-41 842,-41 842,-18 781,-18"/>
<text text-anchor="start" x="803.5" y="-25.8" font-family="arial" font-size="14.00">12</text>
<polygon fill="none" stroke="black" points="842,-18 842,-41 927,-41 927,-18 842,-18"/>
<text text-anchor="start" x="870" y="-25.8" font-family="arial" font-size="14.00">ACC</text>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge2" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-243C707.79,-245.04 706.21,-167.04 781,-165"/>
<path fill="none" stroke="#ff0000" stroke-width="2" d="M637,-245C709.79,-245 708.21,-167 781,-167"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-247C711.79,-244.96 710.21,-166.96 781,-169"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge4" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-218C733.43,-220.6 680.75,-52.6 781,-50"/>
<path fill="none" stroke="#ffffff" stroke-width="2" d="M637,-220C735.34,-220 682.66,-52 781,-52"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-222C737.25,-219.4 684.57,-51.4 781,-54"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge6" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-193C712.18,-195.21 701.85,-98.21 781,-96"/>
<path fill="none" stroke="#ffff00" stroke-width="2" d="M637,-195C714.17,-195 703.83,-98 781,-98"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-197C716.15,-194.79 705.82,-97.79 781,-100"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge8" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-168C700.27,-169.06 714.2,-143.06 781,-142"/>
<path fill="none" stroke="#00ff00" stroke-width="2" d="M637,-170C702.03,-170 715.97,-144 781,-144"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-172C703.8,-170.94 717.73,-144.94 781,-146"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge10" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-143C720.88,-145.34 701.07,-260.34 781,-258"/>
<path fill="none" stroke="#ff8000" stroke-width="2" d="M637,-145C718.9,-145 699.1,-260 781,-260"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-147C716.93,-144.66 697.12,-259.66 781,-262"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge12" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-118C710.36,-119.96 711.64,-190.96 781,-189"/>
<path fill="none" stroke="#0066ff" stroke-width="2" d="M637,-120C708.36,-120 709.64,-191 781,-191"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-122C706.36,-120.04 707.64,-191.04 781,-193"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge14" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-93C700.01,-93.81 714.78,-73.81 781,-73"/>
<path fill="none" stroke="#8000ff" stroke-width="2" d="M637,-95C701.61,-95 716.39,-75 781,-75"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-97C703.22,-96.19 717.99,-76.19 781,-77"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge16" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-68C706.87,-69.68 715.08,-120.68 781,-119"/>
<path fill="none" stroke="#895956" stroke-width="2" d="M637,-70C704.9,-70 713.1,-121 781,-121"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-72C702.92,-70.32 711.13,-121.32 781,-123"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge18" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-43C745.55,-45.68 676.21,-237.68 781,-235"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-45C743.67,-45 674.33,-237 781,-237"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-47C741.79,-44.32 672.45,-236.32 781,-239"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge20" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-193C703.13,-193.77 718.02,-212.77 781,-212"/>
<path fill="none" stroke="#ffff00" stroke-width="2" d="M637,-195C701.55,-195 716.45,-214 781,-214"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-197C699.98,-196.23 714.87,-215.23 781,-216"/>
</g>
</g>
</svg>
</div>
<div id="notes">
<!-- %notes% -->
</div>
<h2>Bill of Materials</h2>
<div id="bom">
<table class="bom">
<tr>
<th class="bom_col_id">Id</th>
<th class="bom_col_description">Description</th>
<th class="bom_col_qty">Qty</th>
<th class="bom_col_unit">Unit</th>
<th class="bom_col_designators">Designators</th>
</tr>
<tr>
<td class="bom_col_id">1</td>
<td class="bom_col_description">Cable, 9 x 24 AWG</td>
<td class="bom_col_qty">1.5</td>
<td class="bom_col_unit">ft</td>
<td class="bom_col_designators">W1</td>
</tr>
<tr>
<td class="bom_col_id">2</td>
<td class="bom_col_description">Connector, CN701, female, 11 pins</td>
<td class="bom_col_qty">1</td>
<td class="bom_col_unit"></td>
<td class="bom_col_designators">Y1</td>
</tr>
<tr>
<td class="bom_col_id">3</td>
<td class="bom_col_description">Connector, D-Sub, female, 9 pins</td>
<td class="bom_col_qty">1</td>
<td class="bom_col_unit"></td>
<td class="bom_col_designators">X1</td>
</tr>
</table>
</div>
</body></html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

+330
View File
@@ -0,0 +1,330 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.43.0 (0)
-->
<!-- Title: %3 Pages: 1 -->
<svg width="935pt" height="340pt"
viewBox="0.00 0.00 935.00 340.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 336)">
<title>%3</title>
<polygon fill="#ffffff" stroke="transparent" points="-4,4 -4,-336 931,-336 931,4 -4,4"/>
<!-- X1 -->
<g id="node1" class="node">
<title>X1</title>
<polygon fill="#ffffff" stroke="black" points="136,-296.5 0,-296.5 0,-43.5 136,-43.5 136,-296.5"/>
<polygon fill="none" stroke="black" points="0,-273 0,-296 136,-296 136,-273 0,-273"/>
<text text-anchor="start" x="59.5" y="-280.8" font-family="arial" font-size="14.00">X1</text>
<polygon fill="none" stroke="black" points="0,-250 0,-273 47,-273 47,-250 0,-250"/>
<text text-anchor="start" x="4" y="-257.8" font-family="arial" font-size="14.00">D&#45;Sub</text>
<polygon fill="none" stroke="black" points="47,-250 47,-273 97,-273 97,-250 47,-250"/>
<text text-anchor="start" x="51" y="-257.8" font-family="arial" font-size="14.00">female</text>
<polygon fill="none" stroke="black" points="97,-250 97,-273 136,-273 136,-250 97,-250"/>
<text text-anchor="start" x="101" y="-257.8" font-family="arial" font-size="14.00">9&#45;pin</text>
<polygon fill="none" stroke="black" points="0,-227 0,-250 84,-250 84,-227 0,-227"/>
<text text-anchor="start" x="25.5" y="-234.8" font-family="arial" font-size="14.00">+12V</text>
<polygon fill="none" stroke="black" points="84,-227 84,-250 136,-250 136,-227 84,-227"/>
<text text-anchor="start" x="106" y="-234.8" font-family="arial" font-size="14.00">1</text>
<polygon fill="none" stroke="black" points="0,-204 0,-227 84,-227 84,-204 0,-204"/>
<text text-anchor="start" x="29" y="-211.8" font-family="arial" font-size="14.00">TX+</text>
<polygon fill="none" stroke="black" points="84,-204 84,-227 136,-227 136,-204 84,-204"/>
<text text-anchor="start" x="106" y="-211.8" font-family="arial" font-size="14.00">2</text>
<polygon fill="none" stroke="black" points="0,-181 0,-204 84,-204 84,-181 0,-181"/>
<text text-anchor="start" x="26.5" y="-188.8" font-family="arial" font-size="14.00">GND</text>
<polygon fill="none" stroke="black" points="84,-181 84,-204 136,-204 136,-181 84,-181"/>
<text text-anchor="start" x="106" y="-188.8" font-family="arial" font-size="14.00">3</text>
<polygon fill="none" stroke="black" points="0,-158 0,-181 84,-181 84,-158 0,-158"/>
<text text-anchor="start" x="34.5" y="-165.8" font-family="arial" font-size="14.00">R&#45;</text>
<polygon fill="none" stroke="black" points="84,-158 84,-181 136,-181 136,-158 84,-158"/>
<text text-anchor="start" x="106" y="-165.8" font-family="arial" font-size="14.00">4</text>
<polygon fill="none" stroke="black" points="0,-135 0,-158 84,-158 84,-135 0,-135"/>
<text text-anchor="start" x="32.5" y="-142.8" font-family="arial" font-size="14.00">R+</text>
<polygon fill="none" stroke="black" points="84,-135 84,-158 136,-158 136,-135 84,-135"/>
<text text-anchor="start" x="106" y="-142.8" font-family="arial" font-size="14.00">5</text>
<polygon fill="none" stroke="black" points="0,-112 0,-135 84,-135 84,-112 0,-112"/>
<text text-anchor="start" x="22" y="-119.8" font-family="arial" font-size="14.00">MUTE</text>
<polygon fill="none" stroke="black" points="84,-112 84,-135 136,-135 136,-112 84,-112"/>
<text text-anchor="start" x="106" y="-119.8" font-family="arial" font-size="14.00">6</text>
<polygon fill="none" stroke="black" points="0,-89 0,-112 84,-112 84,-89 0,-89"/>
<text text-anchor="start" x="31" y="-96.8" font-family="arial" font-size="14.00">TX&#45;</text>
<polygon fill="none" stroke="black" points="84,-89 84,-112 136,-112 136,-89 84,-89"/>
<text text-anchor="start" x="106" y="-96.8" font-family="arial" font-size="14.00">7</text>
<polygon fill="none" stroke="black" points="0,-66 0,-89 84,-89 84,-66 0,-66"/>
<text text-anchor="start" x="35.5" y="-73.8" font-family="arial" font-size="14.00">L&#45;</text>
<polygon fill="none" stroke="black" points="84,-66 84,-89 136,-89 136,-66 84,-66"/>
<text text-anchor="start" x="106" y="-73.8" font-family="arial" font-size="14.00">8</text>
<polygon fill="none" stroke="black" points="0,-43 0,-66 84,-66 84,-43 0,-43"/>
<text text-anchor="start" x="34" y="-50.8" font-family="arial" font-size="14.00">L+</text>
<polygon fill="none" stroke="black" points="84,-43 84,-66 136,-66 136,-43 84,-43"/>
<text text-anchor="start" x="106" y="-50.8" font-family="arial" font-size="14.00">9</text>
</g>
<!-- W1 -->
<g id="node3" class="node">
<title>W1</title>
<polygon fill="#ffffff" stroke="black" points="637,-332 280,-332 280,0 637,0 637,-332"/>
<polygon fill="none" stroke="black" points="280.5,-309 280.5,-332 637.5,-332 637.5,-309 280.5,-309"/>
<text text-anchor="start" x="448" y="-316.8" font-family="arial" font-size="14.00">W1</text>
<polygon fill="none" stroke="black" points="280.5,-286 280.5,-309 382.5,-309 382.5,-286 280.5,-286"/>
<text text-anchor="start" x="324" y="-293.8" font-family="arial" font-size="14.00">9x</text>
<polygon fill="none" stroke="black" points="382.5,-286 382.5,-309 520.5,-309 520.5,-286 382.5,-286"/>
<text text-anchor="start" x="425.5" y="-293.8" font-family="arial" font-size="14.00">24 AWG</text>
<polygon fill="none" stroke="black" points="520.5,-286 520.5,-309 637.5,-309 637.5,-286 520.5,-286"/>
<text text-anchor="start" x="563.5" y="-293.8" font-family="arial" font-size="14.00">1.5 ft</text>
<text text-anchor="start" x="338.5" y="-272.8" font-family="arial" font-size="14.00"> </text>
<text text-anchor="start" x="308.5" y="-253.8" font-family="arial" font-size="14.00">X1:1:+12V</text>
<text text-anchor="start" x="427" y="-253.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;1:RD &#160;&#160;&#160;</text>
<text text-anchor="start" x="546" y="-253.8" font-family="arial" font-size="14.00">Y1:5:+12V</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-246 280.5,-248 637.5,-248 637.5,-246 280.5,-246"/>
<polygon fill="#ff0000" stroke="transparent" points="280.5,-244 280.5,-246 637.5,-246 637.5,-244 280.5,-244"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-242 280.5,-244 637.5,-244 637.5,-242 280.5,-242"/>
<text text-anchor="start" x="311.5" y="-228.8" font-family="arial" font-size="14.00">X1:2:TX+</text>
<text text-anchor="start" x="425" y="-228.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;2:WH &#160;&#160;&#160;</text>
<text text-anchor="start" x="545.5" y="-228.8" font-family="arial" font-size="14.00">Y1:10:TX+</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-221 280.5,-223 637.5,-223 637.5,-221 280.5,-221"/>
<polygon fill="#ffffff" stroke="transparent" points="280.5,-219 280.5,-221 637.5,-221 637.5,-219 280.5,-219"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-217 280.5,-219 637.5,-219 637.5,-217 280.5,-217"/>
<text text-anchor="start" x="309" y="-203.8" font-family="arial" font-size="14.00">X1:3:GND</text>
<text text-anchor="start" x="427.5" y="-203.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;3:YE &#160;&#160;&#160;</text>
<text text-anchor="start" x="546.5" y="-203.8" font-family="arial" font-size="14.00">Y1:8:GND</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-196 280.5,-198 637.5,-198 637.5,-196 280.5,-196"/>
<polygon fill="#ffff00" stroke="transparent" points="280.5,-194 280.5,-196 637.5,-196 637.5,-194 280.5,-194"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-192 280.5,-194 637.5,-194 637.5,-192 280.5,-192"/>
<text text-anchor="start" x="317.5" y="-178.8" font-family="arial" font-size="14.00">X1:4:R&#45;</text>
<text text-anchor="start" x="426" y="-178.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;4:GN &#160;&#160;&#160;</text>
<text text-anchor="start" x="555" y="-178.8" font-family="arial" font-size="14.00">Y1:6:R&#45;</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-171 280.5,-173 637.5,-173 637.5,-171 280.5,-171"/>
<polygon fill="#00ff00" stroke="transparent" points="280.5,-169 280.5,-171 637.5,-171 637.5,-169 280.5,-169"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-167 280.5,-169 637.5,-169 637.5,-167 280.5,-167"/>
<text text-anchor="start" x="315.5" y="-153.8" font-family="arial" font-size="14.00">X1:5:R+</text>
<text text-anchor="start" x="425.5" y="-153.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;5:OG &#160;&#160;&#160;</text>
<text text-anchor="start" x="553" y="-153.8" font-family="arial" font-size="14.00">Y1:1:R+</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-146 280.5,-148 637.5,-148 637.5,-146 280.5,-146"/>
<polygon fill="#ff8000" stroke="transparent" points="280.5,-144 280.5,-146 637.5,-146 637.5,-144 280.5,-144"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-142 280.5,-144 637.5,-144 637.5,-142 280.5,-142"/>
<text text-anchor="start" x="305" y="-128.8" font-family="arial" font-size="14.00">X1:6:MUTE</text>
<text text-anchor="start" x="427.5" y="-128.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;6:BU &#160;&#160;&#160;</text>
<text text-anchor="start" x="542.5" y="-128.8" font-family="arial" font-size="14.00">Y1:4:MUTE</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-121 280.5,-123 637.5,-123 637.5,-121 280.5,-121"/>
<polygon fill="#0066ff" stroke="transparent" points="280.5,-119 280.5,-121 637.5,-121 637.5,-119 280.5,-119"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-117 280.5,-119 637.5,-119 637.5,-117 280.5,-117"/>
<text text-anchor="start" x="313.5" y="-103.8" font-family="arial" font-size="14.00">X1:7:TX&#45;</text>
<text text-anchor="start" x="428" y="-103.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;7:VT &#160;&#160;&#160;</text>
<text text-anchor="start" x="551" y="-103.8" font-family="arial" font-size="14.00">Y1:9:TX&#45;</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-96 280.5,-98 637.5,-98 637.5,-96 280.5,-96"/>
<polygon fill="#8000ff" stroke="transparent" points="280.5,-94 280.5,-96 637.5,-96 637.5,-94 280.5,-94"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-92 280.5,-94 637.5,-94 637.5,-92 280.5,-92"/>
<text text-anchor="start" x="318.5" y="-78.8" font-family="arial" font-size="14.00">X1:8:L&#45;</text>
<text text-anchor="start" x="427.5" y="-78.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;8:BN &#160;&#160;&#160;</text>
<text text-anchor="start" x="556" y="-78.8" font-family="arial" font-size="14.00">Y1:7:L&#45;</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-71 280.5,-73 637.5,-73 637.5,-71 280.5,-71"/>
<polygon fill="#895956" stroke="transparent" points="280.5,-69 280.5,-71 637.5,-71 637.5,-69 280.5,-69"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-67 280.5,-69 637.5,-69 637.5,-67 280.5,-67"/>
<text text-anchor="start" x="316.5" y="-53.8" font-family="arial" font-size="14.00">X1:9:L+</text>
<text text-anchor="start" x="427.5" y="-53.8" font-family="arial" font-size="14.00"> &#160;&#160;&#160;&#160;9:BK &#160;&#160;&#160;</text>
<text text-anchor="start" x="554" y="-53.8" font-family="arial" font-size="14.00">Y1:2:L+</text>
<polygon fill="#000000" stroke="transparent" points="280.5,-46 280.5,-48 637.5,-48 637.5,-46 280.5,-46"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-44 280.5,-46 637.5,-46 637.5,-44 280.5,-44"/>
<polygon fill="#000000" stroke="transparent" points="280.5,-42 280.5,-44 637.5,-44 637.5,-42 280.5,-42"/>
<text text-anchor="start" x="338.5" y="-28.8" font-family="arial" font-size="14.00"> </text>
<polygon fill="none" stroke="black" points="280.5,0 280.5,-23 637.5,-23 637.5,0 280.5,0"/>
<text text-anchor="start" x="284.5" y="-7.8" font-family="arial" font-size="14.00">(colors of DSub cable; colors of CN701 harness may vary)</text>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge1" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-237C200.76,-237.13 216.65,-243.13 280,-243"/>
<path fill="none" stroke="#ff0000" stroke-width="2" d="M136,-239C200.06,-239 215.94,-245 280,-245"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-241C199.35,-240.87 215.24,-246.87 280,-247"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge3" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-214C200.51,-214.06 216.46,-218.06 280,-218"/>
<path fill="none" stroke="#ffffff" stroke-width="2" d="M136,-216C200.02,-216 215.98,-220 280,-220"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-218C199.54,-217.94 215.49,-221.94 280,-222"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge5" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-191C200.25,-191.02 216.24,-193.02 280,-193"/>
<path fill="none" stroke="#ffff00" stroke-width="2" d="M136,-193C200.01,-193 215.99,-195 280,-195"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-195C199.76,-194.98 215.75,-196.98 280,-197"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge7" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-167C200.13,-167 216.12,-168 280,-168"/>
<path fill="none" stroke="#00ff00" stroke-width="2" d="M136,-169C200,-169 216,-170 280,-170"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-171C199.88,-171 215.87,-172 280,-172"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge9" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-144C199.88,-144 215.87,-143 280,-143"/>
<path fill="none" stroke="#ff8000" stroke-width="2" d="M136,-146C200,-146 216,-145 280,-145"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-148C200.13,-148 216.12,-147 280,-147"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge11" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-121C199.64,-121.03 215.62,-118.03 280,-118"/>
<path fill="none" stroke="#0066ff" stroke-width="2" d="M136,-123C200.01,-123 215.99,-120 280,-120"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-125C200.38,-124.97 216.36,-121.97 280,-122"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge13" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-98C199.44,-98.09 215.36,-93.09 280,-93"/>
<path fill="none" stroke="#8000ff" stroke-width="2" d="M136,-100C200.04,-100 215.96,-95 280,-95"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-102C200.64,-101.91 216.56,-96.91 280,-97"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge15" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-75C199.27,-75.17 215.12,-68.17 280,-68"/>
<path fill="none" stroke="#895956" stroke-width="2" d="M136,-77C200.08,-77 215.92,-70 280,-70"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-79C200.88,-78.83 216.73,-71.83 280,-72"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge17" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-52C199.13,-52.26 214.88,-43.26 280,-43"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-54C200.12,-54 215.88,-45 280,-45"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-56C201.12,-55.74 216.87,-46.74 280,-47"/>
</g>
<!-- X1&#45;&#45;W1 -->
<g id="edge19" class="edge">
<title>X1:e&#45;&#45;W1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-191C200.25,-191.02 216.24,-193.02 280,-193"/>
<path fill="none" stroke="#ffff00" stroke-width="2" d="M136,-193C200.01,-193 215.99,-195 280,-195"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M136,-195C199.76,-194.98 215.75,-196.98 280,-197"/>
</g>
<!-- Y1 -->
<g id="node2" class="node">
<title>Y1</title>
<polygon fill="#ffffff" stroke="black" points="927,-317.5 781,-317.5 781,-18.5 927,-18.5 927,-317.5"/>
<polygon fill="none" stroke="black" points="781,-294 781,-317 927,-317 927,-294 781,-294"/>
<text text-anchor="start" x="845.5" y="-301.8" font-family="arial" font-size="14.00">Y1</text>
<polygon fill="none" stroke="black" points="781,-271 781,-294 832,-294 832,-271 781,-271"/>
<text text-anchor="start" x="785" y="-278.8" font-family="arial" font-size="14.00">CN701</text>
<polygon fill="none" stroke="black" points="832,-271 832,-294 882,-294 882,-271 832,-271"/>
<text text-anchor="start" x="836" y="-278.8" font-family="arial" font-size="14.00">female</text>
<polygon fill="none" stroke="black" points="882,-271 882,-294 927,-294 927,-271 882,-271"/>
<text text-anchor="start" x="886" y="-278.8" font-family="arial" font-size="14.00">11&#45;pin</text>
<polygon fill="none" stroke="black" points="781,-248 781,-271 842,-271 842,-248 781,-248"/>
<text text-anchor="start" x="807.5" y="-255.8" font-family="arial" font-size="14.00">1</text>
<polygon fill="none" stroke="black" points="842,-248 842,-271 927,-271 927,-248 842,-248"/>
<text text-anchor="start" x="875" y="-255.8" font-family="arial" font-size="14.00">R+</text>
<polygon fill="none" stroke="black" points="781,-225 781,-248 842,-248 842,-225 781,-225"/>
<text text-anchor="start" x="807.5" y="-232.8" font-family="arial" font-size="14.00">2</text>
<polygon fill="none" stroke="black" points="842,-225 842,-248 927,-248 927,-225 842,-225"/>
<text text-anchor="start" x="876.5" y="-232.8" font-family="arial" font-size="14.00">L+</text>
<polygon fill="none" stroke="black" points="781,-202 781,-225 842,-225 842,-202 781,-202"/>
<text text-anchor="start" x="807.5" y="-209.8" font-family="arial" font-size="14.00">3</text>
<polygon fill="none" stroke="black" points="842,-202 842,-225 927,-225 927,-202 842,-202"/>
<text text-anchor="start" x="864.5" y="-209.8" font-family="arial" font-size="14.00">SGND</text>
<polygon fill="none" stroke="black" points="781,-179 781,-202 842,-202 842,-179 781,-179"/>
<text text-anchor="start" x="807.5" y="-186.8" font-family="arial" font-size="14.00">4</text>
<polygon fill="none" stroke="black" points="842,-179 842,-202 927,-202 927,-179 842,-179"/>
<text text-anchor="start" x="864.5" y="-186.8" font-family="arial" font-size="14.00">MUTE</text>
<polygon fill="none" stroke="black" points="781,-156 781,-179 842,-179 842,-156 781,-156"/>
<text text-anchor="start" x="807.5" y="-163.8" font-family="arial" font-size="14.00">5</text>
<polygon fill="none" stroke="black" points="842,-156 842,-179 927,-179 927,-156 842,-156"/>
<text text-anchor="start" x="868" y="-163.8" font-family="arial" font-size="14.00">+12V</text>
<polygon fill="none" stroke="black" points="781,-133 781,-156 842,-156 842,-133 781,-133"/>
<text text-anchor="start" x="807.5" y="-140.8" font-family="arial" font-size="14.00">6</text>
<polygon fill="none" stroke="black" points="842,-133 842,-156 927,-156 927,-133 842,-133"/>
<text text-anchor="start" x="877" y="-140.8" font-family="arial" font-size="14.00">R&#45;</text>
<polygon fill="none" stroke="black" points="781,-110 781,-133 842,-133 842,-110 781,-110"/>
<text text-anchor="start" x="807.5" y="-117.8" font-family="arial" font-size="14.00">7</text>
<polygon fill="none" stroke="black" points="842,-110 842,-133 927,-133 927,-110 842,-110"/>
<text text-anchor="start" x="878" y="-117.8" font-family="arial" font-size="14.00">L&#45;</text>
<polygon fill="none" stroke="black" points="781,-87 781,-110 842,-110 842,-87 781,-87"/>
<text text-anchor="start" x="807.5" y="-94.8" font-family="arial" font-size="14.00">8</text>
<polygon fill="none" stroke="black" points="842,-87 842,-110 927,-110 927,-87 842,-87"/>
<text text-anchor="start" x="869" y="-94.8" font-family="arial" font-size="14.00">GND</text>
<polygon fill="none" stroke="black" points="781,-64 781,-87 842,-87 842,-64 781,-64"/>
<text text-anchor="start" x="807.5" y="-71.8" font-family="arial" font-size="14.00">9</text>
<polygon fill="none" stroke="black" points="842,-64 842,-87 927,-87 927,-64 842,-64"/>
<text text-anchor="start" x="873.5" y="-71.8" font-family="arial" font-size="14.00">TX&#45;</text>
<polygon fill="none" stroke="black" points="781,-41 781,-64 842,-64 842,-41 781,-41"/>
<text text-anchor="start" x="803.5" y="-48.8" font-family="arial" font-size="14.00">10</text>
<polygon fill="none" stroke="black" points="842,-41 842,-64 927,-64 927,-41 842,-41"/>
<text text-anchor="start" x="871.5" y="-48.8" font-family="arial" font-size="14.00">TX+</text>
<polygon fill="none" stroke="black" points="781,-18 781,-41 842,-41 842,-18 781,-18"/>
<text text-anchor="start" x="803.5" y="-25.8" font-family="arial" font-size="14.00">12</text>
<polygon fill="none" stroke="black" points="842,-18 842,-41 927,-41 927,-18 842,-18"/>
<text text-anchor="start" x="870" y="-25.8" font-family="arial" font-size="14.00">ACC</text>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge2" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-243C707.79,-245.04 706.21,-167.04 781,-165"/>
<path fill="none" stroke="#ff0000" stroke-width="2" d="M637,-245C709.79,-245 708.21,-167 781,-167"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-247C711.79,-244.96 710.21,-166.96 781,-169"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge4" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-218C733.43,-220.6 680.75,-52.6 781,-50"/>
<path fill="none" stroke="#ffffff" stroke-width="2" d="M637,-220C735.34,-220 682.66,-52 781,-52"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-222C737.25,-219.4 684.57,-51.4 781,-54"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge6" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-193C712.18,-195.21 701.85,-98.21 781,-96"/>
<path fill="none" stroke="#ffff00" stroke-width="2" d="M637,-195C714.17,-195 703.83,-98 781,-98"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-197C716.15,-194.79 705.82,-97.79 781,-100"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge8" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-168C700.27,-169.06 714.2,-143.06 781,-142"/>
<path fill="none" stroke="#00ff00" stroke-width="2" d="M637,-170C702.03,-170 715.97,-144 781,-144"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-172C703.8,-170.94 717.73,-144.94 781,-146"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge10" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-143C720.88,-145.34 701.07,-260.34 781,-258"/>
<path fill="none" stroke="#ff8000" stroke-width="2" d="M637,-145C718.9,-145 699.1,-260 781,-260"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-147C716.93,-144.66 697.12,-259.66 781,-262"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge12" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-118C710.36,-119.96 711.64,-190.96 781,-189"/>
<path fill="none" stroke="#0066ff" stroke-width="2" d="M637,-120C708.36,-120 709.64,-191 781,-191"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-122C706.36,-120.04 707.64,-191.04 781,-193"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge14" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-93C700.01,-93.81 714.78,-73.81 781,-73"/>
<path fill="none" stroke="#8000ff" stroke-width="2" d="M637,-95C701.61,-95 716.39,-75 781,-75"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-97C703.22,-96.19 717.99,-76.19 781,-77"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge16" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-68C706.87,-69.68 715.08,-120.68 781,-119"/>
<path fill="none" stroke="#895956" stroke-width="2" d="M637,-70C704.9,-70 713.1,-121 781,-121"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-72C702.92,-70.32 711.13,-121.32 781,-123"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge18" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-43C745.55,-45.68 676.21,-237.68 781,-235"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-45C743.67,-45 674.33,-237 781,-237"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-47C741.79,-44.32 672.45,-236.32 781,-239"/>
</g>
<!-- W1&#45;&#45;Y1 -->
<g id="edge20" class="edge">
<title>W1:e&#45;&#45;Y1:w</title>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-193C703.13,-193.77 718.02,-212.77 781,-212"/>
<path fill="none" stroke="#ffff00" stroke-width="2" d="M637,-195C701.55,-195 716.45,-214 781,-214"/>
<path fill="none" stroke="#000000" stroke-width="2" d="M637,-197C699.98,-196.23 714.87,-215.23 781,-216"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 24 KiB

+26
View File
@@ -0,0 +1,26 @@
connectors:
X1:
type: D-Sub
subtype: female
pinlabels: [+12V, TX+, GND, R-, R+, MUTE, TX-, L-, L+]
Y1:
type: CN701
subtype: female
pins: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12]
pinlabels: [R+, L+, SGND, MUTE, +12V, R-, L-, GND, TX-, TX+, ACC]
cables:
W1:
wirecount: 9
length: 1.5 ft
gauge: 24 AWG
colors: [RD, WH, YE, GN, OG, BU, VT, BN, BK]
notes: (colors of DSub cable; colors of CN701 harness may vary)
connections:
- - X1: [1-9]
- W1: [1-9]
- Y1: [5, 10, 8, 6, 1, 4, 9, 7, 2]
- - X1: 3
- W1: 3
- Y1: 3
+36
View File
@@ -0,0 +1,36 @@
(kicad_symbol_lib (version 20220914) (generator kicad_symbol_editor)
(symbol "XC6701" (in_bom yes) (on_board yes)
(property "Reference" "U" (at 0 5.08 0)
(effects (font (size 1.27 1.27)))
)
(property "Value" "" (at 0 0 0)
(effects (font (size 1.27 1.27)))
)
(property "Footprint" "" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(property "Datasheet" "" (at 0 0 0)
(effects (font (size 1.27 1.27)) hide)
)
(symbol "XC6701_0_0"
(pin power_in line (at -8.89 1.27 0) (length 2.54)
(name "Vin" (effects (font (size 1.27 1.27))))
(number "1" (effects (font (size 1.27 1.27))))
)
(pin power_in line (at 0 -6.35 90) (length 2.54)
(name "GND" (effects (font (size 1.27 1.27))))
(number "2" (effects (font (size 1.27 1.27))))
)
(pin power_out line (at 8.89 1.27 180) (length 2.54)
(name "Vout" (effects (font (size 1.27 1.27))))
(number "3" (effects (font (size 1.27 1.27))))
)
)
(symbol "XC6701_1_1"
(rectangle (start -6.35 3.81) (end 6.35 -3.81)
(stroke (width 0) (type default))
(fill (type background))
)
)
)
)
Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

File diff suppressed because it is too large Load Diff
@@ -0,0 +1,171 @@
(footprint "CUI_SJ-43514" (version 20221018) (generator pcbnew)
(layer "F.Cu")
(attr through_hole)
(fp_text reference "REF**" (at -2.979703 -6.81327) (layer "F.SilkS")
(effects (font (size 0.480598 0.480598) (thickness 0.15)))
(tstamp bfeda05e-5925-424c-8f77-4d0de2d9f221)
)
(fp_text value "CUI_SJ-43514" (at -1.094318 6.206094) (layer "F.Fab")
(effects (font (size 0.480844 0.480844) (thickness 0.15)))
(tstamp bdc14a89-1821-43fc-a9f8-40f3b142a63d)
)
(fp_text user "PCB EDGE" (at -5.75332 8.5049) (layer "F.Fab")
(effects (font (size 0.480277 0.480277) (thickness 0.120069)))
(tstamp 6a88ca6f-a53e-4950-bbc8-44c4d11c2a0a)
)
(fp_line (start -8.5 -3) (end -5.5 -3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp 0050636b-6e15-4ce3-9ac3-09473598b5da))
(fp_line (start -8.5 3) (end -8.5 -3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp ecac6353-2236-4d1a-834d-0a75abb5cee1))
(fp_line (start -5.5 -4.7) (end -5.5 -3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp bf6fd2e2-0049-48bb-a736-39561152d911))
(fp_line (start -5.5 -3) (end -5.5 -2.25)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp dede3ff1-9dd4-49de-979e-95dfa9478423))
(fp_line (start -5.5 -2.25) (end -4.2 -2.25)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp 5eb5c318-7dc4-4e7f-989a-f4ba5dc0821f))
(fp_line (start -5.5 2.25) (end -5.5 3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp 9013f407-26c3-41ed-8b0e-8d3226919b1a))
(fp_line (start -5.5 3) (end -8.5 3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp 0fd41d69-9ce9-4ef0-a762-a71b1aac4fd6))
(fp_line (start -5.5 3) (end -5.5 4.3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp 658d99e0-a80a-4367-a8a5-4c5f9dba1178))
(fp_line (start -5.5 4.3) (end -3.75 4.3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp 7b5ba43a-3077-4f09-add7-a178895e80ae))
(fp_line (start -5.05 4.3) (end -4.55 5.35)
(stroke (width 0.1) (type default)) (layer "F.SilkS") (tstamp 5a1481a0-0072-4fb0-b82f-9002c5f87269))
(fp_line (start -4.55 5.35) (end -3.6 5.35)
(stroke (width 0.1) (type default)) (layer "F.SilkS") (tstamp 5bf00677-c1d9-484b-8a50-5cd0c873eeb5))
(fp_line (start -4.2 -2.25) (end -4.2 2.25)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp ffee2b26-d7e4-4284-9263-c6aca5b9749a))
(fp_line (start -4.2 2.25) (end -5.5 2.25)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp 32f065d2-8bb4-4f1a-84da-02bc6ff17e4d))
(fp_line (start -3.8 -4.7) (end -5.5 -4.7)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp abfac670-5770-42a2-a09b-98c42789dc0a))
(fp_line (start -3.6 5.35) (end -3.6 5)
(stroke (width 0.1) (type default)) (layer "F.SilkS") (tstamp 12653866-eba9-48de-9c11-2db40ab42242))
(fp_line (start -1.4 -4.7) (end 6.1 -4.7)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp e7e22f9d-9cb3-4f0f-81d0-1e6f401e1325))
(fp_line (start 0.4 4.3) (end 0.4 5.4)
(stroke (width 0.1) (type default)) (layer "F.SilkS") (tstamp 44432717-bbe5-4b53-abc2-4fff5060c314))
(fp_line (start 0.4 5.4) (end 1.3 5.4)
(stroke (width 0.1) (type default)) (layer "F.SilkS") (tstamp dd54a902-0e87-4221-9694-bf2b3bf84625))
(fp_line (start 1.3 5.4) (end 1.7 4.6)
(stroke (width 0.1) (type default)) (layer "F.SilkS") (tstamp 1d9fc1f8-7c3b-4056-8cd2-e1b881e3711f))
(fp_line (start 1.5 4.3) (end -1.55 4.3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp ed42dbf6-5647-4586-a2ce-063b416c4194))
(fp_line (start 6.1 -4.7) (end 6.1 -2.7)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp 4619c36d-b0cd-415b-ae48-395ee76ef585))
(fp_line (start 6.1 -0.35) (end 6.1 4.3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp c05166e3-0591-4801-8c91-d3dd803cca16))
(fp_line (start 6.1 4.3) (end 3.4 4.3)
(stroke (width 0.127) (type solid)) (layer "F.SilkS") (tstamp 3c5ea8b3-2ced-4df4-9fc4-309b967f50ce))
(fp_circle (center -4 -5.5) (end -3.8 -5.5)
(stroke (width 0.4) (type solid)) (fill none) (layer "F.SilkS") (tstamp 1a0330d0-db00-4dfa-9914-25086b1fbfbf))
(fp_line (start -5.5 -8.35) (end -5.5 -2.25)
(stroke (width 0.01) (type solid)) (layer "Edge.Cuts") (tstamp ecdf0e30-8453-4e73-b5ab-aa93010d888d))
(fp_line (start -5.5 -2.25) (end -4.2 -2.25)
(stroke (width 0.01) (type solid)) (layer "Edge.Cuts") (tstamp d61220d3-0c4a-46fe-966c-fa6d3205a6bd))
(fp_line (start -5.5 2.25) (end -5.5 8.85)
(stroke (width 0.01) (type solid)) (layer "Edge.Cuts") (tstamp 4b0c47eb-fff4-443f-a38b-fabcc1e8eb82))
(fp_line (start -4.2 -2.25) (end -4.2 2.25)
(stroke (width 0.01) (type solid)) (layer "Edge.Cuts") (tstamp 89f05533-9365-4886-8c31-515ca2e0d00b))
(fp_line (start -4.2 2.25) (end -5.5 2.25)
(stroke (width 0.01) (type solid)) (layer "Edge.Cuts") (tstamp ae1988c7-803b-4b56-b7fd-d8e2dd7b830c))
(fp_line (start -8.75 -3.25) (end -5.75 -3.25)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 940af57e-dd0f-4060-9be4-fe34e7aa903e))
(fp_line (start -8.75 3.25) (end -8.75 -3.25)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 266b0d05-a27e-450f-8538-bc9affd19b04))
(fp_line (start -5.75 -5) (end -3.65 -5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 3b5bc2e3-9f5a-409a-993b-83f5f819c072))
(fp_line (start -5.75 -3.25) (end -5.75 -5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 9ae91dfe-d4b6-4dfa-bddf-91c145ccc5f6))
(fp_line (start -5.75 3.25) (end -8.75 3.25)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 62e06b49-3ebe-49ed-a4c2-3e93da53c16d))
(fp_line (start -5.75 4.5) (end -5.75 3.25)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 097944c5-fe4f-4da3-8780-42e8a8eeff4d))
(fp_line (start -5.25 4.5) (end -5.75 4.5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 7233d18f-b358-4e74-9555-a6a75d6127dc))
(fp_line (start -5.25 5.55) (end -5.25 4.5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 5dd71fc4-88f7-45c2-b6be-97a22f0df7f9))
(fp_line (start -3.65 -5.85) (end -1.5 -5.85)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp ccba6cef-50a5-421e-9d4f-7f2a0e8b80a4))
(fp_line (start -3.65 -5) (end -3.65 -5.85)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 135bbc13-e01b-436c-a876-d8b74759ae6d))
(fp_line (start -1.5 -5.85) (end -1.5 -5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 396eebd4-23db-4244-bfb5-c7a05b73ec13))
(fp_line (start -1.5 -5) (end 6.3 -5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 2f5078ca-1522-4faf-96ff-fa75e32013ee))
(fp_line (start 2 5.55) (end -5.25 5.55)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp dbe5204d-c99e-4064-98e1-bdf7b7b37874))
(fp_line (start 2 5.55) (end 2 4.6)
(stroke (width 0.05) (type default)) (layer "F.CrtYd") (tstamp cdd79330-522a-4535-8c78-14c4608d4d55))
(fp_line (start 6.3 -5) (end 6.3 -2.6)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 570b790c-1c58-4b29-bc5e-93fbc00a1601))
(fp_line (start 6.3 -2.6) (end 6.5 -2.6)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 167c1098-293c-4d8b-b749-92216e026450))
(fp_line (start 6.3 -0.5) (end 6.3 4.6)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp e3966f22-fca2-4ca3-b5f0-05222dd717de))
(fp_line (start 6.3 4.6) (end 2 4.6)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp 9cdb0a50-a0c6-4a55-87c8-48783fc5368e))
(fp_line (start 6.5 -2.6) (end 6.5 -0.5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp e8cc2a6b-ffb6-4f90-90f4-d497d1f0a692))
(fp_line (start 6.5 -0.5) (end 6.3 -0.5)
(stroke (width 0.05) (type solid)) (layer "F.CrtYd") (tstamp d29942c8-f25a-41dc-9e05-ac32b1a9f741))
(fp_line (start -8.5 -3) (end -8.5 3)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp a27f1ab1-c6f9-4b28-9728-cc59daa92ea7))
(fp_line (start -8.5 3) (end -5.5 3)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp e5e3bbf8-cd0b-4d9e-9f24-64dd16354f96))
(fp_line (start -5.5 -4.7) (end -5.5 -3)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp 4242f01b-41cd-4da5-b700-6107f22cd2ee))
(fp_line (start -5.5 -4.7) (end 6.1 -4.7)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp 27a82db8-2858-4f01-baec-c0c199045d07))
(fp_line (start -5.5 -3) (end -8.5 -3)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp f5372e4a-5bde-4c18-81bf-5e6b13679292))
(fp_line (start -5.5 -3) (end -5.5 -2.25)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp 203ba3fa-cb1d-4968-b9f5-596155c2dadf))
(fp_line (start -5.5 -2.25) (end -4.2 -2.25)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp fc87e254-1807-4d59-b472-92b5dc84a38e))
(fp_line (start -5.5 2.25) (end -5.5 3)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp 11b2e23c-dadb-4b7a-aca5-7f204e0de401))
(fp_line (start -5.5 3) (end -5.5 4.3)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp 981f06cf-dc71-4fbc-83d9-b9bff68dddc8))
(fp_line (start -5.5 4.3) (end -5.05 4.3)
(stroke (width 0.127) (type default)) (layer "F.Fab") (tstamp b939b474-cc9b-403b-a66e-5145b84f511b))
(fp_line (start -5.05 4.3) (end -4.55 5.35)
(stroke (width 0.127) (type default)) (layer "F.Fab") (tstamp b365aa16-9e8d-43a4-992e-7f39a81b3c25))
(fp_line (start -4.55 5.35) (end -3.6 5.35)
(stroke (width 0.127) (type default)) (layer "F.Fab") (tstamp 1c73b2ee-5dc0-4690-9ed4-932d3c0a1b18))
(fp_line (start -4.2 -2.25) (end -4.2 2.25)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp ab5dcbaa-38c1-4be7-9a9d-f958f0e3a05e))
(fp_line (start -4.2 2.25) (end -5.5 2.25)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp 0356b2dc-c9bc-4829-8343-27ed86d2e19b))
(fp_line (start -3.6 4.3) (end 0.4 4.3)
(stroke (width 0.127) (type default)) (layer "F.Fab") (tstamp 28bf17a6-3221-4254-b5e3-442590091c92))
(fp_line (start -3.6 5.35) (end -3.6 4.3)
(stroke (width 0.127) (type default)) (layer "F.Fab") (tstamp fede174c-82d4-4214-9a80-dee671777d81))
(fp_line (start 0.4 4.3) (end 0.4 5.4)
(stroke (width 0.127) (type default)) (layer "F.Fab") (tstamp 86c7aabb-f8c0-4c73-b019-b85bebb71f06))
(fp_line (start 0.4 5.4) (end 1.3 5.4)
(stroke (width 0.127) (type default)) (layer "F.Fab") (tstamp b346b889-f83f-4e44-ac3c-b9c18c4bfeca))
(fp_line (start 1.3 5.4) (end 1.85 4.3)
(stroke (width 0.127) (type default)) (layer "F.Fab") (tstamp 83601258-2c7d-4c55-9996-ee590a16f411))
(fp_line (start 1.85 4.3) (end 6.1 4.3)
(stroke (width 0.127) (type default)) (layer "F.Fab") (tstamp decc39a6-5210-4338-a0bf-27444887de8e))
(fp_line (start 6.1 -4.7) (end 6.1 4.3)
(stroke (width 0.127) (type solid)) (layer "F.Fab") (tstamp f0bcef93-c605-4782-9671-50816bcff153))
(pad "" np_thru_hole circle (at -2.6 0) (size 1.1 1.1) (drill 1.1) (layers "*.Cu" "*.Mask") (tstamp 4bf3c14b-548d-46b8-b495-96bd6a488313))
(pad "" np_thru_hole circle (at 2.4 0) (size 1.1 1.1) (drill 1.1) (layers "*.Cu" "*.Mask") (tstamp d20a6657-1fc2-4113-8548-24694ff1e021))
(pad "1" thru_hole rect (at -2.6 -4.8) (size 1.65 1.65) (drill 1.1) (layers "*.Cu" "*.Mask")
(solder_mask_margin 0.102) (tstamp 32f3146d-6082-43d2-96fd-12e0385460bd))
(pad "2" thru_hole circle (at 2.4 3.6) (size 1.65 1.65) (drill 1.1) (layers "*.Cu" "*.Mask")
(solder_mask_margin 0.102) (tstamp 49f2bf78-3fd2-4bd7-9f90-9e57a7203293))
(pad "3" thru_hole circle (at 5.5 -1.6) (size 1.65 1.65) (drill 1.1) (layers "*.Cu" "*.Mask")
(solder_mask_margin 0.102) (tstamp dc557e88-b134-41f4-966a-5f977c97ee79))
(pad "4" thru_hole circle (at -2.6 4.5) (size 1.65 1.65) (drill 1.1) (layers "*.Cu" "*.Mask")
(solder_mask_margin 0.102) (tstamp 076cf2ff-8dd7-4070-a098-78b9ee4a7912))
(model "${KIPRJMOD}/CUI_DEVICES_SJ-43514.step"
(offset (xyz -5.5 0 2.25))
(scale (xyz 1 1 1))
(rotate (xyz -90 0 180))
)
)
+23
View File
@@ -0,0 +1,23 @@
# Hardware
I ordered the boards partially assembled from JLCPCB (to keep costs down, I ordered and soldered some non-standard/stocked parts myself.)
The non-populated/assembled BOM is:
| Mouser #: | Mfr. #: | Desc.: | Order Qty. | Unit Price (USD) |
| ------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------ | ---------- | ----------- |
| 579-ATTINY3216-SNR | ATTINY3216-SNR | 8-bit Microcontrollers - MCU 8-bit Microcontrollers - MCU 20MHz, 32KB, SOIC20, Ind 105C, Green, T&R | 1 | $1.27 |
| 523-L717SDE09PA4CH4 | L717SDE09PA4CH4F | D-Sub Standard Connectors D-Sub Standard Connectors D SUB R/A | 1 | $1.98 |
| 490-SJ-43514 | SJ-43514 | Phone Connectors Phone Connectors audio jack, 3.5 mm, rt, 4 conductor, through hole, 0 switches | 1 | $1.35 |
| 667-ERZ-V20D220 | ERZ-V20D220 | Varistors Varistors 22V 2000A ZNR SUR ABSORBER 20MM | 1 | $1.24 |
| 538-22-28-8093 | 22-28-8093 | Headers & Wire Housings Headers & Wire Housings 2.54MM BREAKAWAY RA 9 CKT Gold | 2 | $0.76 |
| 865-XC6701D502JR-G | XC6701D502JR-G | LDO Voltage Regulators LDO Voltage Regulators 28V High Speed Voltage Regulator | 1 | $1.36 |
| 563-EXN-23350-BK | EXN-23350-BK | Enclosures, Boxes, & Cases Enclosures, Boxes, & Cases Extruded Aluminum Enclosure Black (1.4 X 2.7 X 1.9 In) | 1 | $14.40 |
An earlier version of the board* lacked cutouts in the corners to fit the ends of the intended housing, so I haven't used the listed enclosure (yet).
*Only version of the board I have ordered so far.
### Flashing
The CMake target `flash` uses the AVRDude utility using the "serialupdi" programmer type. I use a [USB => Serial converter](https://www.adafruit.com/product/5335) with the Rx and Tx lines connected, using one of the options described [by SpenceKonde here](https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md).
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,77 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "All Layers",
"auto_track_width": true,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": false,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "fffffff_ffffffff",
"zone_display_mode": 0
},
"meta": {
"filename": "avclan-mockingboard-rounded.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}
@@ -0,0 +1,509 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"board_outline_line_width": 0.09999999999999999,
"copper_line_width": 0.19999999999999998,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.049999999999999996,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.09999999999999999,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.15,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.762,
"height": 1.524,
"width": 1.524
},
"silk_line_width": 0.15,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"min_clearance": 0.33299999999999996
}
},
"diff_pair_dimensions": [
{
"gap": 0.0,
"via_gap": 0.0,
"width": 0.0
}
],
"drc_exclusions": [
"extra_footprint|155000000|98300000|9eb14f8d-8889-43ee-98f8-14d7ff3a00d4|00000000-0000-0000-0000-000000000000",
"silk_edge_clearance|127600000|75600000|3c9aeeb6-9bf2-4b70-8ccb-4aa674772f2c|3bc1c510-8140-48c6-9e1d-e37afa6a5a79",
"silk_edge_clearance|136600000|75600000|6e55689b-dfcc-4b1b-b6da-416a34456e20|6d777aef-3d67-44dd-a85d-1dbda6171f02",
"silk_edge_clearance|138470000|75600000|6e55689b-dfcc-4b1b-b6da-416a34456e20|c93e5386-3bd1-45c9-bd03-1ef6229305ed",
"silk_edge_clearance|169440000|75600000|6e55689b-dfcc-4b1b-b6da-416a34456e20|44ebb4f7-c13a-4c59-b036-8212144cec66"
],
"meta": {
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"connection_width": "warning",
"copper_edge_clearance": "error",
"copper_sliver": "warning",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint": "error",
"footprint_type_mismatch": "ignore",
"hole_clearance": "error",
"hole_near_hole": "error",
"invalid_outline": "error",
"isolated_copper": "warning",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"lib_footprint_issues": "warning",
"lib_footprint_mismatch": "ignore",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "warning",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_edge_clearance": "warning",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"solder_mask_bridge": "error",
"starved_thermal": "error",
"text_height": "warning",
"text_thickness": "warning",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zones_intersect": "error"
},
"rules": {
"max_error": 0.005,
"min_clearance": 0.09,
"min_connection": 0.0,
"min_copper_edge_clearance": 0.3,
"min_hole_clearance": 0.254,
"min_hole_to_hole": 0.5,
"min_microvia_diameter": 0.19999999999999998,
"min_microvia_drill": 0.09999999999999999,
"min_resolved_spokes": 2,
"min_silk_clearance": 0.049999999999999996,
"min_text_height": 1.0,
"min_text_thickness": 0.153,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.09,
"min_via_annular_width": 0.15,
"min_via_diameter": 0.5,
"solder_mask_clearance": 0.0,
"solder_mask_min_width": 0.0,
"solder_mask_to_copper_clearance": 0.0,
"use_height_for_length_calcs": true
},
"teardrop_options": [
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 5,
"td_on_pad_in_zone": false,
"td_onpadsmd": true,
"td_onroundshapesonly": false,
"td_ontrackend": false,
"td_onviapad": true
}
],
"teardrop_parameters": [
{
"td_curve_segcount": 5,
"td_height_ratio": 1.0,
"td_length_ratio": 0.75,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_round_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_curve_segcount": 5,
"td_height_ratio": 1.0,
"td_length_ratio": 0.75,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_rect_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_curve_segcount": 5,
"td_height_ratio": 1.0,
"td_length_ratio": 0.75,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_target_name": "td_track_end",
"td_width_to_size_filter_ratio": 0.9
}
],
"track_widths": [
0.0,
0.1,
0.2,
0.5,
0.75,
1.0
],
"via_dimensions": [
{
"diameter": 0.0,
"drill": 0.0
}
],
"zones_allow_external_fillets": false
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "error",
"no_connect_dangling": "warning",
"pin_not_connected": "warning",
"pin_not_driven": "error",
"pin_to_pin": "error",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "ignore",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "avclan-mockingboard-rounded.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.25,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": []
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "low-power-ATtiny-board.net",
"specctra_dsn": "",
"step": "avclan-mockingboard-rounded.step",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_line_thickness": 6.0,
"default_text_size": 44.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "KiCad",
"ngspice": {
"fix_include_paths": true,
"meta": {
"version": 0
},
"model_mode": 0,
"workbook_filename": ""
},
"page_layout_descr_file": "",
"plot_directory": "./",
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"85a07af0-16ab-4d5b-a3f1-1b717cf4da63",
""
]
],
"text_variables": {}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,82 @@
{
"board": {
"active_layer": 0,
"active_layer_preset": "",
"auto_track_width": false,
"hidden_netclasses": [],
"hidden_nets": [],
"high_contrast_mode": 0,
"net_color_mode": 1,
"opacity": {
"images": 0.6,
"pads": 1.0,
"tracks": 1.0,
"vias": 1.0,
"zones": 0.6
},
"selection_filter": {
"dimensions": true,
"footprints": true,
"graphics": true,
"keepouts": true,
"lockedItems": true,
"otherItems": true,
"pads": true,
"text": true,
"tracks": true,
"vias": true,
"zones": true
},
"visible_items": [
0,
1,
2,
3,
4,
5,
8,
9,
10,
11,
12,
13,
15,
16,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
32,
33,
34,
35,
36,
39,
40
],
"visible_layers": "002f3ff_80000001",
"zone_display_mode": 0
},
"git": {
"repo_password": "",
"repo_type": "",
"repo_username": "",
"ssh_key": ""
},
"meta": {
"filename": "avclan-mockingboard.kicad_prl",
"version": 3
},
"project": {
"files": []
}
}
@@ -0,0 +1,615 @@
{
"board": {
"3dviewports": [],
"design_settings": {
"defaults": {
"apply_defaults_to_fp_fields": false,
"apply_defaults_to_fp_shapes": false,
"apply_defaults_to_fp_text": false,
"board_outline_line_width": 0.1,
"copper_line_width": 0.2,
"copper_text_italic": false,
"copper_text_size_h": 1.5,
"copper_text_size_v": 1.5,
"copper_text_thickness": 0.3,
"copper_text_upright": false,
"courtyard_line_width": 0.05,
"dimension_precision": 4,
"dimension_units": 3,
"dimensions": {
"arrow_length": 1270000,
"extension_offset": 500000,
"keep_text_aligned": true,
"suppress_zeroes": false,
"text_position": 0,
"units_format": 1
},
"fab_line_width": 0.1,
"fab_text_italic": false,
"fab_text_size_h": 1.0,
"fab_text_size_v": 1.0,
"fab_text_thickness": 0.15,
"fab_text_upright": false,
"other_line_width": 0.15,
"other_text_italic": false,
"other_text_size_h": 1.0,
"other_text_size_v": 1.0,
"other_text_thickness": 0.15,
"other_text_upright": false,
"pads": {
"drill": 0.0,
"height": 1.0,
"width": 1.0
},
"silk_line_width": 0.15,
"silk_text_italic": false,
"silk_text_size_h": 1.0,
"silk_text_size_v": 1.0,
"silk_text_thickness": 0.15,
"silk_text_upright": false,
"zones": {
"min_clearance": 0.25
}
},
"diff_pair_dimensions": [
{
"gap": 0.0,
"via_gap": 0.0,
"width": 0.0
}
],
"drc_exclusions": [
"courtyards_overlap|142951435|95185001|740497d3-ece2-41b1-a2fd-b8f316ceb15a|a16457de-07cc-4841-9375-dde6a241c692"
],
"meta": {
"version": 2
},
"rule_severities": {
"annular_width": "error",
"clearance": "error",
"connection_width": "warning",
"copper_edge_clearance": "error",
"copper_sliver": "warning",
"courtyards_overlap": "error",
"diff_pair_gap_out_of_range": "error",
"diff_pair_uncoupled_length_too_long": "error",
"drill_out_of_range": "error",
"duplicate_footprints": "warning",
"extra_footprint": "warning",
"footprint": "error",
"footprint_symbol_mismatch": "warning",
"footprint_type_mismatch": "ignore",
"hole_clearance": "error",
"hole_near_hole": "error",
"holes_co_located": "warning",
"invalid_outline": "error",
"isolated_copper": "warning",
"item_on_disabled_layer": "error",
"items_not_allowed": "error",
"length_out_of_range": "error",
"lib_footprint_issues": "warning",
"lib_footprint_mismatch": "ignore",
"malformed_courtyard": "error",
"microvia_drill_out_of_range": "error",
"missing_courtyard": "ignore",
"missing_footprint": "warning",
"net_conflict": "warning",
"npth_inside_courtyard": "ignore",
"padstack": "warning",
"pth_inside_courtyard": "ignore",
"shorting_items": "error",
"silk_edge_clearance": "warning",
"silk_over_copper": "warning",
"silk_overlap": "warning",
"skew_out_of_range": "error",
"solder_mask_bridge": "error",
"starved_thermal": "error",
"text_height": "warning",
"text_thickness": "warning",
"through_hole_pad_without_hole": "error",
"too_many_vias": "error",
"track_dangling": "warning",
"track_width": "error",
"tracks_crossing": "error",
"unconnected_items": "error",
"unresolved_variable": "error",
"via_dangling": "warning",
"zones_intersect": "error"
},
"rules": {
"max_error": 0.005,
"min_clearance": 0.09,
"min_connection": 0.0,
"min_copper_edge_clearance": 0.3,
"min_hole_clearance": 0.254,
"min_hole_to_hole": 0.5,
"min_microvia_diameter": 0.2,
"min_microvia_drill": 0.1,
"min_resolved_spokes": 2,
"min_silk_clearance": 0.05,
"min_text_height": 1.0,
"min_text_thickness": 0.153,
"min_through_hole_diameter": 0.3,
"min_track_width": 0.09,
"min_via_annular_width": 0.15,
"min_via_diameter": 0.5,
"solder_mask_clearance": 0.0,
"solder_mask_min_width": 0.0,
"solder_mask_to_copper_clearance": 0.0,
"use_height_for_length_calcs": true
},
"teardrop_options": [
{
"td_onpadsmd": true,
"td_onroundshapesonly": false,
"td_ontrackend": false,
"td_onviapad": true
}
],
"teardrop_parameters": [
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 5,
"td_height_ratio": 1.0,
"td_length_ratio": 0.75,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_round_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 5,
"td_height_ratio": 1.0,
"td_length_ratio": 0.75,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_rect_shape",
"td_width_to_size_filter_ratio": 0.9
},
{
"td_allow_use_two_tracks": true,
"td_curve_segcount": 5,
"td_height_ratio": 1.0,
"td_length_ratio": 0.75,
"td_maxheight": 2.0,
"td_maxlen": 1.0,
"td_on_pad_in_zone": false,
"td_target_name": "td_track_end",
"td_width_to_size_filter_ratio": 0.9
}
],
"track_widths": [
0.0,
0.1,
0.2,
0.3,
0.5,
0.75,
1.0
],
"tuning_pattern_settings": {
"diff_pair_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 1.0
},
"diff_pair_skew_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 0.6
},
"single_track_defaults": {
"corner_radius_percentage": 80,
"corner_style": 1,
"max_amplitude": 1.0,
"min_amplitude": 0.2,
"single_sided": false,
"spacing": 0.6
}
},
"via_dimensions": [
{
"diameter": 0.0,
"drill": 0.0
}
],
"zones_allow_external_fillets": false
},
"ipc2581": {
"dist": "",
"distpn": "",
"internal_id": "",
"mfg": "",
"mpn": ""
},
"layer_presets": [],
"viewports": []
},
"boards": [],
"cvpcb": {
"equivalence_files": []
},
"erc": {
"erc_exclusions": [],
"meta": {
"version": 0
},
"pin_map": [
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
1,
0,
1,
2
],
[
0,
1,
0,
0,
0,
0,
1,
1,
2,
1,
1,
2
],
[
0,
0,
0,
0,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
2
],
[
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
2
],
[
0,
0,
0,
1,
0,
0,
1,
0,
0,
0,
0,
2
],
[
0,
2,
1,
2,
0,
0,
1,
0,
2,
2,
2,
2
],
[
0,
2,
0,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
0,
2,
1,
1,
0,
0,
1,
0,
2,
0,
0,
2
],
[
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2,
2
]
],
"rule_severities": {
"bus_definition_conflict": "error",
"bus_entry_needed": "error",
"bus_to_bus_conflict": "error",
"bus_to_net_conflict": "error",
"conflicting_netclasses": "error",
"different_unit_footprint": "error",
"different_unit_net": "error",
"duplicate_reference": "error",
"duplicate_sheet_names": "error",
"endpoint_off_grid": "warning",
"extra_units": "error",
"global_label_dangling": "warning",
"hier_label_mismatch": "error",
"label_dangling": "error",
"lib_symbol_issues": "warning",
"missing_bidi_pin": "warning",
"missing_input_pin": "warning",
"missing_power_pin": "error",
"missing_unit": "warning",
"multiple_net_names": "warning",
"net_not_bus_member": "warning",
"no_connect_connected": "error",
"no_connect_dangling": "warning",
"pin_not_connected": "warning",
"pin_not_driven": "error",
"pin_to_pin": "error",
"power_pin_not_driven": "error",
"similar_labels": "warning",
"simulation_model_issue": "ignore",
"unannotated": "error",
"unit_value_mismatch": "error",
"unresolved_variable": "error",
"wire_dangling": "error"
}
},
"libraries": {
"pinned_footprint_libs": [],
"pinned_symbol_libs": []
},
"meta": {
"filename": "avclan-mockingboard.kicad_pro",
"version": 1
},
"net_settings": {
"classes": [
{
"bus_width": 12,
"clearance": 0.2,
"diff_pair_gap": 0.25,
"diff_pair_via_gap": 0.25,
"diff_pair_width": 0.2,
"line_style": 0,
"microvia_diameter": 0.3,
"microvia_drill": 0.1,
"name": "Default",
"pcb_color": "rgba(0, 0, 0, 0.000)",
"schematic_color": "rgba(0, 0, 0, 0.000)",
"track_width": 0.25,
"via_diameter": 0.8,
"via_drill": 0.4,
"wire_width": 6
}
],
"meta": {
"version": 3
},
"net_colors": null,
"netclass_assignments": null,
"netclass_patterns": []
},
"pcbnew": {
"last_paths": {
"gencad": "",
"idf": "",
"netlist": "low-power-ATtiny-board.net",
"plot": "",
"pos_files": "",
"specctra_dsn": "",
"step": "low-power-ATtiny-board-rounded.step",
"svg": "",
"vrml": ""
},
"page_layout_descr_file": ""
},
"schematic": {
"annotate_start_num": 0,
"bom_export_filename": "",
"bom_fmt_presets": [],
"bom_fmt_settings": {
"field_delimiter": ",",
"keep_line_breaks": false,
"keep_tabs": false,
"name": "CSV",
"ref_delimiter": ",",
"ref_range_delimiter": "",
"string_delimiter": "\""
},
"bom_presets": [],
"bom_settings": {
"exclude_dnp": false,
"fields_ordered": [
{
"group_by": false,
"label": "Reference",
"name": "Reference",
"show": true
},
{
"group_by": true,
"label": "Value",
"name": "Value",
"show": true
},
{
"group_by": false,
"label": "Datasheet",
"name": "Datasheet",
"show": true
},
{
"group_by": false,
"label": "Footprint",
"name": "Footprint",
"show": true
},
{
"group_by": false,
"label": "Qty",
"name": "${QUANTITY}",
"show": true
},
{
"group_by": true,
"label": "DNP",
"name": "${DNP}",
"show": true
}
],
"filter_string": "",
"group_symbols": true,
"name": "Grouped By Value",
"sort_asc": true,
"sort_field": "Reference"
},
"connection_grid_size": 50.0,
"drawing": {
"dashed_lines_dash_length_ratio": 12.0,
"dashed_lines_gap_length_ratio": 3.0,
"default_line_thickness": 6.0,
"default_text_size": 44.0,
"field_names": [],
"intersheets_ref_own_page": false,
"intersheets_ref_prefix": "",
"intersheets_ref_short": false,
"intersheets_ref_show": false,
"intersheets_ref_suffix": "",
"junction_size_choice": 3,
"label_size_ratio": 0.375,
"operating_point_overlay_i_precision": 3,
"operating_point_overlay_i_range": "~A",
"operating_point_overlay_v_precision": 3,
"operating_point_overlay_v_range": "~V",
"overbar_offset_ratio": 1.23,
"pin_symbol_size": 25.0,
"text_offset_ratio": 0.15
},
"legacy_lib_dir": "",
"legacy_lib_list": [],
"meta": {
"version": 1
},
"net_format_name": "KiCad",
"ngspice": {
"fix_include_paths": true,
"meta": {
"version": 0
},
"model_mode": 0,
"workbook_filename": ""
},
"page_layout_descr_file": "",
"plot_directory": "./",
"spice_current_sheet_as_root": false,
"spice_external_command": "spice \"%I\"",
"spice_model_current_sheet_as_root": true,
"spice_save_all_currents": false,
"spice_save_all_dissipations": false,
"spice_save_all_voltages": false,
"subpart_first_id": 65,
"subpart_id_separator": 0
},
"sheets": [
[
"85a07af0-16ab-4d5b-a3f1-1b717cf4da63",
""
]
],
"text_variables": {}
}
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -0,0 +1,2 @@
Default True 2.0 3
True True False
+4
View File
@@ -0,0 +1,4 @@
(fp_lib_table
(version 7)
(lib (name "cui_audio")(type "KiCad")(uri "${KIPRJMOD}")(options "")(descr ""))
)
Binary file not shown.
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,54 @@
%TF.GenerationSoftware,KiCad,Pcbnew,7.0.7-7.0.7~ubuntu22.04.1*%
%TF.CreationDate,2023-09-02T15:09:26-04:00*%
%TF.ProjectId,avclan-mockingboard-rounded,6176636c-616e-42d6-9d6f-636b696e6762,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Profile,NP*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 7.0.7-7.0.7~ubuntu22.04.1) date 2023-09-02 15:09:26*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
%TA.AperFunction,Profile*%
%ADD10C,0.100000*%
%TD*%
G04 APERTURE END LIST*
D10*
X0Y-37000000D02*
X0Y-2000000D01*
X53000000Y-2000000D02*
G75*
G03*
X51000000Y0I-2000000J0D01*
G01*
X7000000Y0D02*
X7000000Y-1500000D01*
X2000000Y0D02*
X7000000Y0D01*
X7000000Y-1500000D02*
X12000000Y-1500000D01*
X12000000Y0D02*
X51000000Y0D01*
X2000000Y0D02*
G75*
G03*
X0Y-2000000I0J-2000000D01*
G01*
X12000000Y-1500000D02*
X12000000Y0D01*
X51000000Y-39000000D02*
X2000000Y-39000000D01*
X53000000Y-2000000D02*
X53000000Y-37000000D01*
X0Y-37000000D02*
G75*
G03*
X2000000Y-39000000I2000000J0D01*
G01*
X51000000Y-39000000D02*
G75*
G03*
X53000000Y-37000000I0J2000000D01*
G01*
M02*
@@ -0,0 +1,91 @@
%TF.GenerationSoftware,KiCad,Pcbnew,7.0.7-7.0.7~ubuntu22.04.1*%
%TF.CreationDate,2023-09-02T15:09:26-04:00*%
%TF.ProjectId,avclan-mockingboard-rounded,6176636c-616e-42d6-9d6f-636b696e6762,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Soldermask,Bot*%
%TF.FilePolarity,Negative*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 7.0.7-7.0.7~ubuntu22.04.1) date 2023-09-02 15:09:26*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 Aperture macros list*
%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%
G04 Aperture macros list end*
%ADD10C,2.000000*%
%ADD11R,1.700000X1.700000*%
%ADD12O,1.700000X1.700000*%
%ADD13C,1.100000*%
%ADD14RoundRect,0.102000X-0.825000X0.825000X-0.825000X-0.825000X0.825000X-0.825000X0.825000X0.825000X0*%
%ADD15C,1.854000*%
%ADD16C,4.000000*%
%ADD17R,1.600000X1.600000*%
%ADD18C,1.600000*%
G04 APERTURE END LIST*
D10*
%TO.C,RV1*%
X49175000Y-22400000D03*
X47025000Y-32400000D03*
%TD*%
D11*
%TO.C,J4*%
X17500000Y-36200000D03*
D12*
X14960000Y-36200000D03*
X12420000Y-36200000D03*
X9880000Y-36200000D03*
X7340000Y-36200000D03*
X4800000Y-36200000D03*
%TD*%
D13*
%TO.C,J1*%
X9500000Y-2750000D03*
X9500000Y-7750000D03*
D14*
X14300000Y-2750000D03*
D15*
X5900000Y-7750000D03*
X11100000Y-10850000D03*
X5000000Y-2750000D03*
%TD*%
D16*
%TO.C,J2*%
X44055000Y-9020000D03*
X19055000Y-9020000D03*
D17*
X37095000Y-10440000D03*
D18*
X34325000Y-10440000D03*
X31555000Y-10440000D03*
X28785000Y-10440000D03*
X26015000Y-10440000D03*
X35710000Y-7600000D03*
X32940000Y-7600000D03*
X30170000Y-7600000D03*
X27400000Y-7600000D03*
%TD*%
D11*
%TO.C,J3*%
X9850000Y-31200000D03*
D12*
X7310000Y-31200000D03*
X4770000Y-31200000D03*
%TD*%
M02*
@@ -0,0 +1,323 @@
%TF.GenerationSoftware,KiCad,Pcbnew,7.0.7-7.0.7~ubuntu22.04.1*%
%TF.CreationDate,2023-09-02T15:09:26-04:00*%
%TF.ProjectId,avclan-mockingboard-rounded,6176636c-616e-42d6-9d6f-636b696e6762,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Soldermask,Top*%
%TF.FilePolarity,Negative*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 7.0.7-7.0.7~ubuntu22.04.1) date 2023-09-02 15:09:26*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 Aperture macros list*
%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%
G04 Aperture macros list end*
%ADD10RoundRect,0.200000X0.275000X-0.200000X0.275000X0.200000X-0.275000X0.200000X-0.275000X-0.200000X0*%
%ADD11RoundRect,0.200000X0.200000X0.275000X-0.200000X0.275000X-0.200000X-0.275000X0.200000X-0.275000X0*%
%ADD12RoundRect,0.250000X-0.325000X-0.650000X0.325000X-0.650000X0.325000X0.650000X-0.325000X0.650000X0*%
%ADD13RoundRect,0.218750X-0.218750X-0.256250X0.218750X-0.256250X0.218750X0.256250X-0.218750X0.256250X0*%
%ADD14RoundRect,0.225000X-0.225000X-0.250000X0.225000X-0.250000X0.225000X0.250000X-0.225000X0.250000X0*%
%ADD15RoundRect,0.250000X0.450000X-0.262500X0.450000X0.262500X-0.450000X0.262500X-0.450000X-0.262500X0*%
%ADD16RoundRect,0.250000X-1.000000X-0.900000X1.000000X-0.900000X1.000000X0.900000X-1.000000X0.900000X0*%
%ADD17RoundRect,0.250000X-1.000000X-0.650000X1.000000X-0.650000X1.000000X0.650000X-1.000000X0.650000X0*%
%ADD18C,2.000000*%
%ADD19RoundRect,0.150000X-0.512500X-0.150000X0.512500X-0.150000X0.512500X0.150000X-0.512500X0.150000X0*%
%ADD20RoundRect,0.140000X-0.170000X0.140000X-0.170000X-0.140000X0.170000X-0.140000X0.170000X0.140000X0*%
%ADD21RoundRect,0.200000X-0.200000X-0.275000X0.200000X-0.275000X0.200000X0.275000X-0.200000X0.275000X0*%
%ADD22RoundRect,0.250000X-0.850000X-0.350000X0.850000X-0.350000X0.850000X0.350000X-0.850000X0.350000X0*%
%ADD23RoundRect,0.249997X-2.950003X-2.650003X2.950003X-2.650003X2.950003X2.650003X-2.950003X2.650003X0*%
%ADD24RoundRect,0.250000X0.325000X0.650000X-0.325000X0.650000X-0.325000X-0.650000X0.325000X-0.650000X0*%
%ADD25RoundRect,0.250000X0.400000X0.600000X-0.400000X0.600000X-0.400000X-0.600000X0.400000X-0.600000X0*%
%ADD26RoundRect,0.250000X-0.262500X-0.450000X0.262500X-0.450000X0.262500X0.450000X-0.262500X0.450000X0*%
%ADD27RoundRect,0.140000X-0.140000X-0.170000X0.140000X-0.170000X0.140000X0.170000X-0.140000X0.170000X0*%
%ADD28R,1.700000X1.700000*%
%ADD29O,1.700000X1.700000*%
%ADD30RoundRect,0.150000X0.875000X0.150000X-0.875000X0.150000X-0.875000X-0.150000X0.875000X-0.150000X0*%
%ADD31C,1.100000*%
%ADD32RoundRect,0.102000X-0.825000X0.825000X-0.825000X-0.825000X0.825000X-0.825000X0.825000X0.825000X0*%
%ADD33C,1.854000*%
%ADD34C,4.000000*%
%ADD35R,1.600000X1.600000*%
%ADD36C,1.600000*%
%ADD37RoundRect,0.250000X0.650000X-0.325000X0.650000X0.325000X-0.650000X0.325000X-0.650000X-0.325000X0*%
%ADD38RoundRect,0.250000X-0.650000X0.325000X-0.650000X-0.325000X0.650000X-0.325000X0.650000X0.325000X0*%
%ADD39RoundRect,0.250000X-0.650000X1.000000X-0.650000X-1.000000X0.650000X-1.000000X0.650000X1.000000X0*%
G04 APERTURE END LIST*
D10*
%TO.C,R9*%
X26550000Y-15425000D03*
X26550000Y-13775000D03*
%TD*%
D11*
%TO.C,R6*%
X14850000Y-11950331D03*
X13200000Y-11950331D03*
%TD*%
D12*
%TO.C,C3*%
X41450000Y-28100000D03*
X44400000Y-28100000D03*
%TD*%
D13*
%TO.C,D9*%
X16384118Y-18700000D03*
X17959118Y-18700000D03*
%TD*%
D14*
%TO.C,C5*%
X35900000Y-28700000D03*
X37450000Y-28700000D03*
%TD*%
D15*
%TO.C,R2*%
X32512500Y-17400000D03*
X32512500Y-15575000D03*
%TD*%
D16*
%TO.C,D4*%
X39400000Y-22300000D03*
X43700000Y-22300000D03*
%TD*%
D17*
%TO.C,D2*%
X39700000Y-18200000D03*
X43700000Y-18200000D03*
%TD*%
D18*
%TO.C,RV1*%
X49175000Y-22400000D03*
X47025000Y-32400000D03*
%TD*%
D19*
%TO.C,D6*%
X25662500Y-29050000D03*
X25662500Y-30950000D03*
X27937500Y-30000000D03*
%TD*%
D20*
%TO.C,C10*%
X18662500Y-15050000D03*
X18662500Y-16010000D03*
%TD*%
D21*
%TO.C,R7*%
X23500000Y-15325000D03*
X25150000Y-15325000D03*
%TD*%
D22*
%TO.C,U1*%
X35500000Y-30745000D03*
X35500000Y-33025000D03*
D23*
X41800000Y-33025000D03*
D22*
X35500000Y-35305000D03*
%TD*%
D24*
%TO.C,C1*%
X42875000Y-14100000D03*
X39925000Y-14100000D03*
%TD*%
%TO.C,C11*%
X10100000Y-13800000D03*
X7150000Y-13800000D03*
%TD*%
D25*
%TO.C,D10*%
X26550000Y-17250000D03*
X23050000Y-17250000D03*
%TD*%
D21*
%TO.C,R12*%
X7175000Y-11900000D03*
X8825000Y-11900000D03*
%TD*%
D11*
%TO.C,R11*%
X6450000Y-28600000D03*
X4800000Y-28600000D03*
%TD*%
D26*
%TO.C,R3*%
X32587500Y-13775000D03*
X34412500Y-13775000D03*
%TD*%
D27*
%TO.C,C9*%
X22968236Y-33385000D03*
X23928236Y-33385000D03*
%TD*%
D28*
%TO.C,J4*%
X17500000Y-36200000D03*
D29*
X14960000Y-36200000D03*
X12420000Y-36200000D03*
X9880000Y-36200000D03*
X7340000Y-36200000D03*
X4800000Y-36200000D03*
%TD*%
D19*
%TO.C,D8*%
X28600000Y-34700000D03*
X28600000Y-36600000D03*
X30875000Y-35650000D03*
%TD*%
D30*
%TO.C,U2*%
X23278236Y-31950000D03*
X23278236Y-30680000D03*
X23278236Y-29410000D03*
X23278236Y-28140000D03*
X23278236Y-26870000D03*
X23278236Y-25600000D03*
X23278236Y-24330000D03*
X23278236Y-23060000D03*
X23278236Y-21790000D03*
X23278236Y-20520000D03*
X13978236Y-20520000D03*
X13978236Y-21790000D03*
X13978236Y-23060000D03*
X13978236Y-24330000D03*
X13978236Y-25600000D03*
X13978236Y-26870000D03*
X13978236Y-28140000D03*
X13978236Y-29410000D03*
X13978236Y-30680000D03*
X13978236Y-31950000D03*
%TD*%
D11*
%TO.C,R13*%
X4050000Y-4600000D03*
X2400000Y-4600000D03*
%TD*%
D17*
%TO.C,D1*%
X45400000Y-14600000D03*
X49400000Y-14600000D03*
%TD*%
D31*
%TO.C,J1*%
X9500000Y-2750000D03*
X9500000Y-7750000D03*
D32*
X14300000Y-2750000D03*
D33*
X5900000Y-7750000D03*
X11100000Y-10850000D03*
X5000000Y-2750000D03*
%TD*%
D12*
%TO.C,C2*%
X41450000Y-25800000D03*
X44400000Y-25800000D03*
%TD*%
D19*
%TO.C,D7*%
X25600000Y-24100000D03*
X25600000Y-26000000D03*
X27875000Y-25050000D03*
%TD*%
D34*
%TO.C,J2*%
X44055000Y-9020000D03*
X19055000Y-9020000D03*
D35*
X37095000Y-10440000D03*
D36*
X34325000Y-10440000D03*
X31555000Y-10440000D03*
X28785000Y-10440000D03*
X26015000Y-10440000D03*
X35710000Y-7600000D03*
X32940000Y-7600000D03*
X30170000Y-7600000D03*
X27400000Y-7600000D03*
%TD*%
D37*
%TO.C,C7*%
X33000000Y-32200000D03*
X33000000Y-29250000D03*
%TD*%
D14*
%TO.C,C6*%
X35350000Y-37300000D03*
X36900000Y-37300000D03*
%TD*%
D10*
%TO.C,R4*%
X36212500Y-17300000D03*
X36212500Y-15650000D03*
%TD*%
D19*
%TO.C,U3*%
X14925000Y-15100000D03*
X14925000Y-16050000D03*
X14925000Y-17000000D03*
X17200000Y-17000000D03*
X17200000Y-15100000D03*
%TD*%
D28*
%TO.C,J3*%
X9850000Y-31200000D03*
D29*
X7310000Y-31200000D03*
X4770000Y-31200000D03*
%TD*%
D11*
%TO.C,R10*%
X14984118Y-18700000D03*
X13334118Y-18700000D03*
%TD*%
%TO.C,R5*%
X14850000Y-13440331D03*
X13200000Y-13440331D03*
%TD*%
D38*
%TO.C,C8*%
X33000000Y-33900000D03*
X33000000Y-36850000D03*
%TD*%
D39*
%TO.C,D3*%
X49395000Y-6609669D03*
X49395000Y-10609669D03*
%TD*%
D37*
%TO.C,C12*%
X3200000Y-9150000D03*
X3200000Y-6200000D03*
%TD*%
D15*
%TO.C,R1*%
X34412500Y-17400000D03*
X34412500Y-15575000D03*
%TD*%
D37*
%TO.C,C4*%
X39400000Y-28400000D03*
X39400000Y-25450000D03*
%TD*%
D21*
%TO.C,R8*%
X23500000Y-13825000D03*
X25150000Y-13825000D03*
%TD*%
M02*
@@ -0,0 +1,18 @@
M48
; DRILL file {KiCad 7.0.7-7.0.7~ubuntu22.04.1} date Sat 02 Sep 2023 03:09:26 PM EDT
; FORMAT={-:-/ absolute / inch / decimal}
; #@! TF.CreationDate,2023-09-02T15:09:26-04:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,7.0.7-7.0.7~ubuntu22.04.1
; #@! TF.FileFunction,NonPlated,1,4,NPTH
FMAT,2
INCH
; #@! TA.AperFunction,NonPlated,NPTH,ComponentDrill
T1C0.0433
%
G90
G05
T1
X0.374Y-0.1083
X0.374Y-0.3051
T0
M30
@@ -0,0 +1,110 @@
M48
; DRILL file {KiCad 7.0.7-7.0.7~ubuntu22.04.1} date Sat 02 Sep 2023 03:09:26 PM EDT
; FORMAT={-:-/ absolute / inch / decimal}
; #@! TF.CreationDate,2023-09-02T15:09:26-04:00
; #@! TF.GenerationSoftware,Kicad,Pcbnew,7.0.7-7.0.7~ubuntu22.04.1
; #@! TF.FileFunction,Plated,1,4,PTH
FMAT,2
INCH
; #@! TA.AperFunction,Plated,PTH,ViaDrill
T1C0.0157
; #@! TA.AperFunction,Plated,PTH,ComponentDrill
T2C0.0394
; #@! TA.AperFunction,Plated,PTH,ComponentDrill
T3C0.0433
; #@! TA.AperFunction,Plated,PTH,ComponentDrill
T4C0.1260
%
G90
G05
T1
X0.0591Y-0.0591
X0.0591Y-0.3543
X0.0591Y-0.6496
X0.2362Y-0.0394
X0.2441Y-0.4055
X0.4035Y-0.2402
X0.4843Y-1.2598
X0.4882Y-0.5
X0.5118Y-0.0394
X0.5197Y-1.2953
X0.5315Y-0.6417
X0.5492Y-0.3878
X0.563Y-0.3465
X0.6102Y-0.2382
X0.7087Y-0.4921
X0.7677Y-0.5925
X0.7692Y-0.6358
X0.7874Y-0.0394
X0.9646Y-0.2874
X0.9843Y-1.3031
X1.0236Y-0.4921
X1.0551Y-1.2579
X1.0748Y-1.3681
X1.1811Y-0.0394
X1.2047Y-1.2362
X1.2126Y-1.4764
X1.2205Y-1.0709
X1.2992Y-1.1024
X1.4567Y-0.0394
X1.4665Y-0.8071
X1.4764Y-0.3346
X1.4833Y-1.3012
X1.4862Y-1.0039
X1.4951Y-1.2382
X1.4951Y-1.3602
X1.5059Y-1.4764
X1.5236Y-0.6024
X1.5778Y-1.1732
X1.5787Y-1.437
X1.6447Y-1.1732
X1.6457Y-1.437
X1.7116Y-1.1634
X1.7126Y-1.437
X1.752Y-0.0394
X1.7904Y-1.2382
X1.7904Y-1.3031
X1.7904Y-1.3602
X1.7913Y-1.4764
X1.8012Y-1.0138
X1.8012Y-1.1122
X1.8504Y-0.4823
X1.8819Y-0.2598
X1.9449Y-0.189
X2.0079Y-0.2598
X2.0276Y-0.0591
X2.0276Y-0.4134
X2.0276Y-0.7677
X2.0276Y-1.122
X2.0276Y-1.4764
T2
X0.1878Y-1.2283
X0.189Y-1.4252
X0.2878Y-1.2283
X0.289Y-1.4252
X0.3878Y-1.2283
X0.389Y-1.4252
X0.489Y-1.4252
X0.589Y-1.4252
X0.689Y-1.4252
X1.0242Y-0.411
X1.0787Y-0.2992
X1.1333Y-0.411
X1.1878Y-0.2992
X1.2423Y-0.411
X1.2969Y-0.2992
X1.3514Y-0.411
X1.4059Y-0.2992
X1.4604Y-0.411
X1.8514Y-1.2756
X1.936Y-0.8819
T3
X0.1969Y-0.1083
X0.2323Y-0.3051
X0.437Y-0.4272
X0.563Y-0.1083
T4
X0.7502Y-0.3551
X1.7344Y-0.3551
T0
M30
@@ -0,0 +1,15 @@
%TF.GenerationSoftware,KiCad,Pcbnew,7.0.7-7.0.7~ubuntu22.04.1*%
%TF.CreationDate,2023-09-02T15:09:26-04:00*%
%TF.ProjectId,avclan-mockingboard-rounded,6176636c-616e-42d6-9d6f-636b696e6762,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Paste,Bot*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 7.0.7-7.0.7~ubuntu22.04.1) date 2023-09-02 15:09:26*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*
@@ -0,0 +1,268 @@
%TF.GenerationSoftware,KiCad,Pcbnew,7.0.7-7.0.7~ubuntu22.04.1*%
%TF.CreationDate,2023-09-02T15:09:26-04:00*%
%TF.ProjectId,avclan-mockingboard-rounded,6176636c-616e-42d6-9d6f-636b696e6762,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Paste,Top*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 7.0.7-7.0.7~ubuntu22.04.1) date 2023-09-02 15:09:26*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 Aperture macros list*
%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%
G04 Aperture macros list end*
%ADD10RoundRect,0.200000X0.275000X-0.200000X0.275000X0.200000X-0.275000X0.200000X-0.275000X-0.200000X0*%
%ADD11RoundRect,0.200000X0.200000X0.275000X-0.200000X0.275000X-0.200000X-0.275000X0.200000X-0.275000X0*%
%ADD12RoundRect,0.250000X-0.325000X-0.650000X0.325000X-0.650000X0.325000X0.650000X-0.325000X0.650000X0*%
%ADD13RoundRect,0.218750X-0.218750X-0.256250X0.218750X-0.256250X0.218750X0.256250X-0.218750X0.256250X0*%
%ADD14RoundRect,0.225000X-0.225000X-0.250000X0.225000X-0.250000X0.225000X0.250000X-0.225000X0.250000X0*%
%ADD15RoundRect,0.250000X0.450000X-0.262500X0.450000X0.262500X-0.450000X0.262500X-0.450000X-0.262500X0*%
%ADD16RoundRect,0.250000X-1.000000X-0.900000X1.000000X-0.900000X1.000000X0.900000X-1.000000X0.900000X0*%
%ADD17RoundRect,0.250000X-1.000000X-0.650000X1.000000X-0.650000X1.000000X0.650000X-1.000000X0.650000X0*%
%ADD18RoundRect,0.150000X-0.512500X-0.150000X0.512500X-0.150000X0.512500X0.150000X-0.512500X0.150000X0*%
%ADD19RoundRect,0.140000X-0.170000X0.140000X-0.170000X-0.140000X0.170000X-0.140000X0.170000X0.140000X0*%
%ADD20RoundRect,0.200000X-0.200000X-0.275000X0.200000X-0.275000X0.200000X0.275000X-0.200000X0.275000X0*%
%ADD21RoundRect,0.250000X-0.850000X-0.350000X0.850000X-0.350000X0.850000X0.350000X-0.850000X0.350000X0*%
%ADD22RoundRect,0.250000X-1.275000X-1.125000X1.275000X-1.125000X1.275000X1.125000X-1.275000X1.125000X0*%
%ADD23RoundRect,0.250000X0.325000X0.650000X-0.325000X0.650000X-0.325000X-0.650000X0.325000X-0.650000X0*%
%ADD24RoundRect,0.250000X0.400000X0.600000X-0.400000X0.600000X-0.400000X-0.600000X0.400000X-0.600000X0*%
%ADD25RoundRect,0.250000X-0.262500X-0.450000X0.262500X-0.450000X0.262500X0.450000X-0.262500X0.450000X0*%
%ADD26RoundRect,0.140000X-0.140000X-0.170000X0.140000X-0.170000X0.140000X0.170000X-0.140000X0.170000X0*%
%ADD27RoundRect,0.150000X0.875000X0.150000X-0.875000X0.150000X-0.875000X-0.150000X0.875000X-0.150000X0*%
%ADD28RoundRect,0.250000X0.650000X-0.325000X0.650000X0.325000X-0.650000X0.325000X-0.650000X-0.325000X0*%
%ADD29RoundRect,0.250000X-0.650000X0.325000X-0.650000X-0.325000X0.650000X-0.325000X0.650000X0.325000X0*%
%ADD30RoundRect,0.250000X-0.650000X1.000000X-0.650000X-1.000000X0.650000X-1.000000X0.650000X1.000000X0*%
G04 APERTURE END LIST*
D10*
%TO.C,R9*%
X26550000Y-15425000D03*
X26550000Y-13775000D03*
%TD*%
D11*
%TO.C,R6*%
X14850000Y-11950331D03*
X13200000Y-11950331D03*
%TD*%
D12*
%TO.C,C3*%
X41450000Y-28100000D03*
X44400000Y-28100000D03*
%TD*%
D13*
%TO.C,D9*%
X16384118Y-18700000D03*
X17959118Y-18700000D03*
%TD*%
D14*
%TO.C,C5*%
X35900000Y-28700000D03*
X37450000Y-28700000D03*
%TD*%
D15*
%TO.C,R2*%
X32512500Y-17400000D03*
X32512500Y-15575000D03*
%TD*%
D16*
%TO.C,D4*%
X39400000Y-22300000D03*
X43700000Y-22300000D03*
%TD*%
D17*
%TO.C,D2*%
X39700000Y-18200000D03*
X43700000Y-18200000D03*
%TD*%
D18*
%TO.C,D6*%
X25662500Y-29050000D03*
X25662500Y-30950000D03*
X27937500Y-30000000D03*
%TD*%
D19*
%TO.C,C10*%
X18662500Y-15050000D03*
X18662500Y-16010000D03*
%TD*%
D20*
%TO.C,R7*%
X23500000Y-15325000D03*
X25150000Y-15325000D03*
%TD*%
D21*
%TO.C,U1*%
X35500000Y-30745000D03*
X35500000Y-33025000D03*
D22*
X40125000Y-31500000D03*
X40125000Y-34550000D03*
X43475000Y-31500000D03*
X43475000Y-34550000D03*
D21*
X35500000Y-35305000D03*
%TD*%
D23*
%TO.C,C1*%
X42875000Y-14100000D03*
X39925000Y-14100000D03*
%TD*%
%TO.C,C11*%
X10100000Y-13800000D03*
X7150000Y-13800000D03*
%TD*%
D24*
%TO.C,D10*%
X26550000Y-17250000D03*
X23050000Y-17250000D03*
%TD*%
D20*
%TO.C,R12*%
X7175000Y-11900000D03*
X8825000Y-11900000D03*
%TD*%
D11*
%TO.C,R11*%
X6450000Y-28600000D03*
X4800000Y-28600000D03*
%TD*%
D25*
%TO.C,R3*%
X32587500Y-13775000D03*
X34412500Y-13775000D03*
%TD*%
D26*
%TO.C,C9*%
X22968236Y-33385000D03*
X23928236Y-33385000D03*
%TD*%
D18*
%TO.C,D8*%
X28600000Y-34700000D03*
X28600000Y-36600000D03*
X30875000Y-35650000D03*
%TD*%
D27*
%TO.C,U2*%
X23278236Y-31950000D03*
X23278236Y-30680000D03*
X23278236Y-29410000D03*
X23278236Y-28140000D03*
X23278236Y-26870000D03*
X23278236Y-25600000D03*
X23278236Y-24330000D03*
X23278236Y-23060000D03*
X23278236Y-21790000D03*
X23278236Y-20520000D03*
X13978236Y-20520000D03*
X13978236Y-21790000D03*
X13978236Y-23060000D03*
X13978236Y-24330000D03*
X13978236Y-25600000D03*
X13978236Y-26870000D03*
X13978236Y-28140000D03*
X13978236Y-29410000D03*
X13978236Y-30680000D03*
X13978236Y-31950000D03*
%TD*%
D11*
%TO.C,R13*%
X4050000Y-4600000D03*
X2400000Y-4600000D03*
%TD*%
D17*
%TO.C,D1*%
X45400000Y-14600000D03*
X49400000Y-14600000D03*
%TD*%
D12*
%TO.C,C2*%
X41450000Y-25800000D03*
X44400000Y-25800000D03*
%TD*%
D18*
%TO.C,D7*%
X25600000Y-24100000D03*
X25600000Y-26000000D03*
X27875000Y-25050000D03*
%TD*%
D28*
%TO.C,C7*%
X33000000Y-32200000D03*
X33000000Y-29250000D03*
%TD*%
D14*
%TO.C,C6*%
X35350000Y-37300000D03*
X36900000Y-37300000D03*
%TD*%
D10*
%TO.C,R4*%
X36212500Y-17300000D03*
X36212500Y-15650000D03*
%TD*%
D18*
%TO.C,U3*%
X14925000Y-15100000D03*
X14925000Y-16050000D03*
X14925000Y-17000000D03*
X17200000Y-17000000D03*
X17200000Y-15100000D03*
%TD*%
D11*
%TO.C,R10*%
X14984118Y-18700000D03*
X13334118Y-18700000D03*
%TD*%
%TO.C,R5*%
X14850000Y-13440331D03*
X13200000Y-13440331D03*
%TD*%
D29*
%TO.C,C8*%
X33000000Y-33900000D03*
X33000000Y-36850000D03*
%TD*%
D30*
%TO.C,D3*%
X49395000Y-6609669D03*
X49395000Y-10609669D03*
%TD*%
D28*
%TO.C,C12*%
X3200000Y-9150000D03*
X3200000Y-6200000D03*
%TD*%
D15*
%TO.C,R1*%
X34412500Y-17400000D03*
X34412500Y-15575000D03*
%TD*%
D28*
%TO.C,C4*%
X39400000Y-28400000D03*
X39400000Y-25450000D03*
%TD*%
D20*
%TO.C,R8*%
X23500000Y-13825000D03*
X25150000Y-13825000D03*
%TD*%
M02*
@@ -0,0 +1,93 @@
%TF.GenerationSoftware,KiCad,Pcbnew,7.0.7-7.0.7~ubuntu22.04.1*%
%TF.CreationDate,2023-09-02T15:09:26-04:00*%
%TF.ProjectId,avclan-mockingboard-rounded,6176636c-616e-42d6-9d6f-636b696e6762,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Legend,Bot*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 7.0.7-7.0.7~ubuntu22.04.1) date 2023-09-02 15:09:26*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 Aperture macros list*
%AMRoundRect*
0 Rectangle with rounded corners*
0 $1 Rounding radius*
0 $2 $3 $4 $5 $6 $7 $8 $9 X,Y pos of 4 corners*
0 Add a 4 corners polygon primitive as box body*
4,1,4,$2,$3,$4,$5,$6,$7,$8,$9,$2,$3,0*
0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3*
1,1,$1+$1,$4,$5*
1,1,$1+$1,$6,$7*
1,1,$1+$1,$8,$9*
0 Add four rect primitives between the rounded corners*
20,1,$1+$1,$2,$3,$4,$5,0*
20,1,$1+$1,$4,$5,$6,$7,0*
20,1,$1+$1,$6,$7,$8,$9,0*
20,1,$1+$1,$8,$9,$2,$3,0*%
G04 Aperture macros list end*
%ADD10C,2.000000*%
%ADD11R,1.700000X1.700000*%
%ADD12O,1.700000X1.700000*%
%ADD13C,1.100000*%
%ADD14RoundRect,0.102000X-0.825000X0.825000X-0.825000X-0.825000X0.825000X-0.825000X0.825000X0.825000X0*%
%ADD15C,1.854000*%
%ADD16C,4.000000*%
%ADD17R,1.600000X1.600000*%
%ADD18C,1.600000*%
G04 APERTURE END LIST*
%LPC*%
D10*
%TO.C,RV1*%
X49175000Y-22400000D03*
X47025000Y-32400000D03*
%TD*%
D11*
%TO.C,J4*%
X17500000Y-36200000D03*
D12*
X14960000Y-36200000D03*
X12420000Y-36200000D03*
X9880000Y-36200000D03*
X7340000Y-36200000D03*
X4800000Y-36200000D03*
%TD*%
D13*
%TO.C,J1*%
X9500000Y-2750000D03*
X9500000Y-7750000D03*
D14*
X14300000Y-2750000D03*
D15*
X5900000Y-7750000D03*
X11100000Y-10850000D03*
X5000000Y-2750000D03*
%TD*%
D16*
%TO.C,J2*%
X44055000Y-9020000D03*
X19055000Y-9020000D03*
D17*
X37095000Y-10440000D03*
D18*
X34325000Y-10440000D03*
X31555000Y-10440000D03*
X28785000Y-10440000D03*
X26015000Y-10440000D03*
X35710000Y-7600000D03*
X32940000Y-7600000D03*
X30170000Y-7600000D03*
X27400000Y-7600000D03*
%TD*%
D11*
%TO.C,J3*%
X9850000Y-31200000D03*
D12*
X7310000Y-31200000D03*
X4770000Y-31200000D03*
%TD*%
%LPD*%
M02*
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,14 @@
%TF.GenerationSoftware,KiCad,Pcbnew,7.0.7-7.0.7~ubuntu22.04.1*%
%TF.CreationDate,2023-09-02T15:09:26-04:00*%
%TF.ProjectId,avclan-mockingboard-rounded,6176636c-616e-42d6-9d6f-636b696e6762,rev?*%
%TF.SameCoordinates,Original*%
%TF.FileFunction,Other,Comment*%
%FSLAX46Y46*%
G04 Gerber Fmt 4.6, Leading zero omitted, Abs format (unit mm)*
G04 Created by KiCad (PCBNEW 7.0.7-7.0.7~ubuntu22.04.1) date 2023-09-02 15:09:26*
%MOMM*%
%LPD*%
G01*
G04 APERTURE LIST*
G04 APERTURE END LIST*
M02*
@@ -0,0 +1,19 @@
Comment,Designator,Footprint,LCSC
SM6T15A,D4,D_SMB,C118275
"BAT54A,215",D7,SOT-23-3,C130910
10u 50V,"C2,C3,C4",C_1206_3216Metric,C13585
SS210,"D1,D2",D_SMA,C14996
1u 50V,"C5,C6",C_0603_1608Metric,C15849
10k,"R4,R5,R6,R7,R8,R9",R_0603_1608Metric,C17414
120,R3,R_0805_2012Metric,C17437
15,"R12,R13",R_0603_1608Metric,C22810
KT-0603R,D9,LED_0603_1608Metric,C2286
470,"R10,R11",R_0603_1608Metric,C23179
4u7,"C10,C9",C_0402_1005Metric,C23733
180,"R1,R2",R_0805_2012Metric,C25270
1SMAF4742A,D3,D_SMA,C3013762
"BAT54C,215","D6,D8",SOT-23-3,C37704
74LVC1G66,U3,SOT-23-5,C5375974
3V3,D10,D_MiniMELF,C8056
1n 100V,C1,C_1206_3216Metric,C9196
47u 10V,"C11,C12,C7,C8",C_1206_3216Metric,C96123
1 Comment Designator Footprint LCSC
2 SM6T15A D4 D_SMB C118275
3 BAT54A,215 D7 SOT-23-3 C130910
4 10u 50V C2,C3,C4 C_1206_3216Metric C13585
5 SS210 D1,D2 D_SMA C14996
6 1u 50V C5,C6 C_0603_1608Metric C15849
7 10k R4,R5,R6,R7,R8,R9 R_0603_1608Metric C17414
8 120 R3 R_0805_2012Metric C17437
9 15 R12,R13 R_0603_1608Metric C22810
10 KT-0603R D9 LED_0603_1608Metric C2286
11 470 R10,R11 R_0603_1608Metric C23179
12 4u7 C10,C9 C_0402_1005Metric C23733
13 180 R1,R2 R_0805_2012Metric C25270
14 1SMAF4742A D3 D_SMA C3013762
15 BAT54C,215 D6,D8 SOT-23-3 C37704
16 74LVC1G66 U3 SOT-23-5 C5375974
17 3V3 D10 D_MiniMELF C8056
18 1n 100V C1 C_1206_3216Metric C9196
19 47u 10V C11,C12,C7,C8 C_1206_3216Metric C96123
@@ -0,0 +1,36 @@
Designator,Val,Package,Mid X,Mid Y,Rotation,Layer
C1,1n 100V,C_1206_3216Metric,41.4,-14.1,180,top
C2,10u 50V,C_1206_3216Metric,42.925,-25.8,0,top
C3,10u 50V,C_1206_3216Metric,42.925,-28.1,0,top
C4,10u 50V,C_1206_3216Metric,39.4,-26.925,90,top
C5,1u 50V,C_0603_1608Metric,36.675,-28.7,0,top
C6,1u 50V,C_0603_1608Metric,36.125,-37.3,0,top
C7,47u 10V,C_1206_3216Metric,33,-30.725,90,top
C8,47u 10V,C_1206_3216Metric,33,-35.375,-90,top
C9,4u7,C_0402_1005Metric,23.448236,-33.385,0,top
C10,4u7,C_0402_1005Metric,18.6625,-15.53,-90,top
C11,47u 10V,C_1206_3216Metric,8.625,-13.8,180,top
C12,47u 10V,C_1206_3216Metric,3.2,-7.675,90,top
D1,SS210,D_SMA,47.4,-14.6,0,top
D2,SS210,D_SMA,41.7,-18.2,0,top
D3,1SMAF4742A,D_SMA,49.395,-8.609669,-90,top
D4,SM6T15A,D_SMB,41.55,-22.3,0,top
D6,"BAT54C,215",SOT-23-3,26.8,-30,180,top
D7,"BAT54A,215",SOT-23-3,26.7375,-25.05,180,top
D8,"BAT54C,215",SOT-23-3,29.7375,-35.65,180,top
D9,KT-0603R,LED_0603_1608Metric,17.171618,-18.7,0,top
D10,3V3,D_MiniMELF,24.8,-17.25,180,top
R1,180,R_0805_2012Metric,34.4125,-16.4875,90,top
R2,180,R_0805_2012Metric,32.5125,-16.4875,90,top
R3,120,R_0805_2012Metric,33.5,-13.775,0,top
R4,10k,R_0603_1608Metric,36.2125,-16.475,90,top
R5,10k,R_0603_1608Metric,14.025,-13.440331,180,top
R6,10k,R_0603_1608Metric,14.025,-11.950331,180,top
R7,10k,R_0603_1608Metric,24.325,-15.325,0,top
R8,10k,R_0603_1608Metric,24.325,-13.825,0,top
R9,10k,R_0603_1608Metric,26.55,-14.6,90,top
R10,470,R_0603_1608Metric,14.159118,-18.7,180,top
R11,470,R_0603_1608Metric,5.625,-28.6,180,top
R12,15,R_0603_1608Metric,8,-11.9,0,top
R13,15,R_0603_1608Metric,3.225,-4.6,180,top
U3,74LVC1G66,SOT-23-5,16.0625,-16.05,180,top
1 Designator Val Package Mid X Mid Y Rotation Layer
2 C1 1n 100V C_1206_3216Metric 41.4 -14.1 180 top
3 C2 10u 50V C_1206_3216Metric 42.925 -25.8 0 top
4 C3 10u 50V C_1206_3216Metric 42.925 -28.1 0 top
5 C4 10u 50V C_1206_3216Metric 39.4 -26.925 90 top
6 C5 1u 50V C_0603_1608Metric 36.675 -28.7 0 top
7 C6 1u 50V C_0603_1608Metric 36.125 -37.3 0 top
8 C7 47u 10V C_1206_3216Metric 33 -30.725 90 top
9 C8 47u 10V C_1206_3216Metric 33 -35.375 -90 top
10 C9 4u7 C_0402_1005Metric 23.448236 -33.385 0 top
11 C10 4u7 C_0402_1005Metric 18.6625 -15.53 -90 top
12 C11 47u 10V C_1206_3216Metric 8.625 -13.8 180 top
13 C12 47u 10V C_1206_3216Metric 3.2 -7.675 90 top
14 D1 SS210 D_SMA 47.4 -14.6 0 top
15 D2 SS210 D_SMA 41.7 -18.2 0 top
16 D3 1SMAF4742A D_SMA 49.395 -8.609669 -90 top
17 D4 SM6T15A D_SMB 41.55 -22.3 0 top
18 D6 BAT54C,215 SOT-23-3 26.8 -30 180 top
19 D7 BAT54A,215 SOT-23-3 26.7375 -25.05 180 top
20 D8 BAT54C,215 SOT-23-3 29.7375 -35.65 180 top
21 D9 KT-0603R LED_0603_1608Metric 17.171618 -18.7 0 top
22 D10 3V3 D_MiniMELF 24.8 -17.25 180 top
23 R1 180 R_0805_2012Metric 34.4125 -16.4875 90 top
24 R2 180 R_0805_2012Metric 32.5125 -16.4875 90 top
25 R3 120 R_0805_2012Metric 33.5 -13.775 0 top
26 R4 10k R_0603_1608Metric 36.2125 -16.475 90 top
27 R5 10k R_0603_1608Metric 14.025 -13.440331 180 top
28 R6 10k R_0603_1608Metric 14.025 -11.950331 180 top
29 R7 10k R_0603_1608Metric 24.325 -15.325 0 top
30 R8 10k R_0603_1608Metric 24.325 -13.825 0 top
31 R9 10k R_0603_1608Metric 26.55 -14.6 90 top
32 R10 470 R_0603_1608Metric 14.159118 -18.7 180 top
33 R11 470 R_0603_1608Metric 5.625 -28.6 180 top
34 R12 15 R_0603_1608Metric 8 -11.9 0 top
35 R13 15 R_0603_1608Metric 3.225 -4.6 180 top
36 U3 74LVC1G66 SOT-23-5 16.0625 -16.05 180 top
Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

+5
View File
@@ -0,0 +1,5 @@
(sym_lib_table
(version 7)
(lib (name "local")(type "KiCad")(uri "${KIPRJMOD}/local.kicad_sym")(options "")(descr ""))
(lib (name "audio")(type "Legacy")(uri "${KIPRJMOD}/SJ-43514.lib")(options "")(descr ""))
)
Binary file not shown.
+6
View File
@@ -0,0 +1,6 @@
if [[ -c /dev/ttyUSB0 ]]; then
sudo chown root:$(id -gn $(whoami)) /dev/ttyUSB0
fi
if [[ -c /dev/ttyUSB1 ]]; then
sudo chown root:$(id -gn $(whoami)) /dev/ttyUSB1
fi
+2
View File
@@ -0,0 +1,2 @@
sudo apk add make cmake avrdude avr-libc gcc-avr tshark
+36
View File
@@ -0,0 +1,36 @@
# Packet analysis with Wireshark
- Install the Lua IEBUS/AVCLAN packet dissector to the Wireshark Lua Plugins folder
- Look in Help > About Wireshark dialog, Folders tab, "Personal Lua Plugins". It was `~/.local/lib/wireshark/plugins` for me, but it didn't exist until I manually created it.
- Copy or link `avclan_plugin.lua` to the Wireshark Lua Pluginds folder
- Linking is more convenient if modifying/developing the dissector
`ln -s $(pwd)/avclan_plugin.lua ~/.local/lib/wireshark/plugins/avclan_plugin.lua`
- The bridge script ([extcap/avclan-pcap.py](extcap/avclan-pcap.py)) needs Python 3 and, for live capture only, [pyserial](https://pypi.org/project/pyserial/). Install pyserial so the `python3` that Wireshark runs can import it (e.g. `pip install pyserial`, or your distro's `python3-serial`). The `--convert` mode and the Wireshark interface listing work without it. (Alternatively, run the script via [uv](https://docs.astral.sh/uv/) — `uv run --script extcap/avclan-pcap.py …` — which resolves the inline PEP 723 dependency automatically; but the GUI extcap uses plain `python3`, so the install above is what makes capture work there.)
## Live capture (Wireshark GUI)
The easiest way to stream packets is as an [extcap](https://www.wireshark.org/docs/man-pages/extcap.html) interface, which appears right in Wireshark's capture list:
- Make the script executable and link it into Wireshark's **Personal Extcap path** (Help > About Wireshark, Folders tab — alongside the Lua plugin folder above):
chmod +x extcap/avclan-pcap.py
mkdir ~/.local/lib/wireshark/extcap
ln -s "$(pwd)/extcap/avclan-pcap.py" ~/.local/lib/wireshark/extcap/avclan-pcap.py
- Restart Wireshark. **AVC-LAN (serial)** now shows up in the interface list. The script autodetects a USB-UART adapter; to override, open the interface's gear/options and set the serial port. Click the shark fin to start. Wireshark owns the process, so stopping the capture (or unplugging the adapter) shuts the bridge down cleanly.
## Live capture (command line)
If you prefer the pipe, the same script works as a plain producer:
./extcap/avclan-pcap.py --port /dev/ttyUSB0 | wireshark -k -i -
Omit `--port` (or pass `--port auto`) to autodetect the adapter.
## Converting a text log to pcap
The Mockingboard's text-mode REPL output (e.g. [msgdumps/myfile.txt](msgdumps/myfile.txt)) can be turned into a capture file offline:
./extcap/avclan-pcap.py --convert msgdumps/myfile.txt -o out.pcap
Use a `.pcapng` extension to get pcapng instead (requires `editcap`, which ships with Wireshark). With the Lua dissector installed, the result is recognized and dissected as IEBUS/AVCLAN packets.
File diff suppressed because it is too large Load Diff
+456
View File
@@ -0,0 +1,456 @@
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.9"
# dependencies = ["pyserial"]
# ///
"""AVC-LAN Mockingboard -> pcap bridge for Wireshark.
Three modes, one script:
* extcap - invoked by Wireshark; appears as the "AVC-LAN (serial)" capture
interface. Wireshark owns the process lifecycle, so stopping the
capture (or unplugging the adapter) tears everything down cleanly.
* pipe - run by hand: `./avclan-pcap.py --port /dev/ttyUSB0 | wireshark -k -i -`
* convert - turn a text-mode serial log into a pcap file offline:
`./avclan-pcap.py --convert msgdumps/myfile.txt -o out.pcap`
The firmware emits frames over serial at 1.2 Mbaud, 8N1, in one of two formats
(selected at the REPL). This script understands both and emits pcap with
linktype 162 (USER15), matching the avclan_plugin.lua dissector.
Discovery (the extcap query phases), `--convert`, and argument handling run on
the standard library alone, so the script keeps a plain `python3` shebang and
Wireshark can always exec it -- Wireshark launches extcaps with a minimal PATH,
which is why a `uv` shebang here would make the interface vanish from the GUI.
The one dependency, `pyserial`, is only needed to actually read the serial port:
capture fails with a clear message if it is missing. Install it normally (so the
`python3` invocation Wireshark uses can find it), or run the script via
`uv run --script` to have uv resolve the inline dependency above.
"""
import argparse
import os
import re
import shutil
import signal
import struct
import subprocess
import sys
import tempfile
import time
from datetime import datetime, timedelta
# ---------------------------------------------------------------------------
# pcap on-the-wire format. Mirrors the old Julia PcapTools output exactly:
# nanosecond magic, snaplen 64, linktype 162 (DLT_USER15 / wtap.USER15).
# ---------------------------------------------------------------------------
PCAP_MAGIC_NS = 0xA1B23C4D
SNAPLEN = 64
LINKTYPE_USER15 = 162
PCAP_GLOBAL_HEADER = struct.pack(
"<IHHiIII",
PCAP_MAGIC_NS, # magic (nanosecond resolution, little-endian)
2, # version major
4, # version minor
0, # thiszone
0, # sigfigs
SNAPLEN, # snaplen
LINKTYPE_USER15,
)
# Serial framing bytes emitted by AVCLAN_printframe(..., binary=1).
DLE = 0x10 # start of a binary frame
ETB = 0x17 # end of a binary frame (followed by \n; CR tolerated, see below)
MAX_DATA_LEN = 32 # AVCLAN payload cap; longer "length" => bad framing
BAUD = 1_200_000
# USB-UART bridge vendor IDs worth preferring during autodetect.
PREFERRED_VIDS = {
0x0403, # FTDI
0x10C4, # Silicon Labs CP210x
0x1A86, # WCH CH340/CH341
0x067B, # Prolific PL2303
}
# ---------------------------------------------------------------------------
# pcap writing
# ---------------------------------------------------------------------------
def write_global_header(out):
out.write(PCAP_GLOBAL_HEADER)
out.flush()
def write_record(out, ts_ns, payload):
sec, nsec = divmod(ts_ns, 1_000_000_000)
out.write(struct.pack("<IIII", sec, nsec, len(payload), len(payload)))
out.write(payload)
out.flush()
# ---------------------------------------------------------------------------
# Binary frame extraction (live capture / pipe modes)
#
# Length-based rather than line-based: the firmware does not escape payload
# bytes, so a data byte of 0x0A/0x10/0x17 must not be allowed to split a frame.
# We locate a DLE, read the fixed 7-byte header, trust its `length` field, then
# require an ETB exactly where it should be -- resyncing on any mismatch.
# ---------------------------------------------------------------------------
def extract_frames(buf):
"""Pull complete frame payloads out of `buf`, consuming what it returns.
Yields the dissector-ready payload for each frame:
[is_unicast, ctrl_hi, ctrl_lo, periph_hi, periph_lo, control, length, data...]
Leaves any trailing partial frame in `buf` for the next call.
"""
frames = []
pos = 0
while True:
dle = buf.find(DLE, pos)
if dle == -1:
buf.clear()
return frames
# Need DLE + 7 header bytes (the last of which is `length`).
if len(buf) < dle + 8:
del buf[:dle]
return frames
length = buf[dle + 7]
if length > MAX_DATA_LEN:
pos = dle + 1 # spurious DLE; resync past it
continue
etb = dle + 8 + length # index where ETB must sit
if len(buf) < etb + 1:
del buf[:dle]
return frames
if buf[etb] != ETB:
pos = dle + 1 # framing mismatch; this DLE was not a real start
continue
frames.append(bytes(buf[dle + 1:etb])) # 7 header bytes + data
pos = etb + 1
while pos < len(buf) and buf[pos] in (0x0D, 0x0A):
pos += 1 # swallow the trailing \r\n
del buf[:pos]
pos = 0
# ---------------------------------------------------------------------------
# Serial helpers (lazy pyserial import)
# ---------------------------------------------------------------------------
def detect_port():
"""Best-guess serial device, or None. Prefers known USB-UART bridges.
Uses pyserial's enumeration when available, but falls back to a stdlib
glob so the extcap config dialog still offers a sensible default before
pyserial has been pulled in.
"""
try:
from serial.tools import list_ports
except ImportError:
import glob
cands = sorted(glob.glob("/dev/ttyUSB*")) + sorted(glob.glob("/dev/ttyACM*"))
return cands[0] if cands else None
ports = list(list_ports.comports())
if not ports:
return None
def score(p):
s = 0
if p.vid in PREFERRED_VIDS:
s += 10
dev = p.device or ""
if "ttyUSB" in dev:
s += 3
elif "ttyACM" in dev:
s += 2
return s
ports.sort(key=score, reverse=True)
return ports[0].device
def ensure_pyserial():
"""Fail with a clear message if pyserial (capture-only) is unavailable."""
try:
import serial # noqa: F401
except ImportError:
sys.exit("error: capture requires pyserial, which is not installed.\n"
"Install it (e.g. `pip install pyserial`), or run this script via "
"`uv run --script` to pull in the inline dependency.")
def resolve_port(requested):
"""Map a requested port (possibly None/"auto") to a concrete device."""
if requested and requested != "auto":
return requested
port = detect_port()
if not port:
sys.exit("error: no serial port given and none could be autodetected "
"(pass --port /dev/ttyUSBx)")
return port
def open_serial(port):
import serial # lazy: only the serial modes need it
# Flow control fully off: the binary payload can legitimately contain
# 0x11 (XON) / 0x13 (XOFF), which a flow-controlled link would eat.
return serial.Serial(
port,
BAUD,
timeout=0.2, # short, so signal flags get checked promptly
xonxoff=False,
rtscts=False,
dsrdtr=False,
)
# ---------------------------------------------------------------------------
# Capture (extcap + pipe)
# ---------------------------------------------------------------------------
_stop = False
def _request_stop(signum, frame):
global _stop
_stop = True
def run_capture(out, port):
"""Stream frames from the serial port to `out` until told to stop."""
ensure_pyserial() # re-execs under uv if pyserial is missing
import serial # for SerialException
port = resolve_port(port)
try:
ser = open_serial(port)
except serial.SerialException as e:
sys.exit("error: could not open %s: %s" % (port, e))
# Put the firmware into binary-frame mode (REPL 'X').
try:
ser.write(b"X")
except serial.SerialException:
pass
buf = bytearray()
try:
write_global_header(out)
while not _stop:
try:
chunk = ser.read(ser.in_waiting or 1)
except serial.SerialException:
break # adapter went away -> stop cleanly
if not chunk:
continue
buf.extend(chunk)
for payload in extract_frames(buf):
write_record(out, time.time_ns(), payload)
except (BrokenPipeError, OSError):
pass # Wireshark closed the fifo/pipe -> we're done
finally:
ser.close()
# ---------------------------------------------------------------------------
# Convert (offline text log -> pcap), replacing Julia avclan_text_to_pcap
# ---------------------------------------------------------------------------
TIME_RE = re.compile(r"^(\d{1,2}):(\d{2}):(\d{2})\.(\d+)$")
def parse_text_line(line, base_date):
"""Parse one text-mode log line.
Returns (ts_ns_or_None, payload) or None if the line is not a frame.
Line format (whitespace separated):
[HH:MM:SS.mmm] is_unicast controller peripheral control length data...
with the numeric fields in C-style notation (0x.. or plain decimal).
"""
tokens = line.split()
if len(tokens) < 5:
return None
ts_ns = None
m = TIME_RE.match(tokens[0])
if m:
h, mn, s, frac = m.groups()
micros = int(frac.ljust(6, "0")[:6])
try:
dt = datetime(base_date.year, base_date.month, base_date.day,
int(h), int(mn), int(s))
except ValueError:
return None
ts_ns = int(dt.timestamp()) * 1_000_000_000 + micros * 1000
tokens = tokens[1:]
if len(tokens) < 5:
return None
try:
is_unicast = int(tokens[0], 0)
controller = int(tokens[1], 0)
peripheral = int(tokens[2], 0)
control = int(tokens[3], 0)
length = int(tokens[4], 0)
except ValueError:
return None
data_tokens = tokens[5:]
if length > MAX_DATA_LEN or len(data_tokens) != length:
return None
try:
data = bytes(int(d, 0) & 0xFF for d in data_tokens)
except ValueError:
return None
payload = bytes([
is_unicast & 0xFF,
(controller >> 8) & 0xFF, controller & 0xFF,
(peripheral >> 8) & 0xFF, peripheral & 0xFF,
control & 0xFF,
length & 0xFF,
]) + data
return ts_ns, payload
def run_convert(infile, output):
# Date comes from the log's mtime (the lines only carry a wall-clock time);
# falls back to today if that is unavailable.
try:
base_date = datetime.fromtimestamp(os.path.getmtime(infile))
except OSError:
base_date = datetime.now()
want_pcapng = bool(output) and output.endswith(".pcapng")
tmp_path = None
if want_pcapng:
fd, tmp_path = tempfile.mkstemp(suffix=".pcap")
out = os.fdopen(fd, "wb")
close_out = True
elif output:
out = open(output, "wb")
close_out = True
else:
out = sys.stdout.buffer
close_out = False
last_ts = None
count = 0
try:
write_global_header(out)
with open(infile, "r") as f:
for line in f:
parsed = parse_text_line(line, base_date)
if parsed is None:
continue
ts_ns, payload = parsed
if ts_ns is None:
# No timestamp on this line; nudge past the previous one so
# ordering is preserved (mirrors the old Julia behaviour).
base = last_ts if last_ts is not None else time.time_ns()
ts_ns = base + 1000
write_record(out, ts_ns, payload)
last_ts = ts_ns
count += 1
finally:
if close_out:
out.close()
if want_pcapng:
editcap = shutil.which("editcap")
if editcap:
subprocess.run([editcap, "-F", "pcapng", tmp_path, output], check=True)
os.unlink(tmp_path)
else:
fallback = output[: -len(".pcapng")] + ".pcap"
shutil.move(tmp_path, fallback)
print("warning: editcap not found; wrote pcap to %s instead of %s"
% (fallback, output), file=sys.stderr)
output = fallback
if output:
print("wrote %d frames to %s" % (count, output), file=sys.stderr)
# ---------------------------------------------------------------------------
# extcap argument phases
# ---------------------------------------------------------------------------
def extcap_interfaces():
print("extcap {version=1.0}{help=https://github.com/}"
"{display=AVC-LAN Mockingboard}")
print("interface {value=avclan}{display=AVC-LAN (serial)}")
def extcap_dlts():
print("dlt {number=%d}{name=USER15}{display=AVC-LAN / IEBus}" % LINKTYPE_USER15)
def extcap_config():
default = detect_port() or "auto"
print('arg {number=0}{call=--port}{display=Serial port}{type=string}'
'{tooltip=Serial device path, or "auto" to autodetect}'
'{default=%s}' % default)
# ---------------------------------------------------------------------------
# main
# ---------------------------------------------------------------------------
def main():
parser = argparse.ArgumentParser(add_help=True)
# extcap discovery/lifecycle flags (Wireshark-driven)
parser.add_argument("--extcap-interfaces", action="store_true")
parser.add_argument("--extcap-dlts", action="store_true")
parser.add_argument("--extcap-config", action="store_true")
parser.add_argument("--extcap-interface")
parser.add_argument("--extcap-version")
parser.add_argument("--capture", action="store_true")
parser.add_argument("--fifo")
parser.add_argument("--extcap-control-in")
parser.add_argument("--extcap-control-out")
# shared / CLI
parser.add_argument("--port", help='serial device, or "auto"')
parser.add_argument("--convert", metavar="LOGFILE",
help="convert a text-mode serial log to pcap")
parser.add_argument("-o", "--output",
help="output file for --convert (.pcap or .pcapng); "
"stdout if omitted")
args, _ = parser.parse_known_args()
if args.extcap_interfaces:
extcap_interfaces()
return
if args.extcap_dlts:
extcap_dlts()
return
if args.extcap_config:
extcap_config()
return
if args.convert:
run_convert(args.convert, args.output)
return
signal.signal(signal.SIGINT, _request_stop)
signal.signal(signal.SIGTERM, _request_stop)
if args.capture:
if not args.fifo:
sys.exit("error: --capture requires --fifo")
with open(args.fifo, "wb") as fifo:
run_capture(fifo, args.port)
return
# No mode flags: behave as a plain pipe into `wireshark -k -i -`.
run_capture(sys.stdout.buffer, args.port)
if __name__ == "__main__":
try:
main()
except BrokenPipeError:
# Reader (Wireshark) went away; exit quietly without a traceback.
try:
sys.stdout.close()
except Exception:
pass
os._exit(0)
+156
View File
@@ -0,0 +1,156 @@
#!/usr/bin/env python3
"""One-off: convert a bracketed-timestamp AVC-LAN `log` dump into a pcap.
The capture in `msgdumps/log` is a foreign text format (not the firmware's):
[ 08:50:12.793 ] 1901F1040025C0EF
Each hex blob is a tight nibble packing of an AVC-LAN frame, with no spaces and
no leading is_unicast byte (unlike the firmware text format that
extcap/avclan-pcap.py's --convert handles):
controller : 3 hex nibbles (12-bit address)
peripheral : 3 hex nibbles (12-bit address)
length : 2 hex nibbles (1 byte: data byte count)
data : length bytes (2*length hex nibbles)
There is no control field in this format; the dissector wants one, so we
synthesize the standard AVC-LAN value (0x0F).
It emits pcap with linktype 162 (DLT_USER15), the payload layout the
avclan_plugin.lua dissector expects -- byte-for-byte compatible with
avclan-pcap.py's output:
[is_unicast, ctrl_hi, ctrl_lo, periph_hi, periph_lo, control, length, data...]
"""
import argparse
import os
import re
import struct
import sys
from datetime import datetime, timedelta
# pcap on-the-wire format -- mirrors avclan-pcap.py exactly:
# nanosecond magic, snaplen 64, linktype 162 (DLT_USER15 / wtap.USER15).
PCAP_MAGIC_NS = 0xA1B23C4D
SNAPLEN = 64
LINKTYPE_USER15 = 162
PCAP_GLOBAL_HEADER = struct.pack(
"<IHHiIII",
PCAP_MAGIC_NS, # magic (nanosecond resolution, little-endian)
2, # version major
4, # version minor
0, # thiszone
0, # sigfigs
SNAPLEN, # snaplen
LINKTYPE_USER15,
)
# AVC-LAN broadcast destination addresses -- a frame to anything else is unicast.
BROADCAST_ADDRS = {0x1FF, 0xFFF}
# This format omits the control field; synthesize the standard AVC-LAN value.
STANDARD_CONTROL = 0x0F
LINE_RE = re.compile(
r"^\[\s*(\d+):(\d+):(\d+)\.(\d+)\s*\]\s*([0-9A-Fa-f]+)\s*$"
)
def write_global_header(out):
out.write(PCAP_GLOBAL_HEADER)
def write_record(out, ts_ns, payload):
sec, nsec = divmod(ts_ns, 1_000_000_000)
out.write(struct.pack("<IIII", sec, nsec, len(payload), len(payload)))
out.write(payload)
def parse_line(line, base_date):
"""Parse one log line -> (ts_ns, payload) or None if not a frame."""
m = LINE_RE.match(line)
if not m:
return None
h, mn, s, frac, hx = m.groups()
# Header is controller(3) + peripheral(3) + length(2) = 8 nibbles, no control.
if len(hx) < 8:
return None
length = int(hx[6:8], 16)
if len(hx) != 8 + 2 * length:
return None
controller = int(hx[0:3], 16)
peripheral = int(hx[3:6], 16)
control = STANDARD_CONTROL # not present in the log; synthesize the standard
is_unicast = 0 if peripheral in BROADCAST_ADDRS else 1
data = bytes.fromhex(hx[8:])
payload = bytes([
is_unicast,
(controller >> 8) & 0xFF, controller & 0xFF,
(peripheral >> 8) & 0xFF, peripheral & 0xFF,
control & 0xFF,
length & 0xFF,
]) + data
micros = int(frac.ljust(6, "0")[:6])
dt = datetime(base_date.year, base_date.month, base_date.day,
int(h), int(mn), int(s))
return dt, micros, payload
def main():
here = os.path.dirname(os.path.abspath(__file__))
parser = argparse.ArgumentParser(description=__doc__,
formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("infile", nargs="?",
default=os.path.join(here, "msgdumps", "log"),
help="input log file (default: msgdumps/log)")
parser.add_argument("-o", "--output",
help="output pcap (default: <infile>.pcap)")
args = parser.parse_args()
output = args.output or (args.infile + ".pcap")
# Lines carry only wall-clock time; take the date from the log's mtime.
try:
base_date = datetime.fromtimestamp(os.path.getmtime(args.infile))
except OSError:
base_date = datetime.now()
count = 0
skipped = 0
prev_tod = None # previous (h,m,s,micros) for midnight-rollover detection
day_offset = timedelta(0)
with open(args.infile, "r") as f, open(output, "wb") as out:
write_global_header(out)
for lineno, line in enumerate(f, 1):
if not line.strip():
continue
parsed = parse_line(line, base_date)
if parsed is None:
skipped += 1
print("skip: malformed line %d: %r" % (lineno, line.rstrip()),
file=sys.stderr)
continue
dt, micros, payload = parsed
tod = (dt.hour, dt.minute, dt.second, micros)
if prev_tod is not None and tod < prev_tod:
day_offset += timedelta(days=1) # wall clock wrapped past midnight
prev_tod = tod
dt = dt + day_offset
ts_ns = int(dt.timestamp()) * 1_000_000_000 + micros * 1000
write_record(out, ts_ns, payload)
count += 1
print("wrote %d frames to %s%s" % (
count, output,
" (%d skipped)" % skipped if skipped else ""), file=sys.stderr)
if __name__ == "__main__":
main()
Binary file not shown.
Binary file not shown.
Binary file not shown.
+551
View File
@@ -0,0 +1,551 @@
#!/usr/bin/env python3
"""Keep the C++ Device/Action enums in sync with the Lua dissector tables.
The Wireshark dissector in scripts/packet-analysis/avclan_plugin.lua is the
authoritative source of truth for AVC-LAN device and action names. Its
`known_devices` / `known_actions` tables and the firmware's C++ enums
(`enum class Device` in src/avclan/device.hpp, `enum ... Action` in
src/avclan/avclan.h) encode the same numeric values and drift apart by hand.
This tool reconciles them, matching entries *by value* so a value renamed in
the dissector is propagated into C++ (and to every reference under src/), not
just added/removed.
Default (no flags) lint the dissector names AND report enum drift; write
nothing; exit non-zero if either has problems. This is
what the pre-commit hook runs.
--fix lint first (never fold an invalid name into C++), then
apply: rewrite the enum bodies and search-replace the
renamed members across src/.
--lint validate the dissector names only.
--verbose list every reference-site replacement made by --fix.
Reconciliation rules (see the project plan for the full rationale):
* Match by value. Names are compared with a case/separator-insensitive
canonical key, so a case-only difference (LIST_FUNCTIONS_REQ vs
List_Functions_Req) is NOT a change -- the existing C++ spelling is kept.
* A beyond-case difference is a rename: the C++ member is renamed to the
house-style form of the dissector name and all references are updated.
* Full mirror: every active dissector entry missing from C++ is added; if C++
carries a value the dissector lacks, that is an error (reported, not
dropped). Commented-out ("pencil-in") Lua entries are ignored.
* New/renamed members follow each enum's house style: Device -> UPPER_SNAKE,
Action -> Title_Case (with a small acronym allowlist kept uppercase).
* New members are inserted at their position in the Lua table (adjacent to
their nearest Lua neighbour that already exists in C++).
The dissector is expected to keep *approximately* valid identifiers: spaces and
punctuation are silently converted to single underscores. Only two hard rules
are enforced by --lint (a name must not start with a digit, and must be at
least 3 characters); the 3-char floor also keeps the reference search-replace
from colliding on 2-character tokens.
Runs as a pre-commit hook via .githooks/pre-commit; that directory is wired up
by the top-level CMake configure step (core.hooksPath). `git commit --no-verify`
still bypasses it.
"""
import argparse
import os
import re
import subprocess
import sys
# ---- locations -------------------------------------------------------------
LUA_REL = os.path.join("scripts", "packet-analysis", "avclan_plugin.lua")
SRC_REL = "src"
SRC_EXTS = (".c", ".cc", ".h", ".hpp")
# Enum specs are matched to a Lua table by NAME; addresses are auto-detected
# separately (no Address enum exists yet). `style` picks the identifier casing,
# `hexfmt` the literal format for freshly added members (matched per file).
ENUM_SPECS = [
{
"name": "Action",
"path": os.path.join("src", "avclan", "avclan.h"),
"lua_table": "known_actions",
"style": "action",
"hexfmt": "0x%02x",
},
{
"name": "Device",
"path": os.path.join("src", "avclan", "device.hpp"),
"lua_table": "known_devices",
"style": "device",
"hexfmt": "0x%02X",
},
]
# Tokens kept fully uppercase when Title-casing an Action name, matching the
# existing hand-written style (CD_Enable_Repeat, Report_TOC). Note LAN -> Lan.
ACTION_ACRONYMS = {"CD", "TOC"}
# ---- name helpers ----------------------------------------------------------
def sanitize(name):
"""Convert an approximate identifier to a valid one: non-word chars become
underscores and runs of underscores collapse to one."""
s = re.sub(r"[^0-9A-Za-z_]", "_", name)
s = re.sub(r"_+", "_", s)
return s.strip("_")
def canonical(name):
"""Case/separator-insensitive key used to match names by identity."""
return re.sub(r"[^0-9A-Za-z]", "", name).upper()
def style_device(name):
return sanitize(name).upper()
def style_action(name):
parts = [p for p in sanitize(name).split("_") if p]
out = []
for p in parts:
if p.upper() in ACTION_ACRONYMS:
out.append(p.upper())
else:
out.append(p[:1].upper() + p[1:].lower())
return "_".join(out)
STYLERS = {"device": style_device, "action": style_action}
# ---- parsing ---------------------------------------------------------------
# An active Lua entry: ` [0x11] = "NAME",` with no leading `--`. The regex
# anchors `[` right after the indentation, so commented `-- [0x..]` lines and
# prose comment lines never match. The name is taken from inside the quotes,
# so trailing `-- ...` comments are ignored.
LUA_ENTRY_RE = re.compile(r'^\s*\[\s*0x([0-9A-Fa-f]+)\s*\]\s*=\s*"([^"]*)"')
LUA_TABLE_OPEN = "local %s = {"
LUA_TABLE_CLOSE_RE = re.compile(r"^\s*\}")
# A C++ enum member: ` Name = 0x11,` (or decimal). `//`-commented members are
# skipped by the caller, so they count as absent.
CPP_MEMBER_RE = re.compile(r"^\s*([A-Za-z_]\w*)\s*=\s*(0x[0-9A-Fa-f]+|\d+)")
class LuaEntry:
def __init__(self, value, name, lineno):
self.value = value
self.name = name
self.lineno = lineno
class CppMember:
def __init__(self, value, name, idx):
self.value = value
self.name = name
self.idx = idx # 0-based index into the file's line list
def read_lines(path):
with open(path, "r") as f:
return f.readlines()
def parse_lua_table(lines, table_name):
"""Return the active entries of a Lua table, in file order."""
open_marker = LUA_TABLE_OPEN % table_name
start = None
for i, line in enumerate(lines):
if line.strip().startswith(open_marker):
start = i
break
if start is None:
return None
entries = []
for j in range(start + 1, len(lines)):
line = lines[j]
if LUA_TABLE_CLOSE_RE.match(line):
break
if line.lstrip().startswith("--"):
continue
m = LUA_ENTRY_RE.match(line)
if m:
entries.append(LuaEntry(int(m.group(1), 16), m.group(2), j + 1))
return entries
def find_enum_body(lines, enum_name):
"""Locate `enum [macro] <name> ... {` and its closing brace. Returns
(open_idx, close_idx) as line indices, or None."""
open_re = re.compile(r"^\s*enum\b[^{;]*\b%s\b[^{;]*\{" % re.escape(enum_name))
for i, line in enumerate(lines):
if open_re.match(line):
for j in range(i + 1, len(lines)):
if LUA_TABLE_CLOSE_RE.match(lines[j]): # `^\s*}` works for C++ too
return i, j
return i, len(lines) - 1
return None
def parse_cpp_enum(lines, enum_name):
"""Return (members, open_idx, close_idx, indent) for a C++ enum, ignoring
commented-out members."""
body = find_enum_body(lines, enum_name)
if body is None:
return None
open_idx, close_idx = body
members = []
indent = " "
for j in range(open_idx + 1, close_idx):
stripped = lines[j].lstrip()
if stripped.startswith("//") or not stripped:
continue
m = CPP_MEMBER_RE.match(lines[j])
if m:
token = m.group(2)
value = int(token, 16) if token.lower().startswith("0x") else int(token)
members.append(CppMember(value, m.group(1), j))
indent = lines[j][: len(lines[j]) - len(lines[j].lstrip())]
return members, open_idx, close_idx, indent
def find_address_spec(root):
"""Auto-detect an `enum ... Address ... {` under src/, so addresses sync
automatically once such an enum is introduced. None today."""
addr_re = re.compile(r"^\s*enum\b[^{;]*\bAddress\b[^{;]*\{")
for path in iter_src_files(root):
if not path.endswith((".h", ".hpp")):
continue
with open(path, "r") as f:
for line in f:
if addr_re.match(line):
return {
"name": "Address",
"path": os.path.relpath(path, root),
"lua_table": "known_addresses",
"style": "device",
"hexfmt": "0x%03X",
}
return None
def iter_src_files(root):
"""List source files under src/, via `git ls-files` so paths excluded by
.gitignore (e.g. the ESP32 port's CMake build directory, which vendors
FetchContent'd third-party code) are never walked into."""
out = subprocess.run(
["git", "-C", root, "ls-files", "-z", "--cached", "--others",
"--exclude-standard", "--", SRC_REL],
capture_output=True, check=True, text=True,
).stdout
paths = sorted(p for p in out.split("\0") if p.endswith(SRC_EXTS))
return [os.path.join(root, p) for p in paths]
# ---- lint ------------------------------------------------------------------
def lint_table(entries, path):
"""Return a list of (lineno, name, reason) for dissector names that break a
hard rule."""
problems = []
seen = {}
for e in entries:
s = sanitize(e.name)
if not s or s[0].isdigit():
problems.append((e.lineno, e.name, "starts with a digit"))
continue
if len(s) < 3:
problems.append((e.lineno, e.name, "shorter than 3 characters"))
key = s.upper()
if key in seen:
problems.append((e.lineno, e.name,
"collides with '%s' (line %d) after sanitize"
% (seen[key][0], seen[key][1])))
else:
seen[key] = (e.name, e.lineno)
return problems
# ---- reconciliation --------------------------------------------------------
class Drift:
def __init__(self, spec):
self.spec = spec
self.renames = [] # (old_name, new_name, value)
self.adds = [] # (value, new_name)
self.cpp_only = [] # (value, name)
def clean(self):
return not (self.renames or self.adds or self.cpp_only)
def reconcile(spec, lua_entries, members):
stylefn = STYLERS[spec["style"]]
drift = Drift(spec)
cpp_by_val = {m.value: m for m in members}
lua_vals = set()
for e in lua_entries:
lua_vals.add(e.value)
target = stylefn(e.name)
if e.value in cpp_by_val:
cur = cpp_by_val[e.value].name
if canonical(cur) != canonical(e.name):
drift.renames.append((cur, target, e.value))
else:
drift.adds.append((e.value, target))
for m in members:
if m.value not in lua_vals:
drift.cpp_only.append((m.value, m.name))
return drift
# ---- fix: rewrite enum bodies + references ---------------------------------
def compute_insertions(adds, lua_order, present_idx, close_idx, indent, hexfmt):
"""Map each added value to the line index it should be inserted before,
mirroring the Lua table order. Returns {index: [rendered_line, ...]}."""
groups = {}
order_pos = {v: i for i, v in enumerate(lua_order)}
for value, name in adds: # adds are already in Lua order
pos = order_pos[value]
ins = None
for j in range(pos - 1, -1, -1):
if lua_order[j] in present_idx:
ins = present_idx[lua_order[j]] + 1
break
if ins is None:
for j in range(pos + 1, len(lua_order)):
if lua_order[j] in present_idx:
ins = present_idx[lua_order[j]]
break
if ins is None:
ins = close_idx
line = "%s%s = %s,\n" % (indent, name, hexfmt % value)
groups.setdefault(ins, []).append(line)
return groups
def apply_additions(path, spec, lua_entries, drift):
if not drift.adds:
return
lines = read_lines(path)
parsed = parse_cpp_enum(lines, spec["name"])
members, _open_idx, close_idx, indent = parsed
present_idx = {m.value: m.idx for m in members}
lua_order = [e.value for e in lua_entries]
groups = compute_insertions(drift.adds, lua_order, present_idx,
close_idx, indent, spec["hexfmt"])
for ins in sorted(groups, reverse=True):
lines[ins:ins] = groups[ins]
with open(path, "w") as f:
f.writelines(lines)
def replace_in_code(content, pattern, repl):
"""Apply `pattern` only to code, leaving comments, string literals and char
literals untouched -- a bare token like a renamed enum member must not be
rewritten where it merely appears in prose (e.g. `CSMA/CD` in a comment)."""
out = []
i = 0
n = len(content)
while i < n:
c = content[i]
nxt = content[i + 1] if i + 1 < n else ""
if c == "/" and nxt == "/":
j = content.find("\n", i)
j = n if j == -1 else j
out.append(content[i:j])
i = j
elif c == "/" and nxt == "*":
j = content.find("*/", i + 2)
j = n if j == -1 else j + 2
out.append(content[i:j])
i = j
elif c == '"' or (c == "'" and not (i > 0 and (content[i - 1].isalnum()
or content[i - 1] == "_"))):
# string, or a char literal (not a C++ digit separator like 1'000)
quote = c
j = i + 1
while j < n:
if content[j] == "\\":
j += 2
continue
if content[j] == quote:
j += 1
break
j += 1
out.append(content[i:j])
i = j
else:
j = i
while j < n:
cj = content[j]
cj1 = content[j + 1] if j + 1 < n else ""
if cj == '"':
break
if cj == "'" and not (content[j - 1].isalnum() or content[j - 1] == "_"):
break
if cj == "/" and (cj1 == "/" or cj1 == "*"):
break
j += 1
out.append(pattern.sub(repl, content[i:j]))
i = j
return "".join(out)
# A token right after one of these keywords is *introducing a name* (a type,
# enum, etc.), not referencing our enum member -- skip it so a member name that
# collides with an unrelated type (e.g. `enum CD { ... }`) is left alone.
DECL_KEYWORD_RE = re.compile(r"\b(?:enum|class|struct|union|namespace|typedef)\s+$")
def apply_renames(root, renames, verbose):
"""Replace whole-word code occurrences of every renamed member across src/.
A single simultaneous pass (alternation) avoids A->B->C chaining."""
if not renames:
return
mapping = {old: new for old, new, _v in renames}
pattern = re.compile(r"\b(%s)\b" % "|".join(re.escape(o) for o in mapping))
for path in iter_src_files(root):
with open(path, "r") as f:
content = f.read()
count = [0]
def repl(m):
if DECL_KEYWORD_RE.search(m.string[: m.start()]):
return m.group(0) # a declaration, not a member reference
count[0] += 1
return mapping[m.group(1)]
new_content = replace_in_code(content, pattern, repl)
if new_content != content:
with open(path, "w") as f:
f.write(new_content)
if verbose:
print(" %s: %d replacement(s)" % (os.path.relpath(path, root), count[0]))
# ---- reporting -------------------------------------------------------------
def print_lint(spec, path, problems):
for lineno, name, reason in problems:
print(" %s:%d: %r -- %s" % (path, lineno, name, reason))
def print_drift(drift):
spec = drift.spec
for old, new, value in drift.renames:
print(" rename %s -> %s (0x%02X)" % (old, new, value))
for value, name in drift.adds:
print(" add %s = 0x%02X" % (name, value))
for value, name in drift.cpp_only:
print(" ERROR %s (0x%02X) is in C++ %s but not the dissector"
% (name, value, spec["name"]))
# ---- driver ----------------------------------------------------------------
def build_specs(root):
specs = list(ENUM_SPECS)
addr = find_address_spec(root)
if addr:
specs.append(addr)
return specs, addr is not None
def load(root, spec, lua_lines):
entries = parse_lua_table(lua_lines, spec["lua_table"])
if entries is None:
sys.exit("error: Lua table '%s' not found" % spec["lua_table"])
parsed = parse_cpp_enum(read_lines(os.path.join(root, spec["path"])), spec["name"])
if parsed is None:
sys.exit("error: C++ enum '%s' not found in %s" % (spec["name"], spec["path"]))
return entries, parsed[0]
def main():
parser = argparse.ArgumentParser(
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("--fix", action="store_true",
help="apply the sync (rewrite enums + references)")
parser.add_argument("--lint", action="store_true",
help="validate dissector names only")
parser.add_argument("--verbose", action="store_true",
help="list every reference replacement made by --fix")
parser.add_argument("--root",
help="repo root (default: inferred from this script)")
args = parser.parse_args()
root = args.root or os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
lua_path = os.path.join(root, LUA_REL)
lua_lines = read_lines(lua_path)
specs, have_address = build_specs(root)
# ---- lint (all modes) ----
lint_failed = False
for spec in specs:
entries = parse_lua_table(lua_lines, spec["lua_table"])
if entries is None:
sys.exit("error: Lua table '%s' not found" % spec["lua_table"])
problems = lint_table(entries, LUA_REL)
if problems:
lint_failed = True
print("dissector name problems in %s (%s):" % (spec["lua_table"], LUA_REL))
print_lint(spec, LUA_REL, problems)
if args.lint:
if not have_address:
print("note: no Address enum found in src/ -- addresses not synced")
if lint_failed:
print("lint: FAILED")
return 1
print("lint: ok")
return 0
# ---- reconcile ----
drifts = []
for spec in specs:
entries, members = load(root, spec, lua_lines)
drifts.append((spec, entries, reconcile(spec, entries, members)))
has_cpp_only = any(d.cpp_only for _s, _e, d in drifts)
has_drift = any(not d.clean() for _s, _e, d in drifts)
if args.fix:
if not have_address:
print("note: no Address enum found in src/ -- addresses not synced")
if lint_failed:
print("fix aborted: resolve the dissector name problems above first")
return 1
if has_cpp_only:
for _s, _e, d in drifts:
if d.cpp_only:
print("%s:" % d.spec["name"])
print_drift(d)
print("fix aborted: C++ has values the dissector lacks (see ERRORs)")
return 1
all_renames = []
for spec, entries, drift in drifts:
apply_additions(os.path.join(root, spec["path"]), spec, entries, drift)
all_renames.extend(drift.renames)
apply_renames(root, all_renames, args.verbose)
for spec, entries, drift in drifts:
if not drift.clean():
print("%s: %d rename(s), %d addition(s)"
% (spec["name"], len(drift.renames), len(drift.adds)))
print("fix: applied" if has_drift else "fix: already in sync")
return 0
# ---- default: report (silent on success -- this is the pre-commit hook) ----
if not (lint_failed or has_drift):
return 0
if not have_address:
print("note: no Address enum found in src/ -- addresses not synced")
for spec, _entries, drift in drifts:
if not drift.clean():
print("%s drift:" % spec["name"])
print_drift(drift)
print("out of sync -- run: scripts/sync_avclan_enums.py --fix")
return 1
if __name__ == "__main__":
sys.exit(main())
-298
View File
@@ -1,298 +0,0 @@
/*
Copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-----------------------------------------------------------------------
this file is a part of the TOYOTA Corolla MP3 Player Project
-----------------------------------------------------------------------
http://www.softservice.com.pl/corolla/avc
May 28 / 2009 - version 2
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include "GlobalDef.h"
#include "com232.h"
#include "avclandrv.h"
// -------------------------------------------------------------------------------------
void Setup();
byte rcv_command[5];
byte rcv_pos = 0;
byte rcv_time_clr = 0;
// -------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------
// MAIN PROGRAM
//
int main()
{
// byte h;
byte readSeq = 0;
byte s_len = 0;
byte s_dig = 0;
byte s_c[2];
byte i;
byte data_tmp[32];
Setup();
TCNT0 = 0;
while( TCNT0 < 250 );
TCNT0 = 0;
while( TCNT0 < 250 );
TCNT0 = 0;
while( TCNT0 < 250 );
RS232_Print("AVCLan reader 1.00\nReady\n\n");
LED_OFF();
RS232_Print_P(PSTR("D - device id\nH - HU id\nS - read sequence\nW - send command\nQ - send broadcast\nL/l - log on/off\nK/k - seq. echo on/off\nR/r - register device\nB - Beep\nT - Measure interval\n"));
while (1) {
if (INPUT_IS_SET) { // if message from some device on AVCLan begin
LED_ON();
AVCLan_Read_Message();
// show message
} else {
LED_OFF();
// check command from HU
if (answerReq != 0) AVCLan_SendAnswer();
}
// HandleEvent
switch (Event) {
case EV_STATUS: Event &= ~EV_STATUS;
AVCLan_Send_Status();
break;
}
// Key handler
if (RS232_RxCharEnd) {
cbi(UCSR0B, RXCIE0); // disable RX complete interrupt
readkey = RS232_RxCharBuffer[RS232_RxCharBegin];// read begin of received Buffer
RS232_RxCharBegin++;
if (RS232_RxCharBegin == RS232_RxCharEnd) // if Buffer is empty
RS232_RxCharBegin = RS232_RxCharEnd = 0; // do reset Buffer
sbi(UCSR0B, RXCIE0); // enable RX complete interrupt
switch (readkey) {
case 'D': if (readSeq) {
CD_ID_1 = data_tmp[0];
CD_ID_2 = data_tmp[1];
RS232_Print_P(PSTR("DEV ID SET: 0x"));
RS232_PrintHex8(CD_ID_1);
RS232_PrintHex8(CD_ID_2);
RS232_Print_P(PSTR("\n"));
showLog = 1;
readSeq=0;
} else {
showLog = 0;
RS232_Print_P(PSTR("DEV ID > \n"));
readSeq = 1;
s_len=0;
s_dig=0;
s_c[0]=s_c[1]=0;
}
break;
case 'H': if (readSeq) {
HU_ID_1 = data_tmp[0];
HU_ID_2 = data_tmp[1];
RS232_Print_P(PSTR("HU ID SET: 0x"));
RS232_PrintHex8(HU_ID_1);
RS232_PrintHex8(HU_ID_2);
RS232_Print_P(PSTR("\n"));
showLog = 1;
readSeq=0;
} else {
showLog = 0;
RS232_Print_P(PSTR("HU ID > \n"));
readSeq = 1;
s_len=0;
s_dig=0;
s_c[0]=s_c[1]=0;
}
break;
case 'S': showLog = 0;
RS232_Print_P(PSTR("READ SEQUENCE > \n"));
readSeq = 1;
s_len=0;
s_dig=0;
s_c[0]=s_c[1]=0;
break;
case 'W' : showLog = 1;
readSeq=0;
AVCLan_SendMyData(data_tmp, s_len);
break;
case 'Q' : showLog = 1;
readSeq=0;
AVCLan_SendMyDataBroadcast(data_tmp, s_len);
break;
case 'R': RS232_Print_P(PSTR("REGIST:\n"));
AVCLan_Command( cmRegister );
TCNT0 = 0;
while( TCNT0 < 135 );
CHECK_AVC_LINE;
break;
case 'r': AVCLan_Register();
break;
case 'l': RS232_Print_P(PSTR("Log OFF\n"));
showLog = 0;
break;
case 'L': RS232_Print_P(PSTR("Log ON\n"));
showLog = 1;
break;
case 'k': RS232_Print_P(PSTR("str OFF\n"));
showLog2 = 0;
break;
case 'K': RS232_Print_P(PSTR("str ON\n"));
showLog2 = 1;
break;
case 'B':
data_tmp[0] = 0x00;
data_tmp[0] = 0x5E;
data_tmp[0] = 0x29;
data_tmp[0] = 0x60;
data_tmp[0] = 0x01;
s_len = 5;
AVCLan_SendMyData(data_tmp, s_len);
break;
case 'T':
AVCLan_Measure();
break;
default :
if (readSeq==1) {
s_c[s_dig]=readkey;
s_dig++;
if (s_dig==2) {
if (s_c[0]<':') s_c[0] -= 48;
else s_c[0] -= 55;
data_tmp[s_len] = 16 * s_c[0];
if (s_c[1]<':') s_c[1] -= 48;
else s_c[1] -= 55;
data_tmp[s_len] += s_c[1];
s_len++;
s_dig=0;
s_c[0]=s_c[1]=0;
}
if (showLog2) {
RS232_Print_P(PSTR("CURRENT SEQUENCE > "));
for (i=0; i<s_len; i++) {
RS232_PrintHex8(data_tmp[i]);
RS232_SendByte(' ');
}
RS232_Print_P(PSTR("\n"));
}
}
} // switch (readkey)
}// if (RS232_RxCharEnd)
}
return 0;
}
// -------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------
// Setup - uP: ATMega328p
//
void Setup()
{
// GIMSK = 0; // (GICR ?) disable external interupts
CD_ID_1 = 0x03;
CD_ID_2 = 0x60;
HU_ID_1 = 0x01;
HU_ID_2 = 0x90;
showLog = 1;
showLog2 = 1;
MCUCR = 0;
// Timer 1
TIMSK1 = 0;
sbi(TIMSK1, OCIE1A); // Enable timer1 compare interrupt
TCCR1A = 0;
TCCR1B |= (1 << WGM12)|(1 << CS12); // Set CTC, prescaler at 256
OCR1A = 62499; // Compare match at 1sec intervals
RS232_Init();
AVCLan_Init();
Event = EV_NOTHING;
sei();
}
// -------------------------------------------------------------------------------------
byte s1=0;
//------------------------------------------------------------------------------
ISR(TIMER1_COMPA_vect) // Timer1 compare match every 1Sec
{
s1++;
if (s1==2) {
s1=0;
if (CD_Mode==stPlay) {
cd_Time_Sec=HexInc(cd_Time_Sec);
if (cd_Time_Sec==0x60) {
cd_Time_Sec = 0;
cd_Time_Min=HexInc(cd_Time_Min);
if (cd_Time_Min==0xA0) {
cd_Time_Min=0x0;
}
}
Event |= EV_STATUS;
}
}
}
//------------------------------------------------------------------------------
+190
View File
@@ -0,0 +1,190 @@
// Copyright (C) 2026 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <stdint.h>
#ifdef __cplusplus
#define AVCLAN_ENUM_CLASS class
#include <type_traits>
namespace avclan {
#if defined(__cpp_lib_to_underlying) && __cpp_lib_to_underlying >= 202102L
using std::to_underlying;
#else
template <class Enum>
requires std::is_enum_v<Enum>
constexpr std::underlying_type_t<Enum> to_underlying(Enum e) noexcept {
return static_cast<std::underlying_type_t<Enum>>(e);
}
#endif
#else
#define AVCLAN_ENUM_CLASS
#endif
enum AVCLAN_ENUM_CLASS Action : uint8_t {
// LAN related
List_Functions_Req = 0x00,
List_Functions_Resp = 0x10,
Lan_Init = 0x01,
Lan_Init_Complete = 0x58,
// Lan_Startup_Complete = 0x58,
Lancheck_End_Req = 0x08,
Lancheck_End_Resp = 0x18,
Lancheck_Scan_Req = 0x0a,
Lancheck_Scan_Resp = 0x1a,
Lancheck_Req = 0x0c,
Lancheck_Resp = 0x1c,
// Lancheck_UNK_Req = 0x0d,
// Lancheck_UNK_Resp = 0x1d,
Ping_Req = 0x20,
Ping_Resp = 0x30,
// Device switching
Enable_Function_Req = 0x42,
Enable_Function_Resp = 0x52,
Disable_Function_Req = 0x43,
Disable_Function_Resp = 0x53,
Advertise_Function = 0x45,
General_Query = 0x46,
// Events
Insertion = 0x50,
Ejection = 0x51,
// Physical interface
Backlight_Adjust = 0x59,
Beep = 0x60,
Screen_Press = 0x78,
Eject = 0x80,
Disc_Up = 0x90,
Disc_Down = 0x91,
Track_Seek_Up = 0x94,
Track_Seek_Down = 0x95,
Track_Fast_Forward = 0x98,
Track_Rewind = 0x99,
Pwrvol_Knob_Righthand_Turn = 0x9c,
Pwrvol_Knob_Lefthand_Turn = 0x9d,
Tape_Not_Ready = 0x9f,
CD_Enable_Repeat = 0xa0,
CD_Disable_Repeat = 0xa1,
CD_Enable_Disk_Repeat = 0xa3,
CD_Disable_Disk_Repeat = 0xa4,
CD_Enable_Scan = 0xa6,
CD_Disable_Scan = 0xa7,
CD_Enable_Disk_Scan = 0xa9,
CD_Disable_Disk_Scan = 0xaa,
CD_Enable_Random = 0xb0,
CD_Disable_Random = 0xb1,
CD_Enable_Disk_Random = 0xb3,
CD_Disable_Disk_Random = 0xb4,
// Requests and Response pairs
Initial_Report_Req = 0xe0,
Initial_Report_Resp = 0xf0,
Playback_Req = 0xe2,
Playback_Resp = 0xf2,
Loading_Req = 0xe4,
Loading_Resp = 0xf4,
Track_Name_Req = 0xed,
Track_Name_Resp = 0xfd,
// Reports
Playback_Status = 0xf1, // Typically unprompted, sent to Device::STATUS
Loading_Status = 0xf3, // Typically unprompted, sent to Device::STATUS
Report_TOC = 0xf9,
};
// Media functions a source device can perform (ultimately bounded by the Action
// set above).
enum AVCLAN_ENUM_CLASS MediaAction : uint8_t {
Play = 0x01,
Pause = 0x02,
Play_Pause = Play | Pause,
Skip_Forward,
Skip_Backward,
Track_Next,
Track_Prev,
Repeat,
Repeat_Single,
Shuffle,
Volume_Up,
Volume_Down,
};
#ifdef __cplusplus
enum class Device : uint8_t;
// Sentinel for a frame with no owning device.
// Compile-time collision check lives in device.hpp
inline constexpr Device NoDevice = Device{0xFF};
namespace detail {
struct Error {
#endif
// Error enums are ordered such that a lower numeric value corresponds to
// more progress/success before an error occured, with explicitly
// cast/constructed 0 (e.g. `Read{0}` in C++ or `(Read)0` in C) being no
// errors
enum AVCLAN_ENUM_CLASS Read : uint8_t {
BAD_DATA_PARITY = 0x01,
BAD_LENGTH_RANGE,
BAD_LENGTH_PARITY,
BAD_PERIPHERAL_PARITY,
BAD_CONTROLLER_PARITY,
BAD_CONTROL_PARITY,
BAD_PARITY, // generic bad parity has max severity
STARTBIT_MISSED,
STARTBIT_MALFORMED,
STARTBIT_TOO_LONG,
BAD_STARTBIT,
POOL_EMPTY, // non-bus error
};
enum AVCLAN_ENUM_CLASS Send : uint8_t {
NAK_DATA = 0x01,
NAK_MESSAGE_LENGTH,
NAK_CONTROL,
NAK_ADDRESS,
NAK, // generic NAK has max severity
BUSY,
MUTED,
};
enum AVCLAN_ENUM_CLASS Parse : uint8_t {
TOO_SHORT = 0x01,
MISMATCH_LENGTH,
LENGTH_TOO_BIG,
};
#ifdef __cplusplus
};
struct SendError {
Device owning_device;
uint8_t reaction;
Error::Send err;
};
#endif
enum AVCLAN_ENUM_CLASS Bit : uint8_t {
bit_zero = 0x00,
bit_one = 0x01,
bit_start = 0x10
};
#ifdef __cplusplus
} // namespace detail
} // namespace avclan
#endif
#undef AVCLAN_ENUM_CLASS
+433
View File
@@ -0,0 +1,433 @@
// copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>
// copyright (C) 2007 Louis Frigon
// Copyright (C) 2015 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
/*
AVC LAN Frame Format
│ Bits │ Description
────────────────────────────────────────
| 1 │ Start bit
| 1 │ Direct/broadcast
| 12 │ Controller address
| 1 │ Parity
| 12 │ Peripheral address
| 1 │ Parity
| 1 │ *Acknowledge* (read below)
| 4 │ Control
| 1 │ Parity
| 1 │ *Acknowledge*
| 8 │ Message length (n)
| 1 │ Parity
| 1 │ *Acknowledge*
────────
| 8 │ Data
| 1 │ Parity
| 1 │ *Acknowledge*
*repeat `n` times*
No acknowledge bits are sent for broadcast frames.
*/
#include <concepts>
#include <cstdio>
#include <memory>
#include <new>
#include "avclan.h"
#include "bus.hpp"
#include "frame.hpp"
#include "hal/phy.h"
#include "stdshim.hpp"
namespace {
using Read = avclan::detail::Error::Read;
using Send = avclan::detail::Error::Send;
using Bit = avclan::detail::Bit;
struct trailer_bits_t {};
struct no_parity_t : trailer_bits_t {}; // raw bits (the broadcast bit)
struct with_parity_t : trailer_bits_t {}; // bits + parity (controller address)
struct with_ack_t : trailer_bits_t {
}; // bits + parity + ACK slot (all other fields)
inline constexpr no_parity_t no_parity{};
inline constexpr with_parity_t with_parity{};
inline constexpr with_ack_t with_ack{};
} // namespace
namespace avclan {
class Bus::Handle {
// A live handle exclusively borrows the Bus for the duration of a
// transaction; holding the reference is what forces `get()` (and thus
// `read`/`send`) to require a mutable Bus, even though the bus hardware
// itself is reached through free `phy_*` functions.
Bus &bus_;
explicit Handle(Bus &bus) : bus_{bus} { phy_guard_enter(); };
friend Bus;
public:
~Handle() { phy_guard_leave(); };
Handle(const Handle &) = delete;
Handle(Handle &&) = delete;
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
Send sendstartbit() { return phy_send_startbit(); };
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
Read readstartbit() { return phy_read_startbit(); };
template <auto N, std::unsigned_integral T,
std::derived_from<trailer_bits_t> Trailer>
requires(sizeof(T) < 3 && N < 16 && !std::same_as<Trailer, with_ack_t>)
Send send(T bits, Trailer /*tag*/) {
const Bit parity = sendbits<N>(bits);
if constexpr (std::is_same_v<Trailer, with_parity_t>)
sendbits<1>(to_underlying(parity));
return Send{0};
};
template <auto N, std::unsigned_integral T>
requires(sizeof(T) < 3 && N < 16)
Send send(T bits, with_ack_t /*tag*/, bool expect_ack) {
send<N>(bits, with_parity);
if (expect_ack)
return read_ACK();
sendbits<1>(1U); // still need to fill the ack bit slot
return Send{0};
};
template <auto N, std::unsigned_integral T,
std::derived_from<trailer_bits_t> Trailer>
requires(sizeof(T) < 3 && N < 16 && !std::same_as<Trailer, with_ack_t>)
Read read(T *bits, Trailer /*tag*/) {
const Bit calc_parity = readbits<N>(bits);
if constexpr (std::is_same_v<Trailer, with_parity_t>) {
uint8_t read_parity;
readbits<1>(&read_parity);
if (to_underlying(calc_parity) != read_parity)
return Read::BAD_PARITY;
}
return Read{0};
};
template <auto N, std::unsigned_integral T, class F>
requires(sizeof(T) < 3 && N < 16)
Read read(T *bits, with_ack_t /*tag*/, F &&ack) {
if (read<N>(bits, with_parity) == Read::BAD_PARITY)
return Read::BAD_PARITY;
if (ack()) {
send_ACK();
} else {
uint8_t slot;
readbits<1>(&slot);
}
return Read{0};
};
template <auto N, std::unsigned_integral T>
requires(sizeof(T) < 3 && N < 16)
Read read(T *bits, with_ack_t /*tag*/, bool ack) {
return read<N>(bits, with_ack, [=]() { return ack; });
}
private:
static void send_ACK() { phy_send_ack(); };
static Send read_ACK() { return phy_read_ack(); };
template <auto N, class T> Bit sendbits(T bits);
template <auto N, class T> Bit readbits(T *bits);
template <auto N>
requires(N > 1 && N < 8)
Bit sendbits(uint8_t bits) {
return phy_send_bits_u8(&bits, N);
};
template <auto N>
requires(N <= 16)
Bit sendbits(uint16_t bits) {
return phy_send_bits_u16(&bits, N);
};
template <auto N>
requires(N < 8)
Bit readbits(uint8_t *bits) {
return static_cast<Bit>(phy_read_bits_u8(bits, N));
};
template <auto N>
requires(N <= 16)
Bit readbits(uint16_t *bits) {
return static_cast<Bit>(phy_read_bits_u16(bits, N));
};
};
template <> inline Bit Bus::Handle::sendbits<8>(uint8_t bits) {
return phy_send_byte(&bits);
};
template <> inline Bit Bus::Handle::sendbits<1>(uint8_t bits) {
const Bit bit{static_cast<Bit>(bits & 1U)};
phy_send_bit(bit);
return bit;
};
template <> inline Bit Bus::Handle::readbits<8>(uint8_t *bits) {
return phy_read_byte(bits);
};
void Bus::init() {
// Idempotent: the single Bus is shared by reference, so every Peripheral's
// ctor calls init() on it — but the hardware must be brought up exactly once
// (phy_init is not assumed re-entrant/idempotent).
if (inited_)
return;
phy_init();
muted_ = false; // phy_init leaves the bus TX unmuted
inited_ = true;
};
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
bool Bus::is_active() const { return phy_active(); };
void Bus::mute(bool mute) {
phy_mute(mute);
muted_ = mute; // Only update muted_ *AFTER* hardware has finished muting
};
auto Bus::read(uint16_t address, Frame::Print print)
-> expected<std::unique_ptr<Frame>, Error::Read> {
struct errtype {
Read errno;
uint16_t val;
} err = {};
using enum Read;
std::unique_ptr<Frame> in(new (std::nothrow) Frame);
if (!in) {
err.errno = POOL_EMPTY;
goto handle_err;
}
{ // bound handle lifetime
auto handle = get();
bool shouldACK = false;
uint8_t tmp = 0;
err.errno = handle.readstartbit();
if (err.errno != Read{0})
goto handle_err;
handle.read<1>(&tmp, no_parity);
in->is_unicast = (tmp != 0U);
if (auto rerr = handle.read<12>(&in->controller_addr, with_parity);
rerr == BAD_PARITY) {
err.errno = BAD_CONTROLLER_PARITY;
if (print.verbose)
err.val = in->controller_addr;
goto handle_err;
}
// Using lambda for delayed evaluation of peripheral_addr field
// deref, which will be written by the time the lambda is evaluated
auto should_ack_lambda = [&]() {
shouldACK = !is_muted() && (in->peripheral_addr == address);
return shouldACK;
};
if (auto rerr =
handle.read<12>(&in->peripheral_addr, with_ack, should_ack_lambda);
rerr == BAD_PARITY) {
err.errno = BAD_PERIPHERAL_PARITY;
if (print.verbose)
err.val = in->peripheral_addr;
goto handle_err;
}
if (auto rerr = handle.read<4>(&in->control, with_ack, shouldACK);
rerr == BAD_PARITY) {
err.errno = BAD_CONTROL_PARITY;
if (print.verbose)
err.val = in->control;
goto handle_err;
}
if (auto rerr = handle.read<8>(&in->length, with_ack, shouldACK);
rerr == BAD_PARITY) {
err.errno = BAD_LENGTH_PARITY;
if (print.verbose)
err.val = in->length;
goto handle_err;
}
if (in->length == 0 || in->length > Frame::MAXLENGTH) {
err.errno = BAD_LENGTH_RANGE;
err.val = in->length;
goto handle_err;
}
for (uint8_t i = 0; i < in->length; i++) {
if (auto rerr = handle.read<8>(&in->data[i], with_ack, shouldACK);
rerr == BAD_PARITY) {
err.errno = BAD_DATA_PARITY;
if (print.verbose)
err.val = in->data[i];
goto handle_err;
}
}
} // destroy handle
if (false) { // NOLINT(readability-simplify-boolean-expr)
handle_err:;
fputs("ERR(read): ", stdout);
switch (err.errno) {
case POOL_EMPTY: puts("failed Frame alloc"); break;
case BAD_STARTBIT: fputs("bad start bit (other)", stdout); break;
case STARTBIT_MISSED: fputs("missed start bit", stdout); break;
case STARTBIT_MALFORMED:
fputs("malformed start bit (external cause)", stdout);
break;
case STARTBIT_TOO_LONG: fputs("bad start bit (long)", stdout); break;
case BAD_CONTROLLER_PARITY:
fputs("reading controller addr.", stdout);
goto VERBOSE;
case BAD_PERIPHERAL_PARITY:
fputs("reading peripheral addr.", stdout);
goto VERBOSE;
case BAD_CONTROL_PARITY: fputs("reading control", stdout); goto VERBOSE;
case BAD_LENGTH_PARITY: fputs("reading length", stdout); goto VERBOSE;
case BAD_LENGTH_RANGE: printf("bad length 0x%02X:", err.val); break;
case BAD_DATA_PARITY: fputs("reading data", stdout); goto VERBOSE;
case BAD_PARITY:
__builtin_unreachable();
VERBOSE:
if (print.verbose) {
printf("; read 0x%02X:", err.val);
}
}
putchar('\n');
}
// Only print if some data has been correctly received
if (print.print && (err.errno < STARTBIT_MISSED)) {
if (err.errno > BAD_DATA_PARITY)
in->length = 0;
in->print(print);
}
if (err.errno != Read{0})
return unexpected(err.errno);
return in;
}
auto Bus::send(const Frame &out, Frame::Print print) -> Send {
struct errtype {
// Error enum is ordered such that a lower numeric value corresponds to
// more success
Send errno;
uint8_t val;
} err = {};
using enum Send;
if (is_muted()) {
err.errno = MUTED;
goto handle_err;
}
{ // bound handle lifetime
auto handle = get();
if (handle.sendstartbit() == BUSY) {
// Some other device is already driving the bus
err.errno = BUSY;
goto handle_err;
}
handle.send<1>(static_cast<uint8_t>(out.is_unicast), no_parity);
handle.send<12>(out.controller_addr, with_parity);
if (auto serr =
handle.send<12>(out.peripheral_addr, with_ack, out.is_unicast);
serr == NAK) {
err.errno = NAK_ADDRESS;
goto handle_err;
}
if (auto serr = handle.send<4>(out.control, with_ack, out.is_unicast);
serr == NAK) {
err.errno = NAK_CONTROL;
goto handle_err;
}
if (auto serr = handle.send<8>(out.length, with_ack, out.is_unicast);
serr == NAK) {
err.errno = NAK_MESSAGE_LENGTH;
goto handle_err;
}
for (uint8_t i = 0; i < out.length; i++) {
// Based on the µPD6708 datasheet, ACK bit for broadcast doesn't seem
// necessary (i.e. This deviates from the previous broadcast specific
// function that sent an extra `1` bit after each byte/parity)
// Explanation for why audio-group broadcast state report isn't working?
if (auto serr = handle.send<8>(out.data[i], with_ack, out.is_unicast);
serr == NAK) {
err.errno = NAK_DATA;
err.val = i;
goto handle_err;
}
}
} // destroy handle
// back to read mode
if (false) { // NOLINT(readability-simplify-boolean-expr)
handle_err:;
fputs("Error", stdout);
switch (err.errno) {
case MUTED: fputs(": Device muted", stdout); break;
case BUSY: fputs(": Busy bus", stdout); break;
case NAK_ADDRESS:
case NAK_CONTROL:
case NAK_MESSAGE_LENGTH:
case NAK_DATA:
case NAK:
fputs(" NAK: ", stdout);
switch (err.errno) {
case NAK_ADDRESS: fputs("address", stdout); break;
case NAK_CONTROL: fputs("Control", stdout); break;
case NAK_MESSAGE_LENGTH: fputs("Message length", stdout); break;
case NAK_DATA: printf(" data[%u]", err.val); break;
case NAK:
case MUTED:
case BUSY: __builtin_unreachable();
}
break;
}
putchar('\n');
}
if (print.print)
out.print(print);
return err.errno;
}
Bus::Handle Bus::get() { return Handle{*this}; };
#if !defined(NDEBUG) && defined(MEASURE_BUS)
// Debug bit-timing measurement on the one physical bus; instance-scoped for the
// same reason as is_active().
// NOLINTNEXTLINE(readability-convert-member-functions-to-static)
void Bus::measure() { phy_measure(); }
#endif
} // namespace avclan
+95
View File
@@ -0,0 +1,95 @@
// copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>
// copyright (C) 2007 Louis Frigon
// Copyright (C) 2015 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
/*
AVC LAN Theory
The AVC LAN bus is an implementation of the IEBus (mode 1) which is a
differential signal; IEBus is electrically (but not logically) compatible with
CAN bus.
- Logical `1`: Potential difference between bus lines (BUS+ pin and BUS pin)
is 20 mV or lower (floating).
- Logical `0`: Potential difference between bus lines (BUS+ pin and BUS pin)
is 120 mV or higher (driving).
A nominal bit length is 39 us, composed of 3 periods: preparation,
synchronization, data.
Figure 1. AVCLAN Bus bit format
│ Prep │<─ Sync ─>│<─ Data ─>│ ...
Driving (logical `0`) ╭──────────╮──────────╮
│ │ │
Floating (logical `1`) ─────────╯ ╰──────────╰─────────
│ 6 μs │── 19 μs ─│─ 13 μs ──│
The logical value during the data period signifies the bit value, e.g. a bit
`0` continues the logical `0` (high potential difference between bus lines) of
the sync period thru the data period, and a bit `1` has a logical `1`
(low/floating potential between bus lines) during the data period. Using the
TCB pulse-width and frequency measure mode, the total bit length differs for
bit `1` and `0`; detailed bit timing can be found in "timing.h". The bus
idles at low potential (floating).
A start bit is nominally 169 us high followed by 20 us low.
A bit `0` is dominant on the bus, which is a design choice that affects
bit/interpretation:
- Low addresses have priority upon transmission conflicts
- The broadcast bit is `1` (floating, no effort) for normal communication
- For acknowledge bits, the receiver extends the logical '0' of the sync
period to the length of a normal bit `0`. Hence, a NAK (bit `1`) is
literally the absence of an ACK.
*/
#pragma once
#include <cstdint>
#include <memory>
#include "avclan.h"
#include "frame.hpp"
#include "stdshim.hpp"
namespace avclan {
class Bus {
public:
using Error = detail::Error;
// There is exactly one physical bus (the HAL `phy_*` layer is a singleton).
// `Bus` models that single hardware instance: it is owned once and shared by
// reference (e.g. multiple `Peripheral`s hold a `Bus &`), never copied — a
// copy would fork `muted_`, which must stay coherent with the one hardware
// TX state.
Bus() = default;
Bus(const Bus &) = delete;
Bus &operator=(const Bus &) = delete;
void init();
bool is_active() const;
void mute(bool mute);
bool is_muted() const { return muted_; };
#ifndef NDEBUG
void measure();
#endif
expected<std::unique_ptr<Frame>, Error::Read> read(uint16_t address,
Frame::Print print);
Error::Send send(const Frame &out, Frame::Print print);
private:
class Handle;
Handle get();
// Assume mute after default ctor; only viable after init call
bool muted_ = true;
bool inited_ = false;
};
} // namespace avclan
+451
View File
@@ -0,0 +1,451 @@
// copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>
// copyright (C) 2007 Louis Frigon
// Copyright (C) 2015 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include <cstdint>
#include <cstring>
#include <memory>
#include "avclan.h"
#include "cdchanger.hpp"
#include "device.hpp"
#include "frame.hpp"
#include "hal/cd_timer.h"
#include "hal/media.h"
namespace {
using namespace avclan;
constexpr uint8_t cdloading_resp[] = {to_underlying(Device::CD_CHANGER),
to_underlying(Device::STATUS),
to_underlying(Action::Loading_Status),
0x00,
0x01,
0x00,
0x01,
0x00,
0x01,
0x02};
constexpr int WIRE_SIZE = 8; // cd state report size in bytes
constexpr int TIME_SKIP = 15; // seconds
constexpr int TWODIGIT_MAX = 99;
/* Pack a 0TWODIGIT_MAX count into 2-digit BCD. Values >TWODIGIT_MAX (sentinels
such as 0xFF / 0x7F meaning "no time") pass through unchanged so they survive
the wire round-trip. */
constexpr uint8_t toBCD(uint8_t val) {
if (val > TWODIGIT_MAX)
return val;
return (uint8_t)(((val / 10) << 4) | (val % 10));
}
extern "C" void incrementTime_callback(void *self) {
static_cast<avclan::CDChanger *>(self)->incrementTime();
}
extern "C" bool isPlaying_callback(void *self) {
return static_cast<avclan::CDChanger *>(self)->isPlaying();
}
} // namespace
namespace avclan {
void CDChanger::init() {
media_init();
cdtimer_init(this, &incrementTime_callback, &isPlaying_callback);
}
void CDChanger::handle(const Frame &in, Frame &out) {
if (in.length < 4)
return; // [Currently known] valid CDChanger frames have at least 4 bytes
const uint8_t *data = &in.data[1];
const auto from = static_cast<Device>(*data++);
/* const auto to = */ data++;
const auto action = static_cast<Action>(*data++);
static const uint8_t function_change_resp[] = {
0x00, to_underlying(Device::CD_CHANGER), 0xFF, 0xFF, 0x01};
using enum Action;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-enum"
// Unicast to CD changer: bytes are (0x00, from, to, action, [extra...]).
switch (action) {
case Enable_Function_Req:
out.is_unicast = true;
out.length = sizeof(function_change_resp);
memcpy(out.data, function_change_resp, sizeof(function_change_resp));
out.data[2] = to_underlying(from);
out.data[3] = to_underlying(Enable_Function_Resp);
state = 0;
flags2 = 0x80;
out.reaction = r_StatusReport;
break;
case Disable_Function_Req:
// Head unit always expects a response, but the state change can be
// conditional
out.is_unicast = true;
out.length = sizeof(function_change_resp);
memcpy(out.data, function_change_resp, sizeof(function_change_resp));
out.data[2] = to_underlying(from);
out.data[3] = to_underlying(Disable_Function_Resp);
if (isPlaying()) {
stopPlaying();
state = 0;
flags2 = 0x80;
out.reaction = r_StatusReport;
} else
out.reaction = r_SendOnly;
break;
case Eject: {
// "Eject" label is multiply wrong; proper meaning unclear:
// - First observed on initial multiple presses of "CD" button,
// triggering (after {0x00, Device::CD_CHANGER, Device::COMM_v1,
// Insertion, 0x01} response) proper activation of
// mockingboard/cd-changer.
// - Subsequently observed when pressing (technically
// releasing?) the fast-forward button and rewind
if (static_cast<bool>(state & SEEKING)) { // FF/RW button released
state &= ~SEEKING;
} else {
out.is_unicast = true;
{
const uint8_t msg[] = {0x00, to_underlying(Device::CD_CHANGER),
to_underlying(Device::CMD_SW),
to_underlying(Insertion), 0x01};
out.length = sizeof(msg);
memcpy(out.data, msg, sizeof(msg));
}
out.reaction = r_SendOnly;
}
break;
}
case Initial_Report_Req: {
out.is_unicast = true;
// No knowledge/understanding of field meaning/interpretation
const uint8_t cdinitreport_resp[] = {0x00,
to_underlying(Device::CD_CHANGER),
to_underlying(from),
to_underlying(Initial_Report_Resp),
0x01,
0x31,
0x10,
0x01,
0x01};
out.length = sizeof(cdinitreport_resp);
memcpy(out.data, cdinitreport_resp, sizeof(cdinitreport_resp));
out.reaction = r_SendOnly;
break;
}
case Playback_Req:
out.data[0] = 0x00;
out.data[1] = to_underlying(Device::CD_CHANGER);
out.data[2] = to_underlying(from);
out.data[3] = to_underlying(Playback_Resp);
out.length = WIRE_SIZE + 4;
serialize(&out.data[4]);
out.is_unicast = true;
out.reaction = r_SendOnly;
break;
case Loading_Req:
out.data[0] = 0x00;
out.length = sizeof(cdloading_resp) + 1;
memcpy(&out.data[1], cdloading_resp, sizeof(cdloading_resp));
out.data[2] = to_underlying(from);
out.data[3] = to_underlying(Loading_Resp);
out.is_unicast = true;
out.reaction = r_SendOnly;
break;
case Track_Seek_Up:
state = SEEKING_TRACK;
if (track < 98)
++track;
else
track = 1;
mins = 0xff;
secs = 0x7f;
flags2 = 0xc0;
generateStatus(out, true, Device::CMD_SW);
media_action(MediaAction::Track_Next);
out.reaction = r_TrackChange;
break;
case Track_Seek_Down:
state = SEEKING_TRACK;
// Track down returns to track beginning if in ~middle of song
if (mins == 0 && secs < 5) {
if (track > 1)
--track;
else
track = TWODIGIT_MAX;
media_action(MediaAction::Track_Prev);
}
mins = 0xff;
secs = 0x7f;
flags2 = 0xc0;
generateStatus(out, true, Device::CMD_SW);
out.reaction = r_TrackChange;
break;
case Track_Fast_Forward: {
state |= SEEKING;
secs += TIME_SKIP;
if (secs > 59) {
secs -= 60;
++mins;
}
generateStatus(out, true, Device::CMD_SW);
media_action(MediaAction::Skip_Forward);
cdtimer_reset(); // Skipped to a whole/round sec; ensure next tick
// is ~1 sec from now
out.reaction = r_SendOnly;
break;
}
case Track_Rewind: {
state |= SEEKING;
if (secs < TIME_SKIP) {
if (mins > 0) {
const uint8_t dif = TIME_SKIP - secs;
secs = 60 - dif;
--mins;
} else {
mins = 0;
secs = 0;
}
} else
secs -= TIME_SKIP;
generateStatus(out, true, Device::CMD_SW);
media_action(MediaAction::Skip_Backward);
cdtimer_reset(); // Skipped to a whole/round sec; ensure next tick
// is ~1 sec from now
out.reaction = r_SendOnly;
break;
}
case CD_Enable_Random:
flags |= RANDOM;
generateStatus(out, true, Device::CMD_SW);
out.reaction = r_StatusReport;
break;
case CD_Disable_Random:
flags &= ~RANDOM;
generateStatus(out, true, Device::CMD_SW);
out.reaction = r_StatusReport;
break;
case CD_Enable_Repeat:
flags |= REPEAT;
generateStatus(out, true, Device::CMD_SW);
out.reaction = r_StatusReport;
break;
case CD_Disable_Repeat:
flags &= ~REPEAT;
generateStatus(out, true, Device::CMD_SW);
out.reaction = r_StatusReport;
break;
case CD_Enable_Disk_Random:
flags |= DISK_RANDOM;
generateStatus(out, true, Device::CMD_SW);
out.reaction = r_StatusReport;
break;
case CD_Disable_Disk_Random:
flags &= ~DISK_RANDOM;
generateStatus(out, true, Device::CMD_SW);
out.reaction = r_StatusReport;
break;
case CD_Enable_Disk_Repeat:
flags |= DISK_REPEAT;
generateStatus(out, true, Device::CMD_SW);
out.reaction = r_StatusReport;
break;
case CD_Disable_Disk_Repeat:
flags &= ~DISK_REPEAT;
generateStatus(out, true, Device::CMD_SW);
out.reaction = r_StatusReport;
break;
default: break;
}
#pragma GCC diagnostic pop
}
std::unique_ptr<Frame> CDChanger::react(
expected<std::unique_ptr<Frame>, detail::SendError> exp) {
if (!exp) {
if (exp.error().reaction == to_underlying(r_StateReport) &&
exp.error().err == detail::Error::Send::NAK_ADDRESS &&
++failedStatusReports > 1) {
failedStatusReports = 0;
stopPlaying(); // Disable periodic updates if e.g. no-one's
// listening (car was turned off?)
}
} else {
auto out = std::move(exp.value());
auto resp = static_cast<reaction_t>(out->reaction);
out->reaction = r_Nothing;
switch (resp) {
case r_Ejection: {
const uint8_t play[] = {0x00,
to_underlying(Device::COMM_CTRL),
to_underlying(Device::COMMUNICATION_V1),
to_underlying(Action::Insertion),
to_underlying(Device::CD_CHANGER),
0x01};
out->length = sizeof(play);
memcpy(out->data, play, sizeof(play));
}
out->reaction = r_Report_Load;
break;
case r_Report_Load:
out->is_unicast = false;
out->peripheral_addr = 0x1FF;
out->length = sizeof(cdloading_resp) + 1;
memcpy(out->data, cdloading_resp, sizeof(cdloading_resp));
out->data[1] = to_underlying(Device::STATUS);
out->data[2] = to_underlying(Action::Loading_Status);
out->reaction = r_SendOnly;
break;
case r_TrackChange:
setTime(0, 0);
cdtimer_reset(); // Skipped to a whole/round sec; ensure next tick is
// ~1 sec from now
[[fallthrough]];
case r_NormalizeState:
normalizeState();
generateStatus(*out, false, Device::STATUS);
out->reaction = r_SendOnly;
break;
case r_StartPlaying:
normalizeState();
generateStatus(*out, false, Device::STATUS);
out->reaction = r_BeganPlaying;
break;
case r_BeganPlaying:
startPlaying(); // only start PIT after normalizing state
out->reaction = r_Nothing;
break;
case r_StatusReport:
generateStatus(*out, false, Device::STATUS);
out->reaction = r_SendOnly;
break;
case r_StateReport: [[fallthrough]];
case r_SendOnly: [[fallthrough]];
case r_Nothing: [[fallthrough]];
default: break;
}
if (out->reaction > r_Nothing)
return out;
}
return {};
}
void CDChanger::enable(Frame &out) {
if (!isPlaying()) {
if (mins > TWODIGIT_MAX)
mins = 0;
if (secs > TWODIGIT_MAX)
secs = 0;
state = SEEKING | SEEKING_TRACK;
flags2 = 0xc0;
generateStatus(out, false, Device::STATUS);
out.reaction = r_StartPlaying;
}
}
bool CDChanger::pending() { return cdtimer_pending(); }
void CDChanger::emit(Frame &out) {
generateStatus(out, false, Device::STATUS);
out.reaction = r_StateReport;
cdtimer_clear();
}
bool CDChanger::isPlaying() const { return playing; }
// Sets CD_mode to play and resets timer count (so that the next interrupt is in
// 1 sec)
void CDChanger::startPlaying() {
static bool havePlayed = false;
if (havePlayed)
media_action(MediaAction::Play);
havePlayed |= true;
playing = true;
cdtimer_reset();
}
void CDChanger::stopPlaying() {
cdtimer_disable();
playing = false;
media_action(MediaAction::Pause);
}
// Serialize cd_status into the wire format.
// track/mins/secs, need converted from decimal to BCD
void CDChanger::serialize(uint8_t *dst) const {
*dst++ = cds;
*dst++ = state;
*dst++ = disc;
*dst++ = toBCD(track);
*dst++ = toBCD(mins);
*dst++ = toBCD(secs);
*dst++ = flags;
*dst++ = flags2;
}
void CDChanger::setTime(uint8_t min, uint8_t sec) {
mins = min;
secs = sec;
}
void CDChanger::incrementTime() {
// Sentinel values (>TWODIGIT_MAX) mean "no time"; leave them alone until
// setTime() replaces them with a real count.
if (secs > TWODIGIT_MAX)
return;
if (secs == 59) {
secs = 0;
if (mins == TWODIGIT_MAX)
mins = 0;
else
mins++;
} else
secs++;
}
// Used for changed status messages
void CDChanger::generateStatus(Frame &status, bool is_unicast,
Device to) const {
status.is_unicast = is_unicast;
if (!is_unicast)
status.peripheral_addr = 0x1FF;
status.control = 0xF;
status.length = WIRE_SIZE + ((is_unicast) ? 4 : 3);
uint8_t *data = status.data;
if (is_unicast)
*data++ = 0x00;
*data++ = to_underlying(Device::CD_CHANGER);
*data++ = to_underlying(to);
*data++ = to_underlying(Action::Playback_Status);
serialize(data);
}
void CDChanger::normalizeState() {
if (mins > TWODIGIT_MAX)
mins = 0;
if (secs > TWODIGIT_MAX)
secs = 0;
state = PLAYBACK;
flags &= (uint8_t)~(DISK_SCAN | SCAN);
flags2 = 0x80;
}
#ifndef NDEBUG
void CDChanger::media_action(MediaAction action) { ::media_action(action); }
bool CDChanger::media_busy() const { return ::media_busy(); };
void CDChanger::mic_toggle() { media_mic_toggle(); };
#endif
} // namespace avclan
+99
View File
@@ -0,0 +1,99 @@
// copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>
// copyright (C) 2007 Louis Frigon
// Copyright (C) 2015 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <cstdint>
#include <memory>
#include "avclan.h"
#include "device.hpp"
#include "frame.hpp"
namespace avclan {
class CDChanger {
public:
enum State : uint8_t {
OPEN = 0x01,
ERR1 = 0x02,
SEEKING = 0x08,
PLAYBACK = 0x10,
SEEKING_TRACK = 0x20,
LOADING = 0x80,
};
enum CD : uint8_t {
CD1 = 1 << 0,
CD2 = 1 << 1,
CD3 = 1 << 2,
CD4 = 1 << 3,
CD5 = 1 << 4,
CD6 = 1 << 5,
};
enum Flags : uint8_t {
DISK_RANDOM = 1 << 1,
RANDOM = 1 << 2,
DISK_REPEAT = 1 << 3,
REPEAT = 1 << 4,
DISK_SCAN = 1 << 5,
SCAN = 1 << 6,
};
/// Message state machine
// - r_Nothing (0x00) means don't send current message
// - All other instances mean send current message and imply the presence of
// follow-up messages within state machine
enum reaction_t : uint8_t {
r_Nothing = 0x00,
r_SendOnly, // No further follow-up needed (beyond sending current)
r_StatusReport, // Needs follow-up status report
r_NormalizeState, // cd_status needs normalized and resent
r_StartPlaying, // ~equivalent to normalizeState, but cycles to BeganPlaying
r_BeganPlaying,
r_TrackChange, // Time needs reset
r_Ejection,
r_Report_Load,
r_StateReport, // *IS* a status report (follow-up or unprompted)
};
static constexpr Device id = Device::CD_CHANGER;
void init();
void handle(const Frame &in, Frame &out);
std::unique_ptr<Frame>
react(expected<std::unique_ptr<Frame>, detail::SendError> exp);
void enable(Frame &out);
void disable(Frame &out);
static bool pending();
void emit(Frame &out);
void incrementTime();
bool isPlaying() const;
#ifndef NDEBUG
void media_action(MediaAction action);
bool media_busy() const;
void mic_toggle();
#endif
private:
void startPlaying();
void stopPlaying();
void serialize(uint8_t *dst) const;
void setTime(uint8_t mins, uint8_t secs);
void generateStatus(Frame &status, bool is_unicast, Device to) const;
void normalizeState();
bool playing = false;
int failedStatusReports = 0;
uint8_t cds = CD1;
uint8_t state = SEEKING | SEEKING_TRACK;
uint8_t disc = 1;
uint8_t track = 1; // Decimal storage; serialize to BCD
uint8_t mins = 0xFF; // Decimal storage; serialize to BCD
uint8_t secs = 0x7F; // Decimal storage; serialize to BCD
uint8_t flags = 0;
uint8_t flags2 = 0xC0;
};
} // namespace avclan
+66
View File
@@ -0,0 +1,66 @@
// copyright (C) 2026 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <concepts>
#include <cstdint>
#include <memory>
#include "avclan.h"
#include "frame.hpp"
#include "stdshim.hpp"
namespace avclan {
enum class Device : uint8_t {
LAN = 0x00,
COMM_CTRL = 0x01,
COMMUNICATION_V1 = 0x11,
COMMUNICATION_V2 = 0x12,
SW_AUDIO = 0x21,
SW_NAME = 0x23,
SW_CONVERTING = 0x24,
CMD_SW = 0x25,
STATUS = 0x31,
INFO_DISPLAY2 = 0x32,
BEEP_HU = 0x28,
BEEP_SPEAKERS = 0x29,
FRONT_PSNG_MONITOR = 0x34,
CD_CHANGER2 = 0x43,
BLUETOOTH_TEL = 0x55,
INFO_DRAWING = 0x56,
NAV_ECU = 0x58,
CAMERA = 0x5C,
CLIMATE_DRAWING = 0x5D,
AUDIO_DRAWING = 0x5E,
TRIP_INFO_DRAWING = 0x5F,
TUNER = 0x60,
TAPE_DECK = 0x61,
CD_SINGLE = 0x62,
CD_CHANGER = 0x63,
AUDIO_AMP = 0x74,
GPS = 0x80,
VOICE_CTRL = 0x85,
XM_TUNER = 0xC0,
CLIMATE_CTRL_DEV = 0xE0,
TRIP_INFO = 0xE5,
};
template <class T>
concept DeviceInterface =
requires { std::integral_constant<Device, T::id>{}; } &&
requires(T dev, const Frame &in, Frame &out,
expected<std::unique_ptr<Frame>, detail::SendError> exp) {
dev.init();
dev.handle(in, out);
dev.enable(out);
{
dev.react(std::move(exp))
} -> std::same_as<std::unique_ptr<Frame>>;
{ dev.pending() } -> std::convertible_to<bool>;
// Devices must clear `pending()` after `emit()` is called
dev.emit(out);
};
} // namespace avclan
+156
View File
@@ -0,0 +1,156 @@
// copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>
// copyright (C) 2007 Louis Frigon
// Copyright (C) 2015 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#include <cstdint>
#include <cstdio>
#include <cstring>
#include "frame.hpp"
#if defined(AVCLAN_FRAME_POOL_N)
#include <array>
#include <cstddef>
#include <limits>
#include <new>
namespace {
template <class T, std::uint8_t N>
requires(N >= 1 && N <= std::numeric_limits<uint8_t>::max())
class Pool {
public:
constexpr Pool() {
for (uint8_t i = 0; i < N; ++i)
ptrs_[i] = &storage_[i];
}
T *acquire() {
if (top_ == 0)
return nullptr;
return ptrs_[--top_];
}
void release(T *ptr) {
// Properly would need an origin check/confirmation if this was used more
// generally
ptrs_[top_++] = ptr;
}
private:
std::array<T, N> storage_;
std::array<T *, N> ptrs_;
uint8_t top_ = N;
};
Pool<avclan::Frame, AVCLAN_FRAME_POOL_N> pool;
} // namespace
#endif
namespace {
using Error = avclan::detail::Error;
using enum Error::Parse;
} // namespace
namespace avclan {
#if defined(AVCLAN_FRAME_POOL_N)
void *Frame::operator new(std::size_t /*count*/,
const std::nothrow_t & /*tag*/) noexcept {
return pool.acquire();
}
// NOLINTNEXTLINE(misc-new-delete-overloads) false-positive
void Frame::operator delete(void *ptr) noexcept {
pool.release(static_cast<Frame *>(ptr));
}
#endif
void Frame::print(Frame::Print print) const {
if (print.binary) {
uint8_t buffer[8];
uint8_t *bptr = buffer;
*bptr++ = 0x10; // Data Link Escape, signaling binary data forthcoming
*bptr++ = static_cast<uint8_t>(is_unicast);
// Send addresses in big-endian order
*bptr++ = static_cast<uint8_t>(controller_addr >> 8);
*bptr++ = static_cast<uint8_t>(controller_addr);
*bptr++ = static_cast<uint8_t>(peripheral_addr >> 8);
*bptr++ = static_cast<uint8_t>(peripheral_addr);
*bptr++ = control;
*bptr++ = length;
fwrite(buffer, 1, 8, stdout);
fwrite(data, 1, length, stdout);
bptr = buffer;
*bptr++ = 0x17; // End of transmission block
*bptr++ = 0x0A; // \n
fwrite(buffer, 1, 2, stdout);
} else {
printf("%X", static_cast<unsigned>(is_unicast));
printf(" 0x%03X", static_cast<unsigned>(controller_addr & 0x0FFF));
printf(" 0x%03X", static_cast<unsigned>(peripheral_addr & 0x0FFF));
printf(" 0x%X", static_cast<unsigned>(control & 0x0F));
printf(" 0x%X", static_cast<unsigned>(length & 0x0F));
for (uint8_t i = 0; i < length; i++) {
printf(" 0x%02X", static_cast<unsigned>(data[i]));
}
putchar('\n');
}
}
Error::Parse Frame::parse(const uint8_t *bytes, uint8_t len) {
struct errtype {
Error::Parse errno;
uint8_t val;
} err = {};
const uint8_t *last = bytes + len;
if (len < Frame::MIN_SIZE) {
err.errno = TOO_SHORT;
goto handle_err;
}
is_unicast = (*bytes++ != 0U);
controller_addr = bytes[0] | ((uint16_t)bytes[1] << 8);
bytes += 2;
peripheral_addr = bytes[0] | ((uint16_t)bytes[1] << 8);
bytes += 2;
control = *bytes++;
length = *bytes++;
if (length > MAXLENGTH) {
err.errno = LENGTH_TOO_BIG;
err.val = length;
goto handle_err;
}
if ((bytes + length) <= last) {
memcpy(data, bytes, length);
} else {
err.errno = MISMATCH_LENGTH;
goto handle_err;
}
if (false) { // NOLINT(readability-simplify-boolean-expr)
handle_err:;
fputs("ERR(parse): ", stdout);
switch (err.errno) {
case TOO_SHORT: puts("not enough bytes too fill AVCLAN frame"); break;
case MISMATCH_LENGTH:
puts("frame->length is longer than remaining data");
break;
case LENGTH_TOO_BIG:
printf("frame->length exceeds MAXLENGTH: 0x%02X\n",
static_cast<unsigned>(err.val));
break;
default: break;
}
}
return err.errno;
}
} // namespace avclan
+53
View File
@@ -0,0 +1,53 @@
// copyright (C) 2006 Marcin Slonicki <marcin@softservice.com.pl>
// copyright (C) 2007 Louis Frigon
// Copyright (C) 2015 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <cstdint>
#include "avclan.h"
#if defined(AVCLAN_FRAME_POOL_N)
#include <cstddef>
#include <new>
#endif
namespace avclan {
enum class Device : uint8_t;
struct Frame {
struct Print {
bool print : 1 = false; // print at all
bool binary : 1 = false; // if printing, format as binary instead of text
bool verbose : 1 = false; // include extra context in error reports
};
using Error = detail::Error;
static constexpr int MAXLENGTH = 32;
static constexpr int MIN_SIZE = 7;
Error::Parse parse(const uint8_t *bytes, uint8_t len);
void print(Print print) const;
#if defined(AVCLAN_FRAME_POOL_N)
// O(1) heapless pooled allocation. Only `new (std::nothrow) Frame` is
// supported.
static void *operator new(std::size_t) = delete;
static void *operator new(std::size_t, const std::nothrow_t &) noexcept;
// NOLINTNEXTLINE(misc-new-delete-overloads) false-positive
static void operator delete(void *) noexcept;
#endif
// reaction has a Device-defined interpretation, with the sole invariant that
// 0 == inactive/non-sendable frame
uint8_t reaction = 0;
Device owning_device = NoDevice;
bool is_unicast;
uint16_t controller_addr; // formerly "master"
uint16_t peripheral_addr; // formerly "slave"
uint8_t control = 0xF;
uint8_t length = 0;
uint8_t data[MAXLENGTH];
};
} // namespace avclan
+19
View File
@@ -0,0 +1,19 @@
// Copyright (C) 2026 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
// Clock setup + GPIO/pin configuration. Call once, first thing at startup
// (before any peripheral init).
void board_init(void);
// Globally enable interrupts. Call after all peripherals are initialized.
void board_enable_interrupts(void);
#ifdef __cplusplus
}
#endif
+32
View File
@@ -0,0 +1,32 @@
// Copyright (C) 2026 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
// CDChanger periodic-timer HAL: the ~1 Hz tick that drives the CD changer's
// status updates. The timer hardware is target-specific; the CD changer owns
// what a tick means (see cdchanger.cc). The device polls cdtimer_pending() and
// clears the tick with cdtimer_clear().
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
// One-time hardware bring-up. Leaves the tick disabled.
void cdtimer_init(void *ptr, void(clbk)(void *), bool(isplay)(void *));
// Reset the count so the next tick is ~1 s out, and enable the tick.
void cdtimer_reset(void);
// Restore / disable the ~1 Hz tick.
void cdtimer_restore(void);
void cdtimer_disable(void);
extern volatile bool cdtimer_pending_flag;
static inline bool cdtimer_pending() { return cdtimer_pending_flag; }
static inline void cdtimer_clear() { cdtimer_pending_flag = false; }
#ifdef __cplusplus
}
#endif
+32
View File
@@ -0,0 +1,32 @@
// Copyright (C) 2026 Allen Hill <allenofthehills@gmail.com>
// SPDX-License-Identifier: GPL-3.0-or-later
// Media-control HAL: emulate head-unit button presses to the audio source. This
// is device functionality (see CDChanger), so this contract is consumed only by
// the device implementation, not the app.
#pragma once
#include "avclan.h"
#ifdef __cplusplus
using MediaAction = avclan::MediaAction;
extern "C" {
#else
typedef enum MediaAction MediaAction;
#endif
// One-time hardware bring-up for the media driver.
void media_init(void);
// Emulate a media function (button press) on the source device.
void media_action(MediaAction fn);
#ifndef NDEBUG
bool media_mic_toggle(void);
bool media_busy(void);
#endif
#ifdef __cplusplus
}
#endif

Some files were not shown because too many files have changed in this diff Show More