航芯ACM32G103开发板评测 02-GPIO输入输出

news2024/10/7 18:27:21

航芯ACM32G103开发板评测 02-GPIO输入输出

航芯ACM32G103开发板评测 GPIO输入输出应用

  1. 软硬件平台
    ACM32G103 Board开发板
    MDK-ARM Keil
    在这里插入图片描述

  2. GPIO输出典型应用——点灯

  3. GPIO输入典型应用——按键

GPIO 功能概述

GPIO 是通用输入/输出(General Purpose I/O)的简称,主要用于工业现场需要用到数字量输入/输出的场合,例如:

  • 输出功能:继电器、 LED、蜂鸣器等的控制
  • 输入功能:传感器状态、高低电平等信息的读取
  • 复用功能:片内外设的对外接口
  • 时序模拟:模拟 SPI、I2C 和 UART 等常用接口的时序

GPIO 功能特性

  • 多种工作模式:每个 GPIO 引脚可以独立配置为输出(推挽或开漏)、输入、外设复用功能或模拟模式。每个 GPIO 引脚可以独立配置为上拉、下拉或浮空。
  • 灵活的复用模式:复用功能(AF)的备用引脚,极大提高了端口利用的灵活性。GPIO引脚通过配置相关的寄存器可以用作复用功能输入/输出引脚。
    在这里插入图片描述
    在这里插入图片描述
GPIO具体细节见航芯ACM32G103_用户手册V1.3 P393

查看acm32官方库函数文件,查看api函数

