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)的更多相关文章

  1. I2C controller core之Bit controller(03)

    FPGA proven, AISC proven, I2C controller core from OpenCores http://opencores.org/project,i2c Bit-co ...

  2. I2C controller core之Bit controller(01)

    FPGA proven, AISC proven, I2C controller core from OpenCores http://opencores.org/project,i2c Bit-co ...

  3. I2C controller core之Bit controller(05)

    6 generate statemachine 1 -- port cmd_ack : out std_logic; -- command completed 4 -- architecture ty ...

  4. I2C controller core之Bit controller(04)

    4) detect start/stop condition START- falling edge on SDA while SCL is high;  STOP -  rising edge on ...

  5. ASP.NET Core MVC中Controller的Action,默认既支持HttpGet,又支持HttpPost

    我们知道ASP.NET Core MVC中Controller的Action上可以声明HttpGet和HttpPost特性标签,来限制可以访问Action的Http请求类型(GET.POST等). 那 ...

  6. 阅读DMA Controller Core 官方手册

    阅读DMA Controller Core 官方手册 DMA控制器框架图 怎样去设定一个DMA控制器 实例化DMA控制器 参数配置界面如下图所示: 对于width of the DMA length ...

  7. ASP.NET Core MVC中Controller的Action如何直接使用Response.Body的Stream流输出数据

    在ASP.NET Core MVC中,我们有时候需要在Controller的Action中直接输出数据到Response.Body这个Stream流中,例如如果我们要输出一个很大的文件到客户端浏览器让 ...

  8. (六)Net Core项目使用Controller之一 c# log4net 不输出日志 .NET Standard库引用导致的FileNotFoundException探究 获取json串里的某个属性值 common.js 如何调用common.js js 筛选数据 Join 具体用法

    (六)Net Core项目使用Controller之一 一.简介 1.当前最流行的开发模式是前后端分离,Controller作为后端的核心输出,是开发人员使用最多的技术点. 2.个人所在的团队已经选择 ...

  9. (十)Net Core项目使用Cookies (八)Net Core项目使用Controller之三-入参

    (十)Net Core项目使用Cookies 一.简介 1.Net Core可以直接使用Cookies,但是调用方式有些区别. 2.Net Core将Request和Response分开实现. 二.基 ...

随机推荐

  1. poj1330 lca 最近公共祖先问题学习笔记

    首先推荐两个博客网址: http://dongxicheng.org/structure/lca-rmq/ http://scturtle.is-programmer.com/posts/30055. ...

  2. K - Count the string kmp_Next数组应用

    It is well known that AekdyCoin is good at string problems as well as number theory problems. When g ...

  3. HTML-class与id的区别及应用

    在样式表定义一个样式的时候,可以定义id也可以定义class. 1.在CSS文件里书写时,ID加前缀"#":CLASS用"." 如只能用id #nav { wi ...

  4. CCEditBox/CCEditBoxImplMac

    #ifndef __CCEditBoxIMPLMAC_H__ #define __CCEditBoxIMPLMAC_H__ #include "cocos2d.h" #if (CC ...

  5. Spring cloud config配置文件加密解密

    Spring cloud config配置文件加密解密 学习了:http://blog.csdn.net/u010475041/article/details/78110349 学习了:<Spr ...

  6. ZOJ1041 Transmitters

    Transmitters Time Limit: 2 Seconds      Memory Limit: 65536 KB In a wireless network with multiple t ...

  7. ScheduleJobFactory

    /* * file name: ScheduleJobFactory.java * copyright: Unis Cloud Information Technology Co., Ltd. Cop ...

  8. C++组合通信

    #include <iostream> #include<vector> #include<string> using namespace std; class A ...

  9. git 拉取和获取 pull 和 fetch 区别【转】

    本文转载自:http://blog.csdn.net/u010094934/article/details/52775653 使用git  直接提交的话   直接 push 获取最新版本  有两种   ...

  10. 树形dp初步

    其实很早之前就学过树形dp,今天总接一下.树形dp就是一个在树上跑的dp(滑稽) 先是一道板子题:树上最大独立集 直接上代码了. #include<iostream> #include&l ...