linux驱动-CCF-1 provider 注册时钟

CCF: common clock frameword

provider 注册时钟分析

 1. 待注册 时钟数据


#define _REGISTER(f, s, ...) { .clk_register = (bcm2835_clk_register)f, \
			       .supported = s,				\
			       .data = __VA_ARGS__ }
#define REGISTER_CLK(s, ...)	_REGISTER(&bcm2835_register_clock,	\
					  s,				\
					  &(struct bcm2835_clock_data)	\
					  {__VA_ARGS__})

1.外设时钟的parents(固定)
static const char *const bcm2835_clock_per_parents[] = {
	"gnd",
	"xosc",
	"testdebug0",
	"testdebug1",
	"plla_per",
	"pllc_per",
	"plld_per",
	"pllh_aux",
};
					  
#define REGISTER_PER_CLK(s, ...)	REGISTER_CLK(			\
	s,								\
	.num_mux_parents = ARRAY_SIZE(bcm2835_clock_per_parents),	\
	.parents = bcm2835_clock_per_parents,				\
	__VA_ARGS__)

2. 分析 dts 引用的时钟

serial@7e201000 {
    compatible = "brcm,bcm2835-pl011\0arm,pl011\0arm,primecell";
    reg = <0x7e201000 0x200>;
    interrupts = <0x02 0x19>;
    clocks = <0x03 0x13 0x03 0x14>;
    clock-names = "uartclk\0apb_pclk";
    arm,primecell-periphid = <0x241011>;
    cts-event-workaround;
    pinctrl-names = "default";
    pinctrl-0 = <0x08 0x09>;
    status = "okay";
    phandle = <0x21>;
};

分析[0x13=19] [0x16=20]

2.1 外设时钟-uart 配置
[BCM2835_CLOCK_UART]	= REGISTER_PER_CLK(
	SOC_ALL,
	.name = "uart",
	.ctl_reg = CM_UARTCTL,
	.div_reg = CM_UARTDIV,
	.int_bits = 10,
	.frac_bits = 12,
	.tcnt_mux = 28),
 
2.2 外设时钟-uart 配置 扩展结果
 [19] = { 
  .clk_register = (bcm2835_clk_register)&bcm2835_register_clock, 
  .supported = ((1UL << (0)) | (1UL << (1))), 
  .data = &(struct bcm2835_clock_data) 
  {
    .num_mux_parents = ARRAY_SIZE(bcm2835_clock_per_parents), 
   .parents = bcm2835_clock_per_parents,
   .name = "uart", 
   .ctl_reg = 0x0f0,
   .div_reg = 0x0f4, 
   .int_bits = 10, 
   .frac_bits = 12, 
   .tcnt_mux = 28
   } 
}

3. bcm2835_clk_probe

        a. 调用bcm2835_register_clock  生成 struct clk_hw 数组

        struct  clk_hw  组成 struct clk_hw_onecell_data onecell               

        b. 调用 of_clk_add_hw_provider  根据 进一步生成of_clk_provider ,并添加到全局列表

      struct clk_hw_onecell_data onecell  填充到struct of_clk_provider *cp 中的data

static int bcm2835_clk_probe(struct platform_device *pdev)
{
	struct device *dev = &pdev->dev;
	struct clk_hw **hws;
	struct bcm2835_cprman *cprman;
	struct resource *res;
	const struct bcm2835_clk_desc *desc;
	const size_t asize = ARRAY_SIZE(clk_desc_array);
	const struct cprman_plat_data *pdata;
	struct device_node *fw_node;
	size_t i;
	u32 clk_id;
	int ret;

	pdata = of_device_get_match_data(&pdev->dev);
	if (!pdata)
		return -ENODEV;

	cprman = devm_kzalloc(dev,
			      struct_size(cprman, onecell.hws, asize),
			      GFP_KERNEL);
	........
	platform_set_drvdata(pdev, cprman);

	cprman->onecell.num = asize;
	hws = cprman->onecell.hws;

	for (i = 0; i < asize; i++) {
		desc = &clk_desc_array[i];
		if (desc->clk_register && desc->data &&
		    (desc->supported & pdata->soc)) {
			hws[i] = desc->clk_register(cprman, desc->data);
		}
	}
	...... 
	ret = of_clk_add_hw_provider(dev->of_node, of_clk_hw_onecell_get,
				      &cprman->onecell);
	return 0;
}

