【联盛德W806上手笔记】二、GPIO

目录

  • GPIO 控制器
  • 库函数
    • 函数
    • 参数
  • 极限翻转速度
    • 寄存器操作
    • 库函数操作
  • 测试
    • main.c
    • wm_it.c

Windows 10 20H2
HLK-W806-V1.0-KIT
WM_SDK_W806_v0.6.0


GPIO 控制器

       摘自《W806 芯片设计指导书 V1.0》
       可配置的 GPIO、软件控制的输入输出、硬件控制的输入输出、可配置中断方式。
       GPIOA 和 GPIOB 寄存器起始地址不同,但是功能一致。
       芯片上电后 7,8 脚默认为 UART0 端口,该端口提供下载及 AT 指令端口以及 log 输出端口。用户使用时候注意不要随意使用该端口作为 GPIO 使用,防止被占用无法下载及调试。在系统起来后,该端口可以复用为其它端口使用。
在这里插入图片描述
       所有 GPIO 如果芯片内部配置为上拉,典型上拉电阻值为 40K,如果配置为下拉,典型下拉电阻值为 49K。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

库函数

函数

       打开wm_gpio.h,有如下的函数声明:

void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init);
//初始化我们需要用到的引脚的工作模式void HAL_GPIO_DeInit(GPIO_TypeDef  *GPIOx, uint32_t GPIO_Pin);
//将初始化之后的引脚恢复成默认的状态–各个寄存器复位时的值GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
//读取我们想要知道的引脚的电平状态void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin, GPIO_PinState PinState);
//给某个引脚写0或1void HAL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
//翻转某个引脚的电平状态void HAL_GPIO_EXTI_IRQHandler(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
//外部中断服务函数,用来响应外部中断的触发。函数实体里面有两个功能,一是清除中断标记位,二是调用下面的回调函数。void HAL_GPIO_EXTI_Callback(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
//中断回调函数,可以理解为中断函数具体要响应的动作。

参数

结构体

typedef struct
{uint32_t Pin;uint32_t Mode;uint32_t Pull;
} GPIO_InitTypeDef;typedef enum
{GPIO_PIN_RESET = 0,GPIO_PIN_SET
} GPIO_PinState;

GPIO_TypeDef

#define GPIOA	((GPIO_TypeDef *)GPIOA_BASE)
#define GPIOB	((GPIO_TypeDef *)GPIOB_BASE)

GPIO_InitTypeDef.Pin

#define GPIO_PIN_0	((uint32_t)0x00000001)
#define GPIO_PIN_1	((uint32_t)0x00000002)
#define GPIO_PIN_2	((uint32_t)0x00000004)
#define GPIO_PIN_3	((uint32_t)0x00000008)
#define GPIO_PIN_4	((uint32_t)0x00000010)
#define GPIO_PIN_5	((uint32_t)0x00000020)
#define GPIO_PIN_6	((uint32_t)0x00000040)
#define GPIO_PIN_7	((uint32_t)0x00000080)
#define GPIO_PIN_8	((uint32_t)0x00000100)
#define GPIO_PIN_9	((uint32_t)0x00000200)
#define GPIO_PIN_10	((uint32_t)0x00000400)
#define GPIO_PIN_11	((uint32_t)0x00000800)
#define GPIO_PIN_12	((uint32_t)0x00001000)
#define GPIO_PIN_13	((uint32_t)0x00002000)
#define GPIO_PIN_14	((uint32_t)0x00004000)
#define GPIO_PIN_15	((uint32_t)0x00008000)
#define GPIO_PIN_16	((uint32_t)0x00010000)
#define GPIO_PIN_17	((uint32_t)0x00020000)
#define GPIO_PIN_18	((uint32_t)0x00040000)
#define GPIO_PIN_19	((uint32_t)0x00080000)
#define GPIO_PIN_20	((uint32_t)0x00100000)
#define GPIO_PIN_21	((uint32_t)0x00200000)
#define GPIO_PIN_22	((uint32_t)0x00400000)
#define GPIO_PIN_23	((uint32_t)0x00800000)
#define GPIO_PIN_24	((uint32_t)0x01000000)
#define GPIO_PIN_25	((uint32_t)0x02000000)
#define GPIO_PIN_26	((uint32_t)0x04000000)
#define GPIO_PIN_27	((uint32_t)0x08000000)
#define GPIO_PIN_28	((uint32_t)0x10000000)
#define GPIO_PIN_29	((uint32_t)0x20000000)
#define GPIO_PIN_30	((uint32_t)0x40000000)
#define GPIO_PIN_31	((uint32_t)0x80000000)
#define GPIO_PIN_ALL	((uint32_t)0xFFFFFFFF)#define GPIO_PIN_MASK	0xFFFFFFFF

