自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(14)
  • 收藏
  • 关注

原创 i2c_probe()及I2C设备地址

I2C的设备驱动是通过i2c_add_driver(&my_driver)向i2c-core注册的,my_driver中的核心是detach和attach函数,在attach中通过probe探测到总线上的设备并把设备和驱动建立连接以完成设备的初始化。如何探测总线上的设备、Linux中i2c设备地址如何标识并引用? I2C中, 典型的attach如下所示: static int my_att

2015-01-22 17:03:27 2050

转载 LINUX IIC 驱动详解

IIC设备是一种通过IIC总线连接的设备,由于其简单性,被广泛引用于电子系统中。在现代电子系统中,有很多的IIC设备需要进行相互之间通信 IIC总线是由PHILIPS公司开发的两线式串行总线,用于连接微处理器和外部IIC设备。IIC设备产生于20世纪80年代,最初专用与音频和视频设备,现在在各种电子设备中都广泛应用 IIC总线有两条总线线路,一条是串行数据线(SDA),一条是串行时钟线

2015-01-22 16:35:10 1521

转载 Linux IIC驱动实例

Linux IIC驱动笔记 最近看了百问网的linux驱动视频,关于IIC部分总结如下:  一、IIC 驱动框架 应用层    open    read    write —————————————————— 驱动层 IIC设备驱动(drv_open drv_read drv_write)          IIC总线驱动      —————————————————— 硬件 (

2015-01-21 21:48:17 487

原创 leetcode----LRU Cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will always be positive) of the key if

2014-12-23 20:14:17 327

转载 leetcode---Valid Number

Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a" => false "2e10" => true Note: It is intended for the problem statement to be ambiguo

2014-12-22 20:21:00 365

原创 leetcode------Implement pow(x, n).

几天没写博客了   一直在调试公司的项目。。。 很明显  题目的要求是  实现x的n次方求知   编译第一次失败了  看了一下堆栈溢出  我一下子明白了要用到简单的递归调用   第二次就通过了  贴代码吧 public class Solution { public double pow(double x, int n) { double result = 0;//保存

2014-12-22 16:27:47 402

原创 leetcode----Wildcard Matching

'?' Matches any single character. '*' Matches any sequence of characters (including the empty sequence). The matching should cover the entire input string (not partial). The function prototype shoul

2014-12-10 17:18:50 353

原创 leetcode-----Single Number II

Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without u

2014-12-10 13:43:53 241

转载 排序算法的复杂度

排序法 平均时间 最差情形 稳定度 额外空间 备注 冒泡 O(n2) O(n2) 稳定 O(1) n小时较好 交换 O(n2) O(n2) 不稳定 O(1) n小时较好 选择 O(n2) O(n2) 不稳定 O(1) n小时较好

2014-12-09 17:26:19 272

原创 leetcode----Longest Consecutive Sequence

Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1, 2, 3

2014-12-09 17:14:31 304

原创 Maximum Product Subarray

Find the contiguous subarray within an array (containing at least one number) which has the largest product. For example, given the array [2,3,-2,4], the contiguous subarray [2,3] has the larges

2014-12-09 14:50:11 269

转载 ZigZag Conversion

这个问题困扰了我一个下午!!! 首先我们从简单的例子找一下规律,我们不看真的字母排序而是指看字母所在位置的排序。假设我们有n个字母,那么我们就有1到n这n个位置。 一: 2排的时候,1到n的排序 1 3 5 7 9  。。。 2 4 6 8 10 。。。 二: 3排的时候,1到n的排序 1   5   9  。。。 2 4

2014-12-05 14:38:35 249

原创 今天用了一天实现了 java中的简易的堆

实现了java中简易的堆   能够向里面插入数据  也可以删除其中的最大值   主要的难点在于

2014-11-10 20:12:25 311

原创 今天开始写博客

今天开始写博客

2014-11-10 18:24:17 270

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除