4. 关键数据结构

struct clk_hw_onecell_data {

        unsigned int num;

        struct clk_hw *hws[]; //provider 注册后的时钟数组

};

struct of_clk_provider {

        struct list_head link;

        struct device_node *node;

        struct clk *(*get)(struct of_phandle_args *clkspec, void *data);

        struct clk_hw *(*get_hw)(struct of_phandle_args *clkspec, void *data);

        void *data;  //对应 clk_hw_onecell_data(包含clk provider 注册的所有数组)

};

struct clk_hw {

        struct clk_core *core;

        struct clk *clk;

        const struct clk_init_data *init;

};

struct clk_init_data {

        const char *name;

        const struct clk_ops *ops;

        const char * const *parent_names;

        u8 num_parents;

        unsigned long flags;

};

struct clk_ops {

        int (*prepare)(struct clk_hw *hw);

        void (*unprepare)(struct clk_hw *hw);

        int (*is_prepared)(struct clk_hw *hw);

        void (*unprepare_unused)(struct clk_hw *hw);

        int (*enable)(struct clk_hw *hw);

        void (*disable)(struct clk_hw *hw);

        int (*is_enabled)(struct clk_hw *hw);

        void (*disable_unused)(struct clk_hw *hw);

       unsigned long (*recalc_rate)(struct clk_hw *hw, unsigned long parent_rate);

        // //通过查询硬件,重新计算此时钟的速率

        long (*round_rate)(struct clk_hw *hw, unsigned long rate,  unsigned long *parent_rate);

           //给定目标速率作为输入,返回时钟实际支持的最接近速率

        int (*determine_rate)(struct clk_hw *hw, struct clk_rate_request *req);

        int (*set_parent)(struct clk_hw *hw, u8 index);

        u8 (*get_parent)(struct clk_hw *hw);

        int (*set_rate)(struct clk_hw *hw, unsigned long rate,   unsigned long parent_rate);

        int (*set_rate_and_parent)(struct clk_hw *hw,    rate, parent_rate, u8 index);

        unsigned long (*recalc_accuracy)(struct clk_hw *hw, unsigned long parent_accuracy);

        int (*get_phase)(struct clk_hw *hw);

        int (*set_phase)(struct clk_hw *hw, int degrees);

        int (*get_duty_cycle)(struct clk_hw *hw, struct clk_duty *duty);

        int (*set_duty_cycle)(struct clk_hw *hw, struct clk_duty *duty);

        void (*init)(struct clk_hw *hw);

        void (*debug_init)(struct clk_hw *hw, struct dentry *dentry);

};

 

 bcm2835_register_clock 追踪