/* Exported functions --------------------------------------------------------*/
void GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init);
void GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
void GPIO_StructInit(GPIO_InitTypeDef* GPIO_InitStruct);
GPIO_PinState GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
uint16_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx);
GPIO_PinState GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
uint16_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx);
void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
void GPIO_WriteBit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin, GPIO_PinState PinState);
void GPIO_Write(GPIO_TypeDef *GPIOx, uint16_t PortVal);
void GPIO_ToggleBits(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
void GPIO_PinLockConfig(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);

在这里插入图片描述

GPIO输出 LED点灯

在航芯ACM32G103开发板中,一共有3个led,但是只有一个user_led可以去控制,其中,pow_led com_led作为提示作用。
接下来就是gpio端口初始化的函数简单分析。

在这里插入图片描述


#define BSP_LED_GPIO            GPIOF
#define BSP_LED_PIN             GPIO_PIN_3
#define BSP_LED_MODE            GPIO_MODE_OUTPUT_PP
#define BSP_LED_PULL            GPIO_PULLUP
#define BSP_LED_DRIVE           GPIO_DRIVE_LEVEL3
#define BSP_LED_ALTERNATE       GPIO_FUNCTION_0
#define BSP_LED_CLK_ENABLE()    __RCC_GPIOF_CLK_ENABLE()

void BSP_LED_Init(void)
{
    GPIO_InitTypeDef  GPIO_InitStruct;

    /* Enable the GPIO_LED Clock */
    BSP_LED_CLK_ENABLE();

    GPIO_InitStruct.Pin       = BSP_LED_PIN;
    GPIO_InitStruct.Mode      = BSP_LED_MODE;
    GPIO_InitStruct.Pull      = BSP_LED_PULL;
    GPIO_InitStruct.Drive     = BSP_LED_DRIVE;
    GPIO_InitStruct.Alternate = BSP_LED_ALTERNATE;

    GPIO_Init(BSP_LED_GPIO, &GPIO_InitStruct);

    GPIO_WriteBit(BSP_LED_GPIO, BSP_LED_PIN, GPIO_PIN_SET);
}

ACM32G103的gpio端口初始化,与stm32等其他mcu基本上没有太大的区别。唯一的区别是GPIO_InitStruct结构体里一些成员有不同。

//stm32f103 hal
typedef struct
{
  uint32_t Pin;       /*!< Specifies the GPIO pins to be configured.
                           This parameter can be any value of @ref GPIO_pins_define */
  uint32_t Mode;      /*!< Specifies the operating mode for the selected pins.
                           This parameter can be a value of @ref GPIO_mode_define */
  uint32_t Pull;      /*!< Specifies the Pull-up or Pull-Down activation for the selected pins.
                          This parameter can be a value of @ref GPIO_pull_define */
  uint32_t Speed;     /*!< Specifies the speed for the selected pins.
                           This parameter can be a value of @ref GPIO_speed_define */
} GPIO_InitTypeDef;

//stm32f103 std
typedef struct
{
  uint16_t GPIO_Pin;             /*!< Specifies the GPIO pins to be configured.
                                      This parameter can be any value of @ref GPIO_pins_define */
  GPIOSpeed_TypeDef GPIO_Speed;  /*!< Specifies the speed for the selected pins.
                                      This parameter can be a value of @ref GPIOSpeed_TypeDef */
  GPIOMode_TypeDef GPIO_Mode;    /*!< Specifies the operating mode for the selected pins.
                                      This parameter can be a value of @ref GPIOMode_TypeDef */
}GPIO_InitTypeDef;

//acm32g103 spl
typedef struct
{
    uint32_t    Pin;               /*!< Specifies the GPIO pins to be configured.
                                        This parameter can be any value of @ref GPIO_pins */
    uint32_t    Mode;              /*!< Specifies the operating mode for the selected pins.
                                         This parameter can be a value of @ref GPIO_mode */
    uint32_t    Pull;              /*!< Specifies the Pull-up or Pull-Down activation for the selected pins.
                                         This parameter can be a value of @ref GPIO_pull */
    uint32_t    Drive;             /*!< Specifies the Output drive capability for the selected pins.
                                         This parameter can be a value of @ref GPIO_drive */
    uint32_t    Alternate;         /*!< Peripheral to be connected to the selected pins
                                         This parameter can be a value of @ref GPIOEx_function_selection */
} GPIO_InitTypeDef;

其中主要的区别是acm32中有一个指定选定引脚的输出驱动能力Drive成员,GPIOx 的 PIN驱动能力5V 耐压 IO 的驱动能力配置:

/** @defgroup GPIO_drive
  * @brief GPIO Output drive capability
  * @{
  */
/*!< Output drive capability up to 2mA, please refer to the product datasheet */
#define  GPIO_DRIVE_LEVEL0                      (0x00000000U)   
/*!< Output drive capability up to 4mA, please refer to the product datasheet */
#define  GPIO_DRIVE_LEVEL1                      (0x00000001U)   
 /*!< Output drive capability up to 6mA, please refer to the product datasheet */
#define  GPIO_DRIVE_LEVEL2                      (0x00000002U)  
/*!< Output drive capability up to 8mA, please refer to the product datasheet */
#define  GPIO_DRIVE_LEVEL3                      (0x00000003U)   
/*!< Output drive capability up to 10mA,please refer to the product datasheet */
#define  GPIO_DRIVE_LEVEL4                      (0x00000004U)   
/*!< Output drive capability up to 12mA,please refer to the product datasheet */
#define  GPIO_DRIVE_LEVEL5                      (0x00000005U)   
/*!< Output drive capability up to 14mA,please refer to the product datasheet */
#define  GPIO_DRIVE_LEVEL6                      (0x00000006U)  
 /*!< Output drive capability up to 16mA,please refer to the product datasheet */
#define  GPIO_DRIVE_LEVEL7                      (0x00000007U)  

GPIO控制函数

//设置或清除选定的数据端口位。
void GPIO_WriteBit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin, GPIO_PinState PinState)
{
    /* Check the parameters */
    assert_param(IS_GPIO_ALL_PERIPH(GPIOx));
    assert_param(IS_GPIO_ALL_PIN(GPIOx, GPIO_Pin));
    assert_param(IS_GPIO_PIN_STATE(PinState));

    if (GPIO_PIN_RESET == PinState)
        GPIOx->BSC = GPIO_Pin << 16U;
    else
        GPIOx->BSC = GPIO_Pin;
}

/******************************************************************************
*@brief : LED on
*@param : none
*@return: none
******************************************************************************/
void BSP_LED_On(void)
{
    GPIO_WriteBit(BSP_LED_GPIO, BSP_LED_PIN, GPIO_PIN_RESET);
}

/******************************************************************************
*@brief : LED off
*@param : none
*@return: none
******************************************************************************/
void BSP_LED_Off(void)
{
    GPIO_WriteBit(BSP_LED_GPIO, BSP_LED_PIN, GPIO_PIN_SET);
}

