pin

【RT-Thread笔记】IO设备模型及GPIO设备

倖福魔咒の 提交于 2019-12-04 04:55:00
RTT内核对象——设备 RT-Thread有多种内核对象,其中设备device就是其中一种。 内核继承关系图如下: 设备继承关系图如下: device对象对应的结构体如下: 其中,设备类型type有如下几类: 设备的操作方法结构体: I/O设备模型框架 RT-Thread 提供了一套简单的 I/O 设备模型框架 : 应用程序通过 I/O 设备管理接口获得正确的设备驱动,然后通过这个设备驱动与底层 I/O 硬件设备进行数据(或控制)交互。 I/O 设备管理层:实现了对设备驱动程序的封装。 设备驱动程序的升级、更替不会对上层应用产生影响, 从而降低了代码的耦合性、复杂性,提高了系统的可靠性。 设备驱动框架层: 对同类硬件设备驱动的抽象, 将不同厂家的同类硬件设备驱动中相同的部分抽取出来。 设备驱动层: 是一组驱使硬件设备工作的程序,实现访问硬件设备的功能。 这一层是与硬件有关的,不同的芯片的同种外设驱动是不同的,STM32的GPIO驱动与NXP的GPIO驱动是不同的。这一层负责创建与注册I/O设备,对于操作逻辑简单的设备,可以不经过设备驱动框架层。 设备的两种注册方式 1、 对于操作逻辑简单的设备,可以不经过设备驱动框架层,直接将设备注册到 I/O 设备管理器中: 2、 对于另一些设备,如看门狗等,则会将创建的设备实例先注册到对应的设备驱动框架中,再由设备驱动框架向 I/O

mstar 平台I2C 配置

旧街凉风 提交于 2019-12-03 23:52:23
芯片的pin 脚可以用作不同的功能,总结一句就是外设进行状态和数据交换。 最常用的是作为GPIO,设置为输出模式时,通过高低电平来控制一些外围设置; // 如LED,屏的电源,背光的开关,功放的静音等等。 除了控制设置之外,还需要和外部设置传输数据。 pin 作为GPIO 设置为IN时,是获取外设的高低来判断外设的状态,最常用的一些source 通道的detect,及一些wakeup 功能。 pin 作为SAR 口,获取ADC值; // 如按键板,参照“mstar平台SAR口使用” pin 作为UART / SPI /SD 口; pin 作为I2C 口; 一般来说,大部分有特殊功能的Pin脚其实都可以作为GPIO使用,但是当我们将其配置成特殊功能后,就不能同时配为GPIO。 所以当我们发现某个Pin脚我们想将其配成GPIO后,却没办法改变它的高低状态时,就要留意一下该Pin脚是否已经被误配为特殊功能了,这时就需要我们先DISABLE 掉这个特殊功能之后,才能设置成GPIO及其状态设定。每个chip有对应一个init GPIO配置,BD_MST{$Board}.h, drvpadconf.c. 标准GPIO口配置 总共时钟状态 #define GPIO_NONE 0 // Not GPIO pin (default) #define GPIO_IN 1 // GPI #define

交易平台基本密钥处理流程(SJL05加密机)

社会主义新天地 提交于 2019-12-03 14:11:27
在平时的工作中,很少接触安全这块内容,最近需要自己独立完成安全这块内容,在开发中遇到的问题会在下面的理解中得到相应的解决。 在交易平台中,基于安全考虑会对传输中的报文进行加密处理,用到最多的是MAC校验、PIN加密。 MAC校验保证数据的完整性,PIN加密保证个人信息的安全性(即你输入的密码用PIN进行保护)。 ------------------------------------------------------------------------------------------------------------------ 首先需要明确三点的是: 1:除加密机之外所有看到的密钥全是以密文形式存在。 2:当你传输索引或加密机加密后的密钥密文给加密机时,加密机会自动找到与之对就应的密钥明文,进行相应的操作(如加密或解密) 3:加密与解密操作中是应用密钥的明文(加密机真正计算MAC、PIN时所用的密钥)。 前提:加密机有一顶层密钥(LMK)(用与加密其他密钥的密钥),通过多人分段输入来进行设置。可以认为此密钥安全。 场景: 1)平台则 1:平台与平台之间一般会有一个BMK(用于平台之间进行工作密钥(MACKEY,PINKEY)的自动分发),受加密机LMK保护。此密钥以索引或是通过加密机LMK加密后的密文形式出现在应用数据库中。 2