static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman,
					  const struct bcm2835_clock_data *data)
{
	struct bcm2835_clock *clock;
	struct clk_init_data init;
	const char *parents[1 << CM_SRC_BITS];
	size_t i;
	int ret;

	/*
	 * Replace our strings referencing parent clocks with the
	 * actual clock-output-name of the parent.
	 */
	for (i = 0; i < data->num_mux_parents; i++) {
		parents[i] = data->parents[i];

		ret = match_string(cprman_parent_names,
				   ARRAY_SIZE(cprman_parent_names),
				   parents[i]);
		if (ret >= 0)
			parents[i] = cprman->real_parent_names[ret];
	}

	memset(&init, 0, sizeof(init));
	init.parent_names = parents;
	init.num_parents = data->num_mux_parents;
	init.name = data->name;
	init.flags = data->flags | CLK_IGNORE_UNUSED;

	/*
	 * Some GPIO clocks for ethernet/wifi PLLs are marked as
	 * critical (since some platforms use them), but if the
	 * firmware didn't have them turned on then they clearly
	 * aren't actually critical.
	 */
	if ((cprman_read(cprman, data->ctl_reg) & CM_ENABLE) == 0)
		init.flags &= ~CLK_IS_CRITICAL;

	/*
	 * Pass the CLK_SET_RATE_PARENT flag if we are allowed to propagate
	 * rate changes on at least of the parents.
	 */
	if (data->set_rate_parent)
		init.flags |= CLK_SET_RATE_PARENT;

	if (data->is_vpu_clock) {
		init.ops = &bcm2835_vpu_clock_clk_ops; //操作函数组
	} else {
		init.ops = &bcm2835_clock_clk_ops; //操作函数组

		/* If the clock wasn't actually enabled at boot, it's not
		 * critical.
		 */
		if (!(cprman_read(cprman, data->ctl_reg) & CM_ENABLE))
			init.flags &= ~CLK_IS_CRITICAL;
	}

	clock = devm_kzalloc(cprman->dev, sizeof(*clock), GFP_KERNEL);
	if (!clock)
		return NULL;

	clock->cprman = cprman;
	clock->data = data;
	clock->hw.init = &init;

	ret = devm_clk_hw_register(cprman->dev, &clock->hw);
	if (ret)
		return ERR_PTR(ret);
	return &clock->hw;
}

 devm_clk_hw_register

int devm_clk_hw_register(struct device *dev, struct clk_hw *hw)
{
	struct clk_hw **hwp;
	int ret;

	hwp = devres_alloc(devm_clk_hw_release, sizeof(*hwp), GFP_KERNEL);
	if (!hwp)
		return -ENOMEM;

	ret = clk_hw_register(dev, hw);
	if (!ret) {
		*hwp = hw;
		devres_add(dev, hwp);
	} else {
		devres_free(hwp);
	}

	return ret;
}

 clk_hw_register 与clk_register

int clk_hw_register(struct device *dev, struct clk_hw *hw)
{
	return PTR_ERR_OR_ZERO(clk_register(dev, hw));
}
struct clk *clk_register(struct device *dev, struct clk_hw *hw)
{
	int i, ret;
	struct clk_core *core;

	core = kzalloc(sizeof(*core), GFP_KERNEL);
	if (!core) {
		ret = -ENOMEM;
		goto fail_out;
	}

	core->name = kstrdup_const(hw->init->name, GFP_KERNEL);
	if (!core->name) {
		ret = -ENOMEM;
		goto fail_name;
	}

	if (WARN_ON(!hw->init->ops)) {
		ret = -EINVAL;
		goto fail_ops;
	}
	core->ops = hw->init->ops;

	if (dev && pm_runtime_enabled(dev))
		core->dev = dev;
	if (dev && dev->driver)
		core->owner = dev->driver->owner;
	core->hw = hw;   //hw与core 相互引用
	core->flags = hw->init->flags;
	core->num_parents = hw->init->num_parents;
	core->min_rate = 0;
	core->max_rate = ULONG_MAX;
	hw->core = core;  //hw与core 相互引用

	/* allocate local copy in case parent_names is __initdata */
	core->parent_names = kcalloc(core->num_parents, sizeof(char *),
					GFP_KERNEL);

	if (!core->parent_names) {
		ret = -ENOMEM;
		goto fail_parent_names;
	}


	/* copy each string name in case parent_names is __initdata */
	for (i = 0; i < core->num_parents; i++) {
		core->parent_names[i] = kstrdup_const(hw->init->parent_names[i],
						GFP_KERNEL);
		if (!core->parent_names[i]) {
			ret = -ENOMEM;
			goto fail_parent_names_copy;
		}
	}