GPIO_InitTypeDef.Mode

#define GPIO_MODE_INPUT					0x01
#define GPIO_MODE_OUTPUT				0x02#define GPIO_MODE_IT_RISING				0x87
#define GPIO_MODE_IT_FALLING			0x88
#define GPIO_MODE_IT_RISING_FALLING		0x89
#define GPIO_MODE_IT_HIGH_LEVEL			0x8a
#define GPIO_MODE_IT_LOW_LEVEL			0x8b

GPIO_InitTypeDef.Pull

#define GPIO_NOPULL						0x12
#define GPIO_PULLUP						0x13
#define GPIO_PULLDOWN					0x14

       一般出现在assert_param断言语句中,用于对函数入口参数的有效性进行判断。

#define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \((INSTANCE) == GPIOB))#define IS_GPIO_AF_INSTANCE(INSTANCE) IS_GPIO_ALL_INSTANCE(INSTANCE)#define IS_GPIO_PIN_ACTION(ACTION) (((ACTION) == GPIO_PIN_RESET) || ((ACTION) == GPIO_PIN_SET))#define IS_GPIO_PIN(PIN)           (((((uint32_t)PIN) & GPIO_PIN_MASK ) != 0x00u) && ((((uint32_t)PIN) & ~GPIO_PIN_MASK) == 0x00u))#define IS_GPIO_MODE(MODE) (((MODE) == GPIO_MODE_INPUT)              ||\((MODE) == GPIO_MODE_OUTPUT)          	 ||\((MODE) == GPIO_MODE_IT_RISING)          ||\((MODE) == GPIO_MODE_IT_FALLING)         ||\((MODE) == GPIO_MODE_IT_RISING_FALLING)  ||\

#define IS_GPIO_PULL(PULL) (((PULL) == GPIO_NOPULL) || ((PULL) == GPIO_PULLUP) || \((PULL) == GPIO_PULLDOWN))

wm_gpio_ex.h中的宏用于处理引脚复用:

