嵌入式学习--江协stm32day5

news2025/6/9 6:30:58

USART

1. 引脚与接口层
  • 异步引脚
    • TX:发送数据输出;RX:接收数据输入;SW_RX:单线半双工模式的接收引脚(替代 RX)。
  • 同步引脚SCLK:同步模式下的时钟输出(主模式)或输入(从模式)。
  • IrDA 接口IrDA_OUT/IrDA_IN,配合编解码模块实现红外通信(需外接 IrDA 收发器)。
  • 硬件流控引脚nRTS(请求发送,输出)、nCTS(清除发送,输入),协调收发双方速率。
2. 数据收发核心:寄存器 + 移位寄存器
  • 发送路径
    CPU/DMA → 写入 发送数据寄存器(TDR) → 送入 发送移位寄存器(并行→串行,逐位输出到 TX/IrDA/SW_RX)。
  • 接收路径
    RX/IrDA/SW_RX 接收串行数据 → 送入 接收移位寄存器(串行→并行)→ 存入 接收数据寄存器(RDR) → 供 CPU/DMA 读取。
  • 关键逻辑:移位寄存器负责 “串并转换”,TDR/RDR 作为数据缓冲(避免 CPU 频繁干预)。
3. 控制与配置:CR1/CR2/CR3 寄存器
  • CR1:基础配置,如:
    • UE:USART 使能;M:字长(8/9 位);WAKE:唤醒模式(空闲线 / 地址标记);
    • 中断使能(TXEIE 发送空、RXNEIE 接收非空、IDLEIE 总线空闲等)。
  • CR2:帧格式与同步控制,如:
    • STOP[1:0]:停止位数量(0.5/1/1.5/2 位);LINEN:LIN 总线模式;
    • 同步模式时钟配置(CPOL 极性、CPHA 相位、CLKEN 时钟使能)。
  • CR3:高级功能,如:
    • DMA 使能(DMAT 发送 DMA、DMA 接收 DMA);
    • 硬件流控(RTSE 使能 nRTS、CTSE 使能 nCTS);
    • 红外模式(IREN)、半双工(HDSEL)等。
4. 波特率生成:USART_BRR 寄存器
  • 核心公式
    USARTDIV=16×波特率fPCLK​​=DIV_Mantissa+16DIV_Fraction​
    • fPCLK:USART 外设时钟(来自 RCC 配置);
    • DIV_Mantissa:整数部分(15 位),DIV_Fraction:小数部分(4 位),共同决定波特率精度(如 9600、115200 等)。
  • 时钟分配:生成的 USARTDIV 同时供给 发送器时钟 和 接收器时钟,保证收发同步。
5. 状态与中断:SR 寄存器 + 中断控制
  • 状态标志(SR
    • TXE:发送数据寄存器空(可写入新数据);
    • RXNE:接收数据寄存器非空(可读取数据);
    • IDLE:总线空闲(异步模式下,用于检测一帧结束);
    • 错误标志:OE(溢出)、PE(奇偶校验错)、FE(帧错)、NE(噪声错)。
  • 中断控制:通过 CR1 使能对应中断(如 TXEIE 使能 TXE 中断),触发后进入 USART 中断控制模块,通知 CPU 处理。

串口发送

#include "stm32f10x.h"                  // Device header
#include "stdio.h"
#include "stdarg.h"
void Serial_Init()
{
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENABLE);
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
	GPIO_InitTypeDef GPIO_InitStructure;
	GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AF_PP;
	GPIO_InitStructure.GPIO_Pin=GPIO_Pin_9;
	GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
	GPIO_Init(GPIOA,&GPIO_InitStructure);
	
	USART_InitTypeDef USART_InitStructrue;
	USART_InitStructrue.USART_BaudRate=9600;
	USART_InitStructrue.USART_HardwareFlowControl=USART_HardwareFlowControl_None;
  USART_InitStructrue.USART_Mode=USART_Mode_Tx;
	USART_InitStructrue.USART_Parity=USART_Parity_No;
	USART_InitStructrue.USART_StopBits=USART_StopBits_1;
	USART_InitStructrue.USART_WordLength=USART_WordLength_8b;
	USART_Init(USART1,&USART_InitStructrue);
	
	USART_Cmd(USART1,ENABLE);

}