	/* avoid unnecessary string look-ups of clk_core's possible parents. */
	core->parents = kcalloc(core->num_parents, sizeof(*core->parents),
				GFP_KERNEL);
	if (!core->parents) {
		ret = -ENOMEM;
		goto fail_parents;
	};

	INIT_HLIST_HEAD(&core->clks);

	hw->clk = __clk_create_clk(hw, NULL, NULL);
	if (IS_ERR(hw->clk)) {
		ret = PTR_ERR(hw->clk);
		goto fail_parents;
	}

	ret = __clk_core_init(core);
	if (!ret)
		return hw->clk;

	__clk_free_clk(hw->clk);
	hw->clk = NULL;

fail_parents:
	.....
}

 __clk_core_init

if (core->ops->init)
    core->ops->init(core->hw);

if (core->ops->recalc_accuracy)
    core->accuracy = core->ops->recalc_accuracy(core->hw,
                    __clk_get_accuracy(core->parent));
if (core->ops->get_phase)
    core->phase = core->ops->get_phase(core->hw);

static int __clk_core_init(struct clk_core *core)
{
	int i, ret;
	struct clk_core *orphan;
	struct hlist_node *tmp2;
	unsigned long rate;

	if (!core)
		return -EINVAL;

	clk_prepare_lock();

	ret = clk_pm_runtime_get(core);
	if (ret)
		goto unlock;

	/* check to see if a clock with this name is already registered */
	if (clk_core_lookup(core->name)) {
		pr_debug("%s: clk %s already initialized\n",
				__func__, core->name);
		ret = -EEXIST;
		goto out;
	}

	/* check that clk_ops are sane.  See Documentation/driver-api/clk.rst */
	if (core->ops->set_rate &&
	    !((core->ops->round_rate || core->ops->determine_rate) &&
	      core->ops->recalc_rate)) {
		pr_err("%s: %s must implement .round_rate or .determine_rate in addition to .recalc_rate\n",
		       __func__, core->name);
		ret = -EINVAL;
		goto out;
	}

	if (core->ops->set_parent && !core->ops->get_parent) {
		pr_err("%s: %s must implement .get_parent & .set_parent\n",
		       __func__, core->name);
		ret = -EINVAL;
		goto out;
	}

	if (core->num_parents > 1 && !core->ops->get_parent) {
		pr_err("%s: %s must implement .get_parent as it has multi parents\n",
		       __func__, core->name);
		ret = -EINVAL;
		goto out;
	}

	if (core->ops->set_rate_and_parent &&
			!(core->ops->set_parent && core->ops->set_rate)) {
		pr_err("%s: %s must implement .set_parent & .set_rate\n",
				__func__, core->name);
		ret = -EINVAL;
		goto out;
	}

	/* throw a WARN if any entries in parent_names are NULL */
	for (i = 0; i < core->num_parents; i++)
		WARN(!core->parent_names[i],
				"%s: invalid NULL in %s's .parent_names\n",
				__func__, core->name);

	core->parent = __clk_init_parent(core);

	/*
	 * Populate core->parent if parent has already been clk_core_init'd. If
	 * parent has not yet been clk_core_init'd then place clk in the orphan
	 * list.  If clk doesn't have any parents then place it in the root
	 * clk list.
	 *
	 * Every time a new clk is clk_init'd then we walk the list of orphan
	 * clocks and re-parent any that are children of the clock currently
	 * being clk_init'd.
	 */
	if (core->parent) {
		hlist_add_head(&core->child_node,
				&core->parent->children);
		core->orphan = core->parent->orphan;
	} else if (!core->num_parents) {
		hlist_add_head(&core->child_node, &clk_root_list);
		core->orphan = false;
	} else {
		hlist_add_head(&core->child_node, &clk_orphan_list);
		core->orphan = true;
	}

	/*
	 * optional platform-specific magic
	 *
	 * The .init callback is not used by any of the basic clock types, but
	 * exists for weird hardware that must perform initialization magic.
	 * Please consider other ways of solving initialization problems before
	 * using this callback, as its use is discouraged.
	 */
	if (core->ops->init)
		core->ops->init(core->hw);

	/*
	 * Set clk's accuracy.  The preferred method is to use
	 * .recalc_accuracy. For simple clocks and lazy developers the default
	 * fallback is to use the parent's accuracy.  If a clock doesn't have a
	 * parent (or is orphaned) then accuracy is set to zero (perfect
	 * clock).
	 */
	if (core->ops->recalc_accuracy)
		core->accuracy = core->ops->recalc_accuracy(core->hw,
					__clk_get_accuracy(core->parent));
	else if (core->parent)
		core->accuracy = core->parent->accuracy;
	else
		core->accuracy = 0;

	/*
	 * Set clk's phase.
	 * Since a phase is by definition relative to its parent, just
	 * query the current clock phase, or just assume it's in phase.
	 */
	if (core->ops->get_phase)
		core->phase = core->ops->get_phase(core->hw);
	else
		core->phase = 0;

	/*
	 * Set clk's duty cycle.
	 */
	clk_core_update_duty_cycle_nolock(core);

	/*
	 * Set clk's rate.  The preferred method is to use .recalc_rate.  For
	 * simple clocks and lazy developers the default fallback is to use the
	 * parent's rate.  If a clock doesn't have a parent (or is orphaned)
	 * then rate is set to zero.
	 */
	if (core->ops->recalc_rate)
		rate = core->ops->recalc_rate(core->hw,
				clk_core_get_rate_nolock(core->parent));
	else if (core->parent)
		rate = core->parent->rate;
	else
		rate = 0;
	core->rate = core->req_rate = rate;

	/*
	 * Enable CLK_IS_CRITICAL clocks so newly added critical clocks
	 * don't get accidentally disabled when walking the orphan tree and
	 * reparenting clocks
	 */
	if (core->flags & CLK_IS_CRITICAL) {
		unsigned long flags;

		ret = clk_core_prepare(core);
		if (ret)
			goto out;

		flags = clk_enable_lock();
		ret = clk_core_enable(core);
		clk_enable_unlock(flags);
		if (ret) {
			clk_core_unprepare(core);
			goto out;
		}
	}

	/*
	 * walk the list of orphan clocks and reparent any that newly finds a
	 * parent.
	 */
	hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) {
		struct clk_core *parent = __clk_init_parent(orphan);

		/*
		 * We need to use __clk_set_parent_before() and _after() to
		 * to properly migrate any prepare/enable count of the orphan
		 * clock. This is important for CLK_IS_CRITICAL clocks, which
		 * are enabled during init but might not have a parent yet.
		 */
		if (parent) {
			/* update the clk tree topology */
			__clk_set_parent_before(orphan, parent);
			__clk_set_parent_after(orphan, parent, NULL);
			__clk_recalc_accuracies(orphan);
			__clk_recalc_rates(orphan, 0);
		}
	}

	kref_init(&core->ref);
