Stm32下环境传感器-Stlm75-hts221-spg30(Hal)

2023-05-16

Stm32下环境传感器-Stlm75-hts221-spg30(Hal)

  • 简介
    • IIC驱动接口
    • Stlm75
    • hts221
    • Spg30

简介

Stlm75与Hts221都是ST的传感器,有官方例程,我只是做了个搬运而已,Spg30网上也有驱动示例,所以我只是拿别人的代码过来水一贴

IIC驱动接口

/**
  ******************************************************************************
  * @file    bsp_i2c.c
  * @author  
  * @version V1.1
  * @date    Mar 5, 2021
  * @brief   
  ******************************************************************************
  * @attention
  *
  *
  ******************************************************************************
  */
/* Includes ------------------------------------------------------------------*/
#include "bsp_i2c.h"

/* Private Typedef -----------------------------------------------------------*/
/* Private Define ------------------------------------------------------------*/

#define I2Cx_TIMEOUT_MAX      3000
#define I2Cx_MAXTRIALSIFERROR 50
/* Private Enum --------------------------------------------------------------*/
/* Private Struct ------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Extern  variables ---------------------------------------------------------*/
/* Private Functions Prototypes-----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/* Extern  Functions ---------------------------------------------------------*/

/**
  * @brief  向指定的地址写入一个字节的值
  * @param  Addr: I2C地址
  * @param  Reg: 写地址
  * @param  Value: 要写的数据
  * @retval 执行状态码
  */
HAL_StatusTypeDef I2Cx_WriteData( I2C_HandleTypeDef *hi2c, uint16_t Addr, uint8_t Reg, uint8_t Value )
{
    return ( HAL_I2C_Mem_Write( hi2c, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1, I2Cx_TIMEOUT_MAX ) );
}

/**
  * @brief  向指定的寄存器地址写入多个数据
  * @param  Addr: I2C地址I2C地址
  * @param  Reg: 写地址
  * @param  RegSize: 写地址大小 (8BIT or 16BIT)
  * @param  pBuffer: 要写的数据
  * @param  Length: 数据长度
  * @retval 执行状态码
  */
HAL_StatusTypeDef I2Cx_WriteBuffer( I2C_HandleTypeDef *hi2c, uint16_t Addr, uint8_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length )
{
    return ( HAL_I2C_Mem_Write( hi2c, Addr, (uint16_t)Reg, RegSize, pBuffer, Length, I2Cx_TIMEOUT_MAX ) );
}

/**
  * @brief  从指定的地址读出一个字节的内容
  * @param  Addr: I2C地址
  * @param  Reg: 读地址
  * @retval 成功返回读出的数据,错误返回HAL_ERROR
  */
uint8_t I2Cx_ReadData( I2C_HandleTypeDef *hi2c, uint16_t Addr, uint8_t Reg )
{
    uint8_t value = 0;

    /* Check the communication status */
    if ( HAL_OK != HAL_I2C_Mem_Read( hi2c, Addr, Reg, I2C_MEMADD_SIZE_8BIT, &value, 1, I2Cx_TIMEOUT_MAX ) )
        return HAL_ERROR;
    return value;
}

/**
  * @brief  从指定的寄存器地址读出多个数据
  * @param  Addr: I2C地址I2C地址
  * @param  Reg: 读地址
  * @param  RegSize: 读地址大小 (8BIT or 16BIT)
  * @param  pBuffer: 存储读出数据的缓冲区
  * @param  Length: 数据长度
  * @retval 执行状态码
  */
HAL_StatusTypeDef I2Cx_ReadBuffer( I2C_HandleTypeDef *hi2c, uint16_t Addr, uint8_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length )
{
    return ( HAL_I2C_Mem_Read( hi2c, Addr, (uint16_t)Reg, RegSize, pBuffer, Length, I2Cx_TIMEOUT_MAX ) );
}

/**
  * @brief  检查指定地址的I2C设备通讯是否正常
  * @note   只用于Rom设备
  * @param  DevAddress: 设备地址
  * @param  Trials: 测试值
  * @retval 状态
  */
HAL_StatusTypeDef I2Cx_IsDeviceReady( I2C_HandleTypeDef *hi2c, uint16_t DevAddress )
{
    return ( HAL_I2C_IsDeviceReady( hi2c, DevAddress, I2Cx_MAXTRIALSIFERROR, I2Cx_TIMEOUT_MAX ) );
}