void Serial_SendByte(uint8_t Byte)
{
	USART_SendData(USART1,Byte);
	while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET);
	
	
}
void Serial_SendArray(uint8_t *Array,uint16_t Length)
{
	uint16_t i;
	for(i=0;i<Length;i++)
	{
		Serial_SendByte(Array[i]);
	}
}
void Serial_SendString(char *String)
{
	uint8_t i;
	for(i=0;String[i]!='\0';i++)
	{
		Serial_SendByte(String[i]);
	
	}
	
}
uint32_t Serial_Pow(uint32_t X,uint32_t Y)
{
	uint32_t Result;
	while(Y--)
	{
		Result*=X;
	}
	return Result;

}
void Serial_SendNumber(uint32_t Number,uint8_t Length)
{
	uint8_t i;
	for(i=0;i<Length;i++)
	{
		
		Serial_SendByte(Number/Serial_Pow(10,Length-i-1)%10+'0');
	
	}
}
int fputc(int ch,FILE *f)
{
	Serial_SendByte(ch);
	return ch;

}

void Serial_printf(char *format,...)
{
	char String[100];
	va_list arg;
	va_start(arg,format);
	vsprintf(String,format,arg);
	va_end(arg);
	Serial_SendString(String);

}

串口发送+接收

#include "stm32f10x.h"                  // Device header
#include "stdio.h"
#include "stdarg.h"

uint8_t Serial_RxFlag;
uint8_t Serial_RxData;
void Serial_Init()
{
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENABLE);
		RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
	GPIO_InitTypeDef GPIO_InitStructure;
	GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AF_PP;
	GPIO_InitStructure.GPIO_Pin=GPIO_Pin_9;
	GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
	GPIO_Init(GPIOA,&GPIO_InitStructure);
	
	GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IPU;
	GPIO_InitStructure.GPIO_Pin=GPIO_Pin_10;
	GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
	GPIO_Init(GPIOA,&GPIO_InitStructure);
	
	USART_InitTypeDef USART_InitStructrue;
	USART_InitStructrue.USART_BaudRate=9600;
	USART_InitStructrue.USART_HardwareFlowControl=USART_HardwareFlowControl_None;
  USART_InitStructrue.USART_Mode=USART_Mode_Tx|USART_Mode_Rx;
	USART_InitStructrue.USART_Parity=USART_Parity_No;
	USART_InitStructrue.USART_StopBits=USART_StopBits_1;
	USART_InitStructrue.USART_WordLength=USART_WordLength_8b;
	USART_Init(USART1,&USART_InitStructrue);
	
	USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	NVIC_InitTypeDef NVIC_InitStructrue;
	NVIC_InitStructrue.NVIC_IRQChannel=USART1_IRQn;
	NVIC_InitStructrue.NVIC_IRQChannelCmd=ENABLE;
	NVIC_InitStructrue.NVIC_IRQChannelPreemptionPriority=1;
	NVIC_InitStructrue.NVIC_IRQChannelSubPriority=1;
	
	NVIC_Init(&NVIC_InitStructrue);
	
	USART_Cmd(USART1,ENABLE);

}

void Serial_SendByte(uint8_t Byte)
{
	USART_SendData(USART1,Byte);
	while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET);
	
	
}
void Serial_SendArray(uint8_t *Array,uint16_t Length)
{
	uint16_t i;
	for(i=0;i<Length;i++)
	{
		Serial_SendByte(Array[i]);
	}
}
void Serial_SendString(char *String)
{
	uint8_t i;
	for(i=0;String[i]!='\0';i++)
	{
		Serial_SendByte(String[i]);
	
	}
	
}
uint32_t Serial_Pow(uint32_t X,uint32_t Y)
{
	uint32_t Result;
	while(Y--)
	{
		Result*=X;
	}
	return Result;

}
void Serial_SendNumber(uint32_t Number,uint8_t Length)
{
	uint8_t i;
	for(i=0;i<Length;i++)
	{
		
		Serial_SendByte(Number/Serial_Pow(10,Length-i-1)%10+'0');
	
	}
}
int fputc(int ch,FILE *f)
{
	Serial_SendByte(ch);
	return ch;

}