Chipsee 7 inch LCD support in Linux kernel 3.14

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Has anybody ported Chipsee 7 inch LCD on Linux kernel 3.14 or later ? Is there any patch available for the same ? If no patches any suggestion porting Chipsee LCD support from Linux kernel 3.8 to Linux kernel 3.14 ? Update: `/* * Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ /dts-v1/; #include "am33xx.dtsi" #include "am335x-bone

CSS: Create iOS style Pin Password box

匿名 (未验证) 提交于 2019-12-03 07:36:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to create a html5 input that looks like the iOS enter Pin (on the lock screen).... with 4 input boxes. How do i achieve this? I tried the following: 1) Created a normal input box. 2) Removed its borders. 3) Placed the above image as the background of the input box. 4) And added some letter spacing. Problem is: As i type the first 3 characters, it fits in the boxes: But when i type the 4th character, the characters move towards the left and hence it appears as below: What can I do to fix this ? Any other better approach ?? EDIT: Ok

How can i rerender Pinterest's Pin It button?

匿名 (未验证) 提交于 2019-12-03 02:44:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to create and manipulate the Pin It button after page load. When i change the button properties with js, it should be rerendered to get the functionality of pinning dynamically loaded images. So, does Pinterest have any method like Facebook's B.XFBML.parse() function? Thanks... 回答1: Just add data-pin-build attribute to the SCRIPT tag: <script defer src="//assets.pinterest.com/js/pinit.js" data-pin-build="parsePinBtns"></script> That causes pinit.js to expose its internal build function to the global window object as parsePinBtns

SoftHSM2 java not working

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to do POC on SoftHSM 2 , but some how I am getting below issue . Exception in thread "main" java.security.ProviderException: Initialization failed at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:376) at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103) at SoftHSM.main(SoftHSM.java:50) Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_SLOT_ID_INVALID at sun.security.pkcs11.wrapper.PKCS11.C_GetSlotInfo(Native Method) at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:365) ... 2 more HSM Config File : #

JSF outputlabel clear

匿名 (未验证) 提交于 2019-12-03 01:48:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have the following problem. I use a form when I provide only PIN. I have validator which checks if its a 4-digit number. Then the action on submit is set to the method which checks if the PIN exists in the database. If not it does message = "no PIN"; I used the message in the output label below the form. Previously it was null so there was no message there. Now it changes into "no PIN" but I have to clear it after clicking the submit button again because the error message doesn't disappear when you enter for example "12as" PIN and

Enable pullup GPIO

匿名 (未验证) 提交于 2019-12-03 00:56:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: im working with a AT91SAM9G25 board which has 4 PIO controller managing up to 32 programmable I/O lines. Each pin is configurable as either a general-purpose I/O line only or as an I/O line multiplexed up to two peripheral I/Os. So, for example, according with the documentation ( SAM9G25 , page 14), signal PC0 can be multiplexed such a general purpose I/O line or as the ISI_D0 line of the VIDEO_ATMEL_ISI (ISI of Image Sensor Interface). The reset state of all GPIO lines is with direction IN and Pullup enabled. when i use GPIOLIB via sysfs i

How can I edit a pinmux for BeagleBone Black on linux kernel 3.17?

匿名 (未验证) 提交于 2019-12-03 00:48:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I can take a peek at /sys/kernel/debug/pinctrl/44e10800.pinmux/pins and see the pin I am interested in: pin 38 (44e10898.0) 00000037 pinctrl-single This corresponds to GPIO[2]4 , or P8.10 . I'm using Fedora 21, with kernel 3.17.7-300.fc21.armv7hl . I would like to change the mux to 0x27 . In words, this would configure the pin to have an internal pull-down resistor (before, it was pull up). The desired output would be: pin 38 (44e10898.0) 00000027 pinctrl-single What can be done? Note: There is no /sys/devices/bone_capemgr.* , as this is not