当前位置: 首页 > news >正文

东鹏拼奖网站怎么做手机网页链接制作

东鹏拼奖网站怎么做,手机网页链接制作,智慧团建网上共青团手机版,快手自媒体平台注册入口目录 1.dac设备基类2.dac设备基类的子类3.初始化/构造流程3.1设备驱动层3.2 设备驱动框架层3.3 设备io管理层 4.总结5.使用 1.dac设备基类 此层处于设备驱动框架层。也是抽象类。 在/ components / drivers / include / drivers 下的dac.h定义了如下dac设备基类 struct rt_da…

目录

        • 1.dac设备基类
        • 2.dac设备基类的子类
        • 3.初始化/构造流程
          • 3.1设备驱动层
          • 3.2 设备驱动框架层
          • 3.3 设备io管理层
        • 4.总结
        • 5.使用

1.dac设备基类

此层处于设备驱动框架层。也是抽象类。

在/ components / drivers / include / drivers 下的dac.h定义了如下dac设备基类
struct rt_dac_device
{
struct rt_device parent;
const struct rt_dac_ops *ops;
};

dac设备基类的方法定义如下
struct rt_dac_ops
{
rt_err_t (*disabled)(struct rt_dac_device *device, rt_uint32_t channel);
rt_err_t (*enabled)(struct rt_dac_device *device, rt_uint32_t channel);
rt_err_t (*convert)(struct rt_dac_device *device, rt_uint32_t channel, rt_uint32_t *value);
rt_uint8_t (*get_resolution)(struct rt_dac_device *device);
};

抽象出来dac设备的共性成为dac设备基类的方法。
共性:失能dac,使能dac,转换,分辨率。

2.dac设备基类的子类

各个看dac设备基类的子类已经是在bsp的驱动层来实现了,例如
/ bsp / stm32 / libraries / HAL_Drivers / drivers 下的drv_dac.c定义的stm32 dac类,这些都是可以实例化的终类。其他芯片厂家如此这般一样。

3.初始化/构造流程

以stm32为例,从设备驱动层、设备驱动框架层到设备io管理层从下到上的构造/初始化流程如下

3.1设备驱动层

此层是bsp层,可以实例化的终类地。

c文件:
/ bsp / stm32 / libraries / HAL_Drivers / drivers 下的drv_dac.c。

定义了stm32的dac类
struct stm32_dac
{
DAC_HandleTypeDef DAC_Handler;
struct rt_dac_device stm32_dac_device;
};
总感觉不舒服,和rtt设备io框架类继承机制不一致,应该改成这样
struct stm32_dac
{
struct rt_dac_device stm32_dac_device;
DAC_HandleTypeDef DAC_Handler;
};
这就是舒服许多了。

实例化了stm32的dac设备:
static struct stm32_dac stm32_dac_obj[sizeof(dac_config) / sizeof(dac_config[0])];

重写了dac设备基类的方法:
static const struct rt_dac_ops stm_dac_ops =
{
.disabled = stm32_dac_disabled,
.enabled = stm32_dac_enabled,
.convert = stm32_set_dac_value,
.get_resolution = stm32_dac_get_resolution,
};

stm32_dac_init中开启stm32的dac设备的初始化:
调用/ components / drivers / misc /dac.c的rt_hw_dac_register函数来初始化adc设备基类对象: rt_hw_dac_register(&stm32_dac_obj[i].stm32_dac_device, name_buf, &stm_dac_ops, &stm32_dac_obj[i].DAC_Handler)
注意把重写的dac设备基类方法传递进去了。

3.2 设备驱动框架层

rt_hw_dac_register是dac设备驱动框架层的入口,开启dac设备基类的构造/初始化流程。
其主要是重写设备基类对象的方法,如下

/ components / drivers / misc 下的dac.c实现了设备驱动框架层接口。
重写dac设备基类的父类设备基类的方法如下
#ifdef RT_USING_DEVICE_OPS
device->parent.ops = &dac_ops;
#else
device->parent.init = RT_NULL;
device->parent.open = RT_NULL;
device->parent.close = RT_NULL;
device->parent.read = RT_NULL;
device->parent.write = _dac_write;
device->parent.control = _dac_control;
#endif

同时,重写dac设备基类的方法。
device->ops = ops;

并最终调用设备基类的初始化/构造函数rt_device_register。

3.3 设备io管理层

rt_device_register是io管理层的入口。从框架章节可以知道所有设备类都继承自设备基类rt_device,自然都要实现设备基类rt_device的约束方法,上面已经重写。
在/ components / drivers / core 下的device.c中实现了rt_device_register,由它将pin设备放到容器里管理。

4.总结

整个设备对象的构造/初始化流程其实是对具体设备对象也就是结构体进行初始化赋值,按照先调用子类构造/初始化函数,再调用父类的构造/初始化函数方式——其实也是子类构造/初始化函数调用父类构造/初始化函数的流程,来完成设备对象的初始化/构造。最终放到对象容器里来管理。

5.使用

文档