void Serial_printf(char *format,...)
{
	char String[100];
	va_list arg;
	va_start(arg,format);
	vsprintf(String,format,arg);
	va_end(arg);
	Serial_SendString(String);

}
uint8_t Serial_GetRxFlag()
{
	if(Serial_RxFlag==1)
	{
		Serial_RxFlag=0;
		return 1;
	}
		return 0;
}
uint8_t Serial_GetRxData()
{
	return Serial_RxData;
}
void USART1_IRQHandler()
{
	if(USART_GetFlagStatus(USART1,USART_IT_RXNE)==SET)
	{
		
		Serial_RxData=USART_ReceiveData(USART1);
		Serial_RxFlag=1;
		USART_ClearITPendingBit(USART1,USART_IT_RXNE);
	
	}

}

串口发送HEX数据包

#include "stm32f10x.h"                  // Device header
#include "stdio.h"
#include "stdarg.h"

uint8_t Serial_RxFlag;
uint8_t Serial_RxData;
uint8_t Serial_TxPacket[4];
uint8_t Serial_RxPacket[4];

void Serial_Init()
{
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENABLE);
		RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
	GPIO_InitTypeDef GPIO_InitStructure;
	GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AF_PP;
	GPIO_InitStructure.GPIO_Pin=GPIO_Pin_9;
	GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
	GPIO_Init(GPIOA,&GPIO_InitStructure);
	
	GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IPU;
	GPIO_InitStructure.GPIO_Pin=GPIO_Pin_10;
	GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
	GPIO_Init(GPIOA,&GPIO_InitStructure);
	
	USART_InitTypeDef USART_InitStructrue;
	USART_InitStructrue.USART_BaudRate=9600;
	USART_InitStructrue.USART_HardwareFlowControl=USART_HardwareFlowControl_None;
  USART_InitStructrue.USART_Mode=USART_Mode_Tx|USART_Mode_Rx;
	USART_InitStructrue.USART_Parity=USART_Parity_No;
	USART_InitStructrue.USART_StopBits=USART_StopBits_1;
	USART_InitStructrue.USART_WordLength=USART_WordLength_8b;
	USART_Init(USART1,&USART_InitStructrue);
	
	USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	NVIC_InitTypeDef NVIC_InitStructrue;
	NVIC_InitStructrue.NVIC_IRQChannel=USART1_IRQn;
	NVIC_InitStructrue.NVIC_IRQChannelCmd=ENABLE;
	NVIC_InitStructrue.NVIC_IRQChannelPreemptionPriority=1;
	NVIC_InitStructrue.NVIC_IRQChannelSubPriority=1;
	
	NVIC_Init(&NVIC_InitStructrue);
	
	USART_Cmd(USART1,ENABLE);

}

void Serial_SendByte(uint8_t Byte)
{
	USART_SendData(USART1,Byte);
	while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET);
	
	
}
void Serial_SendArray(uint8_t *Array,uint16_t Length)
{
	uint16_t i;
	for(i=0;i<Length;i++)
	{
		Serial_SendByte(Array[i]);
	}
}
void Serial_SendString(char *String)
{
	uint8_t i;
	for(i=0;String[i]!='\0';i++)
	{
		Serial_SendByte(String[i]);
	
	}
	
}
uint32_t Serial_Pow(uint32_t X,uint32_t Y)
{
	uint32_t Result;
	while(Y--)
	{
		Result*=X;
	}
	return Result;

}
void Serial_SendNumber(uint32_t Number,uint8_t Length)
{
	uint8_t i;
	for(i=0;i<Length;i++)
	{
		
		Serial_SendByte(Number/Serial_Pow(10,Length-i-1)%10+'0');
	
	}
}
int fputc(int ch,FILE *f)
{
	Serial_SendByte(ch);
	return ch;

}

void Serial_printf(char *format,...)
{
	char String[100];
	va_list arg;
	va_start(arg,format);
	vsprintf(String,format,arg);
	va_end(arg);
	Serial_SendString(String);

}
void Serial_SendPacket()
{
	Serial_SendByte(0xFF);
	Serial_SendArray(Serial_TxPacket,4);
	Serial_SendByte(0xFE);

}
uint8_t Serial_GetRxFlag()
{
	if(Serial_RxFlag==1)
	{
		Serial_RxFlag=0;
		return 1;
	}
		return 0;
}

