I2C controller core之Bit controller(02)
4 generate clock and control signals
1 -- architecture
signal iscl_oen, isda_oen : std_logic; -- internal I2C lines
signal sda_chk : std_logic; -- check SDA status (multi-master arbitration)
signal dscl_oen : std_logic; -- delayed scl_oen signals
signal sSCL, sSDA : std_logic; -- synchronized SCL and SDA inputs
signal dSCL, dSDA : std_logic; -- delayed versions ofsSCL and sSDA
signal clk_en : std_logic; -- statemachine clock enable
signal scl_sync, slave_wait : std_logic; -- clock generation signals
signal ial : std_logic; -- internal arbitration lost signal
signal cnt : unsigned( downto ); -- clock divider counter (synthesis) 12 -- whenever the slave is not ready it can delay the cycle by pulling SCL low
13 -- delay scl_oen
process (clk, nRst)
begin
if (nRst = '') then
dscl_oen <= '';
elsif (clk'event and clk = '') then
dscl_oen <= iscl_oen;
end if;
end process; 23 -- slave_wait is asserted when master wants to drive SCL high, but the slave pulls it low
24 -- slave_wait remains asserted until the slave releases SCL
process (clk, nRst)
begin
if (nRst = '') then
slave_wait <= '';
elsif (clk'event and clk = '') then
slave_wait <= (iscl_oen and not dscl_oen and not sSCL) or (slave_wait and not sSCL);
end if;
end process; 34 -- master drives SCL high, but another master pulls it low
35 -- master start counting down its low cycle now (clock synchronization)
scl_sync <= dSCL and not sSCL and iscl_oen; 38 -- generate clk enable signal
gen_clken: process(clk, nRst)
begin
if (nRst = '') then
cnt <= (others => '');
clk_en <= '';
elsif (clk'event and clk = '') then
if ((rst = '') or (cnt = ) or (ena = '') or (scl_sync = '')) then
cnt <= clk_cnt;
clk_en <= '';
elsif (slave_wait = '') then
cnt <= cnt;
clk_en <= '';
else
cnt <= cnt -;
clk_en <= '';
end if;
end if;
end process gen_clken;
I2C controller core之Bit controller(02)的更多相关文章
- 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(04)
4) detect start/stop condition START- falling edge on SDA while SCL is high; STOP - rising edge on ...
- 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分开实现. 二.基 ...
随机推荐
- poj 1273最大流dinic算法模板
#include<stdio.h> #include<string.h> #define N 300 #define inf 0x7fffffff #include<qu ...
- 51Nod——T 1242 斐波那契数列的第N项
https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1242 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 ...
- Spring for Apache Kafka @KafkaListener使用及注意事项
官方文档: https://docs.spring.io/spring-kafka/reference/html/ @KafkaListener The @KafkaListener annota ...
- Java中处理线程同步
引自:http://blog.csdn.net/aaa1117a8w5s6d/article/details/8295527和http://m.blog.csdn.net/blog/undoner/1 ...
- 大学,助你成长or 让你堕落?
不管是论坛.贴吧.还是博客,都或多或少能够看到诸如对大学教育的反思.抨击之类的文章.至于什么是大学,大学又该怎样度过.大学是助你成长还是让你堕落了?我想这应该是一个见仁见智的问题.作为一个过来人,结合 ...
- 《Spring技术内幕》笔记-第二章 IoC容器的实现
简单介绍 1,在Spring中,SpringIoC提供了一个主要的JavaBean容器.通过IoC模式管理依赖关系.并通过依赖注入和AOP切面增强了为JavaBean这样子的POJO提供事务管理,生命 ...
- hdu5044(二分)
题意:一个树上建两个加油站.使得全部点到达其近期加油站的最大距离最小. 解法:二分答案.关键时二分时候,要最合理话布局两个点的位置,做法是处理出来树的直径,然后在直径两端分别向中间移动二分的x步的两个 ...
- ORACLE-017:SQL优化-is not null和nvl
今天在优化一段sql,原脚本大致例如以下: select a.字段n from tab_a a where a.字段2 is not null; a.字段2添加了索引的,可是查询速度很慢. 于是做了例 ...
- jquery选中表格的某行变色
<tr ng-click="+"selectRow("+i+");"+" ng-mouseover="+"chan ...
- 心跳机制tcp keepalive的讨论、应用及“断网”、"断电"检测的C代码实现(Windows环境下)
版权声明:本文为博主原创文章,转载时请务必注明本文地址, 禁止用于任何商业用途, 否则会用法律维权. https://blog.csdn.net/stpeace/article/details/441 ...