out:
	clk_pm_runtime_put(core);
unlock:
	if (ret)
		hlist_del_init(&core->child_node);

	clk_prepare_unlock();

	if (!ret)
		clk_debug_register(core);

	return ret;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/585265.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

form1弹出子窗体form2,拖动子窗体判断是否离开父窗体区域,含源码(学习笔记)

一、效果&#xff08;进入和离开&#xff09; 子窗体到达父窗体边缘时变色。 二、代码分析 判断父窗体的目的&#xff0c;可以控制子窗体要随父窗体走。上面代码需要加以处理。 如&#xff1a;this.Location new Point(parentPoint.X distanceFromEdge, this.Location.Ydis…

给rwkv_pytorch增加rag

RAG 参考地址语义模型地址选择该模型使用方法方法二安装方法下载模型到本地材料材料处理语义分割计算得分根据得分 分割文本 构建向量数据库问答匹配问答整合 参考地址 RAG简单教程 分割策略 语义模型地址 hf 选择该模型 gte 使用方法 import torch.nn.functional as F…

AQS共享模式之CyclicBarrier

概念&#xff1a;CyclicBarrier翻译为循环(屏障/栅栏)&#xff0c;当一组线程到达一个屏障&#xff08;同步点&#xff09;时被阻塞&#xff0c;直到最后一个线程到达屏障时&#xff0c;屏障才会打开&#xff0c;所有被屏障拦截的线程才会继续工作。 设计目的&#xff1a;和Co…