void USART1_IRQHandler()
{
		static uint8_t RxState=0;
		static uint8_t pRxPacket=0;

	if(USART_GetFlagStatus(USART1,USART_IT_RXNE)==SET)
	{
		uint8_t RxData=USART_ReceiveData(USART1);
		if(RxState==0)
		{
			if(RxData==0xFF)
			{
				RxState=1;
				pRxPacket=0;
			}
		}
		else if(RxState==1)
		{
			Serial_RxPacket[pRxPacket]=RxData;
			pRxPacket++;
			if(pRxPacket>=4)
			{
				RxState=2;
			}
		}
		else if(RxState==2)
		{
			if(RxData==0xFE)
			{
				RxState=0;
				Serial_RxFlag=1;
			
			}
		
		}
		
		USART_ClearITPendingBit(USART1,USART_IT_RXNE);
	
	}

}

串口发送文本数据包

#include "stm32f10x.h"                  // Device header
#include "stdio.h"
#include "stdarg.h"

uint8_t Serial_RxFlag;
uint8_t Serial_RxData;
char Serial_RxPacket[100];

void Serial_Init()
{
	RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1,ENABLE);
		RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA,ENABLE);
	GPIO_InitTypeDef GPIO_InitStructure;
	GPIO_InitStructure.GPIO_Mode=GPIO_Mode_AF_PP;
	GPIO_InitStructure.GPIO_Pin=GPIO_Pin_9;
	GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
	GPIO_Init(GPIOA,&GPIO_InitStructure);
	
	GPIO_InitStructure.GPIO_Mode=GPIO_Mode_IPU;
	GPIO_InitStructure.GPIO_Pin=GPIO_Pin_10;
	GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
	GPIO_Init(GPIOA,&GPIO_InitStructure);
	
	USART_InitTypeDef USART_InitStructrue;
	USART_InitStructrue.USART_BaudRate=9600;
	USART_InitStructrue.USART_HardwareFlowControl=USART_HardwareFlowControl_None;
  USART_InitStructrue.USART_Mode=USART_Mode_Tx|USART_Mode_Rx;
	USART_InitStructrue.USART_Parity=USART_Parity_No;
	USART_InitStructrue.USART_StopBits=USART_StopBits_1;
	USART_InitStructrue.USART_WordLength=USART_WordLength_8b;
	USART_Init(USART1,&USART_InitStructrue);
	
	USART_ITConfig(USART1,USART_IT_RXNE,ENABLE);
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	NVIC_InitTypeDef NVIC_InitStructrue;
	NVIC_InitStructrue.NVIC_IRQChannel=USART1_IRQn;
	NVIC_InitStructrue.NVIC_IRQChannelCmd=ENABLE;
	NVIC_InitStructrue.NVIC_IRQChannelPreemptionPriority=1;
	NVIC_InitStructrue.NVIC_IRQChannelSubPriority=1;
	
	NVIC_Init(&NVIC_InitStructrue);
	
	USART_Cmd(USART1,ENABLE);

}

void Serial_SendByte(uint8_t Byte)
{
	USART_SendData(USART1,Byte);
	while(USART_GetFlagStatus(USART1,USART_FLAG_TXE)==RESET);
	
	
}
void Serial_SendArray(uint8_t *Array,uint16_t Length)
{
	uint16_t i;
	for(i=0;i<Length;i++)
	{
		Serial_SendByte(Array[i]);
	}
}
void Serial_SendString(char *String)
{
	uint8_t i;
	for(i=0;String[i]!='\0';i++)
	{
		Serial_SendByte(String[i]);
	
	}
	
}
uint32_t Serial_Pow(uint32_t X,uint32_t Y)
{
	uint32_t Result;
	while(Y--)
	{
		Result*=X;
	}
	return Result;

}
void Serial_SendNumber(uint32_t Number,uint8_t Length)
{
	uint8_t i;
	for(i=0;i<Length;i++)
	{
		
		Serial_SendByte(Number/Serial_Pow(10,Length-i-1)%10+'0');
	
	}
}
int fputc(int ch,FILE *f)
{
	Serial_SendByte(ch);
	return ch;

}

void Serial_printf(char *format,...)
{
	char String[100];
	va_list arg;
	va_start(arg,format);
	vsprintf(String,format,arg);
	va_end(arg);
	Serial_SendString(String);

}


