Renesas R7FA8D1BH (Cortex®-M85)的 General PWM的应用实践

news2024/9/23 6:17:23

目录

概述

1  General PWM介绍

1.1 特性

1.2 定时器选择注意点

2 时钟配置

3 应用案例

3.1 基本定时器应用

3.2 定时器回调函数案例

3.3 输入捕捉功能案例

3.4 更新周期案例

3.5 更新占空比案例

3.6 单次触发脉冲案例

4 测试

4.1 代码介绍

4.2 验证


概述

本文主要介绍Renesas R7FA8D1BH (Cortex®-M85)的 General PWM各种模式的使用方法,包括PWM的特性介绍,并编写多个案例,详细介绍了各种模式下API函数的使用方法,还编写一个具体的案例,实现PWM的输出,并使用逻辑分析仪捕捉器波形。

1  General PWM介绍

1.1 特性

GPT模块可用于计数事件,测量外部输入信号,产生周期性中断,或输出周期性或PWM信号到GTIOC引脚。该模块支持GPT外设GPT32EH、GPT32E、GPT32和GPT16。GPT16是一个16位定时器。其他外设(GPT32EH、GPT32E和GPT32)是32位定时器。从API的角度来看,这个模块中的32位计时器都是一样的。

GPT模块具有以下特点:

1)支持周期模式、单次模式和PWM模式。
2)支持计数源的PCLK, gtegg引脚,GTIOC引脚,或ELC事件。
3)支持GTIOC引脚上的脱波滤波器。
4)信号可以输出到一个引脚。
5)可配置周期(每个计时器周期的计数)。
6)可配置占空比PWM模式。
7)支持运行时周期的重新配置。
8)支持在PWM模式下运行时重构占空比。
9)支持运行时比较匹配值的重新配置。
10)提供了用于启动、停止和重置计数器的api。
11)提供api来获取当前周期、源时钟频率和计数方向。
12)提供api来获取当前定时器状态和计数器值。
13)支持启动、停止、清除、向上计数、向下计数,并通过外部源从gtegg引脚、GTIOC引脚或ELC事件捕获。
14)支持对称和非对称PWM波形生成。
15)支持一次同步脉冲波形生成。
16)支持自动添加死区时间。
17)支持生成ELC事件,以比较匹配值启动ADC扫描(参见事件链接控制器(r_elc))并更新比较匹配值。
18)支持与POEG通道连接,当检测到错误条件时自动禁用GPT输出。
19)支持定时器停止时设置计数器值。
20)支持启用和禁用输出引脚。
21)支持一次跳过最多七个溢出/下流(波峰/波谷)中断
22)支持通过配置引脚的输出电平在每个比较匹配和周期结束产生自定义PWM波形。

1.2 定时器选择注意点

RA mcu有两个定时器外设:通用PWM定时器(GPT)和异步通用定时器(AGT)。在他们之间进行选择时,要考虑以下因素:

GPTAGT
Low Power ModesThe GPT can operate in sleep mode.The AGT can operate in all low power modes.
Available ChannelsThe number of GPT channels is device specific. All currently supported MCUs have at least 7 GPT channels.All MCUs have 2 AGT channels.
Timer ResolutionAll MCUs have at least one 32-bit GPT timer.The AGT timers are 16-bit timers.
Clock SourceThe GPT runs off PCLKD with a configurable divider up to 1024. It can also be configured to count ELC events or external pulses.The AGT runs off PCLKB, LOCO, or subclock.

2 时钟配置

GPT时钟基于PCLKD频率。您可以使用RA Configuration编辑器的Clocks选项卡或在运行时使用CGC接口来设置PCLKD频率。

该模块可以使用GTETRGA、GTETRGB、GTETRGC、GTETRGD、GTIOCA和GTIOCB引脚作为计数源。该模块可以使用GTIOCA和GTIOCB引脚作为周期性或PWM信号的输出引脚。该模块可以使用GTIOCA和GTIOCB作为输入引脚来测量输入信号。