#define __AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__) do{                             \SET_BIT(__HANDLE__->AF_SEL, __IOPOSITION__);	\CLEAR_BIT(__HANDLE__->AF_S1, __IOPOSITION__);	\CLEAR_BIT(__HANDLE__->AF_S0, __IOPOSITION__);	\}while (0)#define __AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__) do{                             \SET_BIT(__HANDLE__->AF_SEL, __IOPOSITION__);	\CLEAR_BIT(__HANDLE__->AF_S1, __IOPOSITION__);	\SET_BIT(__HANDLE__->AF_S0, __IOPOSITION__);	\}while (0)#define __AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__) do{                             \SET_BIT(__HANDLE__->AF_SEL, __IOPOSITION__);	\SET_BIT(__HANDLE__->AF_S1, __IOPOSITION__);	\CLEAR_BIT(__HANDLE__->AF_S0, __IOPOSITION__);	\}while (0)#define __AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__) do{                             \SET_BIT(__HANDLE__->AF_SEL, __IOPOSITION__);	\SET_BIT(__HANDLE__->AF_S1, __IOPOSITION__);	\SET_BIT(__HANDLE__->AF_S0, __IOPOSITION__);	\}while (0)#define __AFIO_REMAP_SET_OPT5(__HANDLE__, __IOPOSITION__) do{                             \CLEAR_BIT(__HANDLE__->AF_SEL, __IOPOSITION__);	\}while (0)#define __AFIO_REMAP_SET_OPT6(__HANDLE__, __IOPOSITION__) do{                             \CLEAR_BIT(__HANDLE__->AF_SEL, __IOPOSITION__);	\CLEAR_BIT(__HANDLE__->DIR, __IOPOSITION__);	\SET_BIT(__HANDLE__->PULLUP_EN, __IOPOSITION__);	\CLEAR_BIT(__HANDLE__->PULLDOWN_EN, __IOPOSITION__);	\}while (0)#define __AFIO_REMAP_SET_OPT7(__HANDLE__, __IOPOSITION__) do{								\CLEAR_BIT(__HANDLE__->AF_SEL, __IOPOSITION__);	\CLEAR_BIT(__HANDLE__->DIR, __IOPOSITION__);	\SET_BIT(__HANDLE__->PULLUP_EN, __IOPOSITION__);	\CLEAR_BIT(__HANDLE__->PULLDOWN_EN, __IOPOSITION__);	\}while (0)#define __HAL_AFIO_REMAP_SPI_CLK(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_1))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_2))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_15))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_24))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\}while (0)												#define __HAL_AFIO_REMAP_SPI_CS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_0))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_4))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_14))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_23))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\}while (0)	#define __HAL_AFIO_REMAP_SPI_MISO(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_0))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_3))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_16))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_25))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\}while (0)	#define __HAL_AFIO_REMAP_SPI_MOSI(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_7))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_5))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_17))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_26))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\}while (0)													#define __HAL_AFIO_REMAP_UART0_TX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_19))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_27))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART0_RX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_20))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_28))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\CLEAR_BIT(__HANDLE__->PULLUP_EN, __IOPOSITION__);	\}while (0)#define __HAL_AFIO_REMAP_UART0_RTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_21))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_29))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART0_CTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_22))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_30))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART1_TX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_6))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_31))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART1_RX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_7))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_16))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\CLEAR_BIT(__HANDLE__->PULLUP_EN, __IOPOSITION__);	\}while (0)#define __HAL_AFIO_REMAP_UART1_RTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_19))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_2))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART1_CTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_20))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_3))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART2_TX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_2))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_2))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART2_RX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_3))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_3))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\CLEAR_BIT(__HANDLE__->PULLUP_EN, __IOPOSITION__);	\}while (0)#define __HAL_AFIO_REMAP_UART2_RTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_4))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_5))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART2_CTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_5))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_6))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART3_TX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_0))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_5))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART3_RX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_1))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_6))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\CLEAR_BIT(__HANDLE__->PULLUP_EN, __IOPOSITION__);	\}while (0)#define __HAL_AFIO_REMAP_UART3_RTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_2))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART3_CTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_3))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART4_TX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_4))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_8))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART4_RX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_5))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_9))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\CLEAR_BIT(__HANDLE__->PULLUP_EN, __IOPOSITION__);	\}while (0)#define __HAL_AFIO_REMAP_UART4_RTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_5))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_10))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART4_CTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_6))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_11))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)
#define __HAL_AFIO_REMAP_UART5_TX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_12))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_08))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_18))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART5_RX(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_13))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_9))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_17))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\CLEAR_BIT(__HANDLE__->PULLUP_EN, __IOPOSITION__);	\}while (0)#define __HAL_AFIO_REMAP_UART5_RTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_12))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_14))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_UART5_CTS(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_13))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_15))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_ADC(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && 		\((__IOPOSITION__ == GPIO_PIN_1) || (__IOPOSITION__ == GPIO_PIN_2) || \(__IOPOSITION__ == GPIO_PIN_3) || (__IOPOSITION__ == GPIO_PIN_4)))	\{													\__AFIO_REMAP_SET_OPT6(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_PWM0(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_0))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_19))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_12))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_2))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_10))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_PWM1(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_1))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_20))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_3))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_11))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_13))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_PWM2(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_0))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_2))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_12))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_14))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_24))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_PWM3(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_1))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_3))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_13))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_15))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_25))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_PWM4(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_4))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_7))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_14))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_16))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_26))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_I2C_SCL(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_1))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_20))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)	#define __HAL_AFIO_REMAP_I2C_SDA(__HANDLE__, __IOPOSITION__)	do{                             \if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_4))	\{													\__AFIO_REMAP_SET_OPT2(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_19))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)	#define __HAL_AFIO_REMAP_TOUCH(__HANDLE__, __IOPOSITION__)		do{									\if (((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_7)) || \((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_9)) || \((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_10)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_0)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_1)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_2)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_3)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_4)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_5)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_6)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_7)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_8)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_9)) || \((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_12)) || \((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_14)) || \((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_29)))	\{													\if ((__HANDLE__ != GPIOA) || (__IOPOSITION__ != GPIO_PIN_7))	\{												\__AFIO_REMAP_SET_OPT7(GPIOA, GPIO_PIN_7);		\}												\__AFIO_REMAP_SET_OPT7(__HANDLE__, __IOPOSITION__);		\}													\}while (0)#define __HAL_AFIO_REMAP_I2S_EXT_MCK(__HANDLE__, __IOPOSITION__)	do{									\if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_7))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_17))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_I2S_MCK(__HANDLE__, __IOPOSITION__)	do{									\if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_0))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_7))	\{													\__AFIO_REMAP_SET_OPT3(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_17))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_I2S_WS(__HANDLE__, __IOPOSITION__)	do{									\if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_1))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_9))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_9))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_13))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_I2S_CK(__HANDLE__, __IOPOSITION__)	do{									\if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_4))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_8))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_8))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_12))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_I2S_MOSI(__HANDLE__, __IOPOSITION__)	do{									\if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_0))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_11))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_10))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_14))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_I2S_MISO(__HANDLE__, __IOPOSITION__)	do{									\if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_7))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_10))	\{													\__AFIO_REMAP_SET_OPT1(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOA) && (__IOPOSITION__ == GPIO_PIN_11))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\else if ((__HANDLE__ == GPIOB) && (__IOPOSITION__ == GPIO_PIN_15))	\{													\__AFIO_REMAP_SET_OPT4(__HANDLE__, __IOPOSITION__);	\}													\}while (0)#define __HAL_AFIO_REMAP_SWJ_ENABLE	do {									\__AFIO_REMAP_SET_OPT1(GPIOA, GPIO_PIN_1);	\__AFIO_REMAP_SET_OPT1(GPIOA, GPIO_PIN_4);	\} while(0)#define __HAL_AFIO_REMAP_SWJ_DISABLE	do {								\__AFIO_REMAP_SET_OPT5(GPIOA, GPIO_PIN_1);	\__AFIO_REMAP_SET_OPT5(GPIOA, GPIO_PIN_4);	\} while(0)										