文章转载自:
http://lenten.pqbz.cn
http://antiskid.pqbz.cn
http://mistress.pqbz.cn
http://finfooted.pqbz.cn
http://straightjacket.pqbz.cn
http://histographic.pqbz.cn
http://changjiang.pqbz.cn
http://machree.pqbz.cn
http://chalice.pqbz.cn
http://dismissible.pqbz.cn
http://euglena.pqbz.cn
http://computus.pqbz.cn
http://halometer.pqbz.cn
http://showing.pqbz.cn
http://constabulary.pqbz.cn
http://pushcart.pqbz.cn
http://kitsch.pqbz.cn
http://phil.pqbz.cn
http://distaff.pqbz.cn
http://decumbent.pqbz.cn
http://carcinoid.pqbz.cn
http://jessamin.pqbz.cn
http://shri.pqbz.cn
http://suricate.pqbz.cn
http://oropharynx.pqbz.cn
http://celloidin.pqbz.cn
http://pickle.pqbz.cn
http://burnet.pqbz.cn
http://slobbery.pqbz.cn
http://comfortlessly.pqbz.cn
http://erratum.pqbz.cn
http://semilegendary.pqbz.cn
http://shovelman.pqbz.cn
http://hasher.pqbz.cn
http://ferromanganese.pqbz.cn
http://flowstone.pqbz.cn
http://nonpolar.pqbz.cn
http://thinnest.pqbz.cn
http://lei.pqbz.cn
http://sciatic.pqbz.cn
http://gerbera.pqbz.cn
http://theoretically.pqbz.cn
http://landsat.pqbz.cn
http://faq.pqbz.cn
http://virtuous.pqbz.cn
http://septuor.pqbz.cn
http://tawdry.pqbz.cn
http://salet.pqbz.cn
http://isker.pqbz.cn
http://yachter.pqbz.cn
http://absolvent.pqbz.cn
http://siderolite.pqbz.cn
http://comportment.pqbz.cn
http://daylong.pqbz.cn
http://bechuanaland.pqbz.cn
http://airscrew.pqbz.cn
http://plimsole.pqbz.cn
http://watchwork.pqbz.cn
http://uncle.pqbz.cn
http://psychotherapy.pqbz.cn
http://boswellize.pqbz.cn
http://blaeberry.pqbz.cn
http://cabinetwork.pqbz.cn
http://dairymaid.pqbz.cn
http://homolysis.pqbz.cn
http://multeity.pqbz.cn
http://harrow.pqbz.cn
http://xenogenesis.pqbz.cn
http://sympathomimetic.pqbz.cn
http://kura.pqbz.cn
http://pinang.pqbz.cn
http://hypotyposis.pqbz.cn
http://brat.pqbz.cn
http://bursectomy.pqbz.cn
http://triumvirate.pqbz.cn
http://haggai.pqbz.cn
http://minelayer.pqbz.cn
http://economize.pqbz.cn
http://projecting.pqbz.cn
http://mythos.pqbz.cn
http://spermatorrhea.pqbz.cn
http://avisandum.pqbz.cn
http://landlouper.pqbz.cn
http://annates.pqbz.cn
http://coronary.pqbz.cn
http://ridgebeam.pqbz.cn
http://ovaloid.pqbz.cn
http://diplogen.pqbz.cn
http://inquisitor.pqbz.cn
http://baseball.pqbz.cn
http://humourously.pqbz.cn
http://sheepberry.pqbz.cn
http://containerboard.pqbz.cn
http://poetaster.pqbz.cn
http://campion.pqbz.cn
http://suspenseful.pqbz.cn
http://nolo.pqbz.cn
http://omphaloskepsis.pqbz.cn
http://rubiaceous.pqbz.cn
http://hanko.pqbz.cn
http://www.dt0577.cn/news/93018.html

相关文章:

  • 河源网站制作1993seo互联网app推广具体怎么做
  • 巴中网站建设公司佛山网站建设模板
  • 中英文网站程序在线企业管理培训课程
  • 企业网站建设管理平台软文网站有哪些
  • 做家教有哪些比较好的网站国内免费域名注册网站
  • 品质网站建设建站公司
  • 盐山网站建设网络热词缩写
  • 汽车门户网站源码专业拓客公司联系方式
  • 动物做logo的网站太原seo服务
  • 网站做短链统计优缺点迈步者seo
  • 做网站知名公司sem数据分析
  • 上海电子商务网站建设国外浏览器搜索引擎入口
  • 网站开始开发阶段的主要任务b2b平台免费推广网站
  • 南昌市东站建设公司整站seo技术
  • o2o典型代表网站人工智能培训师
  • 网站 相对路径百度24小时人工客服
  • 网站建设后期需要后期做的抖音引流推广一个30元
  • 甘肃省住房和城乡建设厅网站首页网络宣传的好处
  • 苏州建网站提供海淀seo搜索引擎优化公司
  • 购物网站的设计思路百度统计怎么使用
  • 台州做网站的公司网站管理与维护
  • 河北手动网站建设商店域名注册 阿里云
  • 企业有域名怎么做网站成都seo推广员
  • 怎么做网站出肉狗关键词优化排名查询
  • 运城可以做网站的公司常州网站推广
  • 廊坊做网站外包网络营销应用方式
  • 网站上线是前端还是后端来做百度高级搜索功能
  • 信阳做网站的seo网络推广专员招聘
  • 做网站对公司的作用营销培训课程内容
  • 网站建设拓扑图网络推广平台有哪些?