I2C controller core之Bit controller(03)
FPGA proven, AISC proven, I2C controller core from OpenCores
http://opencores.org/project,i2c
Bit-controller
5 block
1) capture SCL and SDA
-- port
scl_i : in std_logic;
sda_i : in std_logic; 5 -- architecture 7 -- block
bus_status_ctrl : block
singal cSCL, cSDA : std_logic_vector( downto ); capture_scl_sda: process(clk, nRst)
begin
if (nRst = '') then
cSCL <= "";
cSDA <= "";
elsif (clk'event and clk = '') then
if (rst = '') then
cSCL <= "";
cSDA <= "";
else
cSCL <= (cSCL() & scl_i);
cSDA <= (cSDA() & sda_i);
endif;
endif;
end process capture_scl_sda;
2) filter SCL and SDA (glitch-free)
1 -- port
ena : in std_logic; -- core enable signal
clk_cnt : in unsigned( downto ); -- clock prescale value 5 -- block
signal fSCL : std_logic_vector( downto ); -- filter inputs for SCL
signal fSDA : std_logic_vector( downto ); -- filter inputs for SDA
signal filter_cnt : unsigned( downto ); -- clock divider for filter filter_divider: process(clk, nRst)
begin
if (nRst = '') then
filter_cnt <= (others => '');
elsif (clk'event and clk = '') then
if ( (rst = '') or (ena = '') ) then
filter_cnt <= (others => '');
elsif (filter_cnt = ) then
filter_cnt <= clk_cnt( downto );
else
filter_cnt <= filter_cnt -;
end if;
end if;
end process filter_divider; filter_scl_sda: process(clk, nRst)
begin
if (nRst = '') then
fSCL <= (others => '');
fSDA <= (others => '');
elsif (clk'event and clk = '') then
if (rst = '') then
fSCL <= (others => '');
fSDA <= (others => '');
elsif (filter_cnt = ) then
fSCL <= (fSCL( downto ) & cSCL());
fSDA <= (fSDA( downto ) & cSDA());
end if;
end if;
end process filter_scl_sda;
3) generate filtered SCL and SDA signals
1 -- architecture
signal sSCL, sSDA : std_logic; -- synchronized SCL and SDA inputs
signal dSCL, dSDA : std_logic; -- delayed versions ofsSCL and sSDA 5 -- block
scl_sda: process(clk, nRst)
begin
if (nRst = '') then
sSCL <= '';
sSDA <= ''; dSCL <= '';
dSDA <= '';
elsif (clk'event and clk = '') then
if (rst = '') then
sSCL <= '';
sSDA <= ''; dSCL <= '';
dSDA <= '';
else
sSCL <= (fSCL() and fSCL()) or
(fSCL() and fSCL()) or
(fSCL() and fSCL());
sSDA <= (fSDA() and fSDA()) or
(fSDA() and fSDA()) or
(fSDA() and fSDA()); dSCL <= sSCL;
dSDA <= sSDA;
end if;
end if;
end process scl_sda;
I2C controller core之Bit controller(03)的更多相关文章
- 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 ...
- 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分开实现. 二.基 ...
随机推荐
- Python 查看关键字
关键字 import keyword print(keyword.kwlist)
- Linux下几种文件传输命令
Linux下几种文件传输命令 sz rz sftp scp 最近在部署系统时接触了一些文件传输命令,分别做一下简单记录: 1.sftp Secure Ftp 是一个基于SSH安全协议的文件传输管理工具 ...
- CentOS6.5下卸载MySql(yum安装)
因为我是用yum安装的mysql,所以卸载相对简单 yum -y remove mysql* 再把相关的文件删掉, rm -f /etc/my.cnf.rpmsave rm -rf /var/lib ...
- Spring MVC中<mvc:annotation-driven />和<context:annotation-config />的区别分析
个人最简单的使用理解: <mvc:annotation-driven />是管理静态资源的,比如静态页面,返回JSON这些. <context:annotation-config / ...
- MVC.Net:对MVC5部署时出现403.14错误的解决方法
当我们部署MVC5到IIS 7的时候,有时会出现403.14的错误,如下图: 对于这个错误的解决方法就是在应用程序的web.config的system.webServer节点中加入这一句: <m ...
- Oracle推断值为非数字
select * from product_info t where t.contract_detailid is not null and length(translate(t.contract_d ...
- SQL Server高速导入数据分享
SQL Server高速导入数据,能够尝试的方法例如以下:CTE.OpenRowSet/OpenDataSource.BULK INSERT.bcp.Shell. 以下依次介绍这几种办法. 1.CTE ...
- 【Discuz】去除版权信息,标题栏与底部改动
这篇文章尽管是介绍怎么把Discuz!的版权信息怎么搞得无影无踪,可是还是建议在不影响论坛视觉效果的情况下,保留Discuz的版权信息,毕竟它为我奉献了一个这么出色的开源论坛的phpproject.主 ...
- HDU 5536/ 2015长春区域 J.Chip Factory Trie
Chip Factory Problem Description John is a manager of a CPU chip factory, the factory produces lots ...
- luogu1273 有限电视网
题目大意 有一棵有根树,每个结点有一个收益,每条边有一个花费.如果要选择一个叶子结点,则根节点到该叶子结点的路径上的所有结点都必须被选择.求当总收益大于等于总花费的情况下,最多能选择多少个叶子结点. ...