当你老了:献给40岁以上还在求职的朋友

怪盗团团长按&#xff1a;本文作者是我的一位老朋友&#xff0c;他已经年过四十&#xff0c;在国内职场&#xff0c;算是不折不扣的中老年人了。难能可贵的是&#xff0c;最近他还换了工作&#xff0c;去了一个自己不熟悉的新行业奋斗。 我一直很纳闷&#xff0c;为何在中国&am…

该安装包不适配当前高性能处理器 请使用 64 位安装包

今天一台用户的一台手机报错&#xff0c;如下&#xff1a; 该安装包不适配当前高性能处理器 请使用 64 位安装包 查了下&#xff0c;网上也有人反馈该问题 https://ask.dcloud.net.cn/question/186865 最后在贴吧上发现答案&#xff1a;https://tieba.baidu.com/p/8773132859 …

Bluetooth Profile 蓝牙协议栈总结

GAP-Generic Access Profile 控制设备广播和连接 GAP profile 的目的是描述&#xff1a; Profile rolesDiscoverability modes and proceduresConnection modes and proceduresSecurity modes and procedures 设备连接过程 LE中GAP有4种角色&#xff1a;BroadcasterObserv…

使用groovy+spock优雅的进行单测

使用groovyspock优雅的进行单测 1. groovyspock示例1.1 简单示例1.2 增加where块的示例1.3 实际应用的示例 2. 单测相关问题2.1 与SpringBoot融合2.2 单测数据与测试数据隔离2.3 SQL自动转换&#xff08;MySQL -> H2&#xff09; 参考 Groovy是一种基于JVM的动态语言&#x…

LVGL自定义滑动