void USART1_IRQHandler()
{
	static uint8_t RxState=0;
	static uint8_t pRxPacket=0;
	if(USART_GetFlagStatus(USART1,USART_IT_RXNE)==SET)
	{
		uint8_t RxData=USART_ReceiveData(USART1);
		if(RxState==0)
		{
			if(RxData=='@'&&Serial_RxFlag==0)
			{
				RxState=1;
				pRxPacket=0;
			}
		}
		else if(RxState==1)
		{
			if(RxData=='\r')
			{
				RxState=2;
			}
			else
			{
			Serial_RxPacket[pRxPacket]=RxData;
			pRxPacket++;
			}
			
		}
		else if(RxState==2)
		{
			if(RxData=='\n')
			{
				RxState=0;
				Serial_RxFlag=1;
				Serial_RxPacket[pRxPacket]='\0';

			}
		
		}
		
		USART_ClearITPendingBit(USART1,USART_IT_RXNE);
	
	}

}

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

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

相关文章

(LeetCode 动态规划(基础版))96. 不同的二叉搜索树 (递推 || 递归)

题目&#xff1a;96. 不同的二叉搜索树 思路&#xff1a;二叉树长度为n时&#xff0c;枚举每个点u作为根节点root&#xff0c;那么root左边的数构成左子树种数left&#xff0c;root右边的数构成右子树种数right&#xff0c;那么当前u为根节点下&#xff0c;二叉树的种数为left*…

vue项目使用svg图标

下面是在 Vue 3 项目中完整引入和使用 vite-plugin-svg-icons 的步骤 1、安装插件 npm install vite-plugin-svg-icons -D # 或 yarn add vite-plugin-svg-icons -D # 或 pnpm add vite-plugin-svg-icons -D 2、配置 Vite 在 vite.config.ts 或 vite.config.js 中配置&…

智能网卡之hinic3 WQE(Work Queue Element)结构梳理

hinic3 WQE&#xff08;Work Queue Element&#xff09;结构详解 本文基于 hinic3 驱动源码&#xff0c;对 WQE&#xff08;Work Queue Element&#xff09;做详细讲解。如需查阅完整源码和结构体定义可参考hinic3_nic_qp.h等文件。 1. WQE 的作用 WQE&#xff08;Work Queue…

力扣HOT100之二分查找:4. 寻找两个正序数组的中位数

这道题如果没有时间复杂度的限制的话&#xff0c;相当好做&#xff0c;但是这道题要求时间复杂度为O(log(m n))&#xff0c;思路很难想&#xff0c;我看了一圈题解&#xff0c;发现华南溜达虎的视频讲得还不错&#xff0c;我是参考他的思路写出来的&#xff0c;这里把他的思路…

PyTorch——损失函数与反向传播(8)

Loss Functions 越小越好 L1loss MSELoss 损失函数 CrossEntyopyLoss 损失函数 import torch from torch.nn import L1Loss from torch import nn# 创建输入和目标张量&#xff0c;用于后续的损失计算 inputs torch.tensor([1,2,3],dtypetorch.float32) targets torch.tenso…

macOS 升级 bash 到最新版本

macOS 的默认「终端」&#xff0c;千年不变的版本。 》〉bash --version GNU bash, version 3.2.57(1)-release (arm64-apple-darwin24) Copyright (C) 2007 Free Software Foundation, Inc. 官方 bash.git - bash 已经将 bash 升级到了 5.2的大版本。 macOS 最新版系统的 ba…

力扣面试150题--课程表

Day 63 题目描述 做法 初次思路&#xff1a;本质就是将所有前置课程和后置课程作为一个有向图&#xff08;前者指向后者&#xff09;&#xff0c;判断这个图是否是一个有向无环图&#xff08;即是否存在拓扑排序&#xff09;&#xff08;本质做法是dfs&#xff09; 做法&…

用通俗的话解释下MCP是个啥?

在AI领域&#xff0c;模型的开发、部署和迭代速度日益加快&#xff0c;但随之而来的挑战也愈发显著&#xff1a;如何高效管理不同版本的模型&#xff1f;如何在复杂环境中确保模型的可追溯性和可复用性&#xff1f;如何实现跨团队、跨平台的模型协作&#xff1f; 在计算机领域…

LeetCode 高频 SQL 50 题(基础版)之 【子查询】· 上

题目&#xff1a;1978. 上级经理已离职的公司员工 题解&#xff1a; select employee_id from Employees where salary<30000 and manager_id is not null and manager_id not in (select distinct employee_id from Employees ) order by employee_id题目&#xff1a;626.…

Spark流水线+Gravitino+Marquez数据血缘采集

1.Openlinage和Marquez简介 1.1 OpenLineage 概述 OpenLineage 是一个开放标准和框架&#xff0c;用于跨工具、平台和系统捕获数据血缘信息。它定义了通用的数据血缘模型和API&#xff0c;允许不同的数据处理工具&#xff08;如ETL、调度器、数据仓库&#xff09;以标准化格…