3 应用案例

3.1 基本定时器应用

这是在应用程序中最少使用GPT的一个基本示例。

void gpt_basic_example (void)
{
    fsp_err_t err = FSP_SUCCESS;
    /* Initializes the module. */
    err = R_GPT_Open(&g_timer0_ctrl, &g_timer0_cfg);
    /* Handle any errors. This function should be defined by the user. */
    assert(FSP_SUCCESS == err);
    /* Start the timer. */
    (void) R_GPT_Start(&g_timer0_ctrl);
}

3.2 定时器回调函数案例

定时器回调函数的应用案例,范例代码如下:

/* Example callback called when timer expires. */
void timer_callback (timer_callback_args_t * p_args)
{
    if (TIMER_EVENT_CYCLE_END == p_args->event)
    {
        /* Add application code to be called periodically here. */
    }
}

3.3 输入捕捉功能案例

这是一个使用GPT捕获脉冲宽度或脉冲周期测量的例子。

/* Example callback called when a capture occurs. */
uint64_t g_captured_time     = 0U;
uint32_t g_capture_overflows = 0U;
void timer_capture_callback (timer_callback_args_t * p_args)
{
    if ((TIMER_EVENT_CAPTURE_A == p_args->event) || (TIMER_EVENT_CAPTURE_B == p_args->event))
    {
        /* (Optional) Get the current period if not known. */
        timer_info_t info;
        (void) R_GPT_InfoGet(&g_timer0_ctrl, &info);
        uint64_t period = info.period_counts;
        /* The maximum period is one more than the maximum 32-bit number, but will be reflected as 0 in
         * timer_info_t::period_counts. */
        if (0U == period)
        {
            period = UINT32_MAX + 1U;
        }
        g_captured_time     = (period * g_capture_overflows) + p_args->capture;
        g_capture_overflows = 0U;
    }
    if (TIMER_EVENT_CYCLE_END == p_args->event)
    {
        /* An overflow occurred during capture. This must be accounted for at the application layer. */
        g_capture_overflows++;
    }
}
void gpt_capture_example (void)
{
    fsp_err_t err = FSP_SUCCESS;
    /* Initializes the module. */
    err = R_GPT_Open(&g_timer0_ctrl, &g_timer0_cfg);
    /* Handle any errors. This function should be defined by the user. */
    assert(FSP_SUCCESS == err);
    /* Enable captures. Captured values arrive in the interrupt. */
    (void) R_GPT_Enable(&g_timer0_ctrl);
    /* (Optional) Disable captures. */
    (void) R_GPT_Disable(&g_timer0_ctrl);
}

3.4 更新周期案例

#define GPT_EXAMPLE_MSEC_PER_SEC           (1000)
#define GPT_EXAMPLE_DESIRED_PERIOD_MSEC    (20)
/* This example shows how to calculate a new period value at runtime. */
void gpt_period_calculation_example (void)
{
    fsp_err_t err = FSP_SUCCESS;
    /* Initializes the module. */
    err = R_GPT_Open(&g_timer0_ctrl, &g_timer0_cfg);
    /* Handle any errors. This function should be defined by the user. */
    assert(FSP_SUCCESS == err);
    /* Start the timer. */
    (void) R_GPT_Start(&g_timer0_ctrl);
    /* Get the source clock frequency (in Hz). There are 3 ways to do this in FSP:
     *  - If the PCLKD frequency has not changed since reset, the source clock frequency is
     *    BSP_STARTUP_PCLKD_HZ >> timer_cfg_t::source_div
     *  - Use the R_GPT_InfoGet function (it accounts for the divider).
     *  - Calculate the current PCLKD frequency using R_FSP_SystemClockHzGet(FSP_PRIV_CLOCK_PCLKD) and right shift
     *    by timer_cfg_t::source_div.
     *
     * This example uses the 3rd option (R_FSP_SystemClockHzGet).
     */
    uint32_t pclkd_freq_hz = R_FSP_SystemClockHzGet(FSP_PRIV_CLOCK_PCLKD) >> g_timer0_cfg.source_div;
    /* Calculate the desired period based on the current clock. Note that this calculation could overflow if the
     * desired period is larger than UINT32_MAX / pclkd_freq_hz. A cast to uint64_t is used to prevent this. */
    uint32_t period_counts =
        (uint32_t) (((uint64_t) pclkd_freq_hz * GPT_EXAMPLE_DESIRED_PERIOD_MSEC) / GPT_EXAMPLE_MSEC_PER_SEC);
    /* Set the calculated period. */
    err = R_GPT_PeriodSet(&g_timer0_ctrl, period_counts);
    assert(FSP_SUCCESS == err);
}