/********************************* END OF FILE *********************************/

Stlm75

/**
  ******************************************************************************
  * @file    module_stlm75.c
  * @author  
  * @version V1.1
  * @date    Mar 5, 2021
  * @brief   
  ******************************************************************************
  * @attention
  *
  *
  ******************************************************************************
  */
/* Includes ------------------------------------------------------------------*/
#include "module_stlm75.h"
#include "bsp_i2c.h"
#include "tool.h"

/* Private Typedef -----------------------------------------------------------*/
/* Private Define ------------------------------------------------------------*/

/* 设备地址 */
#define STLM75_I2C_ADDRESS 0x90

/*
 * STLM75 命令寄存器
 */
/* Read Access Only */
#define STLM75_REG_TEMP 0x00  /* Temperature Register of LM75 */
/* Read/Write Access */
#define STLM75_REG_CONF 0x01  /* Configuration Register of LM75 */
#define STLM75_REG_THYS 0x02  /* Temperature Register of LM75 */
#define STLM75_REG_TOS  0x03  /* Over-temp Shutdown threshold Register of LM75 */

/*
 * STLM75 模式选择
 */
#define STLM75_CONTINUOUS_MODE                  ((uint8_t)0x00)
#define STLM75_ONE_SHOT_MODE                    ((uint8_t)0x01)
#define STLM75_COMPARATOR_MODE                  ((uint8_t)0x00)
#define STLM75_INTERRUPT_MODE                   ((uint8_t)0x02)

/*
 * Alert outside range Limit Temperature 12° <-> 40°c
 */
#define STLM75_TEMPERATURELIMITHIGH 40
#define STLM75_TEMPERATURELIMITlow  12

/* Private Enum --------------------------------------------------------------*/
/* Private Struct ------------------------------------------------------------*/

/* Stlm75温度传感器配置结构体 */
typedef struct
{
  uint8_t AlertMode;            /* Alert Mode Temperature out of range*/
  uint8_t ConversionMode;       /* Continuous/One Shot Mode */
  uint8_t ConversionResolution; /* Temperature Resolution */
  uint8_t ConversionRate;       /* Number of measure per second */
  uint8_t TemperatureLimitHigh; /* High Temperature Limit Range */
  uint8_t TemperatureLimitLow;  /* Low Temperature Limit Range */
}STLM75_InitTypeDef;

/* Private variables ---------------------------------------------------------*/
/* Extern  variables ---------------------------------------------------------*/
/* Private Functions Prototypes-----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/**
  * @brief  Writes one byte to the TSENSOR.
  * @param  DevAddress: Target device address
  * @param  pBuffer: Pointer to data buffer
  * @param  WriteAddr: TSENSOR's internal address to write to.
  * @param  Length: Number of data to write
  */
static uint8_t STLM75_Write( uint8_t* pBuffer, uint8_t WriteAddr, uint16_t Length )
{
    return ( I2Cx_WriteBuffer( &hi2c1, STLM75_I2C_ADDRESS, WriteAddr, I2C_MEMADD_SIZE_8BIT, pBuffer, Length ) );
}

/**
  * @brief  Reads one byte from the TSENSOR.
  * @param  DevAddress: Target device address
  * @param  pBuffer : pointer to the buffer that receives the data read from the TSENSOR.
  * @param  ReadAddr : TSENSOR's internal address to read from.
  * @param  Length: Number of data to read
  */
static uint8_t STLM75_Read( uint8_t* pBuffer, uint8_t ReadAddr, uint16_t Length )
{
    return ( I2Cx_ReadBuffer( &hi2c1, STLM75_I2C_ADDRESS, ReadAddr, I2C_MEMADD_SIZE_8BIT, pBuffer, Length ) );
}

/**
  * @brief  检查指定地址的I2C设备通讯是否正常
  * @note   只用于Rom设备
  * @param  DevAddress: 设备地址
  * @param  Trials: 测试值
  * @retval 状态
  */
static uint8_t STLM75_IsDeviceReady( void )
{
    return ( I2Cx_IsDeviceReady( &hi2c1, STLM75_I2C_ADDRESS ) );
}

/* Extern  Functions ---------------------------------------------------------*/