/******************************************************************************
*@brief : LED toggle
*@param : none
*@return: none
******************************************************************************/
void BSP_LED_Toggle(void)
{
    GPIO_ToggleBits(BSP_LED_GPIO, BSP_LED_PIN);
}

led_example测试函数

void bsp_led_example(void)
{
    printfS("bsp_led_example led_flashing \r\n");
    BSP_LED_On();
    printfS("bsp_led_example led_on \r\n");
    DelayMs(1000);
    BSP_LED_Off();
    printfS("bsp_led_example led_off \r\n");
    DelayMs(500);
}

在这里插入图片描述

GPIO输入 按键控制

在航芯ACM32G103开发板中,一共有2个按键,但是只有一个user_key可以去控制,其中一个是rst复位按键。

按键机械触点断开、闭合时,由于触点的弹性作用,按键开关不会马上稳定接通或一下子断开, 使用按键时会产生图 按键抖动说明图中的带波纹信号,需要用软件消抖处理滤波,不方便输入检测。

在这里插入图片描述

本实验板连接的按键带硬件消抖功能, 见图 按键原理图 ,它利用电容充放电的延时,消除了波纹,从而简化软件的处理,软件只需要直接检测引脚的电平即可。

接下来就是按键key端口初始化的函数简单分析。

BSP_PB_Init初始化配置过程中,基本上就是GPIO端口初始化,和中断配置初始化。

在这里插入图片描述

/******************************************************************************
*@brief : PB init
*@param : none
*@return: none
******************************************************************************/
void BSP_PB_Init(void)
{
    GPIO_InitTypeDef GPIO_InitStruct;
    EXTI_InitTypeDef EXTI_InitStruct;

    BSP_PB_CLK_ENABLE();

    GPIO_InitStruct.Pin       = BSP_PB_PIN;
    GPIO_InitStruct.Mode      = BSP_PB_MODE;
    GPIO_InitStruct.Pull      = BSP_PB_PULL;
    GPIO_InitStruct.Drive     = BSP_PB_DRIVE;
    GPIO_InitStruct.Alternate = BSP_PB_ALTERNATE;

    GPIO_Init(BSP_PB_GPIO, &GPIO_InitStruct);

    EXTI_InitStruct.GPIOx     = BSP_PB_GPIO;
    EXTI_InitStruct.Line      = BSP_PB_PIN;
    EXTI_InitStruct.Mode      = EXTI_MODE_IT;
    EXTI_InitStruct.Trigger   = EXTI_TRIGGER_FALLING;
    EXTI_InitStruct.Cmd       = ENABLE;
    
    EXTI_Init(&EXTI_InitStruct);
    
	EXTI_ClearITPendingBit(BSP_PB_PIN);
    
    NVIC_ClearPendingIRQ(BSP_PB_IRQ);
    NVIC_SetPriority(BSP_PB_IRQ, 0x00);
    NVIC_EnableIRQ(BSP_PB_IRQ);
}

/******************************************************************************
*@brief : get PB state
*@param : none
*@return: none
******************************************************************************/
uint32_t BSP_PB_GetState(void)
{
    return (GPIO_ReadPin(BSP_PB_GPIO, BSP_PB_PIN));
}

void APP_Test(void)
{
    uint32_t state;
    
	printfS("SPL GPIO Demo\r\n");
	printfS("LED flashing frequency: 1Hz.\r\n");
	printfS("The user presses the key to stop flashing, press the key again, and flash again.\r\n");

    g_press = 0;
    
    state = 0;
    while(1)
    {
        if (g_press != 0)
        {
            DelayMs(50);
            g_press = 0;
            if (state == 0)
                state = 1;
            else
                state = 0;
        }
        
        if (state == 0)
        {
            BSP_LED_Toggle();
            printfS("BSP_LED_Toggle \r\n");
        }
        else
        {
            BSP_LED_Off();
        }
		DelayMs(500);
    };
}


void EXTI15_10_IRQHandler(void)
{
    if (EXTI->PDR & BSP_PB_PIN)
    {
        EXTI->PDR = BSP_PB_PIN;
        PB_IRQHandler();
    }
}

