I2C controller core之Bit controller(04)
4) detect start/stop condition
START- falling edge on SDA while SCL is high; STOP - rising edge on SDA while SCL is high
1 -- block
signal sta_condition : std_logic; -- start detected
signal sto_condition : std_logic; -- stop detected detect_sta_sto: process(clk, nRst)
begin
if (nRst = '') then
sta_condition <= '';
sto_condition <= '';
elsif (clk'event and clk = '') then
if (rst = '') then
sta_condition <= '';
sto_condition <= '';
else
sta_condition <= (not sSDA and dSDA) and sSCL;
sto_condition <= (sSDA and not dSDA) and sSCL;
end if;
end if;
end process detect_sta_sto;
5) generate i2c-bus busy signal
1 -- port
busy : out std_logic; -- i2c bus busy 4 -- architecture
signal ibusy : std_logic; -- internal busy signal gen_busy: process(clk, nRst)
begin
if (nRst = '') then
ibusy <= '';
elsif (clk'event and clk = '') then
if (rst = '') then
ibusy <= '';
else
ibusy <= (sta_condition or ibusy) and not sto_condition;
end if;
end if;
end process gen_busy; busy <= ibusy;
6) generate arbitration lost signal
0 -- port
1 al : out std_logic; -- arbitration lost
1 -- architecture
constant I2C_CMD_NOP : std_logic_vector( downto ) := "";
constant I2C_CMD_START : std_logic_vector( downto ) := "";
constant I2C_CMD_STOP : std_logic_vector( downto ) := "";
constant I2C_CMD_READ : std_logic_vector( downto ) := "";
constant I2C_CMD_WRITE : std_logic_vector( downto ) := ""; signal ial : std_logic; -- internal arbitration lost signal
signal sda_chk : std_logic; -- check SDA status (multi-master arbitration) 11 -- block
signal cmd_stop : std_logic; -- STOP command 14 -- aribitration lost when:
15 -- 1) master drives SDA high, but the i2c bus is low
16 -- 2) stop detected while not requested (detect during 'idle' state)
gen_al: process(clk, nRst)
begin
if (nRst = '') then
cmd_stop <= '';
ial <= '';
elsif (clk'event and clk = '') then
if (rst = '') then
cmd_stop <= '';
ial <= '';
else
if (clk_en = '') then
if (cmd = I2C_CMD_STOP) then
cmd_stop <= '';
else
cmd_stop <= '';
end if;
end if; if (c_state = idle) then
ial <= (sda_chk and not sSDA and isda_oen) or (sto_condition and not cmd_stop);
else
ial <= (sda_chk and not sSDA and isda_oen);
end if;
end if;
end if;
end process gen_al;
al <= ial;
7) generate dout signal
1 -- store dout on rising edge of SCL
gen_dout: process(clk, nReset)
begin
if (nReset = '') then
dout <= '';
elsif (clk'event and clk = '') then
if (sSCL = '' and dSCL = '') then
dout <= sSDA;
end if;
end if;
end process gen_dout;
end block bus_status_ctrl;
I2C controller core之Bit controller(04)的更多相关文章
- I2C controller core之Bit controller(03)
FPGA proven, AISC proven, I2C controller core from OpenCores http://opencores.org/project,i2c Bit-co ...
- I2C controller core之Bit controller(01)
FPGA proven, AISC proven, I2C controller core from OpenCores http://opencores.org/project,i2c Bit-co ...
- I2C controller core之Bit controller(05)
6 generate statemachine 1 -- port cmd_ack : out std_logic; -- command completed 4 -- architecture ty ...
- I2C controller core之Bit controller(02)
4 generate clock and control signals 1 -- architecture signal iscl_oen, isda_oen : std_logic; -- int ...
- ASP.NET Core MVC中Controller的Action,默认既支持HttpGet,又支持HttpPost
我们知道ASP.NET Core MVC中Controller的Action上可以声明HttpGet和HttpPost特性标签,来限制可以访问Action的Http请求类型(GET.POST等). 那 ...
- 阅读DMA Controller Core 官方手册
阅读DMA Controller Core 官方手册 DMA控制器框架图 怎样去设定一个DMA控制器 实例化DMA控制器 参数配置界面如下图所示: 对于width of the DMA length ...
- ASP.NET Core MVC中Controller的Action如何直接使用Response.Body的Stream流输出数据
在ASP.NET Core MVC中,我们有时候需要在Controller的Action中直接输出数据到Response.Body这个Stream流中,例如如果我们要输出一个很大的文件到客户端浏览器让 ...
- (六)Net Core项目使用Controller之一 c# log4net 不输出日志 .NET Standard库引用导致的FileNotFoundException探究 获取json串里的某个属性值 common.js 如何调用common.js js 筛选数据 Join 具体用法
(六)Net Core项目使用Controller之一 一.简介 1.当前最流行的开发模式是前后端分离,Controller作为后端的核心输出,是开发人员使用最多的技术点. 2.个人所在的团队已经选择 ...
- (十)Net Core项目使用Cookies (八)Net Core项目使用Controller之三-入参
(十)Net Core项目使用Cookies 一.简介 1.Net Core可以直接使用Cookies,但是调用方式有些区别. 2.Net Core将Request和Response分开实现. 二.基 ...
随机推荐
- STM32定时器配置(TIM1-TIM8)高级定时器+普通定时器,定时计数模式下总结
文章结构: ——> 一.定时器基本介绍 ——> 二.普通定时器详细介绍TIM2-TIM5 ——> 三.定时器代码实例 一.定时器基本介绍 之前有用过野火的学习板上面讲解很详细,所以 ...
- MySQL之SQL优化详解(一)
目录 慢查询日志 1. 慢查询日志开启 2. 慢查询日志设置与查看 3.日志分析工具mysqldumpslow 序言: 在我面试很多人的过程中,很多人谈到SQL优化都头头是道,建索引,explai ...
- JavaSE 学习笔记之Import 导入(十二)
Import - 导入:类名称变长,写起来很麻烦.为了简化,使用了一个关键字:import,可以使用这个关键字导入指定包中的类.记住:实际开发时,到的哪个类就导入哪个类,不建议使用*. import ...
- sencha touch 2制作滑动DataView(无缝list)
Ext.define('App.view.Sections', { extend: 'Ext.dataview.DataView', xtype: 'sectionslist', id: 'mainl ...
- Spell checker POJ 1035 字符串
Spell checker Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 25426 Accepted: 9300 De ...
- asp.net--webservice--安全验证SoapHeader
服务端的设置 客户端设置,需要生成一个服务端的代理,调用服务端的方法
- HDU 5293
树上DP题. 其实有点类似于01的问题.方程很容易想到.首先,因为一条链的节点其实都是在树上的,所以很容易想到应该先求一个LCA.然后,当某节点不是链的LCA时,它的转移就是: dp[i]=sum[i ...
- poj 1635
有根树同构.参考论文<hash在....> #include <iostream> #include <fstream> #include <algorith ...
- maven的启动类和MAVEN_OPTS参数
maven的启动类和MAVEN_OPTS参数 在mvn.cmd的155行, set CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launc ...
- springmvc 时间返回格式化
如果是@ResponseBody,可以通过@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")设置返回的样式: 如果是不是@ResponseBody ...