/**
  * @brief  STLM75温度传感器初始化
  * @param  void
  * @note   void
  * @retval 初始化状态
  */
uint8_t STLM75_Init( void )
{
    uint8_t confreg = 0;
    uint16_t tempreg = 0;

    /* 检查设备是否正常 */
    if ( STLM75_IsDeviceReady() != HAL_OK ) {
        Db_Error("Stlm75 device is error!!!");
        return HAL_ERROR;
    }

    do {
        /* Set the Configuration Register */
        confreg = (uint8_t)( STLM75_COMPARATOR_MODE | STLM75_CONTINUOUS_MODE );
        if ( STLM75_Write( &confreg, STLM75_REG_CONF, 1 ) != HAL_OK )
            break;

        /* Set the Temperature Registers */
        /* Keep the sign bit and shift the temperature value (as given value is integer, the 0.5 digit is not set) */
        tempreg = ( ( ( STLM75_TEMPERATURELIMITHIGH & 0x007F) << 8) | ( STLM75_TEMPERATURELIMITHIGH & 0x8000 ) );
        if ( STLM75_Write( (uint8_t*)(&tempreg), STLM75_REG_TOS, 2 ) != HAL_OK )
            break;

        tempreg = ( ( ( STLM75_TEMPERATURELIMITlow & 0x007F) << 8) | ( STLM75_TEMPERATURELIMITlow & 0x8000) );
        if ( STLM75_Write( (uint8_t*)(&tempreg), STLM75_REG_THYS, 2 ) != HAL_OK )
            break;

        return HAL_OK;
    } while ( 0 );

    return HAL_ERROR;
}

/**
  * @brief  Read The Temperature Sensor Status
  * @param  void
  * @retval Status
  */
uint8_t STLM75_ReadStatus( void )
{
  uint8_t tmp = 0;

  /* Read Status register */
  STLM75_Read( &tmp, STLM75_REG_CONF, 1 );

  /* Return Temperature Sensor Status */
  return (uint8_t)(tmp);
}

/**
  * @brief  Read ID address of STLM75
  * @param  void
  * @retval ID name
  */
uint16_t STLM75_ReadTemp( void )
{
  uint16_t tempreg = 0;
  uint16_t tmp = 0;

  /* Read Temperature registers */
  STLM75_Read( (uint8_t*)(&tempreg), STLM75_REG_TEMP, 2 );

  tmp = ((tempreg & 0x00FF) << 8) | ((tempreg & 0xFF00) >> 8);
  tempreg = (((tmp & 0x7F80) >> 7) | (tmp & 0x8000));

  /* Return Temperature value */
  return ( tempreg / 2 );
}

/********************************* END OF FILE *********************************/

hts221

/**
  ******************************************************************************
  * @file    module_stlm75.c
  * @author  
  * @version V1.1
  * @date    Mar 5, 2021
  * @brief   
  ******************************************************************************
  * @attention
  *
  *
  ******************************************************************************
  */
/* Includes ------------------------------------------------------------------*/
#include "module_stlm75.h"
#include "bsp_i2c.h"
#include "tool.h"

/* Private Typedef -----------------------------------------------------------*/
/* Private Define ------------------------------------------------------------*/

/* 设备地址 */
#define STLM75_I2C_ADDRESS 0x90

/*
 * STLM75 命令寄存器
 */
/* Read Access Only */
#define STLM75_REG_TEMP 0x00  /* Temperature Register of LM75 */
/* Read/Write Access */
#define STLM75_REG_CONF 0x01  /* Configuration Register of LM75 */
#define STLM75_REG_THYS 0x02  /* Temperature Register of LM75 */
#define STLM75_REG_TOS  0x03  /* Over-temp Shutdown threshold Register of LM75 */

/*
 * STLM75 模式选择
 */
#define STLM75_CONTINUOUS_MODE                  ((uint8_t)0x00)
#define STLM75_ONE_SHOT_MODE                    ((uint8_t)0x01)
#define STLM75_COMPARATOR_MODE                  ((uint8_t)0x00)
#define STLM75_INTERRUPT_MODE                   ((uint8_t)0x02)

/*
 * Alert outside range Limit Temperature 12° <-> 40°c
 */
#define STLM75_TEMPERATURELIMITHIGH 40
#define STLM75_TEMPERATURELIMITlow  12

