├── .gitignore ├── .gitmodules ├── ChangeLog ├── LICENSE ├── README ├── README.rst ├── doc ├── Makefile ├── docker │ └── Dockerfile └── sphinx │ ├── Makefile │ └── source │ ├── armbian.txt │ ├── conf.py │ ├── dut-setup.txt │ ├── hw-overview.txt │ ├── image │ ├── board-addon-left.png │ ├── board-addon-right.png │ ├── board-addon-sample.png │ ├── board-bottom-standrad-connectors.png │ ├── board-dypers.png │ ├── board-eth.png │ ├── board-jumpers.png │ ├── board-other-connectors.png │ ├── board-power.png │ ├── board-r21.png │ ├── board-sd.png │ ├── board-top-standard-connectors.png │ ├── board-uart-rs232.png │ ├── board-uart.png │ ├── board-ui.png │ ├── board-usb.png │ └── hw-overview.svg │ ├── index.txt │ ├── install-sw.txt │ └── project-overview.txt ├── hw ├── MIR │ ├── MIR-cache.lib │ ├── MIR.bck │ ├── MIR.dcm │ ├── MIR.kicad_pcb │ ├── MIR.lib │ ├── MIR.pretty │ │ ├── 403AC.kicad_mod │ │ ├── C_0805.kicad_mod │ │ ├── C_T_0805.kicad_mod │ │ ├── Crystal_SMD_Abracon_ABM3-2pin_5.0x3.2mm_HandSoldering.kicad_mod │ │ ├── DTSM-3.kicad_mod │ │ ├── D_0805.kicad_mod │ │ ├── D_SOD-323_HandSoldering.kicad_mod │ │ ├── EXTERNAL ELEMENT.kicad_mod │ │ ├── HC49USM.kicad_mod │ │ ├── MIR-QRCODE.kicad_mod │ │ ├── Pin_Header_Straight_1x01_Pitch2.54mm.kicad_mod │ │ ├── Pin_Header_Straight_1x02_Pitch2.54mm.kicad_mod │ │ ├── Pin_Header_Straight_1x02_Pitch2.54mm_Molex_022232021.kicad_mod │ │ ├── Pin_Header_Straight_1x15_Pitch2.54mm.kicad_mod │ │ ├── Pin_Header_Straight_2x03_Pitch2.54mm.kicad_mod │ │ ├── Pin_Header_Straight_2x08_Pitch2.54mm.kicad_mod │ │ ├── QFN-16-1EP_4x4mm_Pitch0.65mm.kicad_mod │ │ ├── QFN-32-1EP_5x5mm_Pitch0.5mm.kicad_mod │ │ ├── R_0805.kicad_mod │ │ ├── SOD-503.kicad_mod │ │ ├── SOD-523.kicad_mod │ │ ├── SSOP-28_5.3x10.2mm_Pitch0.65mm.kicad_mod │ │ ├── TQFP-32_7x7mm_Pitch0.8mm.kicad_mod │ │ ├── USB_Micro-B_Molex-105017-0001.kicad_mod │ │ ├── USB_Mini_SMD.kicad_mod │ │ └── WQFN-32-1EP_5x5mm_Pitch0.5mm.kicad_mod │ ├── MIR.pro │ ├── MIR.sch │ ├── MIR.xml │ ├── README.rst │ ├── fp-info-cache │ ├── fp-lib-table │ ├── qrcode.png │ └── sym-lib-table ├── MuxPi add-on template │ ├── MuxPi_addon.lib │ ├── MuxPi_addon_template.kicad_pcb │ ├── MuxPi_addon_template.pro │ ├── MuxPi_addon_template.sch │ └── sym-lib-table └── MuxPi │ ├── Dutpower.sch │ ├── Dutuart.sch │ ├── Dyper.sch │ ├── EThernet.sch │ ├── Hdmi.sch │ ├── Microcontroller.sch │ ├── MuxPi-cache.lib │ ├── MuxPi.kicad_pcb │ ├── MuxPi.lib │ ├── MuxPi.pro │ ├── MuxPi.sch │ ├── NanoPi.sch │ ├── Power.sch │ ├── README │ ├── README.rst │ ├── SDMux.sch │ ├── SDReader.sch │ ├── changelog.txt │ ├── lthor.sch │ └── sym-lib-table └── sw ├── MuxPi-addons └── MIR │ ├── Arduino │ └── Mir.ino │ ├── NanoPi │ ├── demo │ │ ├── demo_common.sh │ │ ├── demo_deep_sleep.sh │ │ ├── demo_factory_reset.sh │ │ ├── demo_hdmi.sh │ │ ├── demo_menu.sh │ │ ├── demo_movie.sh │ │ └── exp_codes │ └── flash.sh │ ├── README.rst │ └── format │ ├── __init__.py │ ├── codeformatter.py │ └── translate.py ├── control ├── FreeRTOS │ └── Source │ │ ├── MemMang │ │ ├── ReadMe.url │ │ └── heap_1.c │ │ ├── croutine.c │ │ ├── event_groups.c │ │ ├── include │ │ ├── FreeRTOS.h │ │ ├── StackMacros.h │ │ ├── croutine.h │ │ ├── deprecated_definitions.h │ │ ├── event_groups.h │ │ ├── list.h │ │ ├── message_buffer.h │ │ ├── mpu_prototypes.h │ │ ├── mpu_wrappers.h │ │ ├── portable.h │ │ ├── projdefs.h │ │ ├── queue.h │ │ ├── semphr.h │ │ ├── stack_macros.h │ │ ├── stdint.readme │ │ ├── stream_buffer.h │ │ ├── task.h │ │ └── timers.h │ │ ├── list.c │ │ ├── portable │ │ └── GCC │ │ │ └── ARM_CM0 │ │ │ ├── port.c │ │ │ ├── portmacro.h │ │ │ └── v10 │ │ │ ├── port.c │ │ │ └── portmacro.h │ │ ├── queue.c │ │ ├── readme.txt │ │ ├── stream_buffer.c │ │ ├── tasks.c │ │ └── timers.c ├── LICENSE ├── README.rst ├── include │ ├── cmd.h │ ├── commands.h │ ├── control.h │ ├── leds.h │ ├── misc.h │ ├── tasks.h │ ├── uart.h │ └── xprintf.h ├── openocd │ └── MuxPi.cfg ├── rules.mk ├── src │ ├── FreeRTOSConfig.h │ ├── Makefile │ ├── adc.c │ ├── adc.h │ ├── cmd.c │ ├── commands.c │ ├── control.c │ ├── firmware.c │ ├── firmware.h │ ├── handlers.c │ ├── hdmi.c │ ├── hdmi.h │ ├── keys.c │ ├── keys.h │ ├── leds.c │ ├── misc.c │ ├── oled.c │ ├── oled.h │ ├── state.c │ ├── state.h │ ├── tasks.c │ ├── uart.c │ ├── ws2812.c │ ├── ws2812.h │ └── xprintf.c └── target.mk └── nanopi ├── .gitignore ├── Dockerfile ├── Makefile ├── cmd ├── fota │ └── fota.go └── stm │ ├── client.go │ ├── server.go │ └── stm.go ├── fota ├── fota.go └── sdcard.go ├── power ├── muxpi-power └── systemd │ └── muxpi-power.service └── stm ├── dummy.go ├── rpc_admin.go ├── rpc_user.go ├── stm ├── stm.go ├── stm_suite_test.go ├── stm_test.go └── systemd ├── stm-user.socket ├── stm.service └── stm.socket /.gitignore: -------------------------------------------------------------------------------- 1 | #Sphinx build directory 2 | doc/sphinx/build/ 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "sw/control/libopencm3"] 2 | path = sw/control/libopencm3 3 | url = https://github.com/libopencm3/libopencm3.git 4 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | Release 0.1.0 - Tue Oct. 16 2018 - Adam Malinowski 2 | ===================================================================================== 3 | * Hardware design: 4 | - MuxPi main board 5 | - add-on template 6 | * 'stm' tool for controlling MuxPi accessories 7 | * 'fota' tool for flashing microSD card 8 | * Power control tool for switching MuxPi board in desired state 9 | * Documentation: 10 | - Project overview 11 | - Hardware overview 12 | - NanoPi OS installation 13 | - MuxPi specific software installation 14 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ##### 2 | MuxPi 3 | ##### 4 | 5 | **MuxPi** is an open hardware and open software board which was designed to 6 | aid in automating tasks on physical devices. Initial goal was to automate 7 | testing on hardware platform, thus connected devices will be called **D**\evice 8 | **U**\nder **T**\est or shortly **DUT**\. Muxpi is intended to help in testing 9 | of embedded systems, automatic software installation or flashing and automation 10 | during development. MuxPi is connected between the DUT and a PC/Server machine 11 | which will be managing the work. The name of the board is based on its two 12 | main components: **SD Mux** and **NanoPi** 13 | 14 | 15 | ******** 16 | Features 17 | ******** 18 | 19 | * Providing a DUT connection (UART, USB, ETH, microSD card) to remote location 20 | over Ethernet 21 | * Switching a microSD card between a DUT's microSD card slot and an onboard 22 | USB card reader 23 | * Flashing a microSD card using an onboard USB card reader 24 | * Flashing and controlling state of Samsung mobile devices over fully 25 | controllable, dedicated USB interface 26 | * Switching DUT's power supply 27 | * Switching jumpers/buttons of a DUT in order to (re)boot/(re)configure it 28 | * Measuring power consumption of a DUT 29 | * Handling serial connection (UART) of a DUT 30 | * Writing EDID to a DUT over HDMI connection 31 | * Interacting with a user/maintainer over a simple, bidirectional interface 32 | 33 | 34 | ************* 35 | Documentation 36 | ************* 37 | 38 | `Muxpi documentation`_ is hosted on Read The Docs pages. 39 | 40 | .. _`Muxpi documentation`: https://muxpi.rtfd.io/ 41 | 42 | 43 | ****************************** 44 | Repository Directory structure 45 | ****************************** 46 | 47 | :: 48 | 49 | . 50 | │ 51 | └── doc - overall documentation for all of the components of MuxPi 52 | │ 53 | └── hw - MuxPi board design and fabrication files 54 | │ 55 | └── sw - MuxPi's software 56 | │ 57 | └── attiny - firmware for ATtiny10 microcontroller (watchdog) 58 | │ 59 | └── cortex - firmware for STM32F030 (controller) 60 | │ 61 | └── nanopi - configs, scripts, tools, OS recipes, etc. for NanoPi NEO 62 | │ 63 | └── config - ansible files for configuring NanoPi NEO 64 | │ 65 | └── fota - tools/libs for flashing devices (usually microSD card) 66 | │ with given images 67 | │ 68 | └── stm - tools/libs for communicating with STM32F030 microntroller 69 | │ 70 | └── power - tool for controling power supply for MuxPi's main board 71 | │ 72 | └── gpio - tool for controling MuxPi's GPIOs including two one-color 73 | │ LEDs 74 | │ 75 | └── firmware - tool for updating firmware of STM32 microntroller 76 | │ 77 | └── nv - tool for writing and reading non-volatile data of MuxPi 78 | │ 79 | └── debian - files for creating packages for Debian-based 80 | distributions 81 | 82 | 83 | 84 | ******* 85 | License 86 | ******* 87 | 88 | MuxPi is distributed under `Apache 2.0 License`_ 89 | 90 | .. _`Apache 2.0 License`: LICENSE 91 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /doc/Makefile: -------------------------------------------------------------------------------- 1 | DOC_DIR = sphinx 2 | DOCKER_IMAGE = muxpi-doc-image 3 | DOCKER_CONTAINER = muxpi-doc-container 4 | DOCKER_CONTAINER_WORKDIR = /doc 5 | 6 | .PHONY: all clean build-doc-html build-docker-image clean-doc clean-docker 7 | 8 | all: build-doc-html 9 | 10 | clean: clean-doc clean-docker 11 | 12 | build-doc-html: build-docker-image 13 | docker run --rm=true \ 14 | --volume `pwd`:${DOCKER_CONTAINER_WORKDIR} \ 15 | --user `id -u $$USER`:`id -g $$USER` \ 16 | --name ${DOCKER_CONTAINER} ${DOCKER_IMAGE} \ 17 | make -C ${DOC_DIR} html 18 | 19 | build-docker-image: 20 | docker build -t ${DOCKER_IMAGE} docker 21 | 22 | clean-doc: 23 | -rm -r ${DOC_DIR}/build 24 | 25 | clean-docker: 26 | -docker rm ${DOCKER_CONTAINER} 27 | -docker rmi ${DOCKER_IMAGE} 28 | 29 | -------------------------------------------------------------------------------- /doc/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.8 2 | LABEL maintainer="Michal Sidor " 3 | 4 | ENV PLANTUML_VERSION 1.2018.8 5 | 6 | RUN mkdir -p /opt/plantuml \ 7 | && wget https://sourceforge.net/projects/plantuml/files/plantuml.${PLANTUML_VERSION}.jar/download -O /opt/plantuml/plantuml.jar 8 | RUN apk --no-cache add python3 make openjdk8-jre-base graphviz ttf-freefont \ 9 | libjpeg-turbo zlib tiff \ 10 | && apk --no-cache add -t .makedepends libjpeg-turbo-dev zlib-dev tiff-dev \ 11 | python3-dev build-base 12 | RUN pip3 install --upgrade pip setuptools \ 13 | && pip3 install 'Pillow >=5.2.0,<5.3' 'Sphinx >=1.8.0,<1.9' \ 14 | 'sphinxcontrib-plantuml ==0.11' 'sphinxcontrib-actdiag >=0.8.0,<0.9' \ 15 | 'sphinxcontrib-blockdiag >=1.5.0,<1.6' 'sphinxcontrib-seqdiag >=0.8.0,<0.9' \ 16 | && apk --no-cache del .makedepends 17 | 18 | ENV DATA_DIR=/doc JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk 19 | 20 | WORKDIR $DATA_DIR 21 | VOLUME $DATA_DIR 22 | -------------------------------------------------------------------------------- /doc/sphinx/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line. 5 | SPHINXOPTS = 6 | SPHINXBUILD = sphinx-build 7 | SPHINXPROJ = MuxPi 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -------------------------------------------------------------------------------- /doc/sphinx/source/armbian.txt: -------------------------------------------------------------------------------- 1 | ######################### 2 | OS installation - Armbian 3 | ######################### 4 | 5 | Armbian is an operating system for ARM based boards based on Debian. It is the 6 | recommended operating system for MuxPi board. 7 | 8 | There is also a flavour of Armbian based on Ubuntu, which should work in a 9 | similar manner to the Debian one, although it is not supported. 10 | 11 | 12 | ************ 13 | Installation 14 | ************ 15 | 16 | .. highlight:: console 17 | 18 | #. Download the latest Stretch `Armbian for Nanopi Neo`_. You can either use 19 | `torrent`_ or `http`_ download. We will download via http using wget. You 20 | can install wget on Debian-based distributions with ``apt-get install 21 | wget``:: 22 | 23 | $ wget https://dl.armbian.com/nanopineo/Debian_stretch_next.7z 24 | 25 | .. _`Armbian for Nanopi Neo`: https://www.armbian.com/nanopi-neo/ 26 | .. _`http`: https://dl.armbian.com/nanopineo/Debian_stretch_next.7z 27 | .. _`torrent`: https://dl.armbian.com/nanopineo/Debian_stretch_next.7z.torrent 28 | 29 | #. Uncompress the downloaded file. It will likely be a ``.7z`` file. To extract 30 | it we will use `7-Zip`_. You can install it on Debian-based distributions 31 | with ``apt-get `install p7zip-full``:: 32 | 33 | $ 7z e Debian_* 34 | 35 | .. _`7-Zip`: http://www.7-zip.org/ 36 | 37 | #. Verify if the download and unpacking were successful by checking checksum:: 38 | 39 | $ sha256sum Armbian_*.img 40 | 41 | Output should be the same as contents of sha256sum.sha file. 42 | 43 | #. Connect your SD card and check which ``/dev/sdX`` it is. You can do this 44 | using e.g. fdisk:: 45 | 46 | # fdisk -l 47 | 48 | #. Copy the extracted image to your SD card. 49 | 50 | .. danger:: Make sure your ``/dev/sdX`` device is the SD card. If performed 51 | incorrectly, next step may destroy your files unrecoverably and even stop 52 | your machine from working. 53 | 54 | .. note:: You need to adjust Armbian_*.img name as dd tools does not take 55 | wildcards. 56 | 57 | 58 | :: 59 | 60 | # dd bs=1M if=Armbian_*.img of=/dev/sdX 61 | 62 | You can verify if the image was copied correctly by running:: 63 | 64 | # sha256sum /dev/sdX 65 | 66 | #. Put prepared SD card in your MuxPi's NanoPi SD card slot. 67 | 68 | 69 | ************* 70 | Configuration 71 | ************* 72 | 73 | #. Connect NanoPi's UART0. You can use the UART->USB converter on the MuxPi 74 | board, just connect a cable to microUSB port on the bottom of the board. 75 | 76 | .. note:: 77 | 78 | You can omit this if you connect the device to DHCP server and 79 | connect over ssh. You will need to adjust below steps in such case. 80 | 81 | #. Connect to serial using either screen or minicom (or your tool of choice) 82 | 83 | .. warning:: 84 | 85 | Change ``ttyUSB0`` to your serial that is connected to NanoPi. If you do 86 | not have any USB UART connected, MuxPi's converter should be 87 | ``ttyUSB0``. 88 | 89 | :: 90 | 91 | # screen /dev/ttyUSB0 115200 92 | 93 | # minicom -b 115200 -D /dev/ttyUSB0 94 | 95 | 96 | #. Power the device on. First boot might take some time. 97 | 98 | #. After system boots, you need to log in:: 99 | 100 | login: root 101 | password 1234 102 | 103 | .. note :: 104 | 105 | ``1234`` was the correct password at the time of writing this page. If it 106 | does not work, you should check FAQ section on `Armbian for Nanopi Neo`_ 107 | page. 108 | 109 | #. You will be asked to change your password: 110 | 111 | :: 112 | 113 | You are required to change your password immediately (root enforced) 114 | Changing password for root. 115 | (current) UNIX password: 116 | Enter new UNIX password: 117 | Retype new UNIX password: 118 | 119 | #. Next, you will be greeted with nice, colourful text and initial non-root 120 | user account configuration. Follow the interactive user creation process. 121 | 122 | We always create a ``pi`` user. 123 | 124 | #. Set static IP on the device by creating following file:: 125 | 126 | # vim /etc/network/interfaces.d/eth0 127 | 128 | With the following contents: 129 | 130 | .. code-block:: none 131 | 132 | auto eth0 133 | allow-hotplug eth0 134 | iface eth0 inet static 135 | address 192.168.0.2 136 | netmask 255.255.255.0 137 | gateway 192.168.0.1 138 | 139 | Above will work if you connect MuxPi to your machine (which will have 140 | 192.168.0.1 address) and the 192.168.0.2 address will be available. 141 | For this document purpose we will assume the IP address is ``192.168.0.2``. 142 | 143 | #. Settings need to be changed, you need to restart networking:: 144 | 145 | # systemctl restart networking 146 | 147 | Or just restart the whole device:: 148 | 149 | # shutdown -r now 150 | 151 | #. Now you should be able to connect to device through ssh:: 152 | 153 | $ ssh root@192.168.0.2 154 | 155 | .. note:: 156 | 157 | If you are not able to connect to it, it might mean that the network 158 | settings did not reload properly. It is best to restart device using 159 | serial connection from earlier:: 160 | 161 | # shutdown -r now 162 | 163 | #. Configure UARTs for communication with MuxPi's stm and for communication 164 | with DUT:: 165 | 166 | # armbian-config 167 | 168 | It will ask you for internet connection but it is not required (press any 169 | key to continue) 170 | 171 | Go to :menuselection:`System --> Hardware` and enable ``uart1`` and ``uart2``. 172 | 173 | Reboot when asked. 174 | 175 | .. target-notes:: 176 | 177 | -------------------------------------------------------------------------------- /doc/sphinx/source/conf.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License 15 | 16 | # -- Project information ----------------------------------------------------- 17 | 18 | project = 'MuxPi' 19 | copyright = '2018, Samsung Electronics Co., Ltd' 20 | author = 'Samsung Electronics Co., Ltd' 21 | 22 | # The short X.Y version 23 | version = '0.0' 24 | # The full version, including alpha/beta/rc tags 25 | release = '0.0.1' 26 | 27 | 28 | # -- General configuration --------------------------------------------------- 29 | 30 | # If your documentation needs a minimal Sphinx version, state it here. 31 | # 32 | # needs_sphinx = '1.0' 33 | 34 | 35 | # Add any Sphinx extension module names here, as strings. They can be 36 | # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom 37 | # ones. 38 | extensions = [ 39 | ] 40 | 41 | # Add any paths that contain templates here, relative to this directory. 42 | templates_path = ['_templates'] 43 | 44 | # The suffix(es) of source filenames. 45 | # You can specify multiple suffix as a list of string: 46 | # 47 | # source_suffix = ['.rst', '.md'] 48 | source_suffix = '.txt' 49 | 50 | # The master toctree document. 51 | master_doc = 'index' 52 | 53 | # The language for content autogenerated by Sphinx. Refer to documentation 54 | # for a list of supported languages. 55 | # 56 | # This is also used if you do content translation via gettext catalogs. 57 | # Usually you set "language" from the command line for these cases. 58 | language = None 59 | 60 | # List of patterns, relative to source directory, that match files and 61 | # directories to ignore when looking for source files. 62 | # This pattern also affects html_static_path and html_extra_path . 63 | exclude_patterns = [] 64 | 65 | # The name of the Pygments (syntax highlighting) style to use. 66 | pygments_style = 'sphinx' 67 | 68 | 69 | # -- Options for HTML output ------------------------------------------------- 70 | 71 | # The theme to use for HTML and HTML Help pages. See the documentation for 72 | # a list of builtin themes. 73 | # 74 | html_theme = 'alabaster' 75 | 76 | # Theme options are theme-specific and customize the look and feel of a theme 77 | # further. For a list of options available for each theme, see the 78 | # documentation. 79 | # 80 | # html_theme_options = {} 81 | 82 | # Add any paths that contain custom static files (such as style sheets) here, 83 | # relative to this directory. They are copied after the builtin static files, 84 | # so a file named "default.css" will overwrite the builtin "default.css". 85 | # html_static_path = ['_static'] 86 | 87 | # Custom sidebar templates, must be a dictionary that maps document names 88 | # to template names. 89 | # 90 | # The default sidebars (for documents that don't match any pattern) are 91 | # defined by theme itself. Builtin themes are using these templates by 92 | # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', 93 | # 'searchbox.html']``. 94 | # 95 | # html_sidebars = {} 96 | 97 | 98 | # -- Options for HTMLHelp output --------------------------------------------- 99 | 100 | # Output file base name for HTML help builder. 101 | htmlhelp_basename = 'MuxPidoc' 102 | 103 | 104 | # -- Options for LaTeX output ------------------------------------------------ 105 | 106 | latex_elements = { 107 | # The paper size ('letterpaper' or 'a4paper'). 108 | # 109 | # 'papersize': 'letterpaper', 110 | 111 | # The font size ('10pt', '11pt' or '12pt'). 112 | # 113 | # 'pointsize': '10pt', 114 | 115 | # Additional stuff for the LaTeX preamble. 116 | # 117 | # 'preamble': '', 118 | 119 | # Latex figure (float) alignment 120 | # 121 | # 'figure_align': 'htbp', 122 | } 123 | 124 | # Grouping the document tree into LaTeX files. List of tuples 125 | # (source start file, target name, title, 126 | # author, documentclass [howto, manual, or own class]). 127 | latex_documents = [ 128 | (master_doc, 'MuxPi.tex', 'MuxPi Documentation', 129 | 'Samsung Electronics Co., Ltd', 'manual'), 130 | ] 131 | 132 | 133 | # -- Options for manual page output ------------------------------------------ 134 | 135 | # One entry per manual page. List of tuples 136 | # (source start file, name, description, authors, manual section). 137 | man_pages = [ 138 | (master_doc, 'muxpi', 'MuxPi Documentation', 139 | [author], 1) 140 | ] 141 | 142 | 143 | # -- Options for Texinfo output ---------------------------------------------- 144 | 145 | # Grouping the document tree into Texinfo files. List of tuples 146 | # (source start file, target name, title, author, 147 | # dir menu entry, description, category) 148 | texinfo_documents = [ 149 | (master_doc, 'MuxPi', 'MuxPi Documentation', 150 | author, 'MuxPi', 'One line description of project.', 151 | 'Miscellaneous'), 152 | ] 153 | -------------------------------------------------------------------------------- /doc/sphinx/source/dut-setup.txt: -------------------------------------------------------------------------------- 1 | ################### 2 | MuxPi setup for DUT 3 | ################### 4 | 5 | This manual will teach you how to configure MuxPi to allow interfacing with DUT 6 | using UART or Ethernet connection. 7 | 8 | .. highlight:: console 9 | 10 | First of all, you need to connect to the MuxPi:: 11 | 12 | $ ssh root@192.168.0.2 13 | 14 | 15 | ************************** 16 | Set up DHCP server on eth1 17 | ************************** 18 | 19 | Most embedded Linux distributions are looking for DHCP server thus below 20 | settings should be desired for most situations. 21 | 22 | #. Set up eth1 interaface:: 23 | 24 | # vim /etc/network/interfaces.d/eth1 25 | 26 | And populate it with the following: 27 | 28 | .. code-block:: none 29 | 30 | auto eth1 31 | allow-hotplug eth1 32 | iface eth1 inet static 33 | address 192.168.69.1 34 | netmask 255.255.255.0 35 | 36 | #. Install isc-dhcp-server:: 37 | 38 | # apt-get install isc-dhcp-server 39 | 40 | .. note:: 41 | 42 | You might need to set up a gateway to have internet access on the MuxPi. 43 | For Ubuntu see `this manual`_. 44 | 45 | .. _`this manual`: https://help.ubuntu.com/community/Internet/ConnectionSharing#Ubuntu_Internet_Gateway_Method_.28iptables.29 46 | 47 | #. Then you should set the interface which will be dhcp server:: 48 | 49 | # vim /etc/default/isc-dhcp-server 50 | 51 | Adjust lines at the bottom of the file as below: 52 | 53 | .. code-block:: none 54 | 55 | INTERFACESv4="eth1" 56 | #INTERFACESv6="" 57 | 58 | #. Configure iscp-dhcp-server to always assign the same address:: 59 | 60 | # vim /etc/dhcp/dhcpd.conf 61 | 62 | To always assign the same address:: 63 | 64 | subnet 192.168.69.0 netmask 255.255.255.0 { 65 | range 192.168.69.10 192.168.69.10; 66 | } 67 | 68 | 69 | #. Now after booting the device, you should be able to connect to it using a 70 | protocol understood by both MuxPi and DUT. 71 | 72 | 73 | ****************** 74 | Connect using UART 75 | ****************** 76 | 77 | #. Set terminal options for the DUT serial connection by 78 | running ``stty`` command with appropriate settings:: 79 | 80 | # stty -F /dev/ttyS1 115200 cs8 -cstopb -parenb 81 | 82 | .. note:: 83 | 84 | You need to adjust setting in the command above to fit your UART 85 | connection 86 | 87 | .. warning:: This setting is temporary. 88 | 89 | #. Connect to the device using your tool of choice:: 90 | 91 | # screen /dev/ttyS1 115200 92 | # minicom -b 115200 -D /dev/ttyUSB0 93 | 94 | .. note:: Adjust the baud rate accordingly. 95 | 96 | .. target-notes:: 97 | 98 | -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-addon-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-addon-left.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-addon-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-addon-right.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-addon-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-addon-sample.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-bottom-standrad-connectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-bottom-standrad-connectors.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-dypers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-dypers.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-eth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-eth.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-jumpers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-jumpers.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-other-connectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-other-connectors.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-power.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-power.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-r21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-r21.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-sd.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-top-standard-connectors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-top-standard-connectors.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-uart-rs232.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-uart-rs232.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-uart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-uart.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-ui.png -------------------------------------------------------------------------------- /doc/sphinx/source/image/board-usb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/doc/sphinx/source/image/board-usb.png -------------------------------------------------------------------------------- /doc/sphinx/source/index.txt: -------------------------------------------------------------------------------- 1 | .. MuxPi documentation master file, created by 2 | sphinx-quickstart on Mon Aug 20 15:26:48 2018. 3 | You can adapt this file completely to your liking, but it should at least 4 | contain the root `toctree` directive. 5 | 6 | ====================================== 7 | Welcome to MuxPi's documentation! 8 | ====================================== 9 | MuxPi is an open-source hardware and software board for automation of various tasks that need to 10 | be performed on target devices. It is intended to help in development of firmware, drivers or a 11 | whole platform for specific target devices. 12 | 13 | 14 | .. toctree:: 15 | :maxdepth: 2 16 | :caption: Resources: 17 | 18 | project-overview.txt 19 | hw-overview.txt 20 | armbian 21 | install-sw 22 | dut-setup 23 | 24 | Indices and tables 25 | ================== 26 | 27 | * :ref:`genindex` 28 | * :ref:`search` 29 | -------------------------------------------------------------------------------- /doc/sphinx/source/install-sw.txt: -------------------------------------------------------------------------------- 1 | ########################### 2 | MuxPi software installation 3 | ########################### 4 | 5 | .. note:: 6 | 7 | Below manual, assumes that you have MuxPi board connected to your machine's 8 | local network and it is avaliable at 192.168.0.2 address. If you set another 9 | address or use DHCP server substitute that address for yours. 10 | 11 | .. note :: 12 | 13 | It is recommended to cross-compile MuxPi's software on your host machine, 14 | rather than install go-toolchain on MuxPi's NanoPi NEO board. 15 | 16 | .. highlight:: console 17 | 18 | 19 | ***************** 20 | Building binaries 21 | ***************** 22 | 23 | Building using docker 24 | ===================== 25 | 26 | #. Prerequisites 27 | 28 | * Docker_ 29 | * Make_ 30 | 31 | .. _Docker: https://www.docker.com/ 32 | .. _Make: https://www.gnu.org/software/make/ 33 | 34 | #. Clone MuxPi and go to that directory with software:: 35 | 36 | $ git clone https://github.com/SamsungSLAV/muxpi.git && cd muxpi/sw/nanopi 37 | 38 | #. Build MuxPi software:: 39 | 40 | $ make docker-build 41 | 42 | Resulting binaries will be in ``bin`` directory. 43 | 44 | Building from source 45 | ====================== 46 | 47 | #. Prerequisites 48 | 49 | * git_ 50 | * `go (1.10+)`_ 51 | 52 | .. _git: https://git-scm.com/ 53 | .. _`go (1.10+)`: https://golang.org/doc/install 54 | 55 | #. Go get it and go to muxpi directory:: 56 | 57 | $ go get github.com/SamsungSLAV/muxpi 58 | $ cd $GOPATH/src/github.com/SamsungSLAV/muxpi/sw/nanopi 59 | 60 | #. Download dependencies:: 61 | 62 | $ go get ./... 63 | 64 | #. Build binaries:: 65 | 66 | $ mkdir -p bin 67 | $ GOARCH=arm GOOARM=7 GOOS=linux go build -o bin/stm ./cmd/stm/ 68 | $ GOARCH=arm GOOARM=7 GOOS=linux go build -o bin/fota ./cmd/fota/ 69 | 70 | 71 | ***** 72 | Setup 73 | ***** 74 | 75 | Install muxpi-power 76 | =================== 77 | 78 | #. Copy muxpi-power files to your MuxPi:: 79 | 80 | $ scp power/muxpi-power root@192.168.0.2:/usr/bin 81 | $ scp power/systemd/muxpi-power.service root@192.168.0.2:/etc/systemd/system 82 | 83 | #. On your MuxPi device, enable and start muxpi-power service:: 84 | 85 | # systemctl enable muxpi-power.service 86 | # systemctl start muxpi-power.service 87 | 88 | When you restart MuxPi board, you should see that after system boot, board 89 | comes alive - e.g. display lights up. 90 | 91 | Install stm 92 | =========== 93 | 94 | #. Copy stm binary and systemd files to MuxPi device:: 95 | 96 | $ scp bin/stm root@192.168.0.2:/usr/bin/ 97 | $ scp stm/systemd/stm.service root@192.168.0.2:/etc/systemd/system 98 | $ scp stm/systemd/stm-user.socket root@192.168.0.2:/etc/systemd/system 99 | $ scp stm/systemd/stm.socket root@192.168.0.2:/etc/systemd/system 100 | $ scp stm/stm root@192.168.0.2:/usr/local/bin/stm 101 | 102 | #. On your MuxPi device - create group stm and add your user (assumed to be 103 | ``stm``:: 104 | 105 | # groupadd stm 106 | # usermod -aG stm pi 107 | 108 | #. On your MuxPi device - enable stm sockets:: 109 | 110 | # systemctl daemon-reload 111 | # systemctl enable stm.socket stm-user.socket 112 | # systemctl start stm.socket stm-user.socket 113 | 114 | .. note:: 115 | 116 | Currently stm is not safe for concurrent use and requires root to operate 117 | (or whoever ``/dev/ttyS2`` permissions point to). It is recommended to 118 | install stm as an auto starting service as described above. 119 | 120 | .. warning:: 121 | 122 | stm.service should NOT be started manually or enabled, because when 123 | run through systemd, stm expects to be able to obtain the aforementioned 124 | socket paths from systemd, which is only possible when the service is 125 | launched by the sockets. 126 | 127 | Install fota 128 | ============ 129 | 130 | #. Copy fota binary to MuxPi device:: 131 | 132 | $ scp bin/fota root@192.168.0.2:/usr/bin/ 133 | 134 | #. On your MuxPi device - create a symlink from ``/usr/local/bin/fota`` to 135 | ``/usr/bin/fota/``. Only ``/usr/local/bin/fota/`` should be used by software 136 | interfacing with MuxPi. This allows to swap fota implementation to your 137 | preferred tool:: 138 | 139 | # ln -s /usr/bin/fota /usr/local/bin/fota 140 | 141 | .. target-notes:: 142 | 143 | -------------------------------------------------------------------------------- /doc/sphinx/source/project-overview.txt: -------------------------------------------------------------------------------- 1 | ################ 2 | Project overview 3 | ################ 4 | 5 | 6 | ************** 7 | MuxPi overview 8 | ************** 9 | 10 | **MuxPi** is an open-source hardware and software board which was designed to 11 | aid in automating tasks on physical devices. Initial goal was to automate 12 | testing on hardware platform, thus connected devices will be called **D**\evice 13 | **U**\nder **T**\est or shortly **DUT**\. MuxPi is intended to help in testing 14 | of embedded systems, automatic software installation or flashing and automation 15 | during development. MuxPi is connected between the DUT and a PC/Server machine 16 | which will be managing the work. The name of the board is based on its two 17 | main components: **SD Mux** and **NanoPi** 18 | 19 | 20 | Essential functionalities 21 | ========================= 22 | 23 | * Providing a DUT connection (UART, USB, ETH, microSD card, HDMI DDC) to remote 24 | location over Ethernet 25 | * Switching a microSD card between a DUT's microSD card slot and an onboard 26 | USB card reader 27 | * Flashing a microSD card using an onboard USB card reader 28 | * Flashing and controlling state of Samsung mobile devices over fully 29 | controllable, dedicated USB interface 30 | * Switching DUT's power supply 31 | * Switching jumpers/buttons of a DUT in order to (re)boot/(re)configure it 32 | * Measuring power consumption of a DUT 33 | * Handling serial connection (UART) of a DUT 34 | * Writing EDID to a DUT over HDMI connection 35 | * Interacting with a user/maintainer over a simple, bidirectional interface 36 | 37 | Interfaces / Connectivity 38 | ========================= 39 | 40 | MuxPi provides all **DUT** interfaces using the network interface on the 41 | NanoPi. You can connect to it using standrd RJ45 socket. Additionally NanoPi 42 | NEO's USB OTG and UART might be used to communicate with the MuxPi. 43 | 44 | As for the interfaces to communicate with (or control) a **DUT**, MuxPi is 45 | equipped with: 46 | 47 | * Ethernet 48 | * UART (level shifted) 49 | * USB Host (up to 4 onboard connectors, including one with power and ID 50 | control) 51 | * USB OTG 52 | * DyPers (Dynamic jumPers) 53 | * microSD 54 | * HMDI (via I2C to write EDID) 55 | * power control and measurements 56 | * I2C 57 | * SPI 58 | 59 | 60 | ************************** 61 | Relation to other projects 62 | ************************** 63 | 64 | Samsung projects 65 | ================ 66 | 67 | SD-MUX 68 | ------ 69 | 70 | MuxPi is a successor of `SD-MUX`_. While its main purpose is still the same: 71 | to help automated testing of OS binary images, the MuxPi allows for achieving 72 | much more control and feedback. There are only three common functions of these 73 | two boards: 74 | 75 | .. _`SD-MUX`: https://wiki.tizen.org/SD_MUX 76 | 77 | * SD card multiplexing 78 | * controlling power of a DUT 79 | * USB switch (not a HUB) - switch is the same but in MuxPi it does totally 80 | differnt thing. It is used to redirect USB-M data lines either to NanoPi's 81 | USB or NanoPi's UART. 82 | 83 | And one function which was not present on SD-MUX board natively but would be 84 | added to them as an external circuit: 85 | 86 | * DyPer 87 | 88 | The whole rest of functionalities makes MuxPi far more powerful and versatile 89 | device than SD-MUX. 90 | 91 | Besides the huge difference in hardware there are also two unquestionable 92 | advantages over SD-MUX: 93 | 94 | * user interface - SD-MUX was more "blind" device. User couldn't tell in what 95 | state the device was. You couldn't tell whether the devices were turned on 96 | or off by looking on the board which is problematic in case of bigger number 97 | of devices. MuxPi has several LEDs, graphic OLED display and two buttons. It 98 | may look a little bit to much for such device but experience in using SD-MUX 99 | showed that operator needs information that can't be passed using just LEDs. 100 | * independency - SD-MUX was not a standalone device. It had to be connected 101 | (and powered) via USB - usually a PC or server. To reduce number of USB hubs 102 | connected to PC/server USB hubs had to be used which introduced many 103 | problems. MuxPi is a completely standalone device with its own microcomputer 104 | and linux operating system. It needs only an Ethernet connection and a power 105 | supply. 106 | 107 | 108 | SDWire 109 | ------ 110 | 111 | After SD-MUX, a simpler board was created, `SDWire`_. It is a cheap solution for 112 | multiplexing SD card between connected device and USB (card reader mode). 113 | 114 | .. _`SDWire`: https://wiki.tizen.org/SDWire 115 | 116 | SLAV stack 117 | ---------- 118 | 119 | MuxPi is intended to be used as part of SLAV stack, consisting of: 120 | 121 | * Dryads - pairs of MuxPi and DUT 122 | * Boruta - server application for device farm management 123 | * Weles - server application for test automation 124 | * Perun - TBD. 125 | 126 | ... but nothing is constraining you to use MuxPi on its own or use it with other frameworks. 127 | 128 | Non-Samsung projects 129 | ===================== 130 | 131 | Below list consist only of the public projects based on SD-MUX (MuxPi 132 | predeccessor) 133 | 134 | * `https://github.com/MentorEmbedded/mtda`_ 135 | * `https://github.com/resin-io/autohat-board`_ 136 | 137 | .. _`https://github.com/MentorEmbedded/mtda`: https://github.com/MentorEmbedded/mtda 138 | .. _`https://github.com/resin-io/autohat-board`: https://github.com/resin-io/autohat-board 139 | 140 | 141 | ******** 142 | Licenses 143 | ******** 144 | 145 | MuxPi is distributed under `Apache License Version 2.0`_ 146 | 147 | .. _`Apache License Version 2.0`: https://www.apache.org/licenses/LICENSE-2.0 148 | 149 | .. target-notes:: 150 | -------------------------------------------------------------------------------- /hw/MIR/MIR.bck: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /hw/MIR/MIR.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | $CMP +3.3V 4 | D Power flag, +3.3V 5 | K power-flag 6 | $ENDCMP 7 | # 8 | $CMP +3V3 9 | D Power flag, +3.3V 10 | K power-flag 11 | $ENDCMP 12 | # 13 | $CMP +5V 14 | D Power flag, +5V 15 | K power-flag 16 | $ENDCMP 17 | # 18 | $CMP GND 19 | D Power flag, ground 20 | K power-flag 21 | $ENDCMP 22 | # 23 | $CMP VDD 24 | D Power flag, positive voltage 25 | K power-flag 26 | $ENDCMP 27 | # 28 | #End Doc Library 29 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/403AC.kicad_mod: -------------------------------------------------------------------------------- 1 | (module 403AC (layer F.Cu) (tedit 5AE185BE) 2 | (fp_text reference REF** (at 0.57 3.89) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value 403AC (at 0.07 -3.97) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -3.5 -2.5) (end -3.5 -3) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start -3.5 -3) (end 3.5 -3) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start 3.5 -3) (end 3.5 -2.5) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start -3.5 3) (end -3.5 2.5) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start 3.5 2.5) (end 3.5 3) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start 3.5 3) (end -3.5 3) (layer F.SilkS) (width 0.15)) 14 | (fp_circle (center -2.95 -2.47) (end -3.01 -2.68) (layer F.SilkS) (width 0.15)) 15 | (pad 1 smd rect (at -3.25 0) (size 2.25 3.79) (layers F.Cu F.Paste F.Mask)) 16 | (pad 2 smd rect (at 3.25 0) (size 2.25 3.79) (layers F.Cu F.Paste F.Mask)) 17 | ) 18 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/C_0805.kicad_mod: -------------------------------------------------------------------------------- 1 | (module C_0805 (layer F.Cu) (tedit 58AA8463) 2 | (descr "Capacitor SMD 0805, reflow soldering, AVX (see smccp.pdf)") 3 | (tags "capacitor 0805") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -1.5) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value C_0805 (at 0 1.75) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start 1.75 0.87) (end -1.75 0.87) (layer F.CrtYd) (width 0.05)) 12 | (fp_line (start 1.75 0.87) (end 1.75 -0.88) (layer F.CrtYd) (width 0.05)) 13 | (fp_line (start -1.75 -0.88) (end -1.75 0.87) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start -1.75 -0.88) (end 1.75 -0.88) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -0.5 0.85) (end 0.5 0.85) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start 0.5 -0.85) (end -0.5 -0.85) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start -1 -0.62) (end 1 -0.62) (layer F.Fab) (width 0.1)) 18 | (fp_line (start 1 -0.62) (end 1 0.62) (layer F.Fab) (width 0.1)) 19 | (fp_line (start 1 0.62) (end -1 0.62) (layer F.Fab) (width 0.1)) 20 | (fp_line (start -1 0.62) (end -1 -0.62) (layer F.Fab) (width 0.1)) 21 | (fp_text user %R (at 0 -1.5) (layer F.Fab) 22 | (effects (font (size 1 1) (thickness 0.15))) 23 | ) 24 | (pad 2 smd rect (at 1 0) (size 1 1.25) (layers F.Cu F.Paste F.Mask)) 25 | (pad 1 smd rect (at -1 0) (size 1 1.25) (layers F.Cu F.Paste F.Mask)) 26 | (model Capacitors_SMD.3dshapes/C_0805.wrl 27 | (at (xyz 0 0 0)) 28 | (scale (xyz 1 1 1)) 29 | (rotate (xyz 0 0 0)) 30 | ) 31 | ) 32 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/C_T_0805.kicad_mod: -------------------------------------------------------------------------------- 1 | (module C_T_0805 (layer F.Cu) (tedit 5ACDF93C) 2 | (descr "Capacitor SMD 0805, reflow soldering, AVX (see smccp.pdf)") 3 | (tags "capacitor 0805") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -1.5) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value C_T_0805 (at 0 1.75) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start 1.75 0.87) (end -1.75 0.87) (layer F.CrtYd) (width 0.05)) 12 | (fp_line (start 1.75 0.87) (end 1.75 -0.88) (layer F.CrtYd) (width 0.05)) 13 | (fp_line (start -1.75 -0.88) (end -1.75 0.87) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start -1.75 -0.88) (end 1.75 -0.88) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -1.7 0.85) (end 0.5 0.85) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start 0.5 -0.85) (end -1.7 -0.85) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start -1 -0.62) (end 1 -0.62) (layer F.Fab) (width 0.1)) 18 | (fp_line (start 1 -0.62) (end 1 0.62) (layer F.Fab) (width 0.1)) 19 | (fp_line (start 1 0.62) (end -1 0.62) (layer F.Fab) (width 0.1)) 20 | (fp_line (start -1 0.62) (end -1 -0.62) (layer F.Fab) (width 0.1)) 21 | (fp_text user %R (at 0 -1.5) (layer F.Fab) 22 | (effects (font (size 1 1) (thickness 0.15))) 23 | ) 24 | (fp_line (start -1.7 -0.85) (end -1.7 0.85) (layer F.SilkS) (width 0.15)) 25 | (pad 2 smd rect (at 1 0) (size 1 1.25) (layers F.Cu F.Paste F.Mask)) 26 | (pad 1 smd rect (at -1 0) (size 1 1.25) (layers F.Cu F.Paste F.Mask)) 27 | (model Capacitors_SMD.3dshapes/C_0805.wrl 28 | (at (xyz 0 0 0)) 29 | (scale (xyz 1 1 1)) 30 | (rotate (xyz 0 0 0)) 31 | ) 32 | ) 33 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/Crystal_SMD_Abracon_ABM3-2pin_5.0x3.2mm_HandSoldering.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Crystals:Crystal_SMD_Abracon_ABM3-2pin_5.0x3.2mm_HandSoldering (layer F.Cu) (tedit 58CD2E9C) 2 | (descr "Abracon Miniature Ceramic Smd Crystal ABM3 http://www.abracon.com/Resonators/abm3.pdf, hand-soldering, 5.0x3.2mm^2 package") 3 | (tags "SMD SMT crystal hand-soldering") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -2.8) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value Crystal_SMD_Abracon_ABM3-2pin_5.0x3.2mm_HandSoldering (at 0 2.8) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_text user %R (at 0 0) (layer F.Fab) 12 | (effects (font (size 1 1) (thickness 0.15))) 13 | ) 14 | (fp_line (start -2.3 -1.6) (end 2.3 -1.6) (layer F.Fab) (width 0.1)) 15 | (fp_line (start 2.3 -1.6) (end 2.5 -1.4) (layer F.Fab) (width 0.1)) 16 | (fp_line (start 2.5 -1.4) (end 2.5 1.4) (layer F.Fab) (width 0.1)) 17 | (fp_line (start 2.5 1.4) (end 2.3 1.6) (layer F.Fab) (width 0.1)) 18 | (fp_line (start 2.3 1.6) (end -2.3 1.6) (layer F.Fab) (width 0.1)) 19 | (fp_line (start -2.3 1.6) (end -2.5 1.4) (layer F.Fab) (width 0.1)) 20 | (fp_line (start -2.5 1.4) (end -2.5 -1.4) (layer F.Fab) (width 0.1)) 21 | (fp_line (start -2.5 -1.4) (end -2.3 -1.6) (layer F.Fab) (width 0.1)) 22 | (fp_line (start -2.5 0.6) (end -1.5 1.6) (layer F.Fab) (width 0.1)) 23 | (fp_line (start 2.7 -1.8) (end -4.625 -1.8) (layer F.SilkS) (width 0.12)) 24 | (fp_line (start -4.625 -1.8) (end -4.625 1.8) (layer F.SilkS) (width 0.12)) 25 | (fp_line (start -4.625 1.8) (end 2.7 1.8) (layer F.SilkS) (width 0.12)) 26 | (fp_line (start -4.7 -1.9) (end -4.7 1.9) (layer F.CrtYd) (width 0.05)) 27 | (fp_line (start -4.7 1.9) (end 4.7 1.9) (layer F.CrtYd) (width 0.05)) 28 | (fp_line (start 4.7 1.9) (end 4.7 -1.9) (layer F.CrtYd) (width 0.05)) 29 | (fp_line (start 4.7 -1.9) (end -4.7 -1.9) (layer F.CrtYd) (width 0.05)) 30 | (fp_circle (center 0 0) (end 0.5 0) (layer F.Adhes) (width 0.1)) 31 | (fp_circle (center 0 0) (end 0.416667 0) (layer F.Adhes) (width 0.166667)) 32 | (fp_circle (center 0 0) (end 0.266667 0) (layer F.Adhes) (width 0.166667)) 33 | (fp_circle (center 0 0) (end 0.116667 0) (layer F.Adhes) (width 0.233333)) 34 | (pad 1 smd rect (at -2.7625 0) (size 3.325 2.4) (layers F.Cu F.Paste F.Mask)) 35 | (pad 2 smd rect (at 2.7625 0) (size 3.325 2.4) (layers F.Cu F.Paste F.Mask)) 36 | (model ${KISYS3DMOD}/Crystals.3dshapes/Crystal_SMD_Abracon_ABM3-2pin_5.0x3.2mm_HandSoldering.wrl 37 | (at (xyz 0 0 0)) 38 | (scale (xyz 1 1 1)) 39 | (rotate (xyz 0 0 0)) 40 | ) 41 | ) 42 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/DTSM-3.kicad_mod: -------------------------------------------------------------------------------- 1 | (module DTSM-3 (layer F.Cu) (tedit 5C08EECB) 2 | (fp_text reference REF** (at 0 2.99) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value DTSM-3 (at 0 -3.02) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -3.1 1.8) (end 3.1 1.8) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start 3.1 1.8) (end 3.1 1.1) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start -3.1 1.1) (end -3.1 1.8) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start -3.1 -1.1) (end -3.1 -1.8) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start -3.1 -1.8) (end 3.1 -1.8) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start 3.1 -1.8) (end 3.1 -1.1) (layer F.SilkS) (width 0.15)) 14 | (pad 1 smd rect (at -2.7 0) (size 2 1.6) (layers F.Cu F.Paste F.Mask)) 15 | (pad 2 smd rect (at 2.7 0) (size 2 1.6) (layers F.Cu F.Paste F.Mask)) 16 | ) 17 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/D_0805.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Diodes_SMD:D_0805 (layer F.Cu) (tedit 590CE9A4) 2 | (descr "Diode SMD in 0805 package http://datasheets.avx.com/schottky.pdf") 3 | (tags "smd diode") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -1.6) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value D_0805 (at 0 1.7) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_text user %R (at 0 -1.6) (layer F.Fab) 12 | (effects (font (size 1 1) (thickness 0.15))) 13 | ) 14 | (fp_line (start -1.6 -0.8) (end -1.6 0.8) (layer F.SilkS) (width 0.12)) 15 | (fp_line (start -1.7 0.88) (end -1.7 -0.88) (layer F.CrtYd) (width 0.05)) 16 | (fp_line (start 1.7 0.88) (end -1.7 0.88) (layer F.CrtYd) (width 0.05)) 17 | (fp_line (start 1.7 -0.88) (end 1.7 0.88) (layer F.CrtYd) (width 0.05)) 18 | (fp_line (start -1.7 -0.88) (end 1.7 -0.88) (layer F.CrtYd) (width 0.05)) 19 | (fp_line (start 0.2 0) (end 0.4 0) (layer F.Fab) (width 0.1)) 20 | (fp_line (start -0.1 0) (end -0.3 0) (layer F.Fab) (width 0.1)) 21 | (fp_line (start -0.1 -0.2) (end -0.1 0.2) (layer F.Fab) (width 0.1)) 22 | (fp_line (start 0.2 0.2) (end 0.2 -0.2) (layer F.Fab) (width 0.1)) 23 | (fp_line (start -0.1 0) (end 0.2 0.2) (layer F.Fab) (width 0.1)) 24 | (fp_line (start 0.2 -0.2) (end -0.1 0) (layer F.Fab) (width 0.1)) 25 | (fp_line (start -1 0.65) (end -1 -0.65) (layer F.Fab) (width 0.1)) 26 | (fp_line (start 1 0.65) (end -1 0.65) (layer F.Fab) (width 0.1)) 27 | (fp_line (start 1 -0.65) (end 1 0.65) (layer F.Fab) (width 0.1)) 28 | (fp_line (start -1 -0.65) (end 1 -0.65) (layer F.Fab) (width 0.1)) 29 | (fp_line (start -1.6 0.8) (end 1 0.8) (layer F.SilkS) (width 0.12)) 30 | (fp_line (start -1.6 -0.8) (end 1 -0.8) (layer F.SilkS) (width 0.12)) 31 | (pad 1 smd rect (at -1.05 0) (size 0.8 0.9) (layers F.Cu F.Paste F.Mask)) 32 | (pad 2 smd rect (at 1.05 0) (size 0.8 0.9) (layers F.Cu F.Paste F.Mask)) 33 | (model ${KISYS3DMOD}/Diodes_SMD.3dshapes/D_0805.wrl 34 | (at (xyz 0 0 0)) 35 | (scale (xyz 1 1 1)) 36 | (rotate (xyz 0 0 0)) 37 | ) 38 | ) 39 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/D_SOD-323_HandSoldering.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Diodes_SMD:D_SOD-323_HandSoldering (layer F.Cu) (tedit 58641869) 2 | (descr SOD-323) 3 | (tags SOD-323) 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -1.85) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value D_SOD-323_HandSoldering (at 0.1 1.9) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_text user %R (at 0 -1.85) (layer F.Fab) 12 | (effects (font (size 1 1) (thickness 0.15))) 13 | ) 14 | (fp_line (start -1.9 -0.85) (end -1.9 0.85) (layer F.SilkS) (width 0.12)) 15 | (fp_line (start 0.2 0) (end 0.45 0) (layer F.Fab) (width 0.1)) 16 | (fp_line (start 0.2 0.35) (end -0.3 0) (layer F.Fab) (width 0.1)) 17 | (fp_line (start 0.2 -0.35) (end 0.2 0.35) (layer F.Fab) (width 0.1)) 18 | (fp_line (start -0.3 0) (end 0.2 -0.35) (layer F.Fab) (width 0.1)) 19 | (fp_line (start -0.3 0) (end -0.5 0) (layer F.Fab) (width 0.1)) 20 | (fp_line (start -0.3 -0.35) (end -0.3 0.35) (layer F.Fab) (width 0.1)) 21 | (fp_line (start -0.9 0.7) (end -0.9 -0.7) (layer F.Fab) (width 0.1)) 22 | (fp_line (start 0.9 0.7) (end -0.9 0.7) (layer F.Fab) (width 0.1)) 23 | (fp_line (start 0.9 -0.7) (end 0.9 0.7) (layer F.Fab) (width 0.1)) 24 | (fp_line (start -0.9 -0.7) (end 0.9 -0.7) (layer F.Fab) (width 0.1)) 25 | (fp_line (start -2 -0.95) (end 2 -0.95) (layer F.CrtYd) (width 0.05)) 26 | (fp_line (start 2 -0.95) (end 2 0.95) (layer F.CrtYd) (width 0.05)) 27 | (fp_line (start -2 0.95) (end 2 0.95) (layer F.CrtYd) (width 0.05)) 28 | (fp_line (start -2 -0.95) (end -2 0.95) (layer F.CrtYd) (width 0.05)) 29 | (fp_line (start -1.9 0.85) (end 1.25 0.85) (layer F.SilkS) (width 0.12)) 30 | (fp_line (start -1.9 -0.85) (end 1.25 -0.85) (layer F.SilkS) (width 0.12)) 31 | (pad 1 smd rect (at -1.25 0) (size 1 1) (layers F.Cu F.Paste F.Mask)) 32 | (pad 2 smd rect (at 1.25 0) (size 1 1) (layers F.Cu F.Paste F.Mask)) 33 | (model ${KISYS3DMOD}/Diodes_SMD.3dshapes/D_SOD-323.wrl 34 | (at (xyz 0 0 0)) 35 | (scale (xyz 1 1 1)) 36 | (rotate (xyz 0 0 0)) 37 | ) 38 | ) 39 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/EXTERNAL ELEMENT.kicad_mod: -------------------------------------------------------------------------------- 1 | (module "EXTERNAL ELEMENT" (layer F.Cu) (tedit 5BEBE0D7) 2 | (fp_text reference REF** (at 0 0.5) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value "EXTERNAL ELEMENT" (at 0 -0.5) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | ) 9 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/HC49USM.kicad_mod: -------------------------------------------------------------------------------- 1 | (module HC49USM (layer F.Cu) (tedit 5AD486F4) 2 | (fp_text reference Y1 (at -2.46 3.57) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value 16MHz (at 0 2.54) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start 7 -1.1) (end 7 -2.38) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start -7 -1.1) (end -7 -2.38) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start -7 1.1) (end -7 2.35) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start 7 2.45) (end 7 1.1) (layer F.SilkS) (width 0.15)) 12 | (pad 2 smd rect (at 4.75 0) (size 5.5 1.6) (layers F.Cu F.Paste F.Mask)) 13 | (pad 1 smd rect (at -4.75 0) (size 5.5 1.6) (layers F.Cu F.Paste F.Mask)) 14 | ) 15 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/Pin_Header_Straight_1x01_Pitch2.54mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Pin_Headers:Pin_Header_Straight_1x01_Pitch2.54mm (layer F.Cu) (tedit 59650532) 2 | (descr "Through hole straight pin header, 1x01, 2.54mm pitch, single row") 3 | (tags "Through hole pin header THT 1x01 2.54mm single row") 4 | (fp_text reference REF** (at 0 -2.33) (layer F.SilkS) 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value Pin_Header_Straight_1x01_Pitch2.54mm (at 0 2.33) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) 11 | (fp_line (start 1.27 -1.27) (end 1.27 1.27) (layer F.Fab) (width 0.1)) 12 | (fp_line (start 1.27 1.27) (end -1.27 1.27) (layer F.Fab) (width 0.1)) 13 | (fp_line (start -1.27 1.27) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) 14 | (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) 15 | (fp_line (start -1.33 1.33) (end 1.33 1.33) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start -1.33 1.27) (end -1.33 1.33) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start 1.33 1.27) (end 1.33 1.33) (layer F.SilkS) (width 0.12)) 18 | (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) 19 | (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start -1.8 -1.8) (end -1.8 1.8) (layer F.CrtYd) (width 0.05)) 22 | (fp_line (start -1.8 1.8) (end 1.8 1.8) (layer F.CrtYd) (width 0.05)) 23 | (fp_line (start 1.8 1.8) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) 25 | (fp_text user %R (at 0 0 90) (layer F.Fab) 26 | (effects (font (size 1 1) (thickness 0.15))) 27 | ) 28 | (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 29 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_1x01_Pitch2.54mm.wrl 30 | (at (xyz 0 0 0)) 31 | (scale (xyz 1 1 1)) 32 | (rotate (xyz 0 0 0)) 33 | ) 34 | ) 35 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/Pin_Header_Straight_1x02_Pitch2.54mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Pin_Headers:Pin_Header_Straight_1x02_Pitch2.54mm (layer F.Cu) (tedit 59650532) 2 | (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") 3 | (tags "Through hole pin header THT 1x02 2.54mm single row") 4 | (fp_text reference REF** (at 0 -2.33) (layer F.SilkS) 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value Pin_Header_Straight_1x02_Pitch2.54mm (at 0 4.87) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) 11 | (fp_line (start 1.27 -1.27) (end 1.27 3.81) (layer F.Fab) (width 0.1)) 12 | (fp_line (start 1.27 3.81) (end -1.27 3.81) (layer F.Fab) (width 0.1)) 13 | (fp_line (start -1.27 3.81) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) 14 | (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) 15 | (fp_line (start -1.33 3.87) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start -1.33 1.27) (end -1.33 3.87) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start 1.33 1.27) (end 1.33 3.87) (layer F.SilkS) (width 0.12)) 18 | (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) 19 | (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start -1.8 -1.8) (end -1.8 4.35) (layer F.CrtYd) (width 0.05)) 22 | (fp_line (start -1.8 4.35) (end 1.8 4.35) (layer F.CrtYd) (width 0.05)) 23 | (fp_line (start 1.8 4.35) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) 25 | (fp_text user %R (at 0 1.27 90) (layer F.Fab) 26 | (effects (font (size 1 1) (thickness 0.15))) 27 | ) 28 | (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 29 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 30 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_1x02_Pitch2.54mm.wrl 31 | (at (xyz 0 0 0)) 32 | (scale (xyz 1 1 1)) 33 | (rotate (xyz 0 0 0)) 34 | ) 35 | ) 36 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/Pin_Header_Straight_1x02_Pitch2.54mm_Molex_022232021.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Pin_Header_Straight_1x02_Pitch2.54mm_Molex_022232021 (layer F.Cu) (tedit 5C08EAEE) 2 | (descr "Through hole straight pin header, 1x02, 2.54mm pitch, single row") 3 | (tags "Through hole pin header THT 1x02 2.54mm single row") 4 | (fp_text reference REF** (at -0.02 -2.62) (layer F.SilkS) 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value Pin_Header_Straight_1x02_Pitch2.54mm (at 0 4.87) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_line (start -2.54 -1.27) (end 3.175 -1.27) (layer F.Fab) (width 0.1)) 11 | (fp_line (start 3.175 -1.27) (end 3.175 3.81) (layer F.Fab) (width 0.1)) 12 | (fp_line (start 3.175 3.81) (end -3.175 3.81) (layer F.Fab) (width 0.1)) 13 | (fp_line (start -3.175 3.81) (end -3.175 -0.635) (layer F.Fab) (width 0.1)) 14 | (fp_line (start -3.175 -0.635) (end -2.54 -1.27) (layer F.Fab) (width 0.1)) 15 | (fp_line (start -3.175 3.87) (end 3.175 3.87) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start -3.175 1.27) (end -3.175 3.87) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start 3.175 1.27) (end 3.175 3.87) (layer F.SilkS) (width 0.12)) 18 | (fp_line (start -3.175 1.27) (end 3.175 1.27) (layer F.SilkS) (width 0.12)) 19 | (fp_line (start -3.175 0) (end -3.175 -1.33) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start -3.175 -1.33) (end 3.175 -1.33) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start -3.2 -1.8) (end -3.2 4.35) (layer F.CrtYd) (width 0.05)) 22 | (fp_line (start -3.2 4.35) (end 3.2 4.35) (layer F.CrtYd) (width 0.05)) 23 | (fp_line (start 3.2 4.35) (end 3.2 -1.8) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start 3.2 -1.8) (end -3.2 -1.8) (layer F.CrtYd) (width 0.05)) 25 | (fp_text user %R (at 0 1.27 90) (layer F.Fab) 26 | (effects (font (size 1 1) (thickness 0.15))) 27 | ) 28 | (fp_line (start -0.64 -1.27) (end -2.55 -1.28) (layer F.SilkS) (width 0.15)) 29 | (fp_line (start -2.55 -1.28) (end -1.44 -1.25) (layer F.SilkS) (width 0.15)) 30 | (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 31 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 32 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_1x02_Pitch2.54mm.wrl 33 | (at (xyz 0 0 0)) 34 | (scale (xyz 1 1 1)) 35 | (rotate (xyz 0 0 0)) 36 | ) 37 | ) 38 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/Pin_Header_Straight_1x15_Pitch2.54mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Pin_Header_Straight_1x15_Pitch2.54mm (layer F.Cu) (tedit 59650532) 2 | (descr "Through hole straight pin header, 1x15, 2.54mm pitch, single row") 3 | (tags "Through hole pin header THT 1x15 2.54mm single row") 4 | (fp_text reference REF** (at 0 -2.33) (layer F.SilkS) 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value Pin_Header_Straight_1x15_Pitch2.54mm (at 0 37.89) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_text user %R (at 0 17.78 90) (layer F.Fab) 11 | (effects (font (size 1 1) (thickness 0.15))) 12 | ) 13 | (fp_line (start 1.8 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start 1.8 37.35) (end 1.8 -1.8) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -1.8 37.35) (end 1.8 37.35) (layer F.CrtYd) (width 0.05)) 16 | (fp_line (start -1.8 -1.8) (end -1.8 37.35) (layer F.CrtYd) (width 0.05)) 17 | (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) 18 | (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) 19 | (fp_line (start -1.33 1.27) (end 1.33 1.27) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start 1.33 1.27) (end 1.33 36.89) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start -1.33 1.27) (end -1.33 36.89) (layer F.SilkS) (width 0.12)) 22 | (fp_line (start -1.33 36.89) (end 1.33 36.89) (layer F.SilkS) (width 0.12)) 23 | (fp_line (start -1.27 -0.635) (end -0.635 -1.27) (layer F.Fab) (width 0.1)) 24 | (fp_line (start -1.27 36.83) (end -1.27 -0.635) (layer F.Fab) (width 0.1)) 25 | (fp_line (start 1.27 36.83) (end -1.27 36.83) (layer F.Fab) (width 0.1)) 26 | (fp_line (start 1.27 -1.27) (end 1.27 36.83) (layer F.Fab) (width 0.1)) 27 | (fp_line (start -0.635 -1.27) (end 1.27 -1.27) (layer F.Fab) (width 0.1)) 28 | (pad 15 thru_hole oval (at 0 35.56) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 29 | (pad 14 thru_hole oval (at 0 33.02) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 30 | (pad 13 thru_hole oval (at 0 30.48) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 31 | (pad 12 thru_hole oval (at 0 27.94) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 32 | (pad 11 thru_hole oval (at 0 25.4) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 33 | (pad 10 thru_hole oval (at 0 22.86) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 34 | (pad 9 thru_hole oval (at 0 20.32) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 35 | (pad 8 thru_hole oval (at 0 17.78) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 36 | (pad 7 thru_hole oval (at 0 15.24) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 37 | (pad 6 thru_hole oval (at 0 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 38 | (pad 5 thru_hole oval (at 0 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 39 | (pad 4 thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 40 | (pad 3 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 41 | (pad 2 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 42 | (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 43 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_1x15_Pitch2.54mm.wrl 44 | (at (xyz 0 0 0)) 45 | (scale (xyz 1 1 1)) 46 | (rotate (xyz 0 0 0)) 47 | ) 48 | ) 49 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/Pin_Header_Straight_2x03_Pitch2.54mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Pin_Header_Straight_2x03_Pitch2.54mm (layer F.Cu) (tedit 59650532) 2 | (descr "Through hole straight pin header, 2x03, 2.54mm pitch, double rows") 3 | (tags "Through hole pin header THT 2x03 2.54mm double row") 4 | (fp_text reference REF** (at 1.27 -2.33) (layer F.SilkS) 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value Pin_Header_Straight_2x03_Pitch2.54mm (at 1.27 7.41) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_text user %R (at 1.27 2.54 90) (layer F.Fab) 11 | (effects (font (size 1 1) (thickness 0.15))) 12 | ) 13 | (fp_line (start 4.35 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start 4.35 6.85) (end 4.35 -1.8) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -1.8 6.85) (end 4.35 6.85) (layer F.CrtYd) (width 0.05)) 16 | (fp_line (start -1.8 -1.8) (end -1.8 6.85) (layer F.CrtYd) (width 0.05)) 17 | (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) 18 | (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) 19 | (fp_line (start 1.27 -1.33) (end 3.87 -1.33) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start 1.27 1.27) (end 1.27 -1.33) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start -1.33 1.27) (end 1.27 1.27) (layer F.SilkS) (width 0.12)) 22 | (fp_line (start 3.87 -1.33) (end 3.87 6.41) (layer F.SilkS) (width 0.12)) 23 | (fp_line (start -1.33 1.27) (end -1.33 6.41) (layer F.SilkS) (width 0.12)) 24 | (fp_line (start -1.33 6.41) (end 3.87 6.41) (layer F.SilkS) (width 0.12)) 25 | (fp_line (start -1.27 0) (end 0 -1.27) (layer F.Fab) (width 0.1)) 26 | (fp_line (start -1.27 6.35) (end -1.27 0) (layer F.Fab) (width 0.1)) 27 | (fp_line (start 3.81 6.35) (end -1.27 6.35) (layer F.Fab) (width 0.1)) 28 | (fp_line (start 3.81 -1.27) (end 3.81 6.35) (layer F.Fab) (width 0.1)) 29 | (fp_line (start 0 -1.27) (end 3.81 -1.27) (layer F.Fab) (width 0.1)) 30 | (pad 6 thru_hole oval (at 2.54 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 31 | (pad 5 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 32 | (pad 4 thru_hole oval (at 2.54 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 33 | (pad 3 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 34 | (pad 2 thru_hole oval (at 2.54 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 35 | (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 36 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_2x03_Pitch2.54mm.wrl 37 | (at (xyz 0 0 0)) 38 | (scale (xyz 1 1 1)) 39 | (rotate (xyz 0 0 0)) 40 | ) 41 | ) 42 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/Pin_Header_Straight_2x08_Pitch2.54mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Pin_Headers:Pin_Header_Straight_2x08_Pitch2.54mm (layer F.Cu) (tedit 59650532) 2 | (descr "Through hole straight pin header, 2x08, 2.54mm pitch, double rows") 3 | (tags "Through hole pin header THT 2x08 2.54mm double row") 4 | (fp_text reference REF** (at 1.27 -2.33) (layer F.SilkS) 5 | (effects (font (size 1 1) (thickness 0.15))) 6 | ) 7 | (fp_text value Pin_Header_Straight_2x08_Pitch2.54mm (at 1.27 20.11) (layer F.Fab) 8 | (effects (font (size 1 1) (thickness 0.15))) 9 | ) 10 | (fp_line (start 0 -1.27) (end 3.81 -1.27) (layer F.Fab) (width 0.1)) 11 | (fp_line (start 3.81 -1.27) (end 3.81 19.05) (layer F.Fab) (width 0.1)) 12 | (fp_line (start 3.81 19.05) (end -1.27 19.05) (layer F.Fab) (width 0.1)) 13 | (fp_line (start -1.27 19.05) (end -1.27 0) (layer F.Fab) (width 0.1)) 14 | (fp_line (start -1.27 0) (end 0 -1.27) (layer F.Fab) (width 0.1)) 15 | (fp_line (start -1.33 19.11) (end 3.87 19.11) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start -1.33 1.27) (end -1.33 19.11) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start 3.87 -1.33) (end 3.87 19.11) (layer F.SilkS) (width 0.12)) 18 | (fp_line (start -1.33 1.27) (end 1.27 1.27) (layer F.SilkS) (width 0.12)) 19 | (fp_line (start 1.27 1.27) (end 1.27 -1.33) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start 1.27 -1.33) (end 3.87 -1.33) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start -1.33 0) (end -1.33 -1.33) (layer F.SilkS) (width 0.12)) 22 | (fp_line (start -1.33 -1.33) (end 0 -1.33) (layer F.SilkS) (width 0.12)) 23 | (fp_line (start -1.8 -1.8) (end -1.8 19.55) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start -1.8 19.55) (end 4.35 19.55) (layer F.CrtYd) (width 0.05)) 25 | (fp_line (start 4.35 19.55) (end 4.35 -1.8) (layer F.CrtYd) (width 0.05)) 26 | (fp_line (start 4.35 -1.8) (end -1.8 -1.8) (layer F.CrtYd) (width 0.05)) 27 | (fp_text user %R (at 1.27 8.89 90) (layer F.Fab) 28 | (effects (font (size 1 1) (thickness 0.15))) 29 | ) 30 | (pad 1 thru_hole rect (at 0 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 31 | (pad 2 thru_hole oval (at 2.54 0) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 32 | (pad 3 thru_hole oval (at 0 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 33 | (pad 4 thru_hole oval (at 2.54 2.54) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 34 | (pad 5 thru_hole oval (at 0 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 35 | (pad 6 thru_hole oval (at 2.54 5.08) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 36 | (pad 7 thru_hole oval (at 0 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 37 | (pad 8 thru_hole oval (at 2.54 7.62) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 38 | (pad 9 thru_hole oval (at 0 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 39 | (pad 10 thru_hole oval (at 2.54 10.16) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 40 | (pad 11 thru_hole oval (at 0 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 41 | (pad 12 thru_hole oval (at 2.54 12.7) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 42 | (pad 13 thru_hole oval (at 0 15.24) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 43 | (pad 14 thru_hole oval (at 2.54 15.24) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 44 | (pad 15 thru_hole oval (at 0 17.78) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 45 | (pad 16 thru_hole oval (at 2.54 17.78) (size 1.7 1.7) (drill 1) (layers *.Cu *.Mask)) 46 | (model ${KISYS3DMOD}/Pin_Headers.3dshapes/Pin_Header_Straight_2x08_Pitch2.54mm.wrl 47 | (at (xyz 0 0 0)) 48 | (scale (xyz 1 1 1)) 49 | (rotate (xyz 0 0 0)) 50 | ) 51 | ) 52 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/QFN-16-1EP_4x4mm_Pitch0.65mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module QFN-16-1EP_4x4mm_Pitch0.65mm (layer F.Cu) (tedit 54130A77) 2 | (descr "16-Lead Plastic Quad Flat, No Lead Package (ML) - 4x4x0.9 mm Body [QFN]; (see Microchip Packaging Specification 00000049BS.pdf)") 3 | (tags "QFN 0.65") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -3.4) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value QFN-16-1EP_4x4mm_Pitch0.65mm (at 0 3.4) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start 2.15 -2.15) (end 1.375 -2.15) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start 2.15 2.15) (end 1.375 2.15) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start -2.15 2.15) (end -1.375 2.15) (layer F.SilkS) (width 0.15)) 14 | (fp_line (start -2.15 -2.15) (end -1.375 -2.15) (layer F.SilkS) (width 0.15)) 15 | (fp_line (start 2.15 2.15) (end 2.15 1.375) (layer F.SilkS) (width 0.15)) 16 | (fp_line (start -2.15 2.15) (end -2.15 1.375) (layer F.SilkS) (width 0.15)) 17 | (fp_line (start 2.15 -2.15) (end 2.15 -1.375) (layer F.SilkS) (width 0.15)) 18 | (fp_line (start -2.65 2.65) (end 2.65 2.65) (layer F.CrtYd) (width 0.05)) 19 | (fp_line (start -2.65 -2.65) (end 2.65 -2.65) (layer F.CrtYd) (width 0.05)) 20 | (fp_line (start 2.65 -2.65) (end 2.65 2.65) (layer F.CrtYd) (width 0.05)) 21 | (fp_line (start -2.65 -2.65) (end -2.65 2.65) (layer F.CrtYd) (width 0.05)) 22 | (fp_line (start -2 -1) (end -1 -2) (layer F.Fab) (width 0.15)) 23 | (fp_line (start -2 2) (end -2 -1) (layer F.Fab) (width 0.15)) 24 | (fp_line (start 2 2) (end -2 2) (layer F.Fab) (width 0.15)) 25 | (fp_line (start 2 -2) (end 2 2) (layer F.Fab) (width 0.15)) 26 | (fp_line (start -1 -2) (end 2 -2) (layer F.Fab) (width 0.15)) 27 | (pad 17 smd rect (at -0.625 -0.625) (size 1.25 1.25) (layers F.Cu F.Paste F.Mask) 28 | (solder_paste_margin_ratio -0.2)) 29 | (pad 17 smd rect (at -0.625 0.625) (size 1.25 1.25) (layers F.Cu F.Paste F.Mask) 30 | (solder_paste_margin_ratio -0.2)) 31 | (pad 17 smd rect (at 0.625 -0.625) (size 1.25 1.25) (layers F.Cu F.Paste F.Mask) 32 | (solder_paste_margin_ratio -0.2)) 33 | (pad 17 smd rect (at 0.625 0.625) (size 1.25 1.25) (layers F.Cu F.Paste F.Mask) 34 | (solder_paste_margin_ratio -0.2)) 35 | (pad 16 smd rect (at -0.975 -2 90) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 36 | (pad 15 smd rect (at -0.325 -2 90) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 37 | (pad 14 smd rect (at 0.325 -2 90) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 38 | (pad 13 smd rect (at 0.975 -2 90) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 39 | (pad 12 smd rect (at 2 -0.975) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 40 | (pad 11 smd rect (at 2 -0.325) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 41 | (pad 10 smd rect (at 2 0.325) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 42 | (pad 9 smd rect (at 2 0.975) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 43 | (pad 8 smd rect (at 0.975 2 90) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 44 | (pad 7 smd rect (at 0.325 2 90) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 45 | (pad 6 smd rect (at -0.325 2 90) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 46 | (pad 5 smd rect (at -0.975 2 90) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 47 | (pad 4 smd rect (at -2 0.975) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 48 | (pad 3 smd rect (at -2 0.325) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 49 | (pad 2 smd rect (at -2 -0.325) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 50 | (pad 1 smd rect (at -2 -0.975) (size 0.8 0.35) (layers F.Cu F.Paste F.Mask)) 51 | (model ${KISYS3DMOD}/Housings_DFN_QFN.3dshapes/QFN-16-1EP_4x4mm_Pitch0.65mm.wrl 52 | (at (xyz 0 0 0)) 53 | (scale (xyz 1 1 1)) 54 | (rotate (xyz 0 0 0)) 55 | ) 56 | ) 57 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/QFN-32-1EP_5x5mm_Pitch0.5mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Housings_DFN_QFN:QFN-32-1EP_5x5mm_Pitch0.5mm (layer F.Cu) (tedit 54130A77) 2 | (descr "UH Package; 32-Lead Plastic QFN (5mm x 5mm); (see Linear Technology QFN_32_05-08-1693.pdf)") 3 | (tags "QFN 0.5") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -3.75) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value QFN-32-1EP_5x5mm_Pitch0.5mm (at 0 3.75) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start -1.5 -2.5) (end 2.5 -2.5) (layer F.Fab) (width 0.15)) 12 | (fp_line (start 2.5 -2.5) (end 2.5 2.5) (layer F.Fab) (width 0.15)) 13 | (fp_line (start 2.5 2.5) (end -2.5 2.5) (layer F.Fab) (width 0.15)) 14 | (fp_line (start -2.5 2.5) (end -2.5 -1.5) (layer F.Fab) (width 0.15)) 15 | (fp_line (start -2.5 -1.5) (end -1.5 -2.5) (layer F.Fab) (width 0.15)) 16 | (fp_line (start -3 -3) (end -3 3) (layer F.CrtYd) (width 0.05)) 17 | (fp_line (start 3 -3) (end 3 3) (layer F.CrtYd) (width 0.05)) 18 | (fp_line (start -3 -3) (end 3 -3) (layer F.CrtYd) (width 0.05)) 19 | (fp_line (start -3 3) (end 3 3) (layer F.CrtYd) (width 0.05)) 20 | (fp_line (start 2.625 -2.625) (end 2.625 -2.1) (layer F.SilkS) (width 0.15)) 21 | (fp_line (start -2.625 2.625) (end -2.625 2.1) (layer F.SilkS) (width 0.15)) 22 | (fp_line (start 2.625 2.625) (end 2.625 2.1) (layer F.SilkS) (width 0.15)) 23 | (fp_line (start -2.625 -2.625) (end -2.1 -2.625) (layer F.SilkS) (width 0.15)) 24 | (fp_line (start -2.625 2.625) (end -2.1 2.625) (layer F.SilkS) (width 0.15)) 25 | (fp_line (start 2.625 2.625) (end 2.1 2.625) (layer F.SilkS) (width 0.15)) 26 | (fp_line (start 2.625 -2.625) (end 2.1 -2.625) (layer F.SilkS) (width 0.15)) 27 | (pad 1 smd rect (at -2.4 -1.75) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 28 | (pad 2 smd rect (at -2.4 -1.25) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 29 | (pad 3 smd rect (at -2.4 -0.75) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 30 | (pad 4 smd rect (at -2.4 -0.25) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 31 | (pad 5 smd rect (at -2.4 0.25) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 32 | (pad 6 smd rect (at -2.4 0.75) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 33 | (pad 7 smd rect (at -2.4 1.25) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 34 | (pad 8 smd rect (at -2.4 1.75) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 35 | (pad 9 smd rect (at -1.75 2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 36 | (pad 10 smd rect (at -1.25 2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 37 | (pad 11 smd rect (at -0.75 2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 38 | (pad 12 smd rect (at -0.25 2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 39 | (pad 13 smd rect (at 0.25 2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 40 | (pad 14 smd rect (at 0.75 2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 41 | (pad 15 smd rect (at 1.25 2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 42 | (pad 16 smd rect (at 1.75 2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 43 | (pad 17 smd rect (at 2.4 1.75) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 44 | (pad 18 smd rect (at 2.4 1.25) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 45 | (pad 19 smd rect (at 2.4 0.75) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 46 | (pad 20 smd rect (at 2.4 0.25) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 47 | (pad 21 smd rect (at 2.4 -0.25) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 48 | (pad 22 smd rect (at 2.4 -0.75) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 49 | (pad 23 smd rect (at 2.4 -1.25) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 50 | (pad 24 smd rect (at 2.4 -1.75) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 51 | (pad 25 smd rect (at 1.75 -2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 52 | (pad 26 smd rect (at 1.25 -2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 53 | (pad 27 smd rect (at 0.75 -2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 54 | (pad 28 smd rect (at 0.25 -2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 55 | (pad 29 smd rect (at -0.25 -2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 56 | (pad 30 smd rect (at -0.75 -2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 57 | (pad 31 smd rect (at -1.25 -2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 58 | (pad 32 smd rect (at -1.75 -2.4 90) (size 0.7 0.25) (layers F.Cu F.Paste F.Mask)) 59 | (pad 33 smd rect (at 0.8625 0.8625) (size 1.725 1.725) (layers F.Cu F.Paste F.Mask) 60 | (solder_paste_margin_ratio -0.2)) 61 | (pad 33 smd rect (at 0.8625 -0.8625) (size 1.725 1.725) (layers F.Cu F.Paste F.Mask) 62 | (solder_paste_margin_ratio -0.2)) 63 | (pad 33 smd rect (at -0.8625 0.8625) (size 1.725 1.725) (layers F.Cu F.Paste F.Mask) 64 | (solder_paste_margin_ratio -0.2)) 65 | (pad 33 smd rect (at -0.8625 -0.8625) (size 1.725 1.725) (layers F.Cu F.Paste F.Mask) 66 | (solder_paste_margin_ratio -0.2)) 67 | (model ${KISYS3DMOD}/Housings_DFN_QFN.3dshapes/QFN-32-1EP_5x5mm_Pitch0.5mm.wrl 68 | (at (xyz 0 0 0)) 69 | (scale (xyz 1 1 1)) 70 | (rotate (xyz 0 0 0)) 71 | ) 72 | ) 73 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/R_0805.kicad_mod: -------------------------------------------------------------------------------- 1 | (module R_0805 (layer F.Cu) (tedit 58E0A804) 2 | (descr "Resistor SMD 0805, reflow soldering, Vishay (see dcrcw.pdf)") 3 | (tags "resistor 0805") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -1.65) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value R_0805 (at 0 1.75) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start 1.55 0.9) (end -1.55 0.9) (layer F.CrtYd) (width 0.05)) 12 | (fp_line (start 1.55 0.9) (end 1.55 -0.9) (layer F.CrtYd) (width 0.05)) 13 | (fp_line (start -1.55 -0.9) (end -1.55 0.9) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start -1.55 -0.9) (end 1.55 -0.9) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -0.6 -0.88) (end 0.6 -0.88) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start 0.6 0.88) (end -0.6 0.88) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start -1 -0.62) (end 1 -0.62) (layer F.Fab) (width 0.1)) 18 | (fp_line (start 1 -0.62) (end 1 0.62) (layer F.Fab) (width 0.1)) 19 | (fp_line (start 1 0.62) (end -1 0.62) (layer F.Fab) (width 0.1)) 20 | (fp_line (start -1 0.62) (end -1 -0.62) (layer F.Fab) (width 0.1)) 21 | (fp_text user %R (at 0 0) (layer F.Fab) 22 | (effects (font (size 0.5 0.5) (thickness 0.075))) 23 | ) 24 | (pad 2 smd rect (at 0.95 0) (size 0.7 1.3) (layers F.Cu F.Paste F.Mask)) 25 | (pad 1 smd rect (at -0.95 0) (size 0.7 1.3) (layers F.Cu F.Paste F.Mask)) 26 | (model ${KISYS3DMOD}/Resistors_SMD.3dshapes/R_0805.wrl 27 | (at (xyz 0 0 0)) 28 | (scale (xyz 1 1 1)) 29 | (rotate (xyz 0 0 0)) 30 | ) 31 | ) 32 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/SOD-503.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SOD-503 (layer F.Cu) (tedit 5ACDD019) 2 | (descr "Resistor SMD 0603, reflow soldering, Vishay (see dcrcw.pdf)") 3 | (tags "resistor 0603") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -1.45) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value SOD-503 (at 0 1.27) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start 1.25 0.7) (end -1.25 0.7) (layer F.CrtYd) (width 0.05)) 12 | (fp_line (start 1.25 0.7) (end 1.25 -0.7) (layer F.CrtYd) (width 0.05)) 13 | (fp_line (start -1.25 -0.7) (end -1.25 0.7) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start -1.25 -0.7) (end 1.25 -0.7) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -0.5 -0.68) (end 0.5 -0.68) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start 0.5 0.68) (end -0.5 0.68) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start -0.8 -0.4) (end 0.8 -0.4) (layer F.Fab) (width 0.1)) 18 | (fp_line (start 0.8 -0.4) (end 0.8 0.4) (layer F.Fab) (width 0.1)) 19 | (fp_line (start 0.8 0.4) (end -0.8 0.4) (layer F.Fab) (width 0.1)) 20 | (fp_line (start -0.8 0.4) (end -0.8 -0.4) (layer F.Fab) (width 0.1)) 21 | (fp_text user %R (at 0 0) (layer F.Fab) 22 | (effects (font (size 0.4 0.4) (thickness 0.075))) 23 | ) 24 | (fp_line (start -1.27 0.5635) (end -1.27 -0.5635) (layer F.SilkS) (width 0.12)) 25 | (pad 2 smd rect (at 0.66 0) (size 0.48 0.4) (layers F.Cu F.Paste F.Mask)) 26 | (pad 1 smd rect (at -0.66 0) (size 0.48 0.4) (layers F.Cu F.Paste F.Mask)) 27 | (model ${KISYS3DMOD}/Resistors_SMD.3dshapes/R_0603.wrl 28 | (at (xyz 0 0 0)) 29 | (scale (xyz 1 1 1)) 30 | (rotate (xyz 0 0 0)) 31 | ) 32 | ) 33 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/SOD-523.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SOD-523 (layer F.Cu) (tedit 5ACE010D) 2 | (descr "Resistor SMD 0603, reflow soldering, Vishay (see dcrcw.pdf)") 3 | (tags "resistor 0603") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -1.45) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value SOD-523 (at 0 1.27) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start 1.25 0.7) (end -1.25 0.7) (layer F.CrtYd) (width 0.05)) 12 | (fp_line (start 1.25 0.7) (end 1.25 -0.7) (layer F.CrtYd) (width 0.05)) 13 | (fp_line (start -1.25 -0.7) (end -1.25 0.7) (layer F.CrtYd) (width 0.05)) 14 | (fp_line (start -1.25 -0.7) (end 1.25 -0.7) (layer F.CrtYd) (width 0.05)) 15 | (fp_line (start -0.5 -0.68) (end 0.5 -0.68) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start 0.5 0.68) (end -0.5 0.68) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start -0.8 -0.4) (end 0.8 -0.4) (layer F.Fab) (width 0.1)) 18 | (fp_line (start 0.8 -0.4) (end 0.8 0.4) (layer F.Fab) (width 0.1)) 19 | (fp_line (start 0.8 0.4) (end -0.8 0.4) (layer F.Fab) (width 0.1)) 20 | (fp_line (start -0.8 0.4) (end -0.8 -0.4) (layer F.Fab) (width 0.1)) 21 | (fp_text user %R (at 0 0) (layer F.Fab) 22 | (effects (font (size 0.4 0.4) (thickness 0.075))) 23 | ) 24 | (fp_line (start -1.27 0.5635) (end -1.27 -0.5635) (layer F.SilkS) (width 0.12)) 25 | (pad 2 smd rect (at 0.66 0) (size 0.48 0.4) (layers F.Cu F.Paste F.Mask)) 26 | (pad 1 smd rect (at -0.66 0) (size 0.48 0.4) (layers F.Cu F.Paste F.Mask)) 27 | (model ${KISYS3DMOD}/Resistors_SMD.3dshapes/R_0603.wrl 28 | (at (xyz 0 0 0)) 29 | (scale (xyz 1 1 1)) 30 | (rotate (xyz 0 0 0)) 31 | ) 32 | ) 33 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/SSOP-28_5.3x10.2mm_Pitch0.65mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module SSOP-28_5.3x10.2mm_Pitch0.65mm (layer F.Cu) (tedit 54130A77) 2 | (descr "28-Lead Plastic Shrink Small Outline (SS)-5.30 mm Body [SSOP] (see Microchip Packaging Specification 00000049BS.pdf)") 3 | (tags "SSOP 0.65") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -6.25) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value SSOP-28_5.3x10.2mm_Pitch0.65mm (at 0 6.25) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_text user %R (at 0 0) (layer F.Fab) 12 | (effects (font (size 0.8 0.8) (thickness 0.15))) 13 | ) 14 | (fp_line (start -2.875 -4.75) (end -4.475 -4.75) (layer F.SilkS) (width 0.15)) 15 | (fp_line (start -2.875 5.325) (end 2.875 5.325) (layer F.SilkS) (width 0.15)) 16 | (fp_line (start -2.875 -5.325) (end 2.875 -5.325) (layer F.SilkS) (width 0.15)) 17 | (fp_line (start -2.875 5.325) (end -2.875 4.675) (layer F.SilkS) (width 0.15)) 18 | (fp_line (start 2.875 5.325) (end 2.875 4.675) (layer F.SilkS) (width 0.15)) 19 | (fp_line (start 2.875 -5.325) (end 2.875 -4.675) (layer F.SilkS) (width 0.15)) 20 | (fp_line (start -2.875 -5.325) (end -2.875 -4.75) (layer F.SilkS) (width 0.15)) 21 | (fp_line (start -4.75 5.5) (end 4.75 5.5) (layer F.CrtYd) (width 0.05)) 22 | (fp_line (start -4.75 -5.5) (end 4.75 -5.5) (layer F.CrtYd) (width 0.05)) 23 | (fp_line (start 4.75 -5.5) (end 4.75 5.5) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start -4.75 -5.5) (end -4.75 5.5) (layer F.CrtYd) (width 0.05)) 25 | (fp_line (start -2.65 -4.1) (end -1.65 -5.1) (layer F.Fab) (width 0.15)) 26 | (fp_line (start -2.65 5.1) (end -2.65 -4.1) (layer F.Fab) (width 0.15)) 27 | (fp_line (start 2.65 5.1) (end -2.65 5.1) (layer F.Fab) (width 0.15)) 28 | (fp_line (start 2.65 -5.1) (end 2.65 5.1) (layer F.Fab) (width 0.15)) 29 | (fp_line (start -1.65 -5.1) (end 2.65 -5.1) (layer F.Fab) (width 0.15)) 30 | (pad 28 smd rect (at 3.6 -4.225) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 31 | (pad 27 smd rect (at 3.6 -3.575) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 32 | (pad 26 smd rect (at 3.6 -2.925) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 33 | (pad 25 smd rect (at 3.6 -2.275) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 34 | (pad 24 smd rect (at 3.6 -1.625) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 35 | (pad 23 smd rect (at 3.6 -0.975) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 36 | (pad 22 smd rect (at 3.6 -0.325) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 37 | (pad 21 smd rect (at 3.6 0.325) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 38 | (pad 20 smd rect (at 3.6 0.975) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 39 | (pad 19 smd rect (at 3.6 1.625) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 40 | (pad 18 smd rect (at 3.6 2.275) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 41 | (pad 17 smd rect (at 3.6 2.925) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 42 | (pad 16 smd rect (at 3.6 3.575) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 43 | (pad 15 smd rect (at 3.6 4.225) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 44 | (pad 14 smd rect (at -3.6 4.225) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 45 | (pad 13 smd rect (at -3.6 3.575) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 46 | (pad 12 smd rect (at -3.6 2.925) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 47 | (pad 11 smd rect (at -3.6 2.275) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 48 | (pad 10 smd rect (at -3.6 1.625) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 49 | (pad 9 smd rect (at -3.6 0.975) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 50 | (pad 8 smd rect (at -3.6 0.325) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 51 | (pad 7 smd rect (at -3.6 -0.325) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 52 | (pad 6 smd rect (at -3.6 -0.975) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 53 | (pad 5 smd rect (at -3.6 -1.625) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 54 | (pad 4 smd rect (at -3.6 -2.275) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 55 | (pad 3 smd rect (at -3.6 -2.925) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 56 | (pad 2 smd rect (at -3.6 -3.575) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 57 | (pad 1 smd rect (at -3.6 -4.225) (size 1.75 0.45) (layers F.Cu F.Paste F.Mask)) 58 | (model ${KISYS3DMOD}/Housings_SSOP.3dshapes/SSOP-28_5.3x10.2mm_Pitch0.65mm.wrl 59 | (at (xyz 0 0 0)) 60 | (scale (xyz 1 1 1)) 61 | (rotate (xyz 0 0 0)) 62 | ) 63 | ) 64 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/TQFP-32_7x7mm_Pitch0.8mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module TQFP-32_7x7mm_Pitch0.8mm (layer F.Cu) (tedit 58CC9A48) 2 | (descr "32-Lead Plastic Thin Quad Flatpack (PT) - 7x7x1.0 mm Body, 2.00 mm [TQFP] (see Microchip Packaging Specification 00000049BS.pdf)") 3 | (tags "QFP 0.8") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -6.05) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value TQFP-32_7x7mm_Pitch0.8mm (at 0 6.05) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start -3.625 -3.4) (end -5.05 -3.4) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start 3.625 -3.625) (end 3.3 -3.625) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start 3.625 3.625) (end 3.3 3.625) (layer F.SilkS) (width 0.15)) 14 | (fp_line (start -3.625 3.625) (end -3.3 3.625) (layer F.SilkS) (width 0.15)) 15 | (fp_line (start -3.625 -3.625) (end -3.3 -3.625) (layer F.SilkS) (width 0.15)) 16 | (fp_line (start -3.625 3.625) (end -3.625 3.3) (layer F.SilkS) (width 0.15)) 17 | (fp_line (start 3.625 3.625) (end 3.625 3.3) (layer F.SilkS) (width 0.15)) 18 | (fp_line (start 3.625 -3.625) (end 3.625 -3.3) (layer F.SilkS) (width 0.15)) 19 | (fp_line (start -3.625 -3.625) (end -3.625 -3.4) (layer F.SilkS) (width 0.15)) 20 | (fp_line (start -5.3 5.3) (end 5.3 5.3) (layer F.CrtYd) (width 0.05)) 21 | (fp_line (start -5.3 -5.3) (end 5.3 -5.3) (layer F.CrtYd) (width 0.05)) 22 | (fp_line (start 5.3 -5.3) (end 5.3 5.3) (layer F.CrtYd) (width 0.05)) 23 | (fp_line (start -5.3 -5.3) (end -5.3 5.3) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start -3.5 -2.5) (end -2.5 -3.5) (layer F.Fab) (width 0.15)) 25 | (fp_line (start -3.5 3.5) (end -3.5 -2.5) (layer F.Fab) (width 0.15)) 26 | (fp_line (start 3.5 3.5) (end -3.5 3.5) (layer F.Fab) (width 0.15)) 27 | (fp_line (start 3.5 -3.5) (end 3.5 3.5) (layer F.Fab) (width 0.15)) 28 | (fp_line (start -2.5 -3.5) (end 3.5 -3.5) (layer F.Fab) (width 0.15)) 29 | (fp_text user %R (at 0 0) (layer F.Fab) 30 | (effects (font (size 1 1) (thickness 0.15))) 31 | ) 32 | (pad 32 smd rect (at -2.8 -4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 33 | (pad 31 smd rect (at -2 -4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 34 | (pad 30 smd rect (at -1.2 -4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 35 | (pad 29 smd rect (at -0.4 -4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 36 | (pad 28 smd rect (at 0.4 -4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 37 | (pad 27 smd rect (at 1.2 -4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 38 | (pad 26 smd rect (at 2 -4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 39 | (pad 25 smd rect (at 2.8 -4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 40 | (pad 24 smd rect (at 4.25 -2.8) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 41 | (pad 23 smd rect (at 4.25 -2) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 42 | (pad 22 smd rect (at 4.25 -1.2) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 43 | (pad 21 smd rect (at 4.25 -0.4) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 44 | (pad 20 smd rect (at 4.25 0.4) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 45 | (pad 19 smd rect (at 4.25 1.2) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 46 | (pad 18 smd rect (at 4.25 2) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 47 | (pad 17 smd rect (at 4.25 2.8) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 48 | (pad 16 smd rect (at 2.8 4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 49 | (pad 15 smd rect (at 2 4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 50 | (pad 14 smd rect (at 1.2 4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 51 | (pad 13 smd rect (at 0.4 4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 52 | (pad 12 smd rect (at -0.4 4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 53 | (pad 11 smd rect (at -1.2 4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 54 | (pad 10 smd rect (at -2 4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 55 | (pad 9 smd rect (at -2.8 4.25 90) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 56 | (pad 8 smd rect (at -4.25 2.8) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 57 | (pad 7 smd rect (at -4.25 2) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 58 | (pad 6 smd rect (at -4.25 1.2) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 59 | (pad 5 smd rect (at -4.25 0.4) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 60 | (pad 4 smd rect (at -4.25 -0.4) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 61 | (pad 3 smd rect (at -4.25 -1.2) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 62 | (pad 2 smd rect (at -4.25 -2) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 63 | (pad 1 smd rect (at -4.25 -2.8) (size 1.6 0.55) (layers F.Cu F.Paste F.Mask)) 64 | (model ${KISYS3DMOD}/Housings_QFP.3dshapes/TQFP-32_7x7mm_Pitch0.8mm.wrl 65 | (at (xyz 0 0 0)) 66 | (scale (xyz 1 1 1)) 67 | (rotate (xyz 0 0 0)) 68 | ) 69 | ) 70 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/USB_Micro-B_Molex-105017-0001.kicad_mod: -------------------------------------------------------------------------------- 1 | (module USB_Micro-B_Molex-105017-0001 (layer F.Cu) (tedit 598B308E) 2 | (descr http://www.molex.com/pdm_docs/sd/1050170001_sd.pdf) 3 | (tags "Micro-USB SMD Typ-B") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -4) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value USB_Micro-B_Molex-105017-0001 (at 0.3 3.45) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start -1.1 -3.01) (end -1.1 -2.8) (layer F.Fab) (width 0.1)) 12 | (fp_line (start -1.5 -3.01) (end -1.5 -2.8) (layer F.Fab) (width 0.1)) 13 | (fp_line (start -1.5 -3.01) (end -1.1 -3.01) (layer F.Fab) (width 0.1)) 14 | (fp_line (start -1.1 -2.8) (end -1.3 -2.6) (layer F.Fab) (width 0.1)) 15 | (fp_line (start -1.3 -2.6) (end -1.5 -2.8) (layer F.Fab) (width 0.1)) 16 | (fp_line (start -1.7 -3.2) (end -1.7 -2.75) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start -1.7 -3.2) (end -1.25 -3.2) (layer F.SilkS) (width 0.12)) 18 | (fp_text user %R (at 0 0) (layer F.Fab) 19 | (effects (font (size 1 1) (thickness 0.15))) 20 | ) 21 | (fp_line (start 3.9 -2.65) (end 3.45 -2.65) (layer F.SilkS) (width 0.12)) 22 | (fp_line (start 3.9 -0.8) (end 3.9 -2.65) (layer F.SilkS) (width 0.12)) 23 | (fp_line (start -3.9 1.75) (end -3.9 1.5) (layer F.SilkS) (width 0.12)) 24 | (fp_line (start -3.75 2.5) (end -3.75 -2.5) (layer F.Fab) (width 0.1)) 25 | (fp_line (start -3.75 -2.5) (end 3.75 -2.5) (layer F.Fab) (width 0.1)) 26 | (fp_line (start -3.75 2.501704) (end 3.75 2.501704) (layer F.Fab) (width 0.1)) 27 | (fp_line (start -3 1.801704) (end 3 1.801704) (layer F.Fab) (width 0.1)) 28 | (fp_line (start 3.75 2.5) (end 3.75 -2.5) (layer F.Fab) (width 0.1)) 29 | (fp_line (start 3.9 1.75) (end 3.9 1.5) (layer F.SilkS) (width 0.12)) 30 | (fp_line (start -3.9 -0.8) (end -3.9 -2.65) (layer F.SilkS) (width 0.12)) 31 | (fp_line (start -3.9 -2.65) (end -3.45 -2.65) (layer F.SilkS) (width 0.12)) 32 | (fp_text user "PCB Edge" (at 0 1.8) (layer Dwgs.User) 33 | (effects (font (size 0.5 0.5) (thickness 0.08))) 34 | ) 35 | (fp_line (start -4.4 2.75) (end -4.4 -3.35) (layer F.CrtYd) (width 0.05)) 36 | (fp_line (start -4.4 -3.35) (end 4.4 -3.35) (layer F.CrtYd) (width 0.05)) 37 | (fp_line (start 4.4 -3.35) (end 4.4 2.75) (layer F.CrtYd) (width 0.05)) 38 | (fp_line (start -4.4 2.75) (end 4.4 2.75) (layer F.CrtYd) (width 0.05)) 39 | (pad 6 smd rect (at -2.9 0.35) (size 1.2 1.9) (layers F.Cu F.Mask)) 40 | (pad 6 smd rect (at 2.9 0.35) (size 1.2 1.9) (layers F.Cu F.Mask)) 41 | (pad 6 thru_hole oval (at 3.5 0.35) (size 1.2 1.9) (drill oval 0.6 1.3) (layers *.Cu *.Mask)) 42 | (pad 6 thru_hole oval (at -3.5 0.35 180) (size 1.2 1.9) (drill oval 0.6 1.3) (layers *.Cu *.Mask)) 43 | (pad 6 smd rect (at -1 0.35) (size 1.5 1.9) (layers F.Cu F.Paste F.Mask)) 44 | (pad 6 thru_hole circle (at 2.5 -2.35) (size 1.45 1.45) (drill 0.85) (layers *.Cu *.Mask)) 45 | (pad 3 smd rect (at 0 -2.35) (size 0.4 1.35) (layers F.Cu F.Paste F.Mask)) 46 | (pad 4 smd rect (at 0.65 -2.35) (size 0.4 1.35) (layers F.Cu F.Paste F.Mask)) 47 | (pad 5 smd rect (at 1.3 -2.35) (size 0.4 1.35) (layers F.Cu F.Paste F.Mask)) 48 | (pad 1 smd rect (at -1.3 -2.35) (size 0.4 1.35) (layers F.Cu F.Paste F.Mask)) 49 | (pad 2 smd rect (at -0.65 -2.35) (size 0.4 1.35) (layers F.Cu F.Paste F.Mask)) 50 | (pad 6 thru_hole circle (at -2.5 -2.35) (size 1.45 1.45) (drill 0.85) (layers *.Cu *.Mask)) 51 | (pad 6 smd rect (at 1 0.35) (size 1.5 1.9) (layers F.Cu F.Paste F.Mask)) 52 | (model ${KISYS3DMOD}/Connectors_USB.3dshapes/USB_Micro-B_Molex-105017-0001.wrl 53 | (at (xyz 0 0 0)) 54 | (scale (xyz 1 1 1)) 55 | (rotate (xyz 0 0 0)) 56 | ) 57 | ) 58 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/USB_Mini_SMD.kicad_mod: -------------------------------------------------------------------------------- 1 | (module USB_Mini_SMD (layer F.Cu) (tedit 5AD47C4A) 2 | (fp_text reference J44 (at 6.2666 -1.28 90) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value USB_B_Mini (at 7.943 0.625 90) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (pad 4 smd rect (at 2.54 0.8) (size 2.3 0.5) (layers F.Cu F.Paste F.Mask)) 9 | (pad 3 smd rect (at 2.54 0) (size 2.3 0.5) (layers F.Cu F.Paste F.Mask)) 10 | (pad 2 smd rect (at 2.54 -0.8) (size 2.3 0.5) (layers F.Cu F.Paste F.Mask)) 11 | (pad 1 smd rect (at 2.54 -1.6) (size 2.3 0.5) (layers F.Cu F.Paste F.Mask)) 12 | (pad 6 smd rect (at 2.5 -4.45) (size 2.5 2) (layers F.Cu F.Paste F.Mask)) 13 | (pad 5 smd rect (at 2.54 1.6) (size 2.3 0.5) (layers F.Cu F.Paste F.Mask)) 14 | (pad 6 smd rect (at -3 4.45) (size 2.5 2) (layers F.Cu F.Paste F.Mask)) 15 | (pad 6 smd rect (at 2.5 4.45) (size 2.5 2) (layers F.Cu F.Paste F.Mask)) 16 | (pad 6 smd rect (at -3 -4.45) (size 2.5 2) (layers F.Cu F.Paste F.Mask)) 17 | (pad "" thru_hole circle (at 0 2.2) (size 0.9 0.9) (drill 0.762) (layers *.Cu *.Mask)) 18 | (pad "" thru_hole circle (at 0 -2.2) (size 0.9 0.9) (drill 0.762) (layers *.Cu *.Mask)) 19 | ) 20 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pretty/WQFN-32-1EP_5x5mm_Pitch0.5mm.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Housings_DFN_QFN:WQFN-32-1EP_5x5mm_Pitch0.5mm (layer F.Cu) (tedit 59961CAD) 2 | (descr "QFN, 32-Leads, Body 5x5x0.8mm, Pitch 0.5mm, Thermal Pad 3.1x3.1mm; (see Texas Instruments LM25119 http://www.ti.com/lit/ds/symlink/lm25119.pdf)") 3 | (tags "WQFN 0.5") 4 | (attr smd) 5 | (fp_text reference REF** (at 0 -3.81) (layer F.SilkS) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_text value WQFN-32-1EP_5x5mm_Pitch0.5mm (at 0 3.81) (layer F.Fab) 9 | (effects (font (size 1 1) (thickness 0.15))) 10 | ) 11 | (fp_line (start 2.5 -2.5) (end -1.5 -2.5) (layer F.Fab) (width 0.1)) 12 | (fp_line (start -1.5 -2.5) (end -2.5 -1.5) (layer F.Fab) (width 0.1)) 13 | (fp_line (start -2.5 -1.5) (end -2.5 2.5) (layer F.Fab) (width 0.1)) 14 | (fp_line (start -2.159 -2.667) (end -2.667 -2.667) (layer F.SilkS) (width 0.12)) 15 | (fp_line (start -2.159 2.667) (end -2.667 2.667) (layer F.SilkS) (width 0.12)) 16 | (fp_line (start -2.667 2.667) (end -2.667 2.159) (layer F.SilkS) (width 0.12)) 17 | (fp_line (start 2.667 2.159) (end 2.667 2.667) (layer F.SilkS) (width 0.12)) 18 | (fp_line (start 2.667 2.667) (end 2.159 2.667) (layer F.SilkS) (width 0.12)) 19 | (fp_line (start 2.159 -2.667) (end 2.667 -2.667) (layer F.SilkS) (width 0.12)) 20 | (fp_line (start 2.667 -2.667) (end 2.667 -2.159) (layer F.SilkS) (width 0.12)) 21 | (fp_line (start 2.5 -2.5) (end 2.5 2.5) (layer F.Fab) (width 0.1)) 22 | (fp_line (start 2.5 2.5) (end -2.5 2.5) (layer F.Fab) (width 0.1)) 23 | (fp_line (start -2.95 -2.95) (end 2.95 -2.95) (layer F.CrtYd) (width 0.05)) 24 | (fp_line (start 2.95 -2.95) (end 2.95 2.95) (layer F.CrtYd) (width 0.05)) 25 | (fp_line (start 2.95 2.95) (end -2.95 2.95) (layer F.CrtYd) (width 0.05)) 26 | (fp_line (start -2.95 2.95) (end -2.95 -2.95) (layer F.CrtYd) (width 0.05)) 27 | (fp_text user %R (at 0 0) (layer F.Fab) 28 | (effects (font (size 1 1) (thickness 0.15))) 29 | ) 30 | (pad 33 smd rect (at -0.775 0.775) (size 1.55 1.55) (layers F.Cu F.Paste F.Mask) 31 | (solder_paste_margin_ratio -0.2)) 32 | (pad 33 smd rect (at -0.775 -0.775) (size 1.55 1.55) (layers F.Cu F.Paste F.Mask) 33 | (solder_paste_margin_ratio -0.2)) 34 | (pad 33 smd rect (at 0.775 -0.775) (size 1.55 1.55) (layers F.Cu F.Paste F.Mask) 35 | (solder_paste_margin_ratio -0.2)) 36 | (pad 1 smd rect (at -2.4 -1.75 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 37 | (pad 2 smd rect (at -2.4 -1.25 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 38 | (pad 3 smd rect (at -2.4 -0.75 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 39 | (pad 4 smd rect (at -2.4 -0.25 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 40 | (pad 5 smd rect (at -2.4 0.25 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 41 | (pad 6 smd rect (at -2.4 0.75 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 42 | (pad 7 smd rect (at -2.4 1.25 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 43 | (pad 8 smd rect (at -2.4 1.75 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 44 | (pad 9 smd rect (at -1.75 2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 45 | (pad 10 smd rect (at -1.25 2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 46 | (pad 11 smd rect (at -0.75 2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 47 | (pad 12 smd rect (at -0.25 2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 48 | (pad 13 smd rect (at 0.25 2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 49 | (pad 14 smd rect (at 0.75 2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 50 | (pad 15 smd rect (at 1.25 2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 51 | (pad 16 smd rect (at 1.75 2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 52 | (pad 17 smd rect (at 2.4 1.75 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 53 | (pad 18 smd rect (at 2.4 1.25 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 54 | (pad 19 smd rect (at 2.4 0.75 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 55 | (pad 20 smd rect (at 2.4 0.25 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 56 | (pad 21 smd rect (at 2.4 -0.25 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 57 | (pad 22 smd rect (at 2.4 -0.75 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 58 | (pad 23 smd rect (at 2.4 -1.25 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 59 | (pad 24 smd rect (at 2.4 -1.75 90) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 60 | (pad 25 smd rect (at 1.75 -2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 61 | (pad 26 smd rect (at 1.25 -2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 62 | (pad 27 smd rect (at 0.75 -2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 63 | (pad 28 smd rect (at 0.25 -2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 64 | (pad 29 smd rect (at -0.25 -2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 65 | (pad 30 smd rect (at -0.75 -2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 66 | (pad 31 smd rect (at -1.25 -2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 67 | (pad 32 smd rect (at -1.75 -2.4) (size 0.25 0.6) (layers F.Cu F.Paste F.Mask)) 68 | (pad 33 smd rect (at 0.775 0.775) (size 1.55 1.55) (layers F.Cu F.Paste F.Mask) 69 | (solder_paste_margin_ratio -0.2)) 70 | (model ${KISYS3DMOD}/Housings_DFN_QFN.3dshapes/WQFN-32-1EP_5x5mm_Pitch0.5mm.wrl 71 | (at (xyz 0 0 0)) 72 | (scale (xyz 1 1 1)) 73 | (rotate (xyz 0 0 0)) 74 | ) 75 | ) 76 | -------------------------------------------------------------------------------- /hw/MIR/MIR.pro: -------------------------------------------------------------------------------- 1 | update=Wed 14 Nov 2018 01:30:36 PM CET 2 | version=1 3 | last_client=kicad 4 | [cvpcb] 5 | version=1 6 | NetIExt=net 7 | [general] 8 | version=1 9 | [eeschema] 10 | version=1 11 | LibDir= 12 | [schematic_editor] 13 | version=1 14 | PageLayoutDescrFile= 15 | PlotDirectoryName= 16 | SubpartIdSeparator=0 17 | SubpartFirstId=65 18 | NetFmtName= 19 | SpiceAjustPassiveValues=0 20 | LabSize=50 21 | ERC_TestSimilarLabels=1 22 | [pcbnew] 23 | version=1 24 | PageLayoutDescrFile= 25 | LastNetListRead= 26 | CopperLayerCount=2 27 | BoardThickness=1.6 28 | AllowMicroVias=0 29 | AllowBlindVias=0 30 | RequireCourtyardDefinitions=0 31 | ProhibitOverlappingCourtyards=1 32 | MinTrackWidth=0.2 33 | MinViaDiameter=0.4 34 | MinViaDrill=0.3 35 | MinMicroViaDiameter=0.2 36 | MinMicroViaDrill=0.09999999999999999 37 | MinHoleToHole=0.25 38 | TrackWidth1=0.2 39 | ViaDiameter1=0.8 40 | ViaDrill1=0.4 41 | dPairWidth1=0.2 42 | dPairGap1=0.25 43 | dPairViaGap1=0.25 44 | SilkLineWidth=0.15 45 | SilkTextSizeV=0.6 46 | SilkTextSizeH=0.6 47 | SilkTextSizeThickness=0.12 48 | SilkTextItalic=0 49 | SilkTextUpright=1 50 | CopperLineWidth=0.2 51 | CopperTextSizeV=1.5 52 | CopperTextSizeH=1.5 53 | CopperTextThickness=0.3 54 | CopperTextItalic=0 55 | CopperTextUpright=1 56 | EdgeCutLineWidth=0.2 57 | CourtyardLineWidth=0.05 58 | OthersLineWidth=0.15 59 | OthersTextSizeV=1 60 | OthersTextSizeH=1 61 | OthersTextSizeThickness=0.15 62 | OthersTextItalic=0 63 | OthersTextUpright=1 64 | SolderMaskClearance=0.05 65 | SolderMaskMinWidth=0.25 66 | SolderPasteClearance=0 67 | SolderPasteRatio=-0 68 | [pcbnew/Netclasses] 69 | [pcbnew/Netclasses/1] 70 | Name=Power 71 | Clearance=0.2 72 | TrackWidth=0.6 73 | ViaDiameter=0.8 74 | ViaDrill=0.4 75 | uViaDiameter=0.3 76 | uViaDrill=0.1 77 | dPairWidth=0.2 78 | dPairGap=0.25 79 | dPairViaGap=0.25 80 | -------------------------------------------------------------------------------- /hw/MIR/README.rst: -------------------------------------------------------------------------------- 1 | ######### 2 | MIR addon 3 | ######### 4 | 5 | This folder contains hardware documentation for MIR addon. 6 | The documentation was created with KiCad nightly build. 7 | 8 | For more information go to muxpi/sw/MuxPi-addons/MIR 9 | -------------------------------------------------------------------------------- /hw/MIR/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name MIR)(type KiCad)(uri ${KIPRJMOD}/MIR.pretty)(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /hw/MIR/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/hw/MIR/qrcode.png -------------------------------------------------------------------------------- /hw/MIR/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name MIR)(type Legacy)(uri ${KIPRJMOD}/MIR.lib)(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /hw/MuxPi add-on template/MuxPi_addon.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.4 2 | #encoding utf-8 3 | # 4 | # C 5 | # 6 | DEF C C 0 10 N Y 1 F N 7 | F0 "C" 25 100 50 H V L CNN 8 | F1 "C" 25 -100 50 H V L CNN 9 | F2 "" 38 -150 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | C_* 13 | $ENDFPLIST 14 | DRAW 15 | P 2 0 1 20 -80 -30 80 -30 N 16 | P 2 0 1 20 -80 30 80 30 N 17 | X ~ 1 0 150 110 D 50 50 1 1 P 18 | X ~ 2 0 -150 110 U 50 50 1 1 P 19 | ENDDRAW 20 | ENDDEF 21 | # 22 | # CONN_01X01 23 | # 24 | DEF CONN_01X01 J 0 40 Y N 1 F N 25 | F0 "J" 0 100 50 H V C CNN 26 | F1 "CONN_01X01" 100 0 50 V V C CNN 27 | F2 "" 0 0 50 H I C CNN 28 | F3 "" 0 0 50 H I C CNN 29 | $FPLIST 30 | Pin_Header_Straight_1X* 31 | Pin_Header_Angled_1X* 32 | Socket_Strip_Straight_1X* 33 | Socket_Strip_Angled_1X* 34 | $ENDFPLIST 35 | DRAW 36 | S -50 5 10 -5 0 1 0 N 37 | S -50 50 50 -50 0 1 0 N 38 | X P1 1 -200 0 150 R 50 50 1 1 P 39 | ENDDRAW 40 | ENDDEF 41 | # 42 | # CONN_02X08 43 | # 44 | DEF CONN_02X08 J 0 1 Y N 1 F N 45 | F0 "J" 0 450 50 H V C CNN 46 | F1 "CONN_02X08" 0 0 50 V V C CNN 47 | F2 "" 0 -1200 50 H I C CNN 48 | F3 "" 0 -1200 50 H I C CNN 49 | $FPLIST 50 | Pin_Header_Straight_2X* 51 | Pin_Header_Angled_2X* 52 | Socket_Strip_Straight_2X* 53 | Socket_Strip_Angled_2X* 54 | IDC_Header_Straight_* 55 | $ENDFPLIST 56 | DRAW 57 | S -100 -345 -50 -355 0 1 0 N 58 | S -100 -245 -50 -255 0 1 0 N 59 | S -100 -145 -50 -155 0 1 0 N 60 | S -100 -45 -50 -55 0 1 0 N 61 | S -100 55 -50 45 0 1 0 N 62 | S -100 155 -50 145 0 1 0 N 63 | S -100 255 -50 245 0 1 0 N 64 | S -100 355 -50 345 0 1 0 N 65 | S -100 400 100 -400 0 1 0 N 66 | S 50 -345 100 -355 0 1 0 N 67 | S 50 -245 100 -255 0 1 0 N 68 | S 50 -145 100 -155 0 1 0 N 69 | S 50 -45 100 -55 0 1 0 N 70 | S 50 55 100 45 0 1 0 N 71 | S 50 155 100 145 0 1 0 N 72 | S 50 255 100 245 0 1 0 N 73 | S 50 355 100 345 0 1 0 N 74 | X P1 1 -250 350 150 R 50 50 1 1 P 75 | X P10 10 250 -50 150 L 50 50 1 1 P 76 | X P11 11 -250 -150 150 R 50 50 1 1 P 77 | X P12 12 250 -150 150 L 50 50 1 1 P 78 | X P13 13 -250 -250 150 R 50 50 1 1 P 79 | X P14 14 250 -250 150 L 50 50 1 1 P 80 | X P15 15 -250 -350 150 R 50 50 1 1 P 81 | X P16 16 250 -350 150 L 50 50 1 1 P 82 | X P2 2 250 350 150 L 50 50 1 1 P 83 | X P3 3 -250 250 150 R 50 50 1 1 P 84 | X P4 4 250 250 150 L 50 50 1 1 P 85 | X P5 5 -250 150 150 R 50 50 1 1 P 86 | X P6 6 250 150 150 L 50 50 1 1 P 87 | X P7 7 -250 50 150 R 50 50 1 1 P 88 | X P8 8 250 50 150 L 50 50 1 1 P 89 | X P9 9 -250 -50 150 R 50 50 1 1 P 90 | ENDDRAW 91 | ENDDEF 92 | # 93 | # CP 94 | # 95 | DEF CP C 0 10 N Y 1 F N 96 | F0 "C" 25 100 50 H V L CNN 97 | F1 "CP" 25 -100 50 H V L CNN 98 | F2 "" 38 -150 50 H I C CNN 99 | F3 "" 0 0 50 H I C CNN 100 | $FPLIST 101 | CP_* 102 | $ENDFPLIST 103 | DRAW 104 | S -90 20 -90 40 0 1 0 N 105 | S -90 20 90 20 0 1 0 N 106 | S 90 -20 -90 -40 0 1 0 F 107 | S 90 40 -90 40 0 1 0 N 108 | S 90 40 90 20 0 1 0 N 109 | P 2 0 1 0 -70 90 -30 90 N 110 | P 2 0 1 0 -50 110 -50 70 N 111 | X ~ 1 0 150 110 D 50 50 1 1 P 112 | X ~ 2 0 -150 110 U 50 50 1 1 P 113 | ENDDRAW 114 | ENDDEF 115 | # 116 | # FT230XQ 117 | # 118 | DEF FT230XQ U 0 40 Y Y 1 F N 119 | F0 "U" -550 600 50 H V L CNN 120 | F1 "FT230XQ" 300 600 50 H V L CNN 121 | F2 "QFN-16" 0 0 50 H I C CNN 122 | F3 "" 0 0 50 H I C CNN 123 | $FPLIST 124 | QFN* 125 | $ENDFPLIST 126 | DRAW 127 | S -550 550 550 -550 0 1 10 f 128 | X VCCIO 1 100 700 150 D 50 50 1 1 W 129 | X VCC 10 -100 700 150 D 50 50 1 1 W 130 | X CBUS1 11 700 -200 150 L 50 50 1 1 B 131 | X CBUS0 12 700 -100 150 L 50 50 1 1 B 132 | X GND 13 0 -700 150 U 50 50 1 1 W 133 | X CBUS3 14 700 -400 150 L 50 50 1 1 B 134 | X TXD 15 700 400 150 L 50 50 1 1 O 135 | X ~RTS 16 700 200 150 L 50 50 1 1 I 136 | X GND 17 100 -700 150 U 50 50 1 1 W 137 | X RXD 2 700 300 150 L 50 50 1 1 I 138 | X GND 3 -100 -700 150 U 50 50 1 1 W 139 | X ~CTS 4 700 100 150 L 50 50 1 1 I 140 | X CBUS2 5 700 -300 150 L 50 50 1 1 B 141 | X USBDP 6 -700 0 150 R 50 50 1 1 B 142 | X USBDM 7 -700 100 150 R 50 50 1 1 B 143 | X 3V3OUT 8 -700 400 150 R 50 50 1 1 w 144 | X ~RESET 9 -700 -200 150 R 50 50 1 1 I 145 | ENDDRAW 146 | ENDDEF 147 | # 148 | # Ferrite_Bead_Small 149 | # 150 | DEF Ferrite_Bead_Small L 0 0 N Y 1 F N 151 | F0 "L" 75 50 50 H V L CNN 152 | F1 "Ferrite_Bead_Small" 75 -50 50 H V L CNN 153 | F2 "" -70 0 50 V I C CNN 154 | F3 "" 0 0 50 H I C CNN 155 | $FPLIST 156 | Inductor_* 157 | L_* 158 | *Ferrite* 159 | $ENDFPLIST 160 | DRAW 161 | P 2 0 1 0 0 -50 0 -31 N 162 | P 2 0 1 0 0 35 0 51 N 163 | P 5 0 1 0 -72 11 -44 59 72 -8 44 -56 -72 11 N 164 | X ~ 1 0 100 50 D 50 50 1 1 P 165 | X ~ 2 0 -100 50 U 50 50 1 1 P 166 | ENDDRAW 167 | ENDDEF 168 | # 169 | # LED_ALT 170 | # 171 | DEF LED_ALT D 0 40 Y N 1 F N 172 | F0 "D" 0 100 50 H V C CNN 173 | F1 "LED_ALT" 0 -100 50 H V C CNN 174 | F2 "" 0 0 50 H I C CNN 175 | F3 "" 0 0 50 H I C CNN 176 | $FPLIST 177 | LED* 178 | $ENDFPLIST 179 | DRAW 180 | P 2 0 1 8 -50 -50 -50 50 N 181 | P 2 0 1 0 -50 0 50 0 N 182 | P 4 0 1 8 50 -50 50 50 -50 0 50 -50 F 183 | P 5 0 1 0 -120 -30 -180 -90 -150 -90 -180 -90 -180 -60 N 184 | P 5 0 1 0 -70 -30 -130 -90 -100 -90 -130 -90 -130 -60 N 185 | X K 1 -150 0 100 R 50 50 1 1 P 186 | X A 2 150 0 100 L 50 50 1 1 P 187 | ENDDRAW 188 | ENDDEF 189 | # 190 | # R 191 | # 192 | DEF R R 0 0 N Y 1 F N 193 | F0 "R" 80 0 50 V V C CNN 194 | F1 "R" 0 0 50 V V C CNN 195 | F2 "" -70 0 50 V I C CNN 196 | F3 "" 0 0 50 H I C CNN 197 | $FPLIST 198 | R_* 199 | R_* 200 | $ENDFPLIST 201 | DRAW 202 | S -40 -100 40 100 0 1 10 N 203 | X ~ 1 0 150 50 D 50 50 1 1 P 204 | X ~ 2 0 -150 50 U 50 50 1 1 P 205 | ENDDRAW 206 | ENDDEF 207 | # 208 | #End Library 209 | -------------------------------------------------------------------------------- /hw/MuxPi add-on template/MuxPi_addon_template.pro: -------------------------------------------------------------------------------- 1 | update=Tue 03 Apr 2018 12:37:27 PM CEST 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | -------------------------------------------------------------------------------- /hw/MuxPi add-on template/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name MuxPi_addon)(type Legacy)(uri ${KIPRJMOD}/MuxPi_addon.lib)(options "")(descr "")) 3 | (lib (name power)(type Legacy)(uri ${KICAD_SYMBOL_DIR}/power.lib)(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /hw/MuxPi/MuxPi.pro: -------------------------------------------------------------------------------- 1 | update=Thu 27 Sep 2018 08:41:27 AM CEST 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | [schematic_editor] 32 | version=1 33 | PageLayoutDescrFile= 34 | PlotDirectoryName= 35 | SubpartIdSeparator=0 36 | SubpartFirstId=65 37 | NetFmtName= 38 | SpiceAjustPassiveValues=0 39 | LabSize=60 40 | ERC_TestSimilarLabels=1 41 | -------------------------------------------------------------------------------- /hw/MuxPi/README: -------------------------------------------------------------------------------- 1 | Files in this directory were created using KiCad nightly build. The reason for 2 | usage of nightly build is availability of more extensive libraries and better 3 | tools. 4 | 5 | On Debian-based Linux distributions you can do the following:: 6 | 7 | sudo add-apt-repository ppa:js-reynaud/ppa-kicad 8 | sudo apt-get update 9 | sudo apt-get install kicad kicad-library 10 | -------------------------------------------------------------------------------- /hw/MuxPi/README.rst: -------------------------------------------------------------------------------- 1 | README -------------------------------------------------------------------------------- /hw/MuxPi/changelog.txt: -------------------------------------------------------------------------------- 1 | MuxPi hardware changelog. 2 | 3 | Note: Hardware versioning is not related to git tags of this repository. 4 | 5 | 1.0 - 2017-01-18 - never published 6 | Initial release 7 | Main components: 8 | - NanoPi NEO v1.1 and v1.2 compatible socket 9 | - 4-wire UART level shifter 10 | - Watchdog timer (ATtiny) 11 | - Power control & current measurement 12 | - STM32 microntroller handling: 13 | * SD-MUX module 14 | * DyPers 15 | * UI (OLED 128x32, 2xRGB LED, push buttons) 16 | * HDMI/DDC 17 | * DUT's power switch 18 | * DUT's power consumption measurement 19 | - 2 port USB hub with integrated SD card reader 20 | - USB<->ETH converter 21 | - SD-MUX 22 | - 2x 2-channel DyPers 23 | - HDMI/DDC 24 | 25 | 1.1 - 2018-02-01 26 | Added Cortex-M0 flashing from NanoPi NEO capability 27 | Added reverse-polarity protection 28 | Added USB-M circuitry 29 | Added voltage genreator for DUT UART 30 | Added NanoPi NEO debug UART converter 31 | Changed SD-MUX power supply switching circuitry (MOS -> PNP) 32 | Removed one connector (TS side) for microSD flat cable 33 | 34 | 1.2 - 2018-04-20 35 | Fixed footprint for NanoPi NEO debug UART converter 36 | Fixed (partially) current measurement circuitry - still needs further improvements 37 | Fixed SD-MUX power supply switching circuitry (inverted SOCKET_SEL signal) 38 | Adjusted to NanoPi NEO v1.3 keeping compatibility with v1.2 and v1.1 39 | 40 | 1.3 - 2018-08-14 41 | Added alternative power supply for NanoPi NEO debug UART<->USB converter 42 | Previously the converter was powered from USB cable. As it turned out 43 | it has to be powered even when it's not connected to any PC. 44 | Change few footprints to more convenient ones 45 | Change current measurement circuitry 46 | -------------------------------------------------------------------------------- /hw/MuxPi/sym-lib-table: -------------------------------------------------------------------------------- 1 | (sym_lib_table 2 | (lib (name MuxPi)(type Legacy)(uri ${KIPRJMOD}/MuxPi.lib)(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/Arduino/Mir.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License 15 | */ 16 | 17 | // MIR : MuxPi IR Addon 18 | // This code is responsible for MIR's microcontroller work. 19 | // MIR reads raw code from serial, and sends apropriate IR signal. 20 | #include 21 | 22 | IRsend irsend; 23 | 24 | // Addon LED setup 25 | const int RED = 13; 26 | // Samsung TV remote carrier frequency 27 | const int kHz = 38; 28 | // Samsung TV remote raw data length 29 | const size_t bufferSize = 67; 30 | 31 | // sendCode executes IR data transmission. 32 | // During transmission the red led is on to indicate data transfer. 33 | void sendCode(unsigned int *code) 34 | { 35 | digitalWrite(RED, HIGH); 36 | irsend.sendRaw(code, bufferSize, kHz); 37 | digitalWrite(RED, LOW); 38 | } 39 | 40 | // processData prepares data and sends apropriate IR signal 41 | // 42 | // FIXME: sendSamsung() from IRremote library does not work properly, 43 | // That is why this workaround is needed. 44 | void processData(String raw) 45 | { 46 | // For debug purposes 47 | // Serial.print(raw); 48 | size_t index = 0; 49 | // Convert string to unsignet int array 50 | char *str = (char *)raw.c_str(); 51 | unsigned int arr[bufferSize]; 52 | // Split string 53 | char *p = strtok(str, ","); 54 | 55 | // Convert raw data (string) to unsigned int array. 56 | while (p != NULL && index < bufferSize) 57 | { 58 | arr[index++] = (unsigned int)atoi(p); 59 | p = strtok(NULL, ","); 60 | } 61 | // Send raw code 62 | sendCode(arr); 63 | } 64 | 65 | void setup() 66 | { 67 | //LEDs setup 68 | pinMode(RED, OUTPUT); 69 | 70 | // Serial setup 71 | Serial.begin(57600); 72 | Serial.flush(); 73 | } 74 | 75 | void loop() 76 | { 77 | while (Serial.available() > 0) 78 | { 79 | processData(Serial.readString()); 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/NanoPi/demo/demo_common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./exp_codes 4 | 5 | # Verify if MIR is /dev/ttyUSB0 and if not change this line 6 | dev=/dev/ttyUSB0 7 | stty -F $dev 57600 -hupcl 8 | 9 | # Send anything to MIR to turn of hardware flow control 10 | # Look at -hupcl for details 11 | # It needs to be done only once after -hupcl is used 12 | echo $key_1 > $dev 13 | sleep 2 14 | 15 | # Send key 16 | # $1 - key 17 | # $3 - key name 18 | # $2 - sleep time 19 | send() { 20 | echo "Sending" $3 21 | echo $1 > $dev 22 | sleep $2 23 | } 24 | 25 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/NanoPi/demo/demo_deep_sleep.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./demo_common.sh 4 | 5 | echo "MIR DEMO - DEEP SLEEP'" 6 | 7 | 8 | # Turn the TV on 9 | echo "Turn the TV on" 10 | send $key_power 10 POWER 11 | 12 | # Turn the TV off 13 | echo "Turn the TV off - wait for deep sleep" 14 | send $key_power 45 POWER 15 | 16 | echo "Turn the TV on after deep sleep occured" 17 | send $key_power 1 POWER 18 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/NanoPi/demo/demo_factory_reset.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./demo_common.sh 4 | 5 | echo "MIR DEMO PRESENTATION - ENTERING FACTORY RESET" 6 | 7 | # Turn on TV 8 | echo "Turn the TV on" 9 | #send $key_power 15 "POWER" 10 | 11 | echo "Send factory reset key sequence" 12 | send $key_info 3 "INFO" 13 | send $key_vendor 0 "VENDOR" 14 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/NanoPi/demo/demo_hdmi.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./demo_common.sh 4 | 5 | echo "MIR DEMO PRESENTATION - CHOOSING SIGNAL SOURCE" 6 | 7 | # Turn on TV 8 | echo "Turn the TV on" 9 | send $key_power 15 "POWER" 10 | 11 | echo "Choose HDMI source" 12 | send $key_cyclewindows 10 "SOURCE" 13 | send $key_right 6 "RIGHT" 14 | send $key_enter 6 "ENTER" 15 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/NanoPi/demo/demo_menu.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./demo_common.sh 4 | 5 | echo "MIR DEMO EXAMPLE - VIEW 'ABOUT THIS TV'" 6 | 7 | # Turn on TV 8 | echo "Turn the TV on" 9 | send $key_power 15 PWR 10 | 11 | # # Demo key sequence 12 | echo "Go to Menu to see TV info" 13 | send $key_menu 5 "MENU" 14 | send $key_down 2 "DOWN" 15 | send $key_down 2 "DOWN" 16 | send $key_down 2 "DOWN" 17 | send $key_down 2 "DOWN" 18 | send $key_right 2 "RIGHT" 19 | 20 | send $key_down 2 "DOWN" 21 | send $key_down 2 "DOWN" 22 | send $key_down 2 "DOWN" 23 | send $key_down 2 "DOWN" 24 | send $key_enter 15 "ENTER" 25 | 26 | # Turn off TV 27 | echo "Turn the TV off" 28 | send $key_power 5 PWR 29 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/NanoPi/demo/demo_movie.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . ./demo_common.sh 4 | 5 | echo "MIR DEMO PLAY MOVIE FROM EXTERNAL STORAGE" 6 | 7 | # Turn the TV on and wait 8 | send $key_power 15 "PWR" 9 | # Choose movie source 10 | send $key_cyclewindows 6 "SRC" 11 | send $key_right 6 "R" 12 | # Play video 13 | send $key_enter 5 "ENTER" 14 | send $key_enter 5 "ENTER" 15 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/NanoPi/flash.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | avrdude avrdude -q -V -p atmega328p -D -c arduino -C avrdude.conf -b 115200 -P /dev/ttyUSB0 -U flash:w:Mir.hex:i 4 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/README.rst: -------------------------------------------------------------------------------- 1 | ######### 2 | MIR addon 3 | ######### 4 | 5 | This is a simple addon for controlling various devices through an infrared link. 6 | It is based on ATmega328p microcontroller and IRRemote library for 7 | Arduino. Check its documentation for details. 8 | NanoPi's OS communicates with this addon through serial (UART) 9 | connection available usually at /dev/ttyUSB0. If another USB<->serial 10 | converter is connected to MuxPi then MIR addon might be available at 11 | different device. 12 | 13 | In muxpi/sw/MuxPi-addons/MIR_addon/NanoPi/demo folder you can find 14 | sample codes and scripts for sending IR codes to Samsung TV. 15 | 16 | The general idea is as follows 17 | - read the codes: . exp_codes (in demo folder) 18 | - setup the serial port: stty -F /dev/ttyUSB0 57600 -hupcl 19 | - send a code to the addon: echo $key_power > /dev/ttyUSB0 20 | 21 | NOTE: after setting -hupcl in stty command, first attempt to 22 | send anything to the addon will reset it. Just resend the key 23 | again. It happens only after first call to 'stty -hupcl' switch after 24 | MuxPi boot. Every next transmission will work properly. 25 | 26 | Hardware documentation of this addon is available at 27 | muxpi/hw/MIR folder. 28 | 29 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/format/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SamsungSLAV/muxpi/aa4cb586940617bc43f21b0f4c2600b1ed032630/sw/MuxPi-addons/MIR/format/__init__.py -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/format/codeformatter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import argparse 4 | import sys 5 | 6 | class Options: 7 | def __init__(self, args): 8 | self.parser = argparse.ArgumentParser(description='Translating Samsung codes to raw format') 9 | self.args = args 10 | self.parser.add_argument('code', type=lambda x:hex(int(x,0)), 11 | help='hex code to be translated') 12 | self.parser.add_argument('-p', type=lambda x:hex(int(x,0)), 13 | help='code preambule. \nFor samsung remotes default preambule is 0xE0E0', 14 | default='0xE0E0', dest='preambule') 15 | self.options = self.parser.parse_args() 16 | 17 | def get_options(self): 18 | return self.options 19 | 20 | class CodeFormatter(): 21 | def __init__(self): 22 | self.header = "4553,4500," 23 | self.footer = "550" 24 | self.zero = "548,534," 25 | self.one = "548,1663," 26 | 27 | def format_raw_code(self, preambule, code): 28 | ''' format_raw_code composes raw format code from given hex value ''' 29 | self.raw_code=self.header 30 | 31 | for part in [preambule, code]: 32 | data=format(int(part,16),'0>16b') 33 | for bit in data: 34 | if bit == '0': 35 | self.raw_code+=self.zero 36 | else: 37 | self.raw_code+=self.one 38 | self.raw_code+=self.footer 39 | 40 | def get_raw_code(self,preambule,code): 41 | self.format_raw_code(preambule, code) 42 | return self.raw_code 43 | 44 | def main(): 45 | options = Options(sys.argv).get_options() 46 | code_formatter = CodeFormatter() 47 | print code_formatter.get_raw_code(options.preambule,options.code) 48 | 49 | if __name__ == "__main__": 50 | main() 51 | -------------------------------------------------------------------------------- /sw/MuxPi-addons/MIR/format/translate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from codeformatter import CodeFormatter 4 | 5 | cf = CodeFormatter() 6 | 7 | print "key_power=" + cf.get_raw_code('0xe0e0', '0x40bf') 8 | print "key_vendor=" + cf.get_raw_code('0xe0e0', '0xdc23') 9 | -------------------------------------------------------------------------------- /sw/control/FreeRTOS/Source/MemMang/ReadMe.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,2 3 | [InternetShortcut] 4 | URL=http://www.freertos.org/a00111.html 5 | IDList= 6 | -------------------------------------------------------------------------------- /sw/control/FreeRTOS/Source/MemMang/heap_1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.1.1 3 | * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | 29 | /* 30 | * The simplest possible implementation of pvPortMalloc(). Note that this 31 | * implementation does NOT allow allocated memory to be freed again. 32 | * 33 | * See heap_2.c, heap_3.c and heap_4.c for alternative implementations, and the 34 | * memory management pages of http://www.FreeRTOS.org for more information. 35 | */ 36 | #include 37 | 38 | /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining 39 | all the API functions to use the MPU wrappers. That should only be done when 40 | task.h is included from an application file. */ 41 | #define MPU_WRAPPERS_INCLUDED_FROM_API_FILE 42 | 43 | #include "FreeRTOS.h" 44 | #include "task.h" 45 | 46 | #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE 47 | 48 | #if( configSUPPORT_DYNAMIC_ALLOCATION == 0 ) 49 | #error This file must not be used if configSUPPORT_DYNAMIC_ALLOCATION is 0 50 | #endif 51 | 52 | /* A few bytes might be lost to byte aligning the heap start address. */ 53 | #define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT ) 54 | 55 | /* Allocate the memory for the heap. */ 56 | #if( configAPPLICATION_ALLOCATED_HEAP == 1 ) 57 | /* The application writer has already defined the array used for the RTOS 58 | heap - probably so it can be placed in a special segment or address. */ 59 | extern uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; 60 | #else 61 | static uint8_t ucHeap[ configTOTAL_HEAP_SIZE ]; 62 | #endif /* configAPPLICATION_ALLOCATED_HEAP */ 63 | 64 | /* Index into the ucHeap array. */ 65 | static size_t xNextFreeByte = ( size_t ) 0; 66 | 67 | /*-----------------------------------------------------------*/ 68 | 69 | void *pvPortMalloc( size_t xWantedSize ) 70 | { 71 | void *pvReturn = NULL; 72 | static uint8_t *pucAlignedHeap = NULL; 73 | 74 | /* Ensure that blocks are always aligned to the required number of bytes. */ 75 | #if( portBYTE_ALIGNMENT != 1 ) 76 | { 77 | if( xWantedSize & portBYTE_ALIGNMENT_MASK ) 78 | { 79 | /* Byte alignment required. */ 80 | xWantedSize += ( portBYTE_ALIGNMENT - ( xWantedSize & portBYTE_ALIGNMENT_MASK ) ); 81 | } 82 | } 83 | #endif 84 | 85 | vTaskSuspendAll(); 86 | { 87 | if( pucAlignedHeap == NULL ) 88 | { 89 | /* Ensure the heap starts on a correctly aligned boundary. */ 90 | pucAlignedHeap = ( uint8_t * ) ( ( ( portPOINTER_SIZE_TYPE ) &ucHeap[ portBYTE_ALIGNMENT ] ) & ( ~( ( portPOINTER_SIZE_TYPE ) portBYTE_ALIGNMENT_MASK ) ) ); 91 | } 92 | 93 | /* Check there is enough room left for the allocation. */ 94 | if( ( ( xNextFreeByte + xWantedSize ) < configADJUSTED_HEAP_SIZE ) && 95 | ( ( xNextFreeByte + xWantedSize ) > xNextFreeByte ) )/* Check for overflow. */ 96 | { 97 | /* Return the next free byte then increment the index past this 98 | block. */ 99 | pvReturn = pucAlignedHeap + xNextFreeByte; 100 | xNextFreeByte += xWantedSize; 101 | } 102 | 103 | traceMALLOC( pvReturn, xWantedSize ); 104 | } 105 | ( void ) xTaskResumeAll(); 106 | 107 | #if( configUSE_MALLOC_FAILED_HOOK == 1 ) 108 | { 109 | if( pvReturn == NULL ) 110 | { 111 | extern void vApplicationMallocFailedHook( void ); 112 | vApplicationMallocFailedHook(); 113 | } 114 | } 115 | #endif 116 | 117 | return pvReturn; 118 | } 119 | /*-----------------------------------------------------------*/ 120 | 121 | void vPortFree( void *pv ) 122 | { 123 | /* Memory cannot be freed using this scheme. See heap_2.c, heap_3.c and 124 | heap_4.c for alternative implementations, and the memory management pages of 125 | http://www.FreeRTOS.org for more information. */ 126 | ( void ) pv; 127 | 128 | /* Force an assert as it is invalid to call this function. */ 129 | configASSERT( pv == NULL ); 130 | } 131 | /*-----------------------------------------------------------*/ 132 | 133 | void vPortInitialiseBlocks( void ) 134 | { 135 | /* Only required when static memory is not cleared. */ 136 | xNextFreeByte = ( size_t ) 0; 137 | } 138 | /*-----------------------------------------------------------*/ 139 | 140 | size_t xPortGetFreeHeapSize( void ) 141 | { 142 | return ( configADJUSTED_HEAP_SIZE - xNextFreeByte ); 143 | } 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /sw/control/FreeRTOS/Source/include/stdint.readme: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FREERTOS_STDINT 3 | #define FREERTOS_STDINT 4 | 5 | /******************************************************************************* 6 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 7 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 8 | * built using compilers that do not provide their own stdint.h definition. 9 | * 10 | * To use this file: 11 | * 12 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 13 | * header file, as that directory will already be in the compilers include 14 | * path. 15 | * 16 | * 2) Rename the copied file stdint.h. 17 | * 18 | */ 19 | 20 | typedef signed char int8_t; 21 | typedef unsigned char uint8_t; 22 | typedef short int16_t; 23 | typedef unsigned short uint16_t; 24 | typedef long int32_t; 25 | typedef unsigned long uint32_t; 26 | 27 | #endif /* FREERTOS_STDINT */ 28 | -------------------------------------------------------------------------------- /sw/control/FreeRTOS/Source/portable/GCC/ARM_CM0/v10/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.1.1 3 | * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | 29 | #ifndef PORTMACRO_H 30 | #define PORTMACRO_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /*----------------------------------------------------------- 37 | * Port specific definitions. 38 | * 39 | * The settings in this file configure FreeRTOS correctly for the 40 | * given hardware and compiler. 41 | * 42 | * These settings should not be altered. 43 | *----------------------------------------------------------- 44 | */ 45 | 46 | /* Type definitions. */ 47 | #define portCHAR char 48 | #define portFLOAT float 49 | #define portDOUBLE double 50 | #define portLONG long 51 | #define portSHORT short 52 | #define portSTACK_TYPE uint32_t 53 | #define portBASE_TYPE long 54 | 55 | typedef portSTACK_TYPE StackType_t; 56 | typedef long BaseType_t; 57 | typedef unsigned long UBaseType_t; 58 | 59 | #if( configUSE_16_BIT_TICKS == 1 ) 60 | typedef uint16_t TickType_t; 61 | #define portMAX_DELAY ( TickType_t ) 0xffff 62 | #else 63 | typedef uint32_t TickType_t; 64 | #define portMAX_DELAY ( TickType_t ) 0xffffffffUL 65 | 66 | /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do 67 | not need to be guarded with a critical section. */ 68 | #define portTICK_TYPE_IS_ATOMIC 1 69 | #endif 70 | /*-----------------------------------------------------------*/ 71 | 72 | /* Architecture specifics. */ 73 | #define portSTACK_GROWTH ( -1 ) 74 | #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) 75 | #define portBYTE_ALIGNMENT 8 76 | /*-----------------------------------------------------------*/ 77 | 78 | 79 | /* Scheduler utilities. */ 80 | extern void vPortYield( void ); 81 | #define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) ) 82 | #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) 83 | #define portYIELD() vPortYield() 84 | #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT 85 | #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) 86 | /*-----------------------------------------------------------*/ 87 | 88 | 89 | /* Critical section management. */ 90 | extern void vPortEnterCritical( void ); 91 | extern void vPortExitCritical( void ); 92 | extern uint32_t ulSetInterruptMaskFromISR( void ) __attribute__((naked)); 93 | extern void vClearInterruptMaskFromISR( uint32_t ulMask ) __attribute__((naked)); 94 | 95 | #define portSET_INTERRUPT_MASK_FROM_ISR() ulSetInterruptMaskFromISR() 96 | #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vClearInterruptMaskFromISR( x ) 97 | #define portDISABLE_INTERRUPTS() __asm volatile ( " cpsid i " ::: "memory" ) 98 | #define portENABLE_INTERRUPTS() __asm volatile ( " cpsie i " ::: "memory" ) 99 | #define portENTER_CRITICAL() vPortEnterCritical() 100 | #define portEXIT_CRITICAL() vPortExitCritical() 101 | 102 | /*-----------------------------------------------------------*/ 103 | 104 | /* Task function macros as described on the FreeRTOS.org WEB site. */ 105 | #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) 106 | #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) 107 | 108 | #define portNOP() 109 | 110 | #ifdef __cplusplus 111 | } 112 | #endif 113 | 114 | #endif /* PORTMACRO_H */ 115 | 116 | -------------------------------------------------------------------------------- /sw/control/FreeRTOS/Source/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and or compiler. 4 | 5 | + The FreeRTOS/Source directory contains the three files that are common to 6 | every port - list.c, queue.c and tasks.c. The kernel is contained within these 7 | three files. croutine.c implements the optional co-routine functionality - which 8 | is normally only used on very memory limited systems. 9 | 10 | + The FreeRTOS/Source/Portable directory contains the files that are specific to 11 | a particular microcontroller and or compiler. 12 | 13 | + The FreeRTOS/Source/include directory contains the real time kernel header 14 | files. 15 | 16 | See the readme file in the FreeRTOS/Source/Portable directory for more 17 | information. -------------------------------------------------------------------------------- /sw/control/README.rst: -------------------------------------------------------------------------------- 1 | ##### 2 | Build 3 | ##### 4 | 5 | ============= 6 | Prerequisites 7 | ============= 8 | * arm-none-eabi-gcc compiler 9 | * python 2.7 10 | 11 | NOTE: Version of gcc compiler must not be newer than **4.8.4**! Version 5.0.0 and later do not produce valid binary. 12 | Some information about the problem can be found here: `FreeRTOS forum `_ After not finding any useful help on the forum, the issue was not further investigated. 13 | 14 | python is needed only for building libopencm3 submodule 15 | 16 | ===== 17 | Steps 18 | ===== 19 | 20 | .. code:: 21 | 22 | git clone git@github.com:SamsungSLAV/muxpi.git 23 | 24 | cd muxpi/sw/control 25 | 26 | git submodule update --init 27 | 28 | cd libopencm3 29 | 30 | make TARGET=stm32/f0 31 | 32 | cd ../src 33 | 34 | make bin 35 | 36 | 37 | As an output, ``firmware.bin`` should be generated. 38 | 39 | ####### 40 | Install 41 | ####### 42 | 43 | ============= 44 | Prerequisites 45 | ============= 46 | * stm32flash external tool available in Armbian Ubuntu for NanoPi or `here `_ 47 | 48 | * power script - can be found in this repository: /sw/nanopi/power/muxpi-power 49 | 50 | ===== 51 | Steps 52 | ===== 53 | 54 | Copy ``firmware.bin`` to NanoPi and use stm32flash tool to write the firmware into the M0 microcontroller: 55 | 56 | .. code:: 57 | 58 | muxpi-power off 59 | 60 | muxpi-power flashing 61 | 62 | stm32flash -w firmware.bin /dev/ttyS2 63 | 64 | muxpi-power off 65 | 66 | muxpi-power on 67 | 68 | Done! 69 | -------------------------------------------------------------------------------- /sw/control/include/cmd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file cmd.h 19 | * @author Adam Malinowski 20 | * @brief cmd include file 21 | */ 22 | 23 | #ifndef INCLUDE_CMD_H_ 24 | #define INCLUDE_CMD_H_ 25 | 26 | #include 27 | #include 28 | 29 | void cmd_setup(void); 30 | void cmd_process_data(uint8_t data); 31 | 32 | #endif /* INCLUDE_CMD_H_ */ 33 | -------------------------------------------------------------------------------- /sw/control/include/commands.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file commands.h 19 | * @author Adam Malinowski 20 | * @brief commands include file 21 | */ 22 | 23 | #ifndef INCLUDE_COMMANDS_H_ 24 | #define INCLUDE_COMMANDS_H_ 25 | 26 | typedef int (*cmd_textCallback)(char **args, int argscnt); 27 | 28 | typedef struct { 29 | char *name; 30 | cmd_textCallback textCallback; 31 | char *help; 32 | } client_command; 33 | 34 | const client_command* find_command(char *cmd); 35 | 36 | void process_command(char *cmd); 37 | 38 | #endif /* INCLUDE_COMMANDS_H_ */ 39 | -------------------------------------------------------------------------------- /sw/control/include/control.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file control.h 19 | * @author Adam Malinowski 20 | * @brief control include file 21 | */ 22 | 23 | #ifndef INCLUDE_CONTROL_H_ 24 | #define INCLUDE_CONTROL_H_ 25 | 26 | #include 27 | 28 | #include 29 | 30 | #define PWR_PORT GPIOB 31 | #define HDMI_PORT GPIOB 32 | #define SD_CTRL_PORT GPIOB 33 | #define WD_PORT GPIOB 34 | #define DYPER_PORT GPIOA 35 | #define LTHOR_PORT GPIOC 36 | 37 | #define PWR_SW_ON GPIO1 38 | #define HDMI_HOTPLUG GPIO2 39 | #define SD_CD_TS GPIO6 40 | #define SOCKET_SEL GPIO7 41 | #define WD_RESET GPIO8 42 | #define DYPER_1 GPIO11 43 | #define DYPER_2 GPIO12 44 | 45 | #define LTHOR_SWITCH GPIO13 46 | #define LTHOR_ID GPIO14 47 | #define LTHOR_VBUS GPIO15 48 | 49 | #define TICK_DELAY_DEFAULT 1000 50 | 51 | typedef enum { 52 | Mux_DUT, 53 | Mux_TS, 54 | Mux_IVNALID 55 | } mux_state; 56 | 57 | typedef enum { 58 | Power_Off, 59 | Power_On, 60 | Power_Invalid 61 | } power_state; 62 | 63 | typedef enum { 64 | Lthor_USB, 65 | Lthor_UART, 66 | Lthor_Invalid 67 | } lthor_state; 68 | 69 | void control_setup(void); 70 | 71 | power_state power_state_from_string(char *string); 72 | char* power_state_to_string(power_state state); 73 | 74 | void power_set_state(power_state state); 75 | power_state power_get_state(void); 76 | void power_tick(uint32_t delay_ms); 77 | 78 | void hdmi_set_state(bool state); 79 | 80 | bool dyper_set_state(uint8_t dyper_num, bool state); 81 | 82 | void mux_set_state(mux_state state); 83 | mux_state mux_get_state(void); 84 | void dut(void); 85 | void ts(void); 86 | 87 | lthor_state lthor_state_from_string(char *string); 88 | char* lthor_state_to_string(lthor_state state); 89 | 90 | lthor_state lthor_switch_get_state(void); 91 | void lthor_switch_set_state(lthor_state state); 92 | lthor_state lthor_id_get_state(void); 93 | void lthor_id_set_state(lthor_state state); 94 | power_state lthor_vbus_get_state(void); 95 | void lthor_vbus_set_state(power_state state); 96 | void lthor_do_combo(lthor_state state); 97 | 98 | #endif /* INCLUDE_CONTROL_H_ */ 99 | -------------------------------------------------------------------------------- /sw/control/include/leds.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file leds.h 19 | * @author Adam Malinowski 20 | * @brief leds include file 21 | */ 22 | 23 | #ifndef INCLUDE_LEDS_H_ 24 | #define INCLUDE_LEDS_H_ 25 | 26 | #include 27 | 28 | #include 29 | 30 | #define ADDON_GPIO_PORT GPIOB 31 | 32 | #define AO_LED1 GPIO3 33 | #define AO_LED2 GPIO4 34 | #define AO_LED3 GPIO5 35 | 36 | #define WS_PORT GPIOB 37 | #define WS_DATA GPIO0 38 | 39 | typedef struct { 40 | uint8_t red; 41 | uint8_t green; 42 | uint8_t blue; 43 | } LedColor; 44 | 45 | void leds_setup(void); 46 | void led_toggle(uint32_t led); 47 | void led_set_color(int led_nr, int r, int g, int b); 48 | LedColor led_get_color(int led_nr); 49 | 50 | #endif /* INCLUDE_LEDS_H_ */ 51 | -------------------------------------------------------------------------------- /sw/control/include/misc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file misc.h 19 | * @author Adam Malinowski 20 | * @brief misc include file 21 | */ 22 | 23 | #ifndef INCLUDE_MISC_H_ 24 | #define INCLUDE_MISC_H_ 25 | 26 | char* strtok_lite(char *str, const char* delim); 27 | int str_split(char **dst, int maxcount, char *src, char *tokens); 28 | 29 | #endif /* INCLUDE_MISC_H_ */ 30 | -------------------------------------------------------------------------------- /sw/control/include/tasks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file tasks.h 19 | * @author Adam Malinowski 20 | * @brief tasks include file 21 | */ 22 | 23 | #ifndef INCLUDE_TASKS_H_ 24 | #define INCLUDE_TASKS_H_ 25 | 26 | #include 27 | 28 | void create_tasks(void); 29 | 30 | #endif /* INCLUDE_TASKS_H_ */ 31 | -------------------------------------------------------------------------------- /sw/control/include/uart.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file uart.h 19 | * @author Adam Malinowski 20 | * @brief uart include file 21 | */ 22 | 23 | #ifndef INCLUDE_UART_H_ 24 | #define INCLUDE_UART_H_ 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | 32 | #define UART_PWM_PORT GPIOB 33 | #define UART_PWM GPIO9 34 | 35 | extern xQueueHandle usart_incoming_queue; 36 | extern xQueueHandle usart_outgoing_queue; 37 | extern QueueSetHandle_t usart_queue_set; 38 | 39 | void uart_setup(void); 40 | void uart_send(char *data); 41 | void uart_printf(const char *fmt, ...); 42 | void uart_putc(char data); 43 | 44 | void uart_set_voltage(int mvolts); 45 | int uart_get_voltage(void); 46 | 47 | #endif /* INCLUDE_UART_H_ */ 48 | -------------------------------------------------------------------------------- /sw/control/include/xprintf.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------------*/ 2 | /* Universal string handler for user console interface (C)ChaN, 2011 */ 3 | /*------------------------------------------------------------------------*/ 4 | 5 | #ifndef _STRFUNC 6 | #define _STRFUNC 7 | 8 | #define _USE_XFUNC_OUT 1 /* 1: Use output functions */ 9 | #define _CR_CRLF 1 /* 1: Convert \n ==> \r\n in the output char */ 10 | 11 | #define _USE_XFUNC_IN 1 /* 1: Use input function */ 12 | #define _LINE_ECHO 1 /* 1: Echo back input chars in xgets function */ 13 | 14 | 15 | #if _USE_XFUNC_OUT 16 | #define xdev_out(func) xfunc_out = (void(*)(unsigned char))(func) 17 | extern void (*xfunc_out)(unsigned char); 18 | void xputc (char c); 19 | void xputs (const char* str); 20 | void xfputs (void (*func)(unsigned char), const char* str); 21 | void xprintf (const char* fmt, ...); 22 | void xsprintf (char* buff, const char* fmt, ...); 23 | void xfprintf (void (*func)(unsigned char), const char* fmt, ...); 24 | void put_dump (const void* buff, unsigned long addr, int len, int width); 25 | #define DW_CHAR sizeof(char) 26 | #define DW_SHORT sizeof(short) 27 | #define DW_LONG sizeof(long) 28 | #endif 29 | 30 | #if _USE_XFUNC_IN 31 | #define xdev_in(func) xfunc_in = (unsigned char(*)(void))(func) 32 | extern unsigned char (*xfunc_in)(void); 33 | int xgets (char* buff, int len); 34 | int xfgets (unsigned char (*func)(void), char* buff, int len); 35 | int xatoi (char** str, long* res); 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /sw/control/openocd/MuxPi.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32F0 discovery board with a single STM32F051R8T6 chip. 2 | # http://www.st.com/internet/evalboard/product/253215.jsp 3 | 4 | source [find interface/stlink-v2.cfg] 5 | 6 | transport select hla_swd 7 | 8 | set WORKAREASIZE 0x1000 9 | source [find target/stm32f0x.cfg] 10 | 11 | reset_config srst_only 12 | -------------------------------------------------------------------------------- /sw/control/src/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.1.1 3 | * Copyright (C) 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | #ifndef FREERTOS_CONFIG_H 29 | #define FREERTOS_CONFIG_H 30 | 31 | /*----------------------------------------------------------- 32 | * Application specific definitions. 33 | * 34 | * These definitions should be adjusted for your particular hardware and 35 | * application requirements. 36 | * 37 | * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 38 | * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 39 | * 40 | * See http://www.freertos.org/a00110.html. 41 | *----------------------------------------------------------*/ 42 | 43 | /* Ensure stdint is only used by the compiler, and not the assembler. */ 44 | #ifdef __ICCARM__ 45 | #include 46 | extern uint32_t SystemCoreClock; 47 | #endif 48 | 49 | #define SystemCoreClock 48000000 50 | 51 | #define configUSE_PREEMPTION 1 52 | #define configUSE_IDLE_HOOK 1 53 | #define configUSE_TICK_HOOK 1 54 | #define configCPU_CLOCK_HZ ( SystemCoreClock ) 55 | #define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) 56 | #define configMAX_PRIORITIES ( 5 ) 57 | #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 64 ) 58 | #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 2048 ) ) 59 | #define configMAX_TASK_NAME_LEN ( 5 ) 60 | #define configUSE_TRACE_FACILITY 0 61 | #define configUSE_16_BIT_TICKS 0 62 | #define configIDLE_SHOULD_YIELD 1 63 | #define configUSE_MUTEXES 0 64 | #define configQUEUE_REGISTRY_SIZE 8 65 | #define configCHECK_FOR_STACK_OVERFLOW 1 66 | #define configUSE_RECURSIVE_MUTEXES 0 67 | #define configUSE_MALLOC_FAILED_HOOK 1 68 | #define configUSE_APPLICATION_TASK_TAG 0 69 | #define configUSE_COUNTING_SEMAPHORES 0 70 | #define configGENERATE_RUN_TIME_STATS 0 71 | #define configUSE_QUEUE_SETS 1 72 | 73 | /* Co-routine definitions. */ 74 | #define configUSE_CO_ROUTINES 0 75 | #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) 76 | 77 | /* Software timer definitions. */ 78 | #define configUSE_TIMERS 0 79 | #define configTIMER_TASK_PRIORITY ( 2 ) 80 | #define configTIMER_QUEUE_LENGTH 5 81 | #define configTIMER_TASK_STACK_DEPTH ( 80 ) 82 | 83 | /* Set the following definitions to 1 to include the API function, or zero 84 | to exclude the API function. */ 85 | #define INCLUDE_vTaskPrioritySet 1 86 | #define INCLUDE_uxTaskPriorityGet 1 87 | #define INCLUDE_vTaskDelete 0 88 | #define INCLUDE_vTaskCleanUpResources 0 89 | #define INCLUDE_vTaskSuspend 1 90 | #define INCLUDE_vTaskDelayUntil 1 91 | #define INCLUDE_vTaskDelay 1 92 | 93 | /* Normal assert() semantics without relying on the provision of an assert.h 94 | header file. */ 95 | #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } 96 | 97 | /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS 98 | standard names - or at least those used in the unmodified vector table. */ 99 | #define vPortSVCHandler SVC_Handler 100 | #define xPortPendSVHandler PendSV_Handler 101 | #define xPortSysTickHandler SysTick_Handler 102 | 103 | #endif /* FREERTOS_CONFIG_H */ 104 | 105 | -------------------------------------------------------------------------------- /sw/control/src/Makefile: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libopencm3 project. 3 | ## 4 | ## Copyright (C) 2009 Uwe Hermann 5 | ## 6 | ## This library is free software: you can redistribute it and/or modify 7 | ## it under the terms of the GNU Lesser General Public License as published by 8 | ## the Free Software Foundation, either version 3 of the License, or 9 | ## (at your option) any later version. 10 | ## 11 | ## This library is distributed in the hope that it will be useful, 12 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | ## GNU Lesser General Public License for more details. 15 | ## 16 | ## You should have received a copy of the GNU Lesser General Public License 17 | ## along with this library. If not, see . 18 | ## 19 | 20 | BINARY = firmware 21 | 22 | OPENCM3_DIR=../libopencm3 23 | FREERTOS_DIR=../FreeRTOS 24 | FREERTOS_SRC_DIR=$(FREERTOS_DIR)/Source 25 | FREERTOS_SRC_PORTABLE_DIR=$(FREERTOS_SRC_DIR)/portable/GCC/ARM_CM0 26 | LDSCRIPT = $(OPENCM3_DIR)/lib/stm32/f0/stm32f03xz6.ld 27 | 28 | INCLUDEDIR = -I. 29 | INCLUDEDIR += -I../include 30 | INCLUDEDIR += -I$(FREERTOS_SRC_DIR)/include 31 | INCLUDEDIR += -I$(FREERTOS_SRC_PORTABLE_DIR) 32 | INCLUDEDIR += -I$(OPENCM3_DIR)/include 33 | 34 | OBJS = uart.o handlers.o tasks.o leds.o cmd.o misc.o xprintf.o commands.o control.o oled.o ws2812.o keys.o adc.o hdmi.o state.o 35 | OBJS += $(FREERTOS_SRC_DIR)/list.o 36 | OBJS += $(FREERTOS_SRC_DIR)/queue.o 37 | OBJS += $(FREERTOS_SRC_DIR)/tasks.o 38 | OBJS += $(FREERTOS_SRC_DIR)/timers.o 39 | OBJS += $(FREERTOS_SRC_DIR)/MemMang/heap_1.o 40 | OBJS += $(FREERTOS_SRC_PORTABLE_DIR)/port.o 41 | 42 | include ../target.mk -------------------------------------------------------------------------------- /sw/control/src/adc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file adc.h 19 | * @author Adam Malinowski 20 | * @brief adc include file 21 | */ 22 | 23 | #ifndef SRC_ADC_H_ 24 | #define SRC_ADC_H_ 25 | 26 | #define ADC_CHANNEL_COUNT 5 // Number of ADC channels being measured. 27 | #define ADC_SAMPLES_COUNT 10 // Number of samples per channel for averager. 28 | 29 | #define ADC_CHANNEL_CURRENT 1 // Channel number of current measurement. 30 | #define ADC_CHANNEL_POT 3 // Channel number of potentiometer measurement. 31 | #define ADC_CHANNEL_VREFINT 5 // Channel number of internal voltage reference 32 | 33 | #define ADC_12BIT 4095 // Max value of ADC converter 34 | //#define V33mV 3311 // Supply voltage - in theory it should be exactly 3300 but this is real, measured 35 | // value on sample MuxPi board. 36 | 37 | #define ACS712_0A_VOLTAGE 2500 // 0A absolute value of voltage of ACS712-05 IC. 2.5V means no power is being consumed. 38 | #define ACS712_1A_VOLTAGE 186 // 1A incremental value of voltage of ACS712-05 IC. 2.5V + 186mV is equal to 1A of current. 39 | 40 | #define POT_KOHMS 1058 // Resistance of 1M potentiometer. It should be exactly 1000 ohms in theory but in 41 | // real life it's not. 1058 is the value of one, randomly selected pot. 42 | 43 | #define CURRENT_SENSE_GAIN 3.3 // Gain of current amplifier. 44 | 45 | // Initialize and turn on ADC converter. 46 | void adc_setup(void); 47 | // Get current ADC value of given channel. 48 | int adc_get_value(int channel); 49 | // Get current ADC voltage ( millivolts ) of given channel. 50 | int adc_get_voltage(int channel); 51 | // Get calibrated voltage (millivolts) of given channel. 52 | int adc_get_calibrated(int channel); 53 | // Get current value of DUT current consumption. 54 | int adc_get_current(void); 55 | // Get current resistance of potentiometer. 56 | int adc_get_resistance(void); 57 | // Take over pin associated to channel 1 and configure it as GPIO. 58 | void adc_grab_channel1_and_set_to_zero(void); 59 | // Release pin associated to channel 1 and configure it as ADC input. 60 | void adc_release_channel1(void); 61 | 62 | #endif /* SRC_ADC_H_ */ 63 | -------------------------------------------------------------------------------- /sw/control/src/cmd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file cmd.c 19 | * @author Adam Malinowski 20 | * @brief cmd source file 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include 33 | 34 | #define BUFLEN 64 35 | 36 | 37 | struct { 38 | uint8_t rxBuffer[BUFLEN + 1]; 39 | uint8_t position; 40 | uint8_t hasData; 41 | } USQueue; 42 | 43 | 44 | static void rx_buffer_put(uint8_t data) { 45 | if (USQueue.position < BUFLEN) { 46 | USQueue.rxBuffer[USQueue.position] = data; 47 | USQueue.hasData = 1; 48 | USQueue.position++; 49 | } 50 | } 51 | 52 | static char* rx_buffer_take(int *len) { 53 | *len = USQueue.hasData ? USQueue.position : 0; 54 | USQueue.rxBuffer[USQueue.position] = 0; 55 | USQueue.position = 0; 56 | USQueue.hasData = 0; 57 | return (char *)USQueue.rxBuffer; 58 | } 59 | 60 | void cmd_process_data(uint8_t data) { 61 | char *cmd; 62 | int len; 63 | 64 | if (data == '\n' || data == '\r') { 65 | if (state_get_echo()) { 66 | uart_putc('\n'); 67 | uart_putc('\r'); 68 | } 69 | cmd = rx_buffer_take(&len); 70 | process_command(cmd); 71 | } else { 72 | rx_buffer_put(data); 73 | if (state_get_echo()) { 74 | uart_putc(data); 75 | } 76 | } 77 | } 78 | 79 | void cmd_setup(void) { 80 | state_set_echo(false); 81 | } 82 | -------------------------------------------------------------------------------- /sw/control/src/firmware.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file firmware.c 19 | * @author Adam Malinowski 20 | * @brief Main source file 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include 43 | 44 | char* getVersion(void) { 45 | return "1.0"; 46 | } 47 | 48 | static void clock_setup(void) { 49 | rcc_clock_setup_in_hsi_out_48mhz(); 50 | rcc_periph_clock_enable(RCC_GPIOA); 51 | rcc_periph_clock_enable(RCC_GPIOB); 52 | rcc_periph_clock_enable(RCC_GPIOC); 53 | rcc_periph_clock_enable(RCC_USART1); 54 | rcc_periph_clock_enable(RCC_ADC); 55 | rcc_periph_clock_enable(RCC_SYSCFG_COMP); 56 | rcc_periph_clock_enable(RCC_TIM3); 57 | rcc_periph_clock_enable(RCC_TIM17); 58 | rcc_periph_clock_enable(RCC_DMA); 59 | } 60 | 61 | int main(void) { 62 | clock_setup(); 63 | 64 | state_setup(); 65 | 66 | leds_setup(); 67 | uart_setup(); 68 | control_setup(); 69 | keys_setup(); 70 | adc_setup(); 71 | oled_setup(); 72 | hdmi_setup(); 73 | cmd_setup(); 74 | 75 | create_tasks(); 76 | 77 | vTaskStartScheduler(); 78 | 79 | return 0; 80 | } 81 | 82 | -------------------------------------------------------------------------------- /sw/control/src/firmware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file firmware.h 19 | * @author Adam Malinowski 20 | * @brief firmware include file 21 | */ 22 | 23 | #ifndef SRC_FIRMWARE_H_ 24 | #define SRC_FIRMWARE_H_ 25 | 26 | char* getVersion(void); 27 | 28 | #endif /* SRC_FIRMWARE_H_ */ 29 | -------------------------------------------------------------------------------- /sw/control/src/handlers.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file handlers.c 19 | * @author Adam Malinowski 20 | * @brief handlers source file 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | void sv_call_handler(void); 27 | void pend_sv_handler(void); 28 | void sys_tick_handler(void); 29 | 30 | void vPortSVCHandler(void); 31 | void xPortSysTickHandler(void); 32 | void xPortPendSVHandler(void); 33 | 34 | void vApplicationMallocFailedHook(void); 35 | void vApplicationIdleHook(void); 36 | void vApplicationTickHook(void); 37 | void vApplicationStackOverflowHook(TaskHandle_t pxTask, char *pcTaskName); 38 | 39 | 40 | void vApplicationMallocFailedHook( void ) { 41 | for ( ;; ); 42 | } 43 | /*-----------------------------------------------------------*/ 44 | 45 | void vApplicationIdleHook( void ) { 46 | } 47 | /*-----------------------------------------------------------*/ 48 | 49 | void vApplicationStackOverflowHook(TaskHandle_t pxTask, char *pcTaskName) { 50 | (void) pcTaskName; 51 | (void) pxTask; 52 | } 53 | /*-----------------------------------------------------------*/ 54 | 55 | void vApplicationTickHook( void ) { 56 | } 57 | 58 | void sv_call_handler(void) { 59 | vPortSVCHandler(); 60 | } 61 | void pend_sv_handler(void) { 62 | xPortPendSVHandler(); 63 | } 64 | void sys_tick_handler(void) { 65 | xPortSysTickHandler(); 66 | } 67 | -------------------------------------------------------------------------------- /sw/control/src/hdmi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file hdmi.c 19 | * @author Adam Malinowski 20 | * @brief hdmi source file 21 | */ 22 | 23 | #include 24 | 25 | void hdmi_setup(void) { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /sw/control/src/hdmi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file hdmi.h 19 | * @author Adam Malinowski 20 | * @brief hdmi include file 21 | */ 22 | 23 | #ifndef SRC_HDMI_H_ 24 | #define SRC_HDMI_H_ 25 | 26 | void hdmi_setup(void); 27 | 28 | #endif /* SRC_HDMI_H_ */ 29 | -------------------------------------------------------------------------------- /sw/control/src/keys.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file keys.c 19 | * @author Adam Malinowski 20 | * @brief keys source file 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | void keys_setup(void) { 34 | nvic_enable_irq(NVIC_EXTI4_15_IRQ); 35 | 36 | gpio_mode_setup(KEYS_PORT, GPIO_MODE_INPUT, GPIO_MODE_INPUT, KEY_1_GPIO | KEY_2_GPIO); 37 | 38 | exti_select_source(EXTI12, KEYS_PORT); 39 | exti_select_source(EXTI13, KEYS_PORT); 40 | exti_set_trigger(EXTI12, EXTI_TRIGGER_FALLING); 41 | exti_set_trigger(EXTI13, EXTI_TRIGGER_FALLING); 42 | exti_enable_request(EXTI12); 43 | exti_enable_request(EXTI13); 44 | } 45 | 46 | 47 | static void send_key_pressed_event(int key) { 48 | long xHigherPriorityTaskWoken = pdFALSE; 49 | uint8_t data = key; 50 | xQueueSendToBackFromISR(usart_outgoing_queue, &data, &xHigherPriorityTaskWoken); 51 | portEND_SWITCHING_ISR(xHigherPriorityTaskWoken); 52 | } 53 | 54 | void exti4_15_isr(void) { 55 | if (exti_get_flag_status(EXTI12)) { 56 | send_key_pressed_event(KEY_1); 57 | } 58 | 59 | if (exti_get_flag_status(EXTI13)) { 60 | send_key_pressed_event(KEY_2); 61 | } 62 | 63 | exti_reset_request(EXTI12 | EXTI13); 64 | } 65 | 66 | bool keys_is_1_pressed(void) { 67 | return !gpio_get(KEYS_PORT, KEY_1_GPIO); 68 | } 69 | 70 | bool keys_is_2_pressed(void) { 71 | return !gpio_get(KEYS_PORT, KEY_2_GPIO); 72 | } 73 | -------------------------------------------------------------------------------- /sw/control/src/keys.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file keys.h 19 | * @author Adam Malinowski 20 | * @brief keys include file 21 | */ 22 | 23 | #ifndef SRC_KEYS_H_ 24 | #define SRC_KEYS_H_ 25 | 26 | #include 27 | 28 | #include 29 | 30 | #define KEYS_PORT GPIOB 31 | #define KEY_1_GPIO GPIO12 32 | #define KEY_2_GPIO GPIO13 33 | 34 | #define KEY_1 1 35 | #define KEY_2 2 36 | 37 | void keys_setup(void); 38 | bool keys_is_1_pressed(void); 39 | bool keys_is_2_pressed(void); 40 | 41 | #endif /* SRC_KEYS_H_ */ 42 | -------------------------------------------------------------------------------- /sw/control/src/leds.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file leds.c 19 | * @author Adam Malinowski 20 | * @brief leds source file 21 | */ 22 | 23 | #include 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | #include 31 | #include 32 | 33 | #include 34 | 35 | 36 | void leds_setup(void) { 37 | gpio_mode_setup(ADDON_GPIO_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE, AO_LED1 | AO_LED2 | AO_LED3); 38 | ws2812_init(); 39 | } 40 | 41 | void led_toggle(uint32_t led) { 42 | if (led == AO_LED1 || led == AO_LED2 || led == AO_LED3) { 43 | gpio_toggle(ADDON_GPIO_PORT, led); 44 | } 45 | } 46 | 47 | void led_set_color(int led_nr, int r, int g, int b) { 48 | ws2812_set_led_color(led_nr, r, g, b); 49 | } 50 | 51 | LedColor led_get_color(int led_nr) { 52 | return ws2812_get_led_color(led_nr); 53 | } 54 | -------------------------------------------------------------------------------- /sw/control/src/misc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file misc.c 19 | * @author Adam Malinowski 20 | * @brief misc source file 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | 27 | char* strtok_lite(char *str, const char* delim) { 28 | static char* _buffer; 29 | 30 | if (str != NULL) { 31 | _buffer = str; 32 | } 33 | 34 | if (_buffer[0] == '\0') { 35 | return NULL; 36 | } 37 | 38 | char *ret = _buffer, *b; 39 | const char *d; 40 | 41 | for (b = _buffer; ; b++) { 42 | if (*b == '\0') { 43 | _buffer = '\0'; 44 | break; 45 | } 46 | for (d = delim; *d != '\0'; d++) { 47 | if (*b == *d) { 48 | *b = '\0'; 49 | _buffer = b + 1; 50 | 51 | if (b == ret) { 52 | ret++; 53 | continue; 54 | } 55 | return ret; 56 | } 57 | } 58 | } 59 | 60 | return ret; 61 | } 62 | 63 | int str_split(char **dst, int maxcount, char *src, char *tokens) { 64 | int i; 65 | for (i = 0; i < maxcount; i++, src = NULL) 66 | if (!(dst[i] = strtok_lite(src, tokens))) 67 | break; 68 | return i; 69 | } 70 | -------------------------------------------------------------------------------- /sw/control/src/oled.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file oled.h 19 | * @author Adam Malinowski 20 | * @brief oled include file 21 | */ 22 | 23 | #ifndef SRC_OLED_H_ 24 | #define SRC_OLED_H_ 25 | 26 | #include 27 | 28 | #define OLED_WIDTH (128) 29 | #define OLED_HEIGHT (32) 30 | 31 | #define OLED_PORT GPIOA 32 | #define OLED_RES GPIO6 33 | #define OLED_D_C GPIO3 34 | #define OLED_NSS GPIO4 35 | 36 | typedef enum { 37 | OC_on, 38 | OC_off, 39 | OC_inverse, 40 | OC_clean 41 | } oled_color; 42 | 43 | void oled_setup(void); 44 | void oled_clean_screen(void); 45 | void oled_init(void); 46 | void oled_display_string(int x, int y, char ch[], oled_color color); 47 | void oled_display_char(int x, int y, char ch, oled_color color) ; 48 | 49 | void oled_draw_point(int x, int y, oled_color color); 50 | void oled_draw_line(int x1, int y1, int x2, int y2, oled_color color); 51 | void oled_draw_circle(int cx,int cy, int radius, oled_color color); 52 | void oled_draw_rectangle(int x, int y, int width, int height, oled_color color); 53 | 54 | oled_color oled_color_from_string(char *string); 55 | 56 | #endif /* SRC_OLED_H_ */ 57 | -------------------------------------------------------------------------------- /sw/control/src/state.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file state.c 19 | * @author Adam Malinowski 20 | * @brief state source file 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | 27 | typedef struct { 28 | int idleCurrent; 29 | bool echoState; 30 | } ControllerState; 31 | 32 | static ControllerState cState; 33 | 34 | void state_setup(void) { 35 | memset(&cState, 0, sizeof(cState)); 36 | } 37 | 38 | int state_get_idle_current(void) { 39 | return cState.idleCurrent; 40 | } 41 | 42 | void state_set_idle_current(int mA) { 43 | cState.idleCurrent = mA; 44 | } 45 | 46 | bool state_get_echo(void) { 47 | return true;//cState.echoState; 48 | } 49 | 50 | void state_set_echo(bool state) { 51 | cState.echoState = state; 52 | } 53 | -------------------------------------------------------------------------------- /sw/control/src/state.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file state.h 19 | * @author Adam Malinowski 20 | * @brief state include file 21 | */ 22 | 23 | #include 24 | 25 | #ifndef SRC_STATE_H_ 26 | #define SRC_STATE_H_ 27 | 28 | // Initialize state of controller. 29 | void state_setup(void); 30 | 31 | // Get current (mA) when power of DUT is OFF. This 'idle' current is an offset 32 | // which is subtracted from measured current when DUT power is ON. 33 | int state_get_idle_current(void); 34 | 35 | // Set idle current (mA). 36 | void state_set_idle_current(int mA); 37 | 38 | // Get 'cmd' echo state. 39 | bool state_get_echo(void); 40 | 41 | // Set 'cmd' echo state. 42 | void state_set_echo(bool state); 43 | 44 | #endif /* SRC_STATE_H_ */ 45 | -------------------------------------------------------------------------------- /sw/control/src/tasks.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file tasks.c 19 | * @author Adam Malinowski 20 | * @brief tasks source file 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include 41 | 42 | #define RESISTOR_ADJUSTING_START_TIME 5000 43 | 44 | const uint8_t colors[5][3] = { 45 | {0, 0, 0}, 46 | {255, 0, 0}, 47 | {0, 255, 0}, 48 | {0, 0, 255}, 49 | {255, 255, 255} 50 | }; 51 | 52 | char general_buffer[32]; 53 | 54 | void usartTask(void *pvData); 55 | void utilsTask(void *pvData); 56 | 57 | uint8_t data; 58 | QueueSetMemberHandle_t activated_queue; 59 | 60 | void usartTask(void *pvData) { 61 | (void)pvData; 62 | 63 | vTaskDelay(100); 64 | 65 | while (1) { 66 | activated_queue = xQueueSelectFromSet(usart_queue_set, portMAX_DELAY); 67 | if (activated_queue == usart_incoming_queue) { 68 | while (xQueueReceive(usart_incoming_queue, &data, 0) == pdTRUE) { 69 | cmd_process_data(data); 70 | } 71 | } 72 | if (activated_queue == usart_outgoing_queue) { 73 | while (xQueueReceive(usart_outgoing_queue, &data, 0) == pdTRUE) { 74 | xprintf("pressed: %d\n", data); // This is strange. FIXME 75 | } 76 | } 77 | } 78 | } 79 | 80 | static void show_version(void) { 81 | xsprintf(general_buffer, "HW: 1.0 SW: %s", getVersion()); 82 | // TODO: figure out how to get HW version. 83 | oled_display_string(5, 0, " * MuxPi * ", OC_on); 84 | oled_display_string(5, 2, general_buffer, OC_on); 85 | } 86 | 87 | int key1_pressed_time = 0; 88 | int key2_pressed_time = 0; 89 | 90 | void utilsTask(void *pvData) { 91 | (void)pvData; 92 | 93 | oled_clean_screen(); 94 | show_version(); 95 | 96 | led_set_color(0, colors[0][0], colors[0][1], colors[0][2]); 97 | led_set_color(1, colors[0][0], colors[0][1], colors[0][2]); 98 | 99 | while (1) { 100 | vTaskDelay(10); 101 | 102 | key1_pressed_time = keys_is_1_pressed() ? key1_pressed_time + 1000 : 0; 103 | key2_pressed_time = keys_is_2_pressed() ? key2_pressed_time + 1000 : 0; 104 | if (key1_pressed_time == RESISTOR_ADJUSTING_START_TIME 105 | && key2_pressed_time == RESISTOR_ADJUSTING_START_TIME) { 106 | oled_clean_screen(); 107 | oled_draw_rectangle(0, 0, OLED_WIDTH, OLED_HEIGHT, OC_on); 108 | oled_display_string(8, 1, "Release keys", OC_on); 109 | while (keys_is_1_pressed() || keys_is_2_pressed()) { 110 | vTaskDelay(50); 111 | } 112 | oled_clean_screen(); 113 | oled_draw_rectangle(0, 0, OLED_WIDTH, OLED_HEIGHT, OC_on); 114 | adc_grab_channel1_and_set_to_zero(); 115 | lthor_id_set_state(Lthor_UART); 116 | while (!keys_is_1_pressed() && !keys_is_2_pressed()) { 117 | int res = adc_get_resistance(); 118 | xsprintf(general_buffer, "RES: %4dk", res); 119 | oled_display_string(8, 1, general_buffer, OC_clean); 120 | vTaskDelay(50); 121 | } 122 | adc_release_channel1(); 123 | lthor_id_set_state(Lthor_USB); 124 | oled_clean_screen(); 125 | oled_draw_rectangle(0, 0, OLED_WIDTH, OLED_HEIGHT, OC_on); 126 | } 127 | } 128 | } 129 | 130 | xTaskHandle th_usart, th_utils; 131 | void create_tasks(void) { 132 | 133 | xTaskCreate(usartTask, (const char *) "USRT", 128, NULL, tskIDLE_PRIORITY+1, &th_usart); 134 | xTaskCreate(utilsTask, (const char *) "UTIL", 64, NULL, tskIDLE_PRIORITY+1, &th_utils); 135 | // vTaskSuspend(th_utils); 136 | } 137 | -------------------------------------------------------------------------------- /sw/control/src/uart.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file uart.c 19 | * @author Adam Malinowski 20 | * @brief uart source file 21 | */ 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | #include 34 | 35 | #define USART_INCOMING_QUEUE_LENGTH 32 36 | #define USART_OUTGOING_QUEUE_LENGTH 2 37 | #define USART_COMBINED_QUEUE_LENGTH (USART_INCOMING_QUEUE_LENGTH + USART_OUTGOING_QUEUE_LENGTH) 38 | 39 | xQueueHandle usart_incoming_queue; 40 | xQueueHandle usart_outgoing_queue; 41 | QueueSetHandle_t usart_queue_set; 42 | 43 | void usart1_isr(void) { 44 | long xHigherPriorityTaskWoken = pdFALSE; 45 | if (((USART_CR1(USART1) & USART_CR1_RXNEIE) != 0) && 46 | ((USART_ISR(USART1) & USART_ISR_RXNE) != 0)) { 47 | uint8_t data = usart_recv(USART1); 48 | xQueueSendToBackFromISR(usart_incoming_queue, &data, &xHigherPriorityTaskWoken); 49 | } 50 | portEND_SWITCHING_ISR(xHigherPriorityTaskWoken); 51 | } 52 | 53 | #define ONE_HUNDRED_PERCENT 100 54 | 55 | static void pwm_setup(void) { 56 | gpio_mode_setup(UART_PWM_PORT, GPIO_MODE_AF, GPIO_PUPD_NONE, UART_PWM); 57 | gpio_set_af(UART_PWM_PORT, GPIO_AF2, UART_PWM); 58 | 59 | rcc_periph_reset_pulse(RST_TIM17); 60 | 61 | timer_set_mode(TIM17, TIM_CR1_CKD_CK_INT_MUL_4, TIM_CR1_CMS_EDGE, TIM_CR1_DIR_UP); 62 | timer_set_prescaler(TIM17, 0); 63 | timer_set_period(TIM17, ONE_HUNDRED_PERCENT - 1); 64 | timer_set_oc_value(TIM17, TIM_OC1, ONE_HUNDRED_PERCENT); 65 | TIM_CCMR1(TIM17) |= TIM_CCMR1_OC1M_PWM1 | TIM_CCMR1_OC1M_ACTIVE; // Operating directly on registers because of 66 | // incorrect implementation of the above function 67 | timer_enable_oc_output(TIM17, TIM_OC1); 68 | TIM_BDTR(TIM17) |= TIM_BDTR_MOE; // Operating directly on registers because of 69 | // incorrect implementation of the above function 70 | timer_generate_event(TIM17, TIM_EGR_UG); 71 | timer_enable_counter(TIM17); 72 | } 73 | 74 | void uart_set_voltage(int mvolts) { 75 | #define MAX_VOLTAGE 50 // 5000 millivolts divided by 100 to ease calculations 76 | int period = ONE_HUNDRED_PERCENT - mvolts / MAX_VOLTAGE; 77 | timer_set_oc_value(TIM17, TIM_OC1, period); 78 | } 79 | 80 | int uart_get_voltage(void) { 81 | int duty = TIM_CCR1(TIM17); 82 | return 100 * MAX_VOLTAGE / ONE_HUNDRED_PERCENT * duty; 83 | } 84 | 85 | void uart_setup(void) { 86 | 87 | // FIXME: Get rid of queue set by using only one queue with items containing message type info. 88 | usart_queue_set = xQueueCreateSet(USART_COMBINED_QUEUE_LENGTH); 89 | usart_incoming_queue = xQueueCreate(USART_INCOMING_QUEUE_LENGTH, sizeof(char)); 90 | usart_outgoing_queue = xQueueCreate(USART_OUTGOING_QUEUE_LENGTH, sizeof(char)); 91 | xQueueAddToSet(usart_incoming_queue, usart_queue_set); 92 | xQueueAddToSet(usart_outgoing_queue, usart_queue_set); 93 | 94 | xdev_out(uart_putc); 95 | 96 | nvic_enable_irq(NVIC_USART1_IRQ); 97 | 98 | gpio_mode_setup(GPIOA, GPIO_MODE_AF, GPIO_PUPD_NONE, GPIO9 | GPIO10); 99 | gpio_set_af(GPIOA, GPIO_AF1, GPIO9 | GPIO10); 100 | 101 | usart_set_baudrate(USART1, 115200); 102 | usart_set_databits(USART1, 8); 103 | usart_set_stopbits(USART1, USART_CR2_STOPBITS_1); 104 | usart_set_parity(USART1, USART_PARITY_NONE); 105 | usart_set_flow_control(USART1, USART_FLOWCONTROL_NONE); 106 | usart_set_mode(USART1, USART_MODE_TX_RX); 107 | 108 | usart_enable_rx_interrupt(USART1); 109 | 110 | usart_enable(USART1); 111 | 112 | pwm_setup(); 113 | } 114 | 115 | void uart_send(char *data) { 116 | (void)data; 117 | } 118 | 119 | void uart_putc(char data) { 120 | usart_send_blocking(USART1, data); 121 | } 122 | -------------------------------------------------------------------------------- /sw/control/src/ws2812.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 3 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | /** 18 | * @file ws2812.h 19 | * @author Adam Malinowski 20 | * @brief ws2812 source file 21 | */ 22 | #ifndef SRC_WS2812_H_ 23 | #define SRC_WS2812_H_ 24 | 25 | #include 26 | #include 27 | 28 | /* Definition of TIM instance */ 29 | #define TIMx TIM2 30 | 31 | /* Definition for TIMx clock resources */ 32 | #define TIMx_CLK_ENABLE __HAL_RCC_TIM2_CLK_ENABLE 33 | #define DMAx_CLK_ENABLE __HAL_RCC_DMA1_CLK_ENABLE 34 | 35 | /* Definition for TIMx Pins */ 36 | #define TIMx_CHANNEL1_GPIO_CLK_ENABLE __HAL_RCC_GPIOA_CLK_ENABLE 37 | #define TIMx_GPIO_CHANNEL1_PORT GPIOA 38 | #define GPIO_PIN_CHANNEL1 GPIO_PIN_5 39 | #define GPIO_AF_TIMx GPIO_AF1_TIM2 40 | 41 | /* Definition for TIMx's DMA */ 42 | #define TIMx_CC1_DMA_REQUEST DMA_REQUEST_4 43 | #define TIMx_CC1_DMA_INST DMA1_Channel5 44 | 45 | /* Definition for DMAx's NVIC */ 46 | #define TIMx_DMA_IRQn DMA1_Channel5_IRQn 47 | #define TIMx_DMA_IRQHandler DMA1_Channel5_IRQHandler 48 | 49 | //WS2812 50 | #define WS2812_FREQ (800000) // it is fixed: WS2812 require 800kHz 51 | #define TIMER_CLOCK_FREQ (48000000) // can be modified - multiples of 0.8MHz are suggested 52 | #define TIMER_PERIOD (TIMER_CLOCK_FREQ / WS2812_FREQ) 53 | #define LED_NUMBER (2) // how many LEDs the MCU should control? 54 | #define LED_DATA_SIZE (LED_NUMBER * 24) 55 | #define RESET_SLOTS_BEGIN (50) 56 | #define RESET_SLOTS_END (50) 57 | #define WS2812_LAST_SLOT (1) 58 | #define LED_BUFFER_SIZE (RESET_SLOTS_BEGIN + LED_DATA_SIZE + WS2812_LAST_SLOT + RESET_SLOTS_END) 59 | #define WS2812_0 (TIMER_PERIOD / 3) // WS2812's zero high time is bout one third of the period 60 | #define WS2812_1 (TIMER_PERIOD * 2 / 3) // WS2812's one high time is about two thirds of the period 61 | #define WS2812_RESET (0) 62 | 63 | void ws2812_init(void); 64 | void ws2812_update(void); 65 | void ws2812_set_led_color(uint32_t LEDnumber, uint8_t RED, uint8_t GREEN, 66 | uint8_t BLUE); 67 | LedColor ws2812_get_led_color(uint32_t led_number); 68 | void setWHOLEcolor(uint8_t RED, uint8_t GREEN, uint8_t BLUE); 69 | void fillBufferBlack(void); 70 | void fillBufferWhite(void); 71 | 72 | #endif // SRC_WS2812_H_ 73 | -------------------------------------------------------------------------------- /sw/control/target.mk: -------------------------------------------------------------------------------- 1 | ## 2 | ## This file is part of the libopencm3 project. 3 | ## 4 | ## Copyright (C) 2009 Uwe Hermann 5 | ## Copyright (C) 2010 Piotr Esden-Tempski 6 | ## 7 | ## This library is free software: you can redistribute it and/or modify 8 | ## it under the terms of the GNU Lesser General Public License as published by 9 | ## the Free Software Foundation, either version 3 of the License, or 10 | ## (at your option) any later version. 11 | ## 12 | ## This library is distributed in the hope that it will be useful, 13 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | ## GNU Lesser General Public License for more details. 16 | ## 17 | ## You should have received a copy of the GNU Lesser General Public License 18 | ## along with this library. If not, see . 19 | ## 20 | 21 | LIBNAME = opencm3_stm32f0 22 | DEFS += -DSTM32F0 23 | 24 | FP_FLAGS ?= -msoft-float 25 | ARCH_FLAGS = -mthumb -mcpu=cortex-m0 $(FP_FLAGS) 26 | 27 | ################################################################################ 28 | # OpenOCD specific variables 29 | 30 | OOCD ?= openocd 31 | #OOCD_INTERFACE ?= stlink-v2-1 32 | #OOCD_TARGET ?= stm32f0x 33 | 34 | ################################################################################ 35 | # Black Magic Probe specific variables 36 | # Set the BMP_PORT to a serial port and then BMP is used for flashing 37 | #BMP_PORT ?= 38 | 39 | ################################################################################ 40 | # texane/stlink specific variables 41 | #STLINK_PORT ?= :4242 42 | 43 | 44 | include ../rules.mk 45 | -------------------------------------------------------------------------------- /sw/nanopi/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /sw/nanopi/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.11.1-stretch 2 | LABEL maintainer="Alexander Mazuruk " 3 | 4 | ENV PROJECT="github.com/SamsungSLAV/muxpi/sw/nanopi/" 5 | 6 | RUN go get -d "${PROJECT}/..." 7 | 8 | WORKDIR "${GOPATH}/src/${PROJECT}" 9 | 10 | # Build stm 11 | RUN GOOS=linux GOARCH=arm GOARM=7 go build -o /stm_armv7 ./cmd/stm/ 12 | RUN GOOS=linux GOARCH=amd64 go build -o /stm_amd64 ./cmd/stm/ 13 | 14 | # Build fota 15 | RUN GOOS=linux GOARCH=arm GOARM=7 go build -o /fota_armv7 ./cmd/fota/ 16 | RUN GOOS=linux GOARCH=amd64 go build -o /fota_amd64 ./cmd/fota/ 17 | -------------------------------------------------------------------------------- /sw/nanopi/Makefile: -------------------------------------------------------------------------------- 1 | BUILD_DIR = bin 2 | BUILD_DOCKER_IMAGE = muxpi-build-img 3 | BUILD_DOCKER_CONTAINER = muxpi-build 4 | BINARIES = stm_armv7 stm_amd64 fota_armv7 fota_amd64 5 | BINARIES := $(addprefix ${BUILD_DIR}/, ${BINARIES}) 6 | 7 | .PHONY: all 8 | all: docker-build 9 | 10 | .PHONY: clean 11 | clean: clean-docker-build 12 | 13 | .PHONY: docker-build 14 | docker-build: ${BINARIES} 15 | docker rm "${BUILD_DOCKER_CONTAINER}" 16 | 17 | ${BINARIES}: docker-container | ${BUILD_DIR} 18 | docker cp "${BUILD_DOCKER_CONTAINER}:/$(@F)" $@ 19 | 20 | .PHONY: docker-container 21 | docker-container: docker-build-img 22 | docker create --name "${BUILD_DOCKER_CONTAINER}" "${BUILD_DOCKER_IMAGE}" 23 | 24 | .PHONY: docker-build-img 25 | docker-build-img: 26 | docker build --tag "${BUILD_DOCKER_IMAGE}" . 27 | 28 | ${BUILD_DIR}: 29 | mkdir -p "${BUILD_DIR}" 30 | 31 | .PHONY: clean-docker-build 32 | clean-docker-build: 33 | -docker rm "${BUILD_DOCKER_CONTAINER}" 34 | -docker rmi "${BUILD_DOCKER_IMAGE}" 35 | -rm -f ${BINARIES} 36 | -rmdir ${BUILD_DIR} 37 | 38 | -------------------------------------------------------------------------------- /sw/nanopi/cmd/fota/fota.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package main 18 | 19 | import ( 20 | "encoding/json" 21 | "flag" 22 | "log" 23 | "net/rpc" 24 | "os" 25 | 26 | "github.com/SamsungSLAV/muxpi/sw/nanopi/fota" 27 | "github.com/SamsungSLAV/muxpi/sw/nanopi/stm" 28 | ) 29 | 30 | var ( 31 | sdcard string 32 | mapping string 33 | md5sums string 34 | quiet bool 35 | 36 | remote string 37 | ) 38 | 39 | func setFlags() { 40 | flag.StringVar(&sdcard, "card", "", "path to SDcard") 41 | // TODO: if map is not present it can generate an example. 42 | flag.StringVar(&mapping, "map", "", "path to JSON formatted mapping") 43 | flag.StringVar(&md5sums, "md5", "", "URL or path to MD5SUMS file") 44 | flag.BoolVar(&quiet, "q", false, "suppress logging") 45 | 46 | flag.StringVar(&remote, "remote", "/run/stm-user.socket", "path to remote service socket") 47 | } 48 | 49 | func checkErr(ctx string, err error) { 50 | if err != nil { 51 | log.Fatal(ctx, err) 52 | } 53 | } 54 | 55 | func verbose(str string) { 56 | if !quiet { 57 | log.Println(str) 58 | } 59 | } 60 | 61 | func main() { 62 | setFlags() 63 | flag.Parse() 64 | 65 | if mapping == "" { 66 | log.Fatal("missing mapping argument") 67 | } 68 | if sdcard == "" { 69 | log.Fatal("missing sdcard argument") 70 | } 71 | 72 | f, err := os.Open(mapping) 73 | checkErr("failed to open the mapping: ", err) 74 | defer f.Close() 75 | 76 | partMapping := make(map[string]string) 77 | decoder := json.NewDecoder(f) 78 | checkErr("failed to decode the mapping: ", decoder.Decode(&partMapping)) 79 | 80 | var dev stm.InterfaceCloser 81 | if remote != "" { 82 | cl, err := rpc.Dial("unix", remote) 83 | checkErr("failed to connect to RPC service: ", err) 84 | dev = stm.NewInterfaceClient(cl) 85 | } else { 86 | dev, err = stm.GetDefaultSTM() 87 | checkErr("failed to connect to STM: ", err) 88 | } 89 | defer dev.Close() 90 | 91 | flasher := fota.NewFOTA(dev, sdcard, partMapping) 92 | if !quiet { 93 | flasher.SetVerbose() 94 | } 95 | verbose("FOTA initialized") 96 | 97 | checkErr("SDcard not found: ", fota.WaitForSDcard(dev, sdcard, 10)) 98 | verbose("SDcard detected") 99 | 100 | args := flag.Args() 101 | if len(args) == 0 { 102 | verbose("nothing to do") 103 | return 104 | } 105 | if _, err = os.Stat(args[0]); err != nil { 106 | err = flasher.DownloadAndFlash(md5sums, flag.Args()...) 107 | } else { 108 | err = flasher.Flash(md5sums, flag.Args()...) 109 | } 110 | checkErr("failed to flash images: ", err) 111 | 112 | } 113 | -------------------------------------------------------------------------------- /sw/nanopi/cmd/stm/server.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package main 18 | 19 | import ( 20 | "log" 21 | "net" 22 | "net/rpc" 23 | "os" 24 | "os/signal" 25 | 26 | "github.com/SamsungSLAV/muxpi/sw/nanopi/stm" 27 | "github.com/coreos/go-systemd/activation" 28 | ) 29 | 30 | func registerUserServiceOnListener(impl stm.UserInterface, l net.Listener) { 31 | srv := rpc.NewServer() 32 | checkErr("failed to register user service: ", stm.RegisterUserInterfaceService(srv, impl)) 33 | go srv.Accept(l) 34 | } 35 | 36 | func registerServiceOnListener(impl stm.Interface, l net.Listener) { 37 | srv := rpc.NewServer() 38 | checkErr("failed to register admin service: ", stm.RegisterInterfaceService(srv, impl)) 39 | go srv.Accept(l) 40 | } 41 | 42 | func registerUserService(i stm.UserInterface, path string) net.Listener { 43 | l, err := net.Listen("unix", path) 44 | if err != nil { 45 | log.Fatal("failed to bind a socket: ", err) 46 | } 47 | registerUserServiceOnListener(i, l) 48 | return l 49 | } 50 | 51 | func registerService(i stm.Interface, path string) net.Listener { 52 | l, err := net.Listen("unix", path) 53 | if err != nil { 54 | log.Fatal("failed to bind a socket: ", err) 55 | } 56 | registerServiceOnListener(i, l) 57 | return l 58 | } 59 | 60 | func serveRemoteSTM(dev stm.Interface) { 61 | listeners, err := activation.Listeners() 62 | if err != nil { 63 | if userServiceSocket != "" { 64 | l := registerUserService(dev.(stm.UserInterface), userServiceSocket) 65 | defer l.Close() 66 | } 67 | if serviceSocket != "" { 68 | l := registerService(dev, serviceSocket) 69 | defer l.Close() 70 | } 71 | } else if len(listeners) == 2 { 72 | for _, l := range listeners { 73 | name := l.Addr().String() 74 | switch { 75 | case serviceSocket != "" && name == serviceSocket: 76 | registerServiceOnListener(dev, l) 77 | case userServiceSocket != "" && name == userServiceSocket: 78 | registerUserServiceOnListener(dev.(stm.UserInterface), l) 79 | default: 80 | log.Fatal("unknown fd name: ", name) 81 | } 82 | defer l.Close() 83 | } 84 | } else { 85 | log.Fatal("unexpected number of file descriptors passed: ", len(listeners)) 86 | } 87 | 88 | // Wait for interrupt. 89 | c := make(chan os.Signal, 1) 90 | signal.Notify(c) 91 | <-c 92 | } 93 | -------------------------------------------------------------------------------- /sw/nanopi/cmd/stm/stm.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package main 18 | 19 | import ( 20 | "flag" 21 | "log" 22 | "net/rpc" 23 | 24 | "github.com/SamsungSLAV/muxpi/sw/nanopi/stm" 25 | ) 26 | 27 | var ( 28 | userServiceSocket string 29 | serviceSocket string 30 | serve bool 31 | remote string 32 | dummy bool 33 | ) 34 | 35 | func setGlobalFlags() { 36 | flag.StringVar(&userServiceSocket, "user-listen", "/run/stm-user.socket", "path to socket on which user RPC interface will be served") 37 | flag.StringVar(&serviceSocket, "listen", "/run/stm.socket", "path to socket on which user and admin RPC interface will be served") 38 | flag.BoolVar(&serve, "serve", false, "start RPC service") 39 | flag.StringVar(&remote, "remote", "", "path to socket to use as a RPC service instead of local connection") 40 | flag.BoolVar(&dummy, "dummy", false, "log actions instead of performing them") 41 | } 42 | 43 | func checkErr(ctx string, err error) { 44 | if err != nil { 45 | log.Fatal(ctx, err) 46 | } 47 | } 48 | 49 | func main() { 50 | allCommands := []command{ 51 | new(multiplexer), 52 | new(cutter), 53 | new(current), 54 | new(display), 55 | new(leds), 56 | new(switches), 57 | } 58 | for _, cmd := range allCommands { 59 | cmd.setFlags() 60 | } 61 | setGlobalFlags() 62 | flag.Parse() 63 | 64 | if (remote != "") && serve { 65 | log.Fatal("conflicting flags: serve and remote") 66 | } 67 | 68 | if (remote != "") && dummy { 69 | log.Fatal("conflicting flags: dummy and remote") 70 | } 71 | 72 | var dev stm.InterfaceCloser 73 | if dummy { 74 | dev = stm.NewDummy("stm") 75 | } else if remote != "" { 76 | cl, err := rpc.Dial("unix", remote) 77 | checkErr("failed to connect to RPC service: ", err) 78 | 79 | dev = stm.NewInterfaceClient(cl) 80 | } else { 81 | var err error 82 | dev, err = stm.GetDefaultSTM() 83 | checkErr("failed to connect to STM: ", err) 84 | } 85 | defer dev.Close() 86 | 87 | if serve { 88 | serveRemoteSTM(dev) 89 | return 90 | } 91 | 92 | for _, cmd := range allCommands { 93 | cmd.run(dev) 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /sw/nanopi/fota/sdcard.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package fota 18 | 19 | import ( 20 | "fmt" 21 | "os" 22 | "time" 23 | 24 | "github.com/SamsungSLAV/muxpi/sw/nanopi/stm" 25 | fsnotify "gopkg.in/fsnotify/fsnotify.v1" 26 | ) 27 | 28 | const sdcardWaitTimeout = 30 * time.Second 29 | 30 | // checkFile checks if file specified with filename is present and is a block device. 31 | // It returns (true, nil) if it is. Non-nil error is returned if other error type 32 | // than NotExistError is met. 33 | func checkFile(filename string) (bool, error) { 34 | f, err := os.Stat(filename) 35 | if err != nil { 36 | if os.IsNotExist(err) { 37 | return false, nil 38 | } 39 | return false, fmt.Errorf("could not access file %s: %s", filename, err) 40 | } 41 | // SDcard detected. 42 | mode := f.Mode() 43 | if mode&os.ModeDevice != 0 { 44 | // Partition is a block device. 45 | return true, nil 46 | } 47 | // Partition is not a block device. 48 | return false, fmt.Errorf("unexpected attribute: %s", mode) 49 | } 50 | 51 | // WaitForSDcard checks if an SDcard is present in the system and returns. 52 | // If card is not found it restarts it by DUT -> TS switch and tries again until 53 | // number of retryCount is exceeded (then it returns an error). 54 | func WaitForSDcard(dev stm.Interface, sdcard string, retryCount int) error { 55 | watcher, err := fsnotify.NewWatcher() 56 | if err != nil { 57 | return fmt.Errorf("starting watcher failed: %s", err) 58 | } 59 | defer watcher.Close() 60 | err = watcher.Add("/dev/disk/by-path/") 61 | if err != nil { 62 | return fmt.Errorf("add of sdcard to watcher failed: %s", err) 63 | } 64 | 65 | ticker := time.NewTicker(sdcardWaitTimeout) 66 | defer ticker.Stop() 67 | 68 | // Check for first partition of SDcard (device is always available on muxPi). 69 | filename := sdcard + "1" 70 | for try := 0; try < retryCount; try++ { 71 | isPresent, err := checkFile(filename) 72 | if err != nil { 73 | return err 74 | } 75 | if isPresent { 76 | return nil 77 | } 78 | 79 | err = dev.DUT() 80 | if err != nil { 81 | return fmt.Errorf("failed to DUT: %s", err) 82 | } 83 | // It is good to make sure that it is completely disconnected from the reader. 84 | time.Sleep(2 * time.Second) 85 | err = dev.TS() 86 | if err != nil { 87 | return fmt.Errorf("failed to TS: %s", err) 88 | } 89 | 90 | wait: 91 | select { 92 | case event := <-watcher.Events: 93 | if event.Op&fsnotify.Create == fsnotify.Create { 94 | break 95 | } 96 | goto wait 97 | case err := <-watcher.Errors: 98 | return fmt.Errorf("watcher error occurred: %s", err) 99 | case <-ticker.C: 100 | } 101 | } 102 | return fmt.Errorf("exceeded number of attempts") 103 | } 104 | -------------------------------------------------------------------------------- /sw/nanopi/power/muxpi-power: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | MODE_PIN=203 6 | MODE_NORMAL=0 7 | MODE_FLASHING=1 8 | 9 | POWER_PIN=3 10 | POWER_OFF=0 11 | POWER_ON=1 12 | 13 | check_gpio_sysfs() { 14 | test -e /sys/class/gpio 15 | } 16 | 17 | export_gpio_out() { 18 | GPIO_NUM=$1 19 | test -d "/sys/class/gpio/gpio$GPIO_NUM" \ 20 | || echo "$GPIO_NUM" > /sys/class/gpio/export 21 | echo out > "/sys/class/gpio/gpio$GPIO_NUM/direction" 22 | } 23 | 24 | prepare_gpios() { 25 | export_gpio_out $MODE_PIN 26 | export_gpio_out $POWER_PIN 27 | } 28 | 29 | gpio_set() { 30 | GPIO_NUM=$1 31 | GPIO_VALUE=$2 32 | echo "$GPIO_VALUE" > "/sys/class/gpio/gpio$GPIO_NUM/value" 33 | } 34 | 35 | stm_power_off() { 36 | prepare_gpios 37 | gpio_set $POWER_PIN $POWER_OFF 38 | gpio_set $MODE_PIN $MODE_NORMAL 39 | } 40 | 41 | stm_power_on() { 42 | prepare_gpios 43 | gpio_set $POWER_PIN $POWER_OFF 44 | gpio_set $MODE_PIN $MODE_NORMAL 45 | gpio_set $POWER_PIN $POWER_ON 46 | } 47 | 48 | stm_flash_mode() { 49 | prepare_gpios 50 | gpio_set $POWER_PIN $POWER_OFF 51 | gpio_set $MODE_PIN $MODE_FLASHING 52 | gpio_set $POWER_PIN $POWER_ON 53 | } 54 | 55 | SUBCOMMAND="$1" 56 | case "$SUBCOMMAND" in 57 | "off") 58 | stm_power_off 59 | ;; 60 | "on") 61 | stm_power_on 62 | ;; 63 | "flashing") 64 | stm_flash_mode 65 | ;; 66 | *) 67 | echo "unknown command" 68 | printf "usage: %s {off,on,flashing}\n" "$0" 69 | exit 1 70 | ;; 71 | esac 72 | -------------------------------------------------------------------------------- /sw/nanopi/power/systemd/muxpi-power.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=MuxPi microcontroller power 3 | 4 | [Service] 5 | Type=oneshot 6 | ExecStart=/usr/bin/muxpi-power on 7 | ExecStop=/usr/bin/muxpi-power off 8 | RemainAfterExit=yes 9 | 10 | [Install] 11 | WantedBy=basic.target 12 | -------------------------------------------------------------------------------- /sw/nanopi/stm/dummy.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package stm 18 | 19 | import ( 20 | "log" 21 | "time" 22 | ) 23 | 24 | // Dummy is a dummy implementation of Interface. 25 | // It logs to the standard logger from "log" package. 26 | type Dummy struct { 27 | ctx string 28 | } 29 | 30 | // NewDummy return a dummy implementation of Interface. 31 | // Each message will be prefixed with context. 32 | func NewDummy(context string) InterfaceCloser { 33 | return &Dummy{ctx: context} 34 | } 35 | 36 | // Close prints "Close" to the standard logger. 37 | func (d *Dummy) Close() error { 38 | log.Println(d.ctx, "Close") 39 | return nil 40 | } 41 | 42 | // PowerTick prints "PowerTick" and duration argument to the standard logger. 43 | func (d *Dummy) PowerTick(duration time.Duration) error { 44 | log.Println(d.ctx, "PowerTick", duration) 45 | return nil 46 | } 47 | 48 | // SetLED prints "SetLED" and arguments to the standard logger. 49 | func (d *Dummy) SetLED(led LED, r, g, b uint8) error { 50 | log.Println(d.ctx, "SetLED", led, r, g, b) 51 | return nil 52 | } 53 | 54 | // ClearDisplay prints "ClearDisplay" to the standard logger. 55 | func (d *Dummy) ClearDisplay() error { 56 | log.Println(d.ctx, "ClearDisplay") 57 | return nil 58 | } 59 | 60 | // PrintText prints "PrintText" and arguments to the standard logger. 61 | func (d *Dummy) PrintText(x, y uint, color Color, text string) error { 62 | log.Println(d.ctx, "PrintText", x, y, color, text) 63 | return nil 64 | } 65 | 66 | // DUT prints "DUT" to the standard logger. 67 | func (d *Dummy) DUT() error { 68 | log.Println(d.ctx, "DUT") 69 | return nil 70 | } 71 | 72 | // TS prints "TS" to the standard logger. 73 | func (d *Dummy) TS() error { 74 | log.Println(d.ctx, "TS") 75 | return nil 76 | } 77 | 78 | // GetCurrent prints "GetCurrent" to the standard logger and returns 0. 79 | func (d *Dummy) GetCurrent() (int, error) { 80 | log.Println(d.ctx, "GetCurrent") 81 | return 0, nil 82 | } 83 | 84 | // StartCurrentRecord prints "StartCurrentRecord" and arguments to the standard logger. 85 | func (d *Dummy) StartCurrentRecord(samples int, interval time.Duration) error { 86 | log.Println(d.ctx, "StartCurrentRecord", samples, interval) 87 | return nil 88 | } 89 | 90 | // StopCurrentRecord prints "StopCurrentRecord" to the standard logger. 91 | func (d *Dummy) StopCurrentRecord() error { 92 | log.Println(d.ctx, "StopCurrentRecord") 93 | return nil 94 | } 95 | 96 | // GetCurrentRecord prints "GetCurrentRecord" to the standard logger and returns nil. 97 | func (d *Dummy) GetCurrentRecord() ([]int, error) { 98 | log.Println(d.ctx, "GetCurrentRecord") 99 | return nil, nil 100 | } 101 | 102 | // HDMI prints "HDMI" and argument to the standard logger. 103 | func (d *Dummy) HDMI(on bool) (err error) { 104 | log.Println(d.ctx, "HDMI", on) 105 | return nil 106 | } 107 | 108 | // SetDyper prints "SetDyper" and arguments to the standard logger. 109 | func (d *Dummy) SetDyper(dyper Dyper, on bool) error { 110 | log.Println(d.ctx, "SetDyper", dyper, on) 111 | return nil 112 | } 113 | -------------------------------------------------------------------------------- /sw/nanopi/stm/stm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ "$(id -u)" -eq 0 ]; then 3 | /usr/bin/stm -remote /run/stm.socket $@ 4 | else 5 | /usr/bin/stm -remote /run/stm-user.socket $@ 6 | fi 7 | -------------------------------------------------------------------------------- /sw/nanopi/stm/stm_suite_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package stm_test 18 | 19 | import ( 20 | . "github.com/onsi/ginkgo" 21 | . "github.com/onsi/gomega" 22 | 23 | "testing" 24 | ) 25 | 26 | func TestStm(t *testing.T) { 27 | RegisterFailHandler(Fail) 28 | RunSpecs(t, "Stm Suite") 29 | } 30 | -------------------------------------------------------------------------------- /sw/nanopi/stm/stm_test.go: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017-2018 Samsung Electronics Co., Ltd All Rights Reserved 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License 15 | */ 16 | 17 | package stm_test 18 | 19 | import ( 20 | "time" 21 | 22 | . "github.com/SamsungSLAV/muxpi/sw/nanopi/stm" 23 | 24 | . "github.com/onsi/ginkgo" 25 | . "github.com/onsi/gomega" 26 | ) 27 | 28 | var _ = Describe("Stm", func() { 29 | var dev InterfaceCloser 30 | 31 | BeforeEach(func() { 32 | var err error 33 | dev, err = GetDefaultSTM() 34 | Expect(err).ToNot(HaveOccurred()) 35 | }) 36 | 37 | AfterEach(func() { 38 | err := dev.Close() 39 | Expect(err).ToNot(HaveOccurred()) 40 | }) 41 | 42 | It("should switch to DUT", func() { 43 | err := dev.DUT() 44 | Expect(err).ToNot(HaveOccurred()) 45 | }) 46 | 47 | It("should do power tick", func() { 48 | err := dev.PowerTick(time.Second) 49 | Expect(err).ToNot(HaveOccurred()) 50 | }) 51 | 52 | It("should switch to TS", func() { 53 | err := dev.TS() 54 | Expect(err).ToNot(HaveOccurred()) 55 | }) 56 | 57 | It("should clear the display", func() { 58 | err := dev.ClearDisplay() 59 | Expect(err).ToNot(HaveOccurred()) 60 | }) 61 | 62 | It("should print text on the display", func() { 63 | err := dev.PrintText(0, 0, Foreground, "test text") 64 | Expect(err).ToNot(HaveOccurred()) 65 | time.Sleep(2 * time.Second) 66 | err = dev.PrintText(0, 0, Background, "test text") 67 | Expect(err).ToNot(HaveOccurred()) 68 | }) 69 | 70 | It("should blink the left LED", func() { 71 | err := dev.SetLED(LED1, 255, 255, 255) 72 | Expect(err).ToNot(HaveOccurred()) 73 | time.Sleep(2 * time.Second) 74 | err = dev.SetLED(LED1, 0, 0, 0) 75 | Expect(err).ToNot(HaveOccurred()) 76 | }) 77 | 78 | It("should blink the right LED", func() { 79 | err := dev.SetLED(LED2, 255, 255, 255) 80 | Expect(err).ToNot(HaveOccurred()) 81 | time.Sleep(2 * time.Second) 82 | err = dev.SetLED(LED2, 0, 0, 0) 83 | Expect(err).ToNot(HaveOccurred()) 84 | }) 85 | }) 86 | -------------------------------------------------------------------------------- /sw/nanopi/stm/systemd/stm-user.socket: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=User socket activation for STM daemon 3 | 4 | [Socket] 5 | SocketMode=0660 6 | SocketGroup=stm 7 | ListenStream=/run/stm-user.socket 8 | Service=stm.service 9 | 10 | [Install] 11 | WantedBy=sockets.target 12 | -------------------------------------------------------------------------------- /sw/nanopi/stm/systemd/stm.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=STM RPC 3 | Requires=stm-user.socket 4 | Requires=stm.socket 5 | Requires=muxpi-power.service 6 | 7 | [Service] 8 | ExecStart=/usr/bin/stm -serve 9 | KillSignal=SIGINT 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /sw/nanopi/stm/systemd/stm.socket: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Admin socket activation for STM daemon 3 | 4 | [Socket] 5 | SocketMode=0660 6 | ListenStream=/run/stm.socket 7 | 8 | [Install] 9 | WantedBy=sockets.target 10 | --------------------------------------------------------------------------------