极限翻转速度

寄存器操作

int main(void)
{SystemClock_Config(CPU_CLK_240M);GPIO_Init();while (1){CLEAR_BIT(GPIOB->DATA, GPIO_PIN_0);SET_BIT(GPIOB->DATA, GPIO_PIN_0);CLEAR_BIT(GPIOB->DATA, GPIO_PIN_0);SET_BIT(GPIOB->DATA, GPIO_PIN_0);CLEAR_BIT(GPIOB->DATA, GPIO_PIN_0);SET_BIT(GPIOB->DATA, GPIO_PIN_0);CLEAR_BIT(GPIOB->DATA, GPIO_PIN_0);SET_BIT(GPIOB->DATA, GPIO_PIN_0);HAL_Delay(10);}
}

在这里插入图片描述
在这里插入图片描述

库函数操作

int main(void)
{SystemClock_Config(CPU_CLK_240M);GPIO_Init();while (1){HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_SET);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_SET);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_RESET);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0, GPIO_PIN_SET);HAL_Delay(10);}
}

在这里插入图片描述
在这里插入图片描述

测试

在这里插入图片描述
在这里插入图片描述
       PB0闪烁,按下BOOT键可改变PB1、PB2的状态。

main.c


#include <stdio.h>
#include "wm_hal.h"void Error_Handler(void);
static void GPIO_Init(void);static volatile uint8_t key_flag = 0;int main(void)
{uint16_t i = 0, j = 0;SystemClock_Config(CPU_CLK_160M);printf("enter main\r\n");HAL_Init();GPIO_Init();while (1){if (key_flag == 1){key_flag = 0;switch(++j){case 1:HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_RESET);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_2, GPIO_PIN_SET);break;case 2:HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_SET);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_2, GPIO_PIN_RESET);break;case 3:HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_RESET);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_2, GPIO_PIN_RESET);break;default:HAL_GPIO_WritePin(GPIOB, GPIO_PIN_1, GPIO_PIN_SET);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_2, GPIO_PIN_SET);j = 0;break;}}if(++i >= 500){HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_0);i = 0;}HAL_Delay(1);}return 0;
}static void GPIO_Init(void)
{GPIO_InitTypeDef GPIO_InitStruct = {0};__HAL_RCC_GPIO_CLK_ENABLE();GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2;GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT;GPIO_InitStruct.Pull = GPIO_NOPULL;HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);HAL_GPIO_WritePin(GPIOB, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2, GPIO_PIN_SET);GPIO_InitStruct.Pin = GPIO_PIN_0;GPIO_InitStruct.Mode = GPIO_MODE_IT_FALLING;GPIO_InitStruct.Pull = GPIO_PULLUP;HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);HAL_NVIC_SetPriority(GPIOA_IRQn, 0);HAL_NVIC_EnableIRQ(GPIOA_IRQn);}void HAL_GPIO_EXTI_Callback(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
{if ((GPIOx == GPIOA) && (GPIO_Pin == GPIO_PIN_0)){key_flag = 1;}
}void Error_Handler(void)
{while (1){}
}void assert_failed(uint8_t *file, uint32_t line)
{printf("Wrong parameters value: file %s on line %d\r\n", file, line);
}

wm_it.c

#include "wm_hal.h"#define readl(addr) ({unsigned int __v = (*(volatile unsigned int *) (addr)); __v;})
__attribute__((isr)) void CORET_IRQHandler(void)
{readl(0xE000E010);HAL_IncTick();
}__attribute__((isr)) void GPIOA_IRQHandler(void)
{HAL_GPIO_EXTI_IRQHandler(GPIOA, GPIO_PIN_0);
}

在这里插入图片描述

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

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

相关文章

php 显示变量类型

echo "<br/> type ".gettype($my_data);

Java知多少(105)套接字(Socket)

网络应用模式主要有&#xff1a; 主机/终端模式&#xff1a;集中计算&#xff0c;集中管理&#xff1b;客户机/服务器&#xff08;Client/Server,简称C/S&#xff09;模式&#xff1a;分布计算&#xff0c;分布管理&#xff1b;浏览器/服务器模式&#xff1a;利用Internet跨平台…

fastq-dump 报错 解决方案

命令行&#xff1a; ~/sratoolkit/sratoolkit.2.3.2/bin/fastq-dump --split-spot --gzip xxxx.sra 报错信息: fastq-dump.2.3.2 err: name not found while resolving tree within virtual file system module - failed to open xxxx.sra 解决方法&#xff1a; 找不到xxx.sra&…

css格式化排版

body{ font-family:"宋体";} body{font-family:"Microsoft Yahei"&#xff0c;“微软雅黑”;} 2.文字排版--字号、颜色&#xff1a; body{ font-size:12px; color:#666;} 3.文字排版--粗体&#xff1a; p span{ font-weight:bold; } 4.文字排版--斜体&a…

【联盛德W806上手笔记】三、MCU系统与时钟结构

目录总线结构AHB-1 总线AHB-2 总线时钟与复位主要特性时钟结构功能描述时钟门控时钟自适应关断功能复位时钟分频寄存器描述寄存器列表软件时钟门控使能寄存器软件时钟掩码寄存器软件复位控制寄存器时钟分频配置寄存器调试控制寄存器I2S 时钟控制寄存器复位状态寄存器调试功能控…

datatables 搜索框 placeholder 属性

$(#table_id_example).DataTable({"fnPreDrawCallback": function( oSettings ) {$(.dataTables_filter input).attr({name:search,placeholder: 搜索站内新闻公告});//提示},language: {"sProcessing": "处理中...","sLengthMenu": &…

如何开发一个异常检测系统:如何评价一个异常检测算法

利用数值来评价一个异常检测算法的重要性 使用实数评价法很重要&#xff0c;当你用某个算法来开发一个具体的机器学习应用时&#xff0c;你常常需要做出很多决定&#xff0c;如选择什么样的特征等等&#xff0c;如果你能找到如何来评价算法&#xff0c;直接返回一个实数来告诉你…

计算机类产品评价技术指标体系研究之图形(像)篇

(一&#xff09;显卡对于核心的显卡来说&#xff0c;显存工作频率越高性能越好&#xff0c;而显存的ns数值越小的显存能跑更高的频率&#xff0c;所以显存的ns被认为是显卡选购的关键之一&#xff0c;另外就是显存的品牌。显卡和主板上都有“内存”&#xff0c;不过主板上的那种…

【联盛德W806上手笔记】四、PWM模块

目录PWM 控制器库函数函数参数宏测试程序独立模式main.cwm_hal_msp.cwm_it.c实验现象多通道同步模式main.cwm_hal_msp.cwm_it.c实验现象Windows 10 20H2 HLK-W806-V1.0-KIT WM_SDK_W806_v0.6.0 摘自《W806 芯片设计指导书 V1.0》、《W806 MCU 芯片规格书 V2.0》 PWM 控制器 5 …

C#中如何稳定精确地每隔5ms执行某个函数?

C#中如何稳定精确地每隔5ms执行某个函数&#xff1f; 在开始前我有一些资料&#xff0c;是我根据自己从业十年经验&#xff0c;熬夜搞了几个通宵&#xff0c;精心整理了一份「C#的资料从专业入门到高级教程工具包」&#xff0c;点个关注&#xff0c;全部无偿共享给大家&#xf…

datatable 自定义搜索框 + 汉化

HTML <input type"text" id"my_news_search" class"" placeholder"搜索站内新闻"> <button class"" id"my_news_search_btn" type"button">搜索</button> JS <script>$(docu…

vlan

分割广播域1.物理分割&#xff08;路由器&#xff09;2.逻辑分割&#xff08;VLAN&#xff09;VLAN的优势&#xff1a;1.控制广播2.增强网络安全性3.简化管理VLAN的种类&#xff1a;1.静态VLAN&#xff1a;基于端口划分静态VLAN2.动态VLAN&#xff1a;基于MAC地址划分VLAN注&am…

【联盛德W806上手笔记】五、TIM定时器

目录定时器库函数函数参数宏Demo中的测试程序main.cwm_hal_msp.cwm_it.c实验现象Windows 10 20H2 HLK-W806-V1.0-KIT WM_SDK_W806_v0.6.0 摘自《W806 芯片设计指导书 V1.0》、《W806 MCU 芯片规格书 V2.0》 定时器 微秒与毫秒计时&#xff08;据时钟频率配置计数个数&#xff…

linux驱动分离分层的概念

这个分离分层的概念和输入子系统有点像&#xff0c;但不是完全一样的。为什么会再弄一个这个模型出来我也没有搞懂&#xff0c;现在我的学习还停留在把知识学懂的层面上。至于为什么会产生这种知识&#xff0c;现在我还无从解释&#xff0c;还需时日成长。 这次先上代码在解释整…

IOS-企业开发人员账号amp;邓白氏码申请记录

Apple开发人员账号分三种&#xff0c;个人。公司&#xff0c;还有企业。个人和公司都称为标准账号。另一种是教育机构的账号。 账号介绍 个人和公司的就不说了。如今仅仅说企业账号 首先是申请企业账号的地址&#xff1a; https://developer.apple.com/programs/ios/enterpri…

wordpress置顶文章调用与设置

文章来源: https://www.xuewangzhan.net/wpbbs/15737.html wordpress网站后台允许我们设置一些置顶文章&#xff0c;然后通过调用置顶文章的代码把它调用到自己的网站前台。 下面是最常用的wordpress调用置顶文章代码&#xff0c;适用于所有模板使用。 <?php $sticky g…

【联盛德W806上手笔记】六、7816/UART 控制器

目录7816/UART 控制器串口功能7816 接口功能下载口库函数函数参数宏Demo中的测试程序main.cwm_hal_msp.cwm_it.cfifo.cfifo.hWindows 10 20H2 HLK-W806-V1.0-KIT WM_SDK_W806_v0.6.0 摘自《W806 芯片设计指导书 V1.0》、《W806 MCU 芯片规格书 V2.0》 7816/UART 控制器 设备端…

数据库去重查询问题详解

预算2014年院线预算 影城&#xff08;多选&#xff09;北京CBD影城 查询 科目蚌埠万达广场店北京CBD影城  营业收入11 票房收入11 卖品收入00 逾期收入00 广告收入00 映前广告00 LCD广告00 阵地收入00 IMAX广告收入00 其他广告收入00 其…

MySQL5.7更改用户名密码

ALTER USER test% IDENTIFIED BY 123456; https://www.cnblogs.com/paul8339/p/9054497.html 更改用户名密码&#xff0c;官方推荐使用alter ALTER USER test% IDENTIFIED BY 123456; 还有一种 update mysql.user set authentication_stringpassword("新密码") …