/* Private Enum --------------------------------------------------------------*/
/* Private Struct ------------------------------------------------------------*/

/* Stlm75温度传感器配置结构体 */
typedef struct
{
  uint8_t AlertMode;            /* Alert Mode Temperature out of range*/
  uint8_t ConversionMode;       /* Continuous/One Shot Mode */
  uint8_t ConversionResolution; /* Temperature Resolution */
  uint8_t ConversionRate;       /* Number of measure per second */
  uint8_t TemperatureLimitHigh; /* High Temperature Limit Range */
  uint8_t TemperatureLimitLow;  /* Low Temperature Limit Range */
}STLM75_InitTypeDef;

/* Private variables ---------------------------------------------------------*/
/* Extern  variables ---------------------------------------------------------*/
/* Private Functions Prototypes-----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/**
  * @brief  Writes one byte to the TSENSOR.
  * @param  DevAddress: Target device address
  * @param  pBuffer: Pointer to data buffer
  * @param  WriteAddr: TSENSOR's internal address to write to.
  * @param  Length: Number of data to write
  */
static uint8_t STLM75_Write( uint8_t* pBuffer, uint8_t WriteAddr, uint16_t Length )
{
    return ( I2Cx_WriteBuffer( &hi2c1, STLM75_I2C_ADDRESS, WriteAddr, I2C_MEMADD_SIZE_8BIT, pBuffer, Length ) );
}

/**
  * @brief  Reads one byte from the TSENSOR.
  * @param  DevAddress: Target device address
  * @param  pBuffer : pointer to the buffer that receives the data read from the TSENSOR.
  * @param  ReadAddr : TSENSOR's internal address to read from.
  * @param  Length: Number of data to read
  */
static uint8_t STLM75_Read( uint8_t* pBuffer, uint8_t ReadAddr, uint16_t Length )
{
    return ( I2Cx_ReadBuffer( &hi2c1, STLM75_I2C_ADDRESS, ReadAddr, I2C_MEMADD_SIZE_8BIT, pBuffer, Length ) );
}

/**
  * @brief  检查指定地址的I2C设备通讯是否正常
  * @note   只用于Rom设备
  * @param  DevAddress: 设备地址
  * @param  Trials: 测试值
  * @retval 状态
  */
static uint8_t STLM75_IsDeviceReady( void )
{
    return ( I2Cx_IsDeviceReady( &hi2c1, STLM75_I2C_ADDRESS ) );
}

/* Extern  Functions ---------------------------------------------------------*/

/**
  * @brief  STLM75温度传感器初始化
  * @param  void
  * @note   void
  * @retval 初始化状态
  */
uint8_t STLM75_Init( void )
{
    uint8_t confreg = 0;
    uint16_t tempreg = 0;

    /* 检查设备是否正常 */
    if ( STLM75_IsDeviceReady() != HAL_OK ) {
        Db_Error("Stlm75 device is error!!!");
        return HAL_ERROR;
    }

    do {
        /* Set the Configuration Register */
        confreg = (uint8_t)( STLM75_COMPARATOR_MODE | STLM75_CONTINUOUS_MODE );
        if ( STLM75_Write( &confreg, STLM75_REG_CONF, 1 ) != HAL_OK )
            break;

        /* Set the Temperature Registers */
        /* Keep the sign bit and shift the temperature value (as given value is integer, the 0.5 digit is not set) */
        tempreg = ( ( ( STLM75_TEMPERATURELIMITHIGH & 0x007F) << 8) | ( STLM75_TEMPERATURELIMITHIGH & 0x8000 ) );
        if ( STLM75_Write( (uint8_t*)(&tempreg), STLM75_REG_TOS, 2 ) != HAL_OK )
            break;

        tempreg = ( ( ( STLM75_TEMPERATURELIMITlow & 0x007F) << 8) | ( STLM75_TEMPERATURELIMITlow & 0x8000) );
        if ( STLM75_Write( (uint8_t*)(&tempreg), STLM75_REG_THYS, 2 ) != HAL_OK )
            break;

        return HAL_OK;
    } while ( 0 );

    return HAL_ERROR;
}

/**
  * @brief  Read The Temperature Sensor Status
  * @param  void
  * @retval Status
  */