触摸和编码器都可以操作 typedef struct {lv_obj_t* obj;int16_t x;int16_t y;int16_t width;int16_t height; }pos_and_size_t;typedef struct {lv_obj_t* obj;lv_coord_t height;lv_coord_t width;lv_coord_t width_pad;lv_coord_t height_pad;lv_coord_t child_widget;lv_co…

2024王炸组合!基于Mamba的遥感图像处理引爆顶会!

对比传统方法&#xff0c;基于Mamba的遥感图像处理在计算效率和分析精度方面遥遥领先&#xff0c;Mamba遥感也成为了论文研究的新方向。 具体来说&#xff0c;在融合高分辨率的空间图像和低分辨率的光谱图像获取综合信息方面&#xff0c;Mamba可以提升性能&#xff0c;同时保持…

【Harmony3.1/4.0】笔记七-选项卡布局

概念 当页面信息较多时&#xff0c;为了让用户能够聚焦于当前显示的内容&#xff0c;需要对页面内容进行分类&#xff0c;提高页面空间利用率。Tabs组件可以在一个页面内快速实现视图内容的切换&#xff0c;一方面提升查找信息的效率&#xff0c;另一方面精简用户单次获取到的…

MySQL CRUD操作

前言&#x1f440;~ 上一章我们介绍了数据库的一些基础操作&#xff0c;关于如何去创建一个数据库&#xff0c;还有使用数据库&#xff0c;删 除数据库以及对表进行的一些基础操作&#xff0c;今天我们学习CRUD操作 俗称&#xff08;增删改查&#xff09; 如果各位对文章的内…

Objenesis 底层

Objenesis 简介 Objenesis 是一个 Java 库&#xff0c;用于在不调用构造方法的情况下创建对象。由于绕过了构造方法&#xff0c;所以无法调用构造方法中的初始化逻辑。相应的&#xff0c;Objenesis 无法创建抽象类、枚举、接口的实例对象。 起源 与其称之为起源&#xff0c;…

基于ST的STM32F407ZGT6嵌入式uCOS-III V3.08 操作系统工程实验

1.基于的开发板 2.原理图截图: 3.主控芯片框图与性能特点: High-performance foundation line, Arm Cortex-M4 core with DSP and FPU, 1 Mbyte of Flash memory, 168 MHz CPU, ART Accelerator, Ethernet, FSMC The STM32F405xx and STM32F407xx family is based on the high…

多家企业机密数据遭Lockbit3.0窃取,亚信安全发布《勒索家族和勒索事件监控报告》

本周态势快速感知 本周全球共监测到勒索事件87起&#xff0c;与上周相比勒索事件大幅下降。美国依旧为受勒索攻击最严重的国家&#xff0c;占比45%。 本周Cactus是影响最严重的勒索家族&#xff0c;Lockbit3.0和Bianlian恶意家族紧随其后&#xff0c;从整体上看Lockbit3.0依旧…

Meltdown 以及Linux KPTI技术简介

文章目录 前言一、Introduction二、 Background2.1 Out-of-order execution2.2 Address Spaces2.3 Cache Attacks 三、A Toy Example四、Building Blocks of the Attack4.1 Executing Transient Instructions4.2 Building a Covert Channel 五、Meltdown5.1 Attack Description…

深度学习之视觉特征提取器——LeNet

LeNet 引入 LeNet是是由深度学习巨头Yann LeCun在1998年提出&#xff0c;可以算作多层卷积网络在图像识别领域的首次成功应用。我们现在通常说的LeNet是指LeNet-5&#xff0c;最早的LeNet-1在1988年即开始研究&#xff0c;前后持续十年之久。但是&#xff0c;受限于当时计算机…

c++初阶——类和对象(下)

大家好&#xff0c;我是小锋&#xff0c;今天我们来学习我们类和对象的最后一个章节&#xff0c;我们本期的内容主要是类和对象的一些细节进行讲解 再谈构造函数 我们在初始化时有两种方式一种是函数体内初始化&#xff0c;一种是初始化列表 我们先来看看日期类的初始化 构造…

[机缘参悟-166] :周期论:万物的周期现象是这个世界有序性和稳定性保障;超越周期:在轮回中,把握周期节奏。

目录 前言&#xff1a;超越周期 一、周期是大自然和宇宙的规律&#xff0c;是天道 1.1 概述 1.2 万物的周期规律的现象 1.3 电磁波的周期 二、计算机世界中的周期性 三、佛家的生命轮回规律 四、人类社会发展的周期规律 五、经济活动的周期规律 5.1 概述 5.2 股市的…

Ieetcode——21.合并两个有序链表

21. 合并两个有序链表 - 力扣&#xff08;LeetCode&#xff09; 合并两个有序链表我们的思路是创建一个新链表&#xff0c;然后遍历已知的两个有序链表&#xff0c;并比较其节点的val值&#xff0c;将小的尾插到新链表中&#xff0c;然后继续遍历&#xff0c;直到将该两个链表…

C语言实验-函数与模块化程序设计

一&#xff1a; 编写函数fun&#xff0c;其功能是&#xff1a;输入一个正整数&#xff0c;将其每一位上为偶数的数取出重新构成一个新数并输出。主函数负责输入输出&#xff0c;如输入87653142&#xff0c;则输出8642。&#xff08;main函数->fun函数&#xff09; #define _…
最新文章