上面的方法是利用按键中断去判断的,下面使用MultiButton开源框架,进行按键检测。

MultiButton按键检测

MultiButton开源框架仓库 https://github.com/0x1abin/MultiButton

参考博客https://blog.csdn.net/qq_36075612/article/details/115901032

MultiButton | 一个小巧简单易用的事件驱动型按键驱动模块 https://zhuanlan.zhihu.com/p/128961191

本次使用的是博客中的版本,仓库版本的代码可能与下面代码不一样,应该是更新了代码和api。

使用方法

1.先申请一个按键结构。

2.初始化按键对象,绑定按键的GPIO电平读取接口read_button_pin() ,后一个参数设置有效触发电平。

3.注册按键事件。

4.启动按键。

5.设置一个5ms间隔的定时器循环调用后台处理函数。

//按键状态读取接口
unsigned char btn0_id = 0;
struct Button button0;

uint8_t  read_button0_GPIO(void)
{
    return (GPIO_ReadPin(BSP_PB_GPIO, BSP_PB_PIN));
}

void button_callback(void *button)
{
    uint32_t btn_event_val; 
    
    btn_event_val = get_button_event((struct Button *)button); 
    
    switch(btn_event_val)
    {
      case PRESS_DOWN:
          printf("---> key1 press down! <---\r\n"); 
      break; 
 
      case PRESS_UP: 
          printf("***> key1 press up! <***\r\n");
      break; 
 
      case PRESS_REPEAT: 
          printf("---> key1 press repeat! <---\r\n");
      break; 
 
      case SINGLE_CLICK: 
          printf("---> key1 single click! <---\r\n");
      break; 
 
      case DOUBLE_CLICK: 
          printf("***> key1 double click! <***\r\n");
      break; 
 
      case LONG_PRESS_START: 
          printf("---> key1 long press start! <---\r\n");
      break; 
 
      case LONG_PRESS_HOLD: 
          printf("***> key1 long press hold! <***\r\n");
      break; 
    }
}
特性

MultiButton 使用C语言实现,基于面向对象方式设计思路,每个按键对象单独用一份数据结构管理:

struct Button {

	uint16_t ticks;
	uint8_t  repeat: 4;
	uint8_t  event : 4;
	uint8_t  state : 3;
	uint8_t  debounce_cnt : 3;
	uint8_t  active_level : 1;
	uint8_t  button_level : 1;
	uint8_t  (*hal_button_Level)(void);
	BtnCallback  cb[number_of_event];
	struct Button* next;
};

这样每个按键使用单向链表相连,依次进入 button_handler(struct Button* handle) 状态机处理,所以每个按键的状态彼此独立。

按键事件
事件说明
PRESS_DOWN按键按下,每次按下都触发
PRESS_UP按键弹起,每次松开都触发
PRESS_REPEAT重复按下触发,变量repeat计数连击次数
SINGLE_CLICK单击按键事件
DOUBLE_CLICK双击按键事件
LONG_PRESS_START达到长按时间阈值时触发一次
LONG_PRESS_HOLD长按期间一直触发
/******************************************************************************
*@brief : main program
*@param : none
*@return: none
******************************************************************************/
int main(void)
{
   
    board_hardware_init();
    printfS("board_hardware_init [ok] \r\n");
    //Timer_Update_Test();
    
    
   //初始化按键对象
    button_init(&button0, read_button0_GPIO, 0);
    button_attach(&button0, PRESS_DOWN,       button_callback);
    button_attach(&button0, PRESS_UP,         button_callback);
    button_attach(&button0, PRESS_REPEAT,     button_callback);
    button_attach(&button0, SINGLE_CLICK,     button_callback);
    button_attach(&button0, DOUBLE_CLICK,     button_callback);
    button_attach(&button0, LONG_PRESS_START, button_callback);
    button_attach(&button0, LONG_PRESS_HOLD,  button_callback);
   //启动按键
   button_start(&button0);
    while(1)
    {
        //bsp_led_example();
        button_ticks();
        DelayMs(5);
    }
    
}

在这里插入图片描述

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Mysql的基本用法(上)非常详细、快速上手