uint8_t STLM75_ReadStatus( void )
{
  uint8_t tmp = 0;

  /* Read Status register */
  STLM75_Read( &tmp, STLM75_REG_CONF, 1 );

  /* Return Temperature Sensor Status */
  return (uint8_t)(tmp);
}

/**
  * @brief  Read ID address of STLM75
  * @param  void
  * @retval ID name
  */
uint16_t STLM75_ReadTemp( void )
{
  uint16_t tempreg = 0;
  uint16_t tmp = 0;

  /* Read Temperature registers */
  STLM75_Read( (uint8_t*)(&tempreg), STLM75_REG_TEMP, 2 );

  tmp = ((tempreg & 0x00FF) << 8) | ((tempreg & 0xFF00) >> 8);
  tempreg = (((tmp & 0x7F80) >> 7) | (tmp & 0x8000));

  /* Return Temperature value */
  return ( tempreg / 2 );
}

/********************************* END OF FILE *********************************/

Spg30

/**
  ******************************************************************************
  * @file    module_sgp30.c
  * @author  HuZhang
  * @version V1.1
  * @date    Mar 5, 2021
  * @brief   
  ******************************************************************************
  * @attention
  *
  *
  ******************************************************************************
  */
/* Includes ------------------------------------------------------------------*/
#include "module_sgp30.h"
#include "i2c.h"
#include "tool.h"

/* Private Typedef -----------------------------------------------------------*/
/* Private Define ------------------------------------------------------------*/

/* CRC8校验参数 */
#define CRC8_POLYNOMIAL      0x31
#define CRC8_INITIAALIZATION 0xFF

/* I2C地址 */
#define SGP30_ADDR       0x58
#define SGP30_ADDR_WRITE ( SGP30_ADDR << 1 )
#define SGP30_ADDR_READ  ( ( SGP30_ADDR << 1 ) + 1 )

/* Private Enum --------------------------------------------------------------*/

typedef enum  {
    /* 初始化空气质量测量 */
    INIT_AIR_QUALITY    = 0x2003,
    /* 开始空气质量测量 */
    MEASURE_AIR_QUALITY = 0x2008
}sgp30_cmd;

/* Private Struct ------------------------------------------------------------*/

struct sgp30_data_t {
    uint16_t co2;
    uint16_t tvoc;
}sgp30Data;

/* Private variables ---------------------------------------------------------*/
/* Extern  variables ---------------------------------------------------------*/
/* Private Functions Prototypes-----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/

/**
  * @brief  CRC-8校验
  * @param  message:要校验的数据
  * @param  initial_value:要校验的数据
  * @note   void
  * @retval void
  */
uint8_t CheckCrc8( const uint8_t* message )
{
    uint8_t  remainder;     /* 余数 */
    uint8_t  i = 0, j = 0;  /* 循环变量 */

    /* 初始化 */
    remainder = CRC8_INITIAALIZATION;

    for ( j = 0; j < 2; j++ ) {
        remainder ^= message[ j ];

        /* 从最高位开始依次计算  */
        for ( i = 0; i < 8; i++ ) {
            if ( remainder & 0x80 ) {
                remainder = ( remainder << 1 ) ^ CRC8_POLYNOMIAL;
            }
            else {
                remainder = ( remainder << 1 );
            }
        }
    }

    /* 返回计算的CRC码 */
    return remainder;
}

/**
 * @brief   软复位SGP30
 * @param   void
 * @retval  成功返回HAL_OK
*/
static uint8_t sgp30SoftReset( void )
{
    uint8_t cmd = 0x06;
    return HAL_I2C_Master_Transmit( &hi2c1, SGP30_ADDR_WRITE, &cmd, 1, 0xFFFF );
}

/**
  * @brief  spg指令发送
  * @param  cmd:指令
  * @note   void
  * @retval 发送结果
  */
static uint8_t spg30CmdSend ( sgp30_cmd cmd )
{
    uint8_t cmdBuffer[2];

    cmdBuffer[ 0 ] = cmd >> 8;
    cmdBuffer[ 1 ] = cmd;

    return HAL_I2C_Master_Transmit( &hi2c1, SGP30_ADDR_WRITE, cmdBuffer, 2, 0xFFFF );
}

/* Extern  Functions ---------------------------------------------------------*/

/**
  * @brief  初始化空气传感器-spg30
  * @param  void
  * @note   void
  * @retval void
  */
