[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
第一个:鸿蒙系统驱动开发的过程中,首先要清楚驱动框架是如何布局的,鸿蒙系统內部为开发者提供了驱动框架能力,包括驱动加载、驱动服务管理和驱动消息机制。这样做也是为了,构建一个驱动架构平台,为驱动开发者提供更加精准、高效的开发环境,力求做到一次开发,多系统部署。
第二个:驱动模型
HDF框架以组件化的驱动模型作为核心设计思想,为开发者提供更精细化的驱动管理,让驱动开发和部署更加规范。
第三个:硬件代码实现
驱动添加:
驱动配置分为两个部分——HDF框架定义的驱动设备描述和驱动的私有配置信息
HCS(HDF驱动框架配置描述)
私有配置文件存放驱动私有配置信息
驱动服务管理机制:
驱动服务发布策略:policy为2表示驱动对内核态和用户态都发布服务。
驱动消息机制:
第四个:
运行效果:通过控制my_led 0 关闭灯 my_led 1 打开对应的灯
总结:和linux驱动控制类似,用户程序不能直接访问驱动,只有驱动程序向用户态暴露server后,用户程序才能通过Dispatch的方式发送指令到驱动程序,并可以将用户态的数据传递给驱动。
多练习才能走的更远。