上篇结束了java基础&#xff0c;本篇主要对Mysql中的一些常用的方法进行了总结&#xff0c;主要对查询方法进行了讲解&#xff0c;包括重要的多表查询用到的内连接和外连接等&#xff0c;以下代码可以直接复制到可视化软件中&#xff0c;方便阅读以及练习&#xff1b; SELECT *…

CRM市场营销管理功能,如何进行客户细分和数据分析?

CRM管理系统中的营销管理模块&#xff0c;它的锋芒常被销售管理所掩盖&#xff0c;但对于企业的业务来说同样重要。营销部门虽然不像销售人员一样直接面对客户&#xff0c;却是挖掘线索、商机的重要角色。CRM在市场营销领域的关键功能包括&#xff1a;营销漏斗、客户细分、营销…

详解静态网页数据获取以及浏览器数据和网络数据交互流程-Python

目录 前言 一、静态网页数据 二、网址通讯流程 1.DNS查询 2.建立连接 3.发送HTTP请求 4.服务器处理请求 5.服务器响应 6.渲染页面 7.页面交互 三、URL/POST/GET 1.URL 2.GET 形式 3.POST 形式 四.获取静态网页数据 1.requests库 点关注&#xff0c;防走丢&am…

C++上位软件通过Snap7开源库访问西门子S7-1200/S7-1500数据块的方法

前言 本人一直从事C上位软件开发工作较多&#xff0c;在之前的项目中通过C访问西门子PLC S7-200/S7-1200/S7-1500并进行数据交互的应用中一直使用的是ModbusTCP/ModbusRTU协议进行。Modbus上位开源库采用的LibModbus。经过实际应用发现Modbus开源库单次发送和接受的数据不能超过…

基于双闭环PI和SVPWM的PMSM控制器simulink建模与仿真

目录 1.课题概述 2.系统仿真结果 3.核心程序与模型 4.系统原理简介 4.1 双闭环PI控制器设计 4.2 SVPWM技术 4.3 控制系统实现 5.完整工程文件 1.课题概述 基于双闭环PI和SVPWM的PMSM控制器simulink建模与仿真。系统包括逆变桥、PMSM、park变换、clark变换、SVPWM、PI控…

了解长短期记忆 (LSTM) 网络:穿越时间和记忆的旅程

一、说明 在人工智能和机器学习的迷人世界中&#xff0c;长短期记忆 (LSTM) 网络作为一项突破性创新脱颖而出。LSTM 旨在解决传统循环神经网络 (RNN) 的局限性&#xff0c;尤其是在学习长期依赖性方面的局限性&#xff0c;彻底改变了我们在各个领域建模和预测序列的能力。本文深…

算法分析与设计 第一次课外作业

算法分析与设计 第一次课外作业 文章目录 算法分析与设计 第一次课外作业一. 单选题&#xff08;共8题&#xff0c;80分&#xff09;二. 判断题&#xff08;共2题&#xff0c;20分&#xff09; 一. 单选题&#xff08;共8题&#xff0c;80分&#xff09; (单选题)以下叙述中错误…

【模拟电路】模拟集成电路之神-NE555

一、集成电路NE555简介 二、功能框图与引脚说明 三、比较器&#xff08;运放&#xff09; 四、反相门&#xff08;非门&#xff09; 五、或非门 六、双稳态触发器 七、NE555的工作原理 集成电路NE555的芯片手册 C5157696 一、集成电路NE555简介 NE555起源于上个世纪70年代&a…

CCNP课程实验-03-Route_Path_Control_CFG

目录 实验条件网络拓朴需求 基础配置需求实现1.A---F所有区用Loopback模拟&#xff0c;地址格式为&#xff1a;XX.XX.XX.XX/32&#xff0c;其中X为路由器编号。根据拓扑宣告进对应协议。A1和A2区为特例&#xff0c;A1&#xff1a;55.55.55.0/24&#xff0c;A2&#xff1a;55.55…

java spring boot 获取resource目录下的文档