uint8_t sgp30Init ( void )
{
    /* 复位 */
    if ( HAL_OK != sgp30SoftReset() )
        return HAL_ERROR;

    HAL_Delay( 100 );

    return spg30CmdSend( INIT_AIR_QUALITY );
}

/**
  * @brief  sgp30获取空气质量参数
  * @param  sgp30Data:二氧化碳浓度 甲醛浓度
  * @note   void
  * @retval void
  */
uint8_t spg30GetArgument ( uint16_t *sgp30Data )
{
    uint8_t status;
    uint8_t recv_buffer[6] = { 0 };

    /* 启动测量 */
    status = spg30CmdSend( MEASURE_AIR_QUALITY );
    if ( status != HAL_OK ) {
        Db_Error("sgp30 start fail\r\n");
        return HAL_ERROR;
    }

    HAL_Delay(100);

    /* 读取测量数据 */
    status = HAL_I2C_Master_Receive( &hi2c1, SGP30_ADDR_READ, (uint8_t*)recv_buffer, 6, 0xFFFF );
    if ( status != HAL_OK ) {
        Db_Error("I2C Master Receive fail\r\n");
        return HAL_ERROR;
    }

    /* 校验接收的测量数据 */
    if ( CheckCrc8( &recv_buffer[ 0 ] ) != recv_buffer[ 2 ]) {
        Db_Error("co2 recv data crc check fail\r\n");
        return HAL_ERROR;
    }
    if ( CheckCrc8( &recv_buffer[ 3 ] ) != recv_buffer[ 5 ]) {
        Db_Error("tvoc recv data crc check fail\r\n");
        return HAL_ERROR;
    }


    /* 转换测量数据 */
    sgp30Data[ 0 ]  = recv_buffer[ 0 ] << 8 | recv_buffer[ 1 ];
    sgp30Data[ 1 ] = recv_buffer[ 3 ] << 8 | recv_buffer[ 4 ];

    return HAL_OK;
}

/********************************* END OF FILE *********************************/

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Stm32下环境传感器-Stlm75-hts221-spg30(Hal) 的相关文章

  • ubuntu多个系统之间文件局域网共享

    前言 xff1a 博主需要在多台主机上进行数据传输 xff0c 由于数据量比较大所以 xff0c 使用移动介质进行传输极为不方便 xff0c 并且也不没有更多的资源在两台主机都进行备份 下面的方式 xff0c 是博主在测试大量的网络上的帖子