基于微信小程序的车位共享平台的设计与实现源码数据库文档

摘 要 近年来&#xff0c;随着国民经济的飞速发展&#xff0c;城镇化进程的步伐加快&#xff0c;城市人口急剧增长&#xff0c;人们的生活水平持续改善&#xff0c;特别是大中型城市&#xff0c;城市的交通规模日益增大&#xff0c;汽车的保有量不断提高&#xff0c;然而城市的…

多模态大语言模型arxiv论文略读(111)

SEA: Supervised Embedding Alignment for Token-Level Visual-Textual Integration in MLLMs ➡️ 论文标题&#xff1a;SEA: Supervised Embedding Alignment for Token-Level Visual-Textual Integration in MLLMs ➡️ 论文作者&#xff1a;Yuanyang Yin, Yaqi Zhao, Yaji…

怎么让自己ip显示外省?一文说清操作

在互联网时代&#xff0c;IP地址不仅关联网络连接&#xff0c;还可能影响IP属地显示。那么&#xff0c;手机和电脑用户怎么让自己IP显示外省&#xff1f;一文说清操作要点。 ‌ 二、4种主流方法详解 要让自己的IP显示为外省地址&#xff0c;主要有以下几种方法&#xff1a; …

【Docker】容器安全之非root用户运行

【Docker】容器安全之非root用户运行 1. 场景2. 原 Dockerfile 内容3. 整改结果4. 非 root 用户带来的潜在问题4.1 文件夹读写权限异常4.2 验证文件夹权限 1. 场景 最近有个项目要交付&#xff0c;第三方测试对项目源码扫描后发现一个问题&#xff0c;服务的 Dockerfile 都未指…

汽车车载软件平台化项目规模颗粒度选择的一些探讨

汽车进入 SDV 时代后&#xff0c;车载软件研发呈现出开源生态构建、电子架构升级、基础软件标准化、本土供应链崛起、AI 原生架构普及、云边协同开发等趋势&#xff0c;这些趋势促使车载软件研发面临新挑战&#xff0c;如何构建适应这些变化的平台化架构成为车企与 Tier 1 的战…

【八股消消乐】构建微服务架构体系—服务注册与发现

&#x1f60a;你好&#xff0c;我是小航&#xff0c;一个正在变秃、变强的文艺倾年。 &#x1f514;本专栏《八股消消乐》旨在记录个人所背的八股文&#xff0c;包括Java/Go开发、Vue开发、系统架构、大模型开发、具身智能、机器学习、深度学习、力扣算法等相关知识点&#xff…

掌握Git核心:版本控制、分支管理与远程操作

前言 无论热爱技术的阅读者你是希望掌握Git的企业级应用&#xff0c;能够深刻理解Git操作过程及操作原理&#xff0c;理解工作区暂存区、版本库的含义&#xff1b;还是想要掌握Git的版本、分支管理&#xff0c;自由的进行版本回退、撤销、修改等Git操作方式与背后原理和通过分…

c#,Powershell,mmsys.cpl,使用Win32 API展示音频设备属性对话框

常识&#xff08;基础&#xff09; 众所周知&#xff0c;mmsys.cpl使管理音频设备的控制面板小工具&#xff0c; 其能产生一个对话框&#xff08;属性表&#xff09;让我们查看和修改各设备的详细属性&#xff1a; 在音量合成器中单击音频输出设备的小图标也能实现这个效果&a…

STM标准库-TIM旋转编码器

文章目录 一、编码器接口1.1简介1.2正交编码器1.3编码器接口基本结构**1. 模块与 STM32 配置的映射关系****2. 设计实现步骤&#xff08;核心流程&#xff09;****① 硬件规划****② 时钟使能****③ GPIO 配置&#xff08;对应架构图 “GPIO” 模块&#xff09;****④ 时基单元…

【原创】基于视觉模型+FFmpeg+MoviePy实现短视频自动化二次编辑+多赛道

AI视频处理系统功能总览 &#x1f3af; 系统概述 这是一个智能短视频自动化处理系统&#xff0c;专门用于视频搬运和二次创作。系统支持多赛道配置&#xff0c;可以根据不同的内容类型&#xff08;如"外国人少系列"等&#xff09;应用不同的处理策略。 &#x1f3d…