主要代码 String filePath"templates/test.xls" ClassPathResource classPathResource new ClassPathResource(filePath); InputStream inputStream classPathResource.getInputStream();目录 主要目录存放再这 代码案例 public void downloadTemplate( HttpS…

是否需要跟上鸿蒙(OpenHarmony)开发岗位热潮?

前言 自打华为2019年发布鸿蒙操作系统以来&#xff0c;网上各种声音百家争鸣。尤其是2023年发布会公布的鸿蒙4.0宣称不再支持Android&#xff0c;更激烈的讨论随之而来。 本文没有宏大的叙事&#xff0c;只有基于现实的考量。 通过本文&#xff0c;你将了解到&#xff1a; Har…

密码学上的经典瞬间:如果当时有Python!

提到“安全”&#xff0c;首先想到的一定是加密。 在如今的互联网环境中&#xff0c;信息加密无处不在&#xff0c;我们早已习惯&#xff0c;甚至毫无感觉。 比如&#xff0c;通过https协议访问的各个网站的内容&#xff0c;QQ&#xff0c;微信等聊天工具之间互相发送的信息等等…

前端开发_JavaScript基础

JavaScript介绍 JS是一种运行在客户端&#xff08;浏览器&#xff09;的编程语言&#xff0c;实现人机交互效果 作用&#xff1a; 网页特效 (监听用户的一些行为让网页作出对应的反馈) 表单验证 (针对表单数据的合法性进行判断) 数据交互 (获取后台的数据, 渲染到前端) 服…

Android--Jetpack--WorkManager详解

2024已经到来&#xff0c;愿你安睡时&#xff0c;山河入梦。愿你醒来时&#xff0c;满目春风。愿你欢笑时&#xff0c;始终如一。愿你行进时&#xff0c;前程似锦&#xff0c;坦荡从容。 编程语言的未来&#xff1f; 目录 一&#xff0c;定义 二&#xff0c;特点 三&#xff0c…

【心得】PHP文件包含高级利用攻击面个人笔记

目录 一、nginx日志文件包含 二、临时文件包含 三、php的session文件包含 四、pear文件包含 五 、远程文件包含 文件包含 include "/var/www/html/flag.php"; 一 文件名可控 $file$_GET[file]; include $file.".php"; //用php伪协议 &#xff0…

【Leetcode】2487. 从链表中移除节点

文章目录 题目思路代码 题目 2487. 从链表中移除节点 思路 1、递归移除节点&#xff1a; 如果头节点为空&#xff0c;直接返回空。递归调用函数处理下一个节点 head->next。在递归返回后&#xff0c;判断当前节点的值是否小于之前记录的最大值 maxVal。如果小于 maxVal…

【Unity中的A星寻路】Navigation导航寻路系统四大页签详解

&#x1f468;‍&#x1f4bb;个人主页&#xff1a;元宇宙-秩沅 &#x1f468;‍&#x1f4bb; hallo 欢迎 点赞&#x1f44d; 收藏⭐ 留言&#x1f4dd; 加关注✅! &#x1f468;‍&#x1f4bb; 本文由 秩沅 原创 &#x1f468;‍&#x1f4bb; 收录于专栏&#xff1a;Uni…

uniapp 使用wx.getFuzzyLocation获取当前的模糊地理位置

前言&#xff1a; 最近在进行一个小程序项目开发的时候&#xff0c;需要用到定位的功能&#xff0c;然后首先是尝试了getLocation方法&#xff0c;但是sccess中的内容始终无法打印&#xff0c;后来才知道是需要申请权限&#xff0c;在连续小程序后台管理员申请权限之后&#x…

【鸿蒙千帆起】《开心消消乐》完成鸿蒙原生应用开发,创新多端联动用户体验

《开心消消乐》已经完成鸿蒙原生应用开发&#xff0c;乐元素成为率先完成鸿蒙原生应用开发的 20游戏厂商之一。作为一款经典游戏&#xff0c;《开心消消乐》已经拥有 8 亿玩家&#xff0c;加入鸿蒙原生应用生态&#xff0c;将为其带来更优的游戏性能和更多创新体验。自 9 月 25…

【Math】重要性采样 Importance sample推导【附带Python实现】

【Math】重要性采样 Importance sample推导【附带Python实现】 文章目录 【Math】重要性采样 Importance sample推导【附带Python实现】1. Why need importance sample?2. Derivation of Discrete Distribution3. Derivation of Continuous Distribution3. An Example 笔者在学…