随机推荐

  • idea如何清理缓存

    今天运行项目突然报错 检查半天 发现代码没问题 但就是报错 好气啊 最后解决办法就是把以前的缓存清理掉 问题解决 idea清理缓存的方法 File gt Invalidate Caches Restart
  • VNC登录失败:Authentication Failure

    遇到问题 xff1a 解决 xff1a 返回MobaXter xff0c 登录服务器 重置密码 回到VNC Viwer xff0c 重新连接
  • Haar特征

    一 Haar特征 特征是计算机视觉领域一种常用的特征描述算子 xff0c 特征 xff0c 描述图像的特征 xff0c 多用于人脸检测 行人检测 xff0c 等目标检测 xff0c Haar like特征模板内只有白色和黑色两种矩形 xff
  • 在线免费生成IntelliJ IDEA 15.0注册码

    http idea iteblog com key PHP
  • UCOSⅢ简介

    UCOS 简介 简述一 裸机系统与多任务系统二 UCOS 的重要特性三 UCOS 的组成 简述 UCOS xff08 UCOS的第三代内核 xff09 是一个可裁剪 可固化 可剥夺的多任务系统 xff0c 具有高度可移植性 xff0c 没有
  • 树莓派无屏幕无网线远程桌面连接配置方法

    要进行远程连接 xff0c 首先需要让树莓派连上网 xff0c 一种方法是使用网线 xff0c 另一种方法是使用WiFi 本文介绍后者 1树莓派WiFi的配置 没有网线的情况下 xff0c 要远程访问则只能通过WiFi 而由于没有屏幕 xf
  • 【C#可视化工具开发】(Visual Studio2017)利用echarts——1.界面设计

    C 可视化工具开发 近期在做一个可视化工具 xff0c 有关于指标对标相关内容 xff0c 用自己几乎没学到的Visual Studio 2017疯狂开发 xff08 碰壁 xff09 xff0c 由于总体的可视化工具还没做完 xff0c
  • 使用精灵标注助手生成json文件

    使用精灵助手教程 本文主要介绍如何使用精灵标注助手生成json文件 下载精灵标注助手 下载链接 xff1a http www jinglingbiaozhu com 选择windows版本进行下载 安装方式很简单 xff0c 就是一直nex
  • 关于Nginx配置文件在推流取流时的对应模块作用

    关于Nginx配置文件在推流取流时的对应模块作用 前言 xff1a 前提知识1 xff09 xff1a 取流地址只是我们从用于管理路面监控视频的DVR NVR的IP地址 xff0c 这里只需要知道该地址即可 重点是讲述推流和拉流nginx
  • go语言实战-----30-----token机制微信公众号签名验证的方法、XML解析,CDATA解析、交换协议、接收消息协议、被动回复消息协议、正则表达式

    一 token机制微信公众号签名验证的方法 1 token机制 token机制就是使用一个token 通常是一个字符串 xff0c 长度没有特别限制 xff0c 一般是10字节或者16字节 xff0c 然后按照一定的算法生成签名 xff0c
  • python下划线的5种类型

    python中5中下划线 学习的原文章1链接 学习的原文章2 双前导下划线解释 链接 1 单前导下划线 以单个下划线开头的变量或方法仅供内部使用 xff0c 有私有声明的作用 xff0c 但这并不是python语法的强制规定 xff0c 而
  • JAVA课后习题(一)——我是歌手

    大家好 xff01 我是小黄 xff0c 很高兴又跟大家见面啦 xff01 今天更新的是 xff1a JAVA程序设计课后习题 我是歌手往期检索 xff1a 程序设计学习笔记 目录 创建时间 xff1a 2020年10月23日 软件版本 x
  • 解决git时出现error: src refspec master does not match any问题

    问题复现 xff1a 今天在使用gitee创建仓库后上传写好的代码时报错 在远程关联仓库后无法正常推送 键入下图代码时报错error src refspec master does not match any xxx 解决方法 xff1a
  • 如何购买云服务器----以华为云服务器为例

    进入华为云官网 https activity huaweicloud com 登入自己注册的账户 进入控制台 点击界面里我的资源 弹性云服务器ECS 点击右上角 购买弹性云服务器 按照自己的需求选择 xff0c 重点注意 xff1a 计费方
  • Java编写MapReduce的步骤

    Mapper 自定义类继承Mapper类重写自定义类中的map方法 xff0c 在该方法中将K1和V1转为K2和V2将生成的K2和V2写入上下文中 二 Reduce 自定义类继承Reduce类重写Reducer中的reduce方法 xff0
  • PX4入门及开发指南

    PX4入门及开发指南 用户手册开发者手册 用户手册 https docs px4 cc master zh index html 开发者手册 https dev px4 cc master zh index html
  • 树莓派编译工作空间卡死

    树莓派编译程序时遇到卡死 1 树莓派安装的Ubuntu mate 16 04 系统默认设置的swap交换空间不够 xff0c 而编译某些文件的时候需要较大的交换空间 xff0c 树莓派的交换空间被用满所以树莓派看起来好像是死机了的样子 xf
  • 超好用但是很多人不知道的的串口(网络)调试助手推荐

    小众但是超好用的串口 xff08 网络 xff09 调试助手 前言O ComToll xff08 串口 xff09 格西烽火串口网络调试助手伏特加串口 xff08 网络 xff09 调试助手windows自带的串口调试助手总结 前言 这里的
  • STM32上可用的的SM 2 3 4国密算法

    可在STM32上使用的国密算法 SM 2 3 4 SM2SM3SM4 下面直接给出代码 xff0c 有问题可评论 xff0c 自己改动的 xff0c 测试不到的地方可能有bug xff0c 欢迎指正 SM2 由于SM2算法牵扯到一些较为复杂
  • Stm32下环境传感器-Stlm75-hts221-spg30(Hal)

    Stm32下环境传感器 Stlm75 hts221 spg30 xff08 Hal xff09 简介IIC驱动接口Stlm75hts221Spg30 简介 Stlm75与Hts221都是ST的传感器 xff0c 有官方例程 xff0c 我只