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分开实现. 二.基 ...
随机推荐
- (转)window.location.hash 属性使用说明
location是javascript里边管理地址栏的内置对象,比如location.href就管理页面的url,用location.href=url就可以直接将页面重定向url.而location. ...
- Django——8 关系表的数据操作 表关联对象的访问 多表查询
Django 关系表中的数据操作 表关联对象的访问 关联对象的add方法 create方法 remove方法 clear方法 多表查询 查询补充 聚合查询 分组查询 F查询 Q查询 关系表的数据操作 ...
- Maven学习总结(7)——eclipse中使用Maven创建Web项目
Maven学习总结(七)--eclipse中使用Maven创建Web项目 一.创建Web项目 1.1 选择建立Maven Project 选择File -> New ->Project,如 ...
- EXt js 学习笔记总结
1. get . fly. getCmp .getBody .getDoc .getDom.. get-----ExtJs获取节点.dom.提供缓存机制 Ext.Element类是Ext对DO ...
- POJ2001 Shortest Prefixes (Trie树)
直接用Trie树即可. 每个节点统计经过该点的单词数,遍历时当经过的单词数为1时即为合法的前缀. type arr=record next:array['a'..'z'] of longint; w: ...
- Hibernate二级缓存的使用
1.什么是缓存? 缓存是介于物理数据源与应用程序之间,是对数据库中的数据复制一份临时放在内存中的容器,其作用是为了减少应用程序对物理数据源访问的次数,从而提高了应用程序的运行性能.Hibernate在 ...
- LeetCode 122 Best Time to Buy and Sell Stock II(股票买入卖出的最佳时间 II)
翻译 话说你有一个数组,当中第i个元素表示第i天的股票价格. 设计一个算法以找到最大利润. 你能够尽可能多的进行交易(比如.多次买入卖出股票). 然而,你不能在同一时间来多次交易. (比如.你必须在下 ...
- BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第9章节--client对象模型和REST APIs概览 介绍SP2013中远程APIs
BEGINNING SHAREPOINT® 2013 DEVELOPMENT 第9章节--client对象模型和REST APIs概览 介绍SP2013中远程APIs 当SP首次開始 ...
- android 5.0新特性学习总结之下拉刷新(一)
android 5.0 后google最终在 support v4 包下 添加了下拉刷新的控件 项目地址: https://github.com/stormzhang/SwipeRefreshLayo ...
- T4语法
阅读目录 阅读目录 1.什么是T4? 2.vs插件的安装 3.T4初体验 4.T4语法 其实对于“T4模板”的学习,讲得最详细的还是MSDN,下面给出对应的链接,可以点开深入的了解. 回到顶部 1 ...