3.5 更新占空比案例


#define GPT_EXAMPLE_DESIRED_DUTY_CYCLE_PERCENT    (25)
#define GPT_EXAMPLE_MAX_PERCENT                   (100)
/* This example shows how to calculate a new duty cycle value at runtime. */
void gpt_duty_cycle_calculation_example (void)
{
    fsp_err_t err = FSP_SUCCESS;
    /* Initializes the module. */
    err = R_GPT_Open(&g_timer0_ctrl, &g_timer0_cfg);
    /* Handle any errors. This function should be defined by the user. */
    assert(FSP_SUCCESS == err);
    /* Start the timer. */
    (void) R_GPT_Start(&g_timer0_ctrl);
    /* Get the current period setting. */
    timer_info_t info;
    (void) R_GPT_InfoGet(&g_timer0_ctrl, &info);
    uint32_t current_period_counts = info.period_counts;
    /* Calculate the desired duty cycle based on the current period. Note that if the period could be larger than
     * UINT32_MAX / 100, this calculation could overflow. A cast to uint64_t is used to prevent this. The cast is
     * not required for 16-bit timers. */
    uint32_t duty_cycle_counts =
        (uint32_t) (((uint64_t) current_period_counts * GPT_EXAMPLE_DESIRED_DUTY_CYCLE_PERCENT) /
                    GPT_EXAMPLE_MAX_PERCENT);
    /* Set the calculated duty cycle. */
    err = R_GPT_DutyCycleSet(&g_timer0_ctrl, duty_cycle_counts, GPT_IO_PIN_GTIOCB);
    assert(FSP_SUCCESS == err);
}

3.6 单次触发脉冲案例

