承接 neuronlight/pinout 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

neuronlight/pinout

Composer 安装命令:

composer require neuronlight/pinout

包简介

Electronic device pinout renderer

关键字:

README 文档

README

Pinout facilitates the rendering of integrated circuit pinout diagrams from a JSON file.

Installation

$ composer require neuronlight/pinout

Test the installation by browsing to /vendor/neuronlight/pinout/examples/index.php

You should see a pinout diagram for the PIC12F675 microcontroller.

Simple usage

Include the javascript in your web page:

<script type="text/javascript" src="/vendor/neuronlight/pinout/pinout.js"></script>

To have a pinout diagram rendered from a JSON use an element with a data-device attribute:

<div data-device="pic12f675"></div>

where (in this case) pic12f675 is the filename (sans .json extension - although it can be included) of the JSON file defining the device.

You'll also need to include jQuery; either locally or via one of the many CDNs available

Defining a device

A JSON file for a device takes the form:

{
	"name": "Serial Infrared Decoder",
	"description": "Serial Infrared Decoder based on PIC12F675 8-Bit Microcontroller",
	"package-type": "SDIP",
	"pin-count": 8,
	"pinout": {
	    "undefined": "NC",
		"pins": {
			"1": {
				"name": "VDD",
				"signal-direction": "none",
				"description": "Positive supply"
			},
			"2": {
				"name": "IR IN",
				"signal-direction": "in",
				"description": "Infrared module input"
	        },
			"3": {
				"name": "IR IN",
				"signal-direction": "in",
				"description": "Infrared module input"
	        },
			"4": [
					{
						"name": "MCLR",
						"inverted": true,
						"signal-direction": "in",
						"description": "Master clear"
					},
					{
						"name": "VPP",
						"signal-direction": "in",
						"description": "Programming voltage"
					}
			],
			"5": {
				"name": "Serial Out",
				"signal-direction": "both",
				"description": "Serial data output"
	        },
			"8": {
				"name": "VSS",
				"signal-direction": "none",
				"description": "Ground reference"
			}
		}
	}
}

Package types currently supported are DIP, PDIP, CERDIP, SDIP & SPDIP.

(Devices with less than 24 pins that are defined as DIP sized packages are rendered as SDIP)

Changing the appearance of the diagram

The diagram is rendered using paramters in the default configuration file:

{
	"color": "000",
	"background": "fff",
	"width": 640,
	"height": 480,
	"scale": 10
}

Some, or all of the paramters can be overridden in one of two ways.

  1. An alternative configuration file (named pinout_config.json) can be created and placed in the same directory as the device JSON file (parameters defined this way override those defined in the default configuration file)

  2. Other attributes can be added to the HTML element (any parameters define in this way override those defined in any configuration file)

Element attributes supported are:

data-width - width of diagram in pixels

data-height - height of digram in pixels

data-scale - scale of diagram (number of pixels per mm)

data-color - diagram color (in hex M, RGB or RRGGBB format)

data-background - background color

Direct use

The device image can be called directly. The example image is called, for example, with the form:

/vendor/neuronlight/pinout/pinout.php?f=/vendor/neuronlight/pinout/examples/pic12f675.json&w=600&h=300&c=f40

The file parameter can be omitted when calling directly; the device JSON being sent as a POST parameter called 'dev' instead. When called in such a way the appearance can only be changed from that defined in the default configuration file by way of $_GET parameters (i.e. no custom config file will be loaded).

Experimenter

There's a basic tool included for experimenting with the pinout functions that can be found at /vendor/neuronlight/pinout/examples/experimenter.php (html5 browser required).

Share and enjoy.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2018-03-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固