/* Example callback called when timer overflows. */
void gpt_overflow_callback (timer_callback_args_t * p_args)
{
    if (TIMER_EVENT_CYCLE_END == p_args->event)
    {
        /* Use R_GPT_DutyCycleSet() API to set new values for each cycle.
         * - Use GPT_IO_PIN_ONE_SHOT_LEADING_EDGE to set the leading edge transition match value (GTCCRC or GTCCRE register).
         * - Use GPT_IO_PIN_ONE_SHOT_TRAILING_EDGE to set the trailing edge transition match value (GTCCRD or GTCCRF register).
         */
    }
}
#define GPT_ONE_SHOT_EXAMPLE_DUTY_CYCLE_GTCCRD_GTCCRF    (0x1000U)
#define GPT_ONE_SHOT_EXAMPLE_DUTY_CYCLE_GTCCRC           (0x800U)
#define GPT_ONE_SHOT_EXAMPLE_DUTY_CYCLE_GTCCRE           (0x100U)
void gpt_one_shot_pulse_mode_example (void)
{
    fsp_err_t err = FSP_SUCCESS;
    /* Initializes the module. */
    err = R_GPT_Open(&g_timer0_ctrl, &g_timer0_cfg);
    /* Handle any errors. This function should be defined by the user. */
    assert(FSP_SUCCESS == err);
    /* Set the duty cycle for One-Shot-Pulse mode */
    /* GPT_IO_PIN_ONE_SHOT_LEADING_EDGE sets the initial value for the GTCCRC register if GTIOCnA is the selected pin for output. */
    err = R_GPT_DutyCycleSet(&g_timer0_ctrl,
                             GPT_ONE_SHOT_EXAMPLE_DUTY_CYCLE_GTCCRC,
                             GPT_IO_PIN_GTIOCA | GPT_IO_PIN_ONE_SHOT_LEADING_EDGE);
    assert(FSP_SUCCESS == err);
    /* GPT_IO_PIN_ONE_SHOT_LEADING_EDGE sets the initial value for the GTCCRE register if GTIOCnB is the selected pin for output. */
    err = R_GPT_DutyCycleSet(&g_timer0_ctrl,
                             GPT_ONE_SHOT_EXAMPLE_DUTY_CYCLE_GTCCRE,
                             GPT_IO_PIN_GTIOCB | GPT_IO_PIN_ONE_SHOT_LEADING_EDGE);
    assert(FSP_SUCCESS == err);
    /* GPT_IO_PIN_ONE_SHOT_TRAILING_EDGE sets the initial value for the GTCCRD register if GTIOCnA is the selected pin for output. */
    err = R_GPT_DutyCycleSet(&g_timer0_ctrl,
                             GPT_ONE_SHOT_EXAMPLE_DUTY_CYCLE_GTCCRD_GTCCRF,
                             GPT_IO_PIN_GTIOCA | GPT_IO_PIN_ONE_SHOT_TRAILING_EDGE);
    assert(FSP_SUCCESS == err);
    /* GPT_IO_PIN_ONE_SHOT_TRAILING_EDGE sets the initial value for the GTCCRF register if GTIOCnB is the selected pin for output.
     * GPT_BUFFER_FORCE_PUSH pushes set values to temporary registers to prepare for the initial output cycle. This must be done
     * when setting the duty cycle before starting the timer. */
    err = R_GPT_DutyCycleSet(&g_timer0_ctrl,
                             GPT_ONE_SHOT_EXAMPLE_DUTY_CYCLE_GTCCRD_GTCCRF,
                             GPT_IO_PIN_GTIOCB | GPT_IO_PIN_ONE_SHOT_TRAILING_EDGE | GPT_BUFFER_FORCE_PUSH);
    assert(FSP_SUCCESS == err);
    /* Start the timer. */
    (void) R_GPT_Start(&g_timer0_ctrl);
    /* (Optional) Stop the timer. */
    (void) R_GPT_Stop(&g_timer0_ctrl);
}
GPT Compare Match Set Example
This example demonstrates the configuration and use of compare match with GPT timer.

/* Example callback called when compare match occurs. */
void gpt_compare_match_callback (timer_callback_args_t * p_args)
{
    if (TIMER_EVENT_COMPARE_A == p_args->event)
    {
        /* Add application code to be called periodically here. */
    }
}
#define GPT_COMPARE_MATCH_EXAMPLE_VALUE    (0x2000U)
void gpt_compare_match_set_example (void)
{
    fsp_err_t err = FSP_SUCCESS;
    /* Initializes the module. */
    err = R_GPT_Open(&g_timer0_ctrl, &g_timer0_cfg);
    /* Handle any errors. This function should be defined by the user. */
    assert(FSP_SUCCESS == err);
    /* Set the compare match value (GPT_COMPARE_MATCH_EXAMPLE_VALUE). This value must be less than or equal to period value. */
    err = R_GPT_CompareMatchSet(&g_timer0_ctrl, GPT_COMPARE_MATCH_EXAMPLE_VALUE, TIMER_COMPARE_MATCH_A);
    assert(FSP_SUCCESS == err);
    /* Start the timer. */
    (void) R_GPT_Start(&g_timer0_ctrl);
    /* (Optional) Stop the timer. */
    (void) R_GPT_Stop(&g_timer0_ctrl);
}

4 测试

4.1 代码介绍

编写一个Demo实现4路PWM信号输出,其详细代码如下:

 /*
 FILE NAME  :  bsp_pwm.c
 Description:  pwm interface
 Author     :  tangmingfei2013@126.com
 Date       :  2024/06/03
 */
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include "bsp_pwm.h"
#include "hal_data.h"

void GPT_PWM_SetDuty3(uint8_t duty, uint32_t pin);
void GPT_PWM_SetDuty2(uint8_t duty, uint32_t pin);
void GPT_PWM_SetDuty1(uint8_t duty, uint32_t pin);


void pwm_init( void )
{
    // timer 1   GPT_IO_PIN_GTIOCA
    R_GPT_Open(&g_timer1_ctrl, &g_timer1_cfg);
    R_GPT_Start(&g_timer1_ctrl);
   /* Set the calculated duty cycle. */
    GPT_PWM_SetDuty1(60, GPT_IO_PIN_GTIOCA);
    
    // timer 2   GPT_IO_PIN_GTIOCB
    R_GPT_Open(&g_timer2_ctrl, &g_timer2_cfg);
    R_GPT_Start(&g_timer2_ctrl);
    // set duty 
    GPT_PWM_SetDuty2(80, GPT_IO_PIN_GTIOCB); 
    
    // timer 6   GPT_IO_PIN_GTIOCA & GPT_IO_PIN_GTIOCB
    R_GPT_Open(&g_timer3_ctrl, &g_timer3_cfg);
    R_GPT_Start(&g_timer3_ctrl);
    // set duty 
    GPT_PWM_SetDuty3( 50, GPT_IO_PIN_GTIOCA);
    // set duty 
    GPT_PWM_SetDuty3( 20, GPT_IO_PIN_GTIOCB);
}

void GPT_PWM_SetDuty3(uint8_t duty, uint32_t pin)
{
    fsp_err_t  err;
    timer_info_t info;
    uint32_t current_period_counts;
    uint32_t duty_cycle_counts;
 
    if (duty > 100)
        duty = 100; 
 
    R_GPT_InfoGet(&g_timer3_ctrl, &info);
    
    current_period_counts = info.period_counts;
    
    duty_cycle_counts = (uint32_t)(((uint64_t) current_period_counts * duty) / 100);
 
 
    err = R_GPT_DutyCycleSet(&g_timer3_ctrl, duty_cycle_counts, pin);
    assert(FSP_SUCCESS == err);
}


void GPT_PWM_SetDuty2(uint8_t duty, uint32_t pin)
{
    fsp_err_t  err;
    timer_info_t info;
    uint32_t current_period_counts;
    uint32_t duty_cycle_counts;
 
    if (duty > 100)
        duty = 100; 
 
    R_GPT_InfoGet(&g_timer2_ctrl, &info);
    
    current_period_counts = info.period_counts;
    
    duty_cycle_counts = (uint32_t)(((uint64_t) current_period_counts * duty) / 100);
 
 
    err = R_GPT_DutyCycleSet(&g_timer2_ctrl, duty_cycle_counts, pin);
    assert(FSP_SUCCESS == err);
}

void GPT_PWM_SetDuty1(uint8_t duty, uint32_t pin)
{
    fsp_err_t  err;
    timer_info_t info;
    uint32_t current_period_counts;
    uint32_t duty_cycle_counts;
 
    if (duty > 100)
        duty = 100; 
 
    R_GPT_InfoGet(&g_timer1_ctrl, &info);
    
    current_period_counts = info.period_counts;
    
    duty_cycle_counts = (uint32_t)(((uint64_t) current_period_counts * duty) / 100);
 
 
    err = R_GPT_DutyCycleSet(&g_timer1_ctrl, duty_cycle_counts, pin);
    assert(FSP_SUCCESS == err);
}


/* End of this file */

4.2 验证

编译和下载代码到板卡中,运行结果如下:

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

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

相关文章

基于SpringBoot+Vue+MySQL的特色旅游网站系统

系统展示 用户前台界面 管理员后台界面 系统背景 随着旅游业的蓬勃发展&#xff0c;人们对旅游体验的需求日益多样化与个性化。传统的旅游信息查询与预订方式已难以满足现代游客的需求。因此&#xff0c;我们开发了这款基于SpringBootVueMySQL的特色旅游网站系统。该系统旨在通…

HTML实现的简单网站首页模板

这个是简单的网站首页模板&#xff0c;用于学习或者参考 实现代码: <!DOCTYPE html> <html lang"zh"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"&…

移动硬盘‘需格式化‘困境:原因剖析、恢复策略与预防之道

困境直击&#xff1a;移动硬盘为何需格式化才能访问&#xff1f; 在数字化时代&#xff0c;移动硬盘作为数据存储与传输的重要工具&#xff0c;其稳定性与可靠性直接关系到用户数据的安全。然而&#xff0c;不少用户在使用过程中遭遇了“移动硬盘需要格式化才能打开”的尴尬境…

Qt_对话框QDialog的介绍

目录 1、新建项目对话框 2、非模态对话框 3、模态对话框 4、自定义对话框 5、Qt内置对话框 5.1 消息对话框QMessageBox 5.2 颜色对话框QColorDialog 5.3 文件对话框QFileDialog 5.4 字体对话框QFontDialog 5.5 输入对话框QInputDialog 结语 前言: 在Qt中&…

布草洗涤必备4张表-———未来之窗行业应用跨平台架构

一、洗涤厂客户月度报表 二、大酒店楼层布草月度统计报表 三、职员月度报表 四、司机当日统计报表 五、阿雪技术观 拥抱开源与共享&#xff0c;见证科技进步奇迹&#xff0c;畅享人类幸福时光&#xff01; 让我们积极投身于技术共享的浪潮中&#xff0c;不仅仅是作为受益者&a…

【软件测试】Bug 篇

哈喽&#xff0c;哈喽&#xff0c;大家好~ 我是你们的老朋友&#xff1a;保护小周ღ 今天给大家带来的是 【软件测试】Bug 篇&#xff0c;首先了解, 什么是Bug, 如何定义一个Bug, 如何描述一个 Bug, Bug的级别, 和 Bug 的生命周期, 以及测试人员跟开发人员产生争执如何处理,…

最佳植树距离 - 华为OD统一考试(E卷)

2024华为OD机试&#xff08;C卷D卷E卷&#xff09;最新题库【超值优惠】Java/Python/C合集 题目描述 按照环保公司要求&#xff0c;小明需要在沙化严重的地区进行植树防沙工作&#xff0c;初步目标是种植一条直线的树带。由于有些区域目前不适合种植树木&#xff0c;所以只能在…

橙子质量检测系统源码分享

橙子质量检测检测系统源码分享 [一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示] 1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 项目来源AACV Association for the Advancement of Computer Vis…

【报告阅读】chatgpt-o1 技术报告阅读 | 新的迭代开始了~

OpenAI o1是通过强化学习去进行复杂推理&#xff0c;在它回答之前&#xff0c;他会经过复杂的内部思维链的思考。 经过强化训练的o1多强 1 表现 在美国数学奥林匹克预选赛中名列前500名的学生中&#xff0c;o1排89名 在物理、生物、化学问题的基准测试中超过人类博士水平 其…

stm32单片机个人学习笔记7(TIM定时中断)

前言 本篇文章属于stm32单片机&#xff08;以下简称单片机&#xff09;的学习笔记&#xff0c;来源于B站教学视频。下面是这位up主的视频链接。本文为个人学习笔记&#xff0c;只能做参考&#xff0c;细节方面建议观看视频&#xff0c;肯定受益匪浅。 STM32入门教程-2023版 细…

Python可迭代对象(1)---从C++开发者学习python日记

目录 1。什么是可迭代对象&#xff1f; 2。列表(list) 列表的创建 列表基本操作 以上全部代码的总运行结果 列表脚本操作符 列表常用的方法和函数 列表推导式 ​编辑列表的嵌套 以上全部代码的总运行结果 复习列表内容 3。元组(tuple) 元组的基本运算 元组的方法 …

SFUD库移植

1.源码 GitHub - armink/SFUD: An using JEDECs SFDP standard serial (SPI) flash universal driver library | 一款使用 JEDEC SFDP 标准的串行 (SPI) Flash 通用驱动库 2.介绍 这个通用驱动库,实际就是帮你封装好了读写spiflash的函数, 我们只需要对接以下底层,就可以轻松…

快速了解使用路由器

插槽的使用和用法&#xff1a;slot 为什么要使用插槽&#xff1a; 在Vue.js等前端框架中 在Vue.js等前端框架中&#xff0c;插槽&#xff08;Slot&#xff09;是一种强大的工具&#xff0c;允许开发者在组件之间动态地传递和呈现内容。使用插槽的主要原因包括&#xff1a; …

【LTW】Domain General Face Forgery Detection by Learning to Weight

文章目录 Domain General Face Forgery Detection by Learning to Weightkey points方法LTW元分割策略学习过程损失函数实验评价结果消融实验总结Domain General Face Forgery Detection by Learning to Weight 会议:AAAI-21 作者: code: https://github.com/skJack/LTW 上…

用uniapp 及socket.io做一个简单聊天 升级 9

比这之前优化了以下功能 上线通知 群聊里适时显示在线人数 约请好友 通过好友通过socket 相应端自动变化 PC端可以拉取摄象头拍照 PC端可以录音发送 拉起摄象头发送录象 <template><view class""><scroll-view scroll-y"true" class&…

2024 离线ASR和TTS推荐与示例

2024 离线ASR和TTS推荐 文章目录 2024 离线ASR和TTS推荐一、前言二、安装与使用1、EdgeTTS的安装和使用&#xff08;1&#xff09;Edge TTS介绍与效果试听&#xff08;2&#xff09;Edge TTS安装&#xff08;3&#xff09;Edge TTS查看支持的音色&#xff08;4&#xff09;Edge…

16【Protues51单片机仿真】智能洗衣机倒计时系统

目录 一、主要功能 二、硬件资源 三、程序编程 四、实现现象 一、主要功能 用直流电机转动模拟洗衣机。要求 有弱洗、普通洗、强洗三种模式&#xff0c;可通过按键选择。可以设置洗衣时长&#xff0c;通关按键选择15、30、45、60、90分钟。时间到蜂鸣器报警提示。LCD 显示…

MySQL:事务的ACID特性隔离级别脏读/不可重复读/幻读/Next-Key锁——场景复现

目录 1、什么是事务 2、 事务的ACID特性 2.1 事务的隔离性 3、为什么要使用事务&#xff1f; 4、查看支持事务的存储引擎 5、使用事务 5.1 控制事务 5.1.1 开启事务 5.1.2 关闭事务 5.2 开始一个事务&#xff0c;执行修改后回滚 5.3 开始一个事务&#xff0c;执行修…

set-ExecutionPolicy RemoteSigned 提示不是内部或外部命令,也不是可运行的程序或批处理文件

这个错误一般发生在使用命令提示符或者PowerShell窗口中找不到set-ExecutionPolicy RemoteSigned。如果你想在命令提示符或者PowerShell窗口运行set-ExecutionPolicy RemoteSigned&#xff0c;你需要搜索打开Window PowerShell ISE&#xff0c;并以管理员身份打开&#xff0c;输…

图结构感知的Transformer:一种新的图表示学习方法

人工智能咨询培训老师叶梓 转载标明出处 尽管图神经网络&#xff08;GNNs&#xff09;在处理图数据方面取得了显著成就&#xff0c;但它们在表达能力和捕获长距离依赖方面存在局限性。为了突破这些局限&#xff0c;研究者们开始探索将Transformer架构应用于图表示学习。在此基…