Renesas MCU使用SCI_I2C驅動OLED

目錄

概述

1 軟硬件

?1.1 軟件版本信息

1.2?OLED屏幕

1.2.1?OLED簡介

1.2.2 SSD1306介紹

1.2.3 0.9寸OLED模塊介紹

?2 FSP配置項目

2.1 配置項目參數

?2.2 生成項目文件架構

3 代碼實現

3.1 I2C的庫函數

3.1.1?R_SCI_I2C_Open()

3.1.2?R_SCI_I2C_Read()

3.1.3??R_SCI_I2C_Write()

3.2 應用函數接口

3.2.1 初始化函數

3.2.2 讀數據函數

?3.2.3 寫數據函數

3.2.4?回調函數

4 OLED驅動實現

4.1 編寫驅動程序

4.2 編寫測試函數

4.3 源代碼

5 測試


概述

本文主要介紹使用Renesas MCU的SCI_I2C模塊驅動OLED,文中介紹了OLED的相關知識,包括模塊參數,接口信息,還介紹了FSP庫中I2C相關的接口函數。最后使用HS3003采集環境溫濕度數據,并在OLED UI上顯示出來。

1 軟硬件

?1.1 軟件版本信息

軟硬件信息版本信息
Renesas MCUR7FA4M2AD3C
KeilMDK ARM 5.38
FSP 版本5.3.0
調試工具:st-linkST-LINK/V2-1

?注意:

在Keil MDK中可以更改FSP的版本,方法如下

1.2?OLED屏幕

1.2.1?OLED簡介

? ? ?OLED(有機發光二極管)是一種顯示技術,它使用有機物質來發出光線。與傳統液晶顯示屏相比,OLED具有更高的對比度和更廣的視角。它沒有背光源,因此可以提供更深的黑色和更明亮的白色。

? ? ? ?OLED顯示屏由許多小的發光二極管組成,每個像素都可以獨立發光。這意味著OLED顯示屏可以實現真正的黑色,因為當像素關閉時,沒有任何光線發射。

? ? ?OLED具有快速的響應時間,因此在顯示動態圖像時可以提供更流暢的畫面。此外,OLED顯示屏擁有更寬廣的視角,因此無論從哪個角度觀看,圖像都能保持清晰和準確。

? ? ? OLED顯示屏還具有較高的能源效率。因為每個像素都可以獨立點亮,所以在顯示黑色時可以關閉相應的像素,從而節省能源。

? ? ? OLED技術可應用于各種設備,包括智能手機、電視、電子書閱讀器、車載顯示屏等。由于OLED顯示屏的薄度和柔性,它還可以用于可彎曲的顯示設備和可穿戴設備。

? ? ? ?然而,OLED顯示屏也有一些限制。首先,長時間顯示相同的圖像可能會導致“燒結”效應,即在屏幕上留下輪廓。其次,OLED顯示屏的壽命相對較短,使用壽命通常較液晶顯示屏更短。

? ? ? 總的來說,OLED技術在顯示領域具有許多優勢,如高對比度、廣視角和能源效率。隨著技術的不斷發展,OLED顯示屏將在各種設備中得到更廣泛的應用。

1.2.2 SSD1306介紹

? ? ? SSD1306是一款常用的單色OLED驅動芯片,由Solomon Systech Limited(國巨控股)設計和生產。它被廣泛應用于各種嵌入式系統和電子設備中,用于驅動OLED顯示屏。

? ? ? SSD1306采用低功耗、高對比度和快速刷新率的技術,使得顯示效果清晰亮麗。它具備128x64或128x32像素的分辨率,并支持四種顯示模式:正常顯示、反轉顯示、鏡像顯示和指令顯示。SSD1306還可以通過I2C或SPI接口與微控制器或其他外部設備進行通信。

? ? ? SSD1306內置了豐富的圖形繪制和文本顯示功能,可以輕松實現直線、矩形、圓形、位圖等圖形的繪制,以及字符、數字和自定義字體的顯示。它還提供了多種顯示模式和亮度調節選項,可以根據實際需求靈活控制顯示效果。

? ? ? SSD1306還具備內置的電源管理功能,支持低電壓檢測和電池電量顯示,可以實現智能電源管理。此外,它還支持多種硬件和軟件配置選項,方便用戶進行定制化開發。

? ? ? 總的來說,SSD1306是一款功能強大、易于使用的OLED驅動芯片,適用于各種嵌入式系統和電子設備中,能夠實現高質量、低功耗的顯示效果。

1.2.3 0.9寸OLED模塊介紹

筆者使用的0.9寸OLED模塊, 驅動芯片為SSD1306,該模塊采用I2C驅動方式,對外有四個引腳:

1) GND: 電源地

2)VCC: 電源正極 ,工作電壓區間為3~5.5V

3)SCL: I2C 時鐘引腳

4) SDA: I2C數據引腳

模塊的原理圖如下:

?2 FSP配置項目

2.1 配置項目參數

1)配置系統時鐘,根據硬件特性配置時鐘,筆者的板卡上的晶振為12M Hz

?2) 在Pins面板配置SCI3,使能I2C,并且配置IO端口

3)在Stacks面板創建i2c的object

?配置參數

?2.2 生成項目文件架構

點擊Generate Project content 按鈕,生成項目文件,其文件架構如下:

3 代碼實現

3.1 I2C的庫函數

3.1.1?R_SCI_I2C_Open()

函數原型:


fsp_err_t R_SCI_I2C_Open	(	i2c_master_ctrl_t *const 	p_api_ctrl,i2c_master_cfg_t const *const 	p_cfg )	

函數功能: 打開I2C設備

返回值介紹:

FSP_SUCCESSRequested clock rate was set exactly.
FSP_ERR_ALREADY_OPENModule is already open.
FSP_ERR_IP_CHANNEL_NOT_PRESENTChannel is not available on this MCU.
FSP_ERR_ASSERTIONParameter check failure due to one or more reasons below:
  1. p_api_ctrl or p_cfg is NULL.
  2. extended parameter is NULL.
  3. Callback parameter is NULL.
  4. Clock rate requested is greater than 400KHz
  5. Invalid IRQ number assigned

3.1.2?R_SCI_I2C_Read()

函數原型:


fsp_err_t R_SCI_I2C_Read	(	i2c_master_ctrl_t *const 	p_api_ctrl,uint8_t *const 	p_dest,uint32_t const 	bytes,bool const 	restart )	

函數功能:?從I2C設備執行讀取操作。當操作(成功)完成時,調用者將通過回調中的I2C_MASTER_EVENT_RX_COMPLETE收到通知。

返回值:

FSP_SUCCESSFunction executed without issue.
FSP_ERR_ASSERTIONThe parameter p_ctrl, p_dest is NULL, bytes is 0.
FSP_ERR_INVALID_SIZEProvided number of bytes more than uint16_t size (65535) while DTC is used for data transfer.
FSP_ERR_NOT_OPENDevice was not even opened.

3.1.3??R_SCI_I2C_Write()

函數原型:


fsp_err_t R_SCI_I2C_Write	(	i2c_master_ctrl_t *const 	p_api_ctrl,uint8_t *const 	p_src,uint32_t const 	bytes,bool const 	restart )	

函數功能:?對I2C設備進行寫操作,如果相關通道上已經有正在進行的I2C傳輸,則此函數將失敗。否則,將開始I2C寫操作。當用戶沒有提供回調時,該函數執行阻塞寫入。否則,寫操作是非阻塞的,并且當操作完成時將通過回調中的I2C_EVENT_TX_COMPLETE通知調用者。

返回值:

FSP_SUCCESSFunction executed without issue.
FSP_ERR_ASSERTIONp_ctrl, p_src is NULL.
FSP_ERR_INVALID_SIZEProvided number of bytes more than uint16_t size (65535) while DTC is used for data transfer.
FSP_ERR_NOT_OPENDevice was not even opened.

3.2 應用函數接口

創建bsp_i2c.c文件,實現i2c的應用函數接口

3.2.1 初始化函數

代碼第24行:打開端口

代碼第27行:設置設備地址

3.2.2 讀數據函數

代碼第54行:從設備中讀取數據

代碼第57行:判斷接收數據是否完成

?3.2.3 寫數據函數

代碼第36行:從設備中寫數據

代碼第41行:判斷寫數據是否完成

3.2.4?回調函數

代碼第16行:接收當前event

?

4 OLED驅動實現

4.1 編寫驅動程序

1)創建oled_drv.c文件,編寫如下代碼:

/** \file$Id: oled.c 40486 2018-08-12 13:50:21Z tangmingfei2013@126.com $Copyright (c)tangmingfei2013@126.com Holding B.V.
All Rights Reserved.This source code and any compilation or derivative thereof is the proprietary
information of mingfei.tang Holding B.V. and is confidential in nature.
Under no circumstances is this software to be combined with any
Open Source Software in any way or placed under an Open Source License
of any type without the express written permission of mingfei.tang Holding B.V.
*/
/*******************************************************************************
* EXPORT INCLUDE FILES
*******************************************************************************/
#include "bsp_i2c.h" 
#include "oled_drv.h"
/*******************************************************************************
* LOCAL INCLUDE FILES
*******************************************************************************/
#include "font.h"static uint8_t charSize;
/******************************************************************************
* LOCAL FUNCTION DECLARATIONS
******************************************************************************/
static void oled_WriteRegister(uint8_t val,  uint8_t reg);/******************************************************************************
* EXPORTED FUNCTIONS
******************************************************************************/
void oled_Init(void)
{ i2c2_init_para(OLED_ADDRESS);oled_WriteRegister(0xAE,PARA);//--display offoled_WriteRegister(0x00,PARA);//---set low column addressoled_WriteRegister(0x10,PARA);//---set high column addressoled_WriteRegister(0x40,PARA);//--set start line address  oled_WriteRegister(0xB0,PARA);//--set page addressoled_WriteRegister(0x81,PARA); // contract controloled_WriteRegister(0xFF,PARA);//--128   oled_WriteRegister(0xA1,PARA);//set segment remap oled_WriteRegister(0xA6,PARA);//--normal / reverseoled_WriteRegister(0xA8,PARA);//--set multiplex ratio(1 to 64)oled_WriteRegister(0x3F,PARA);//--1/32 dutyoled_WriteRegister(0xC8,PARA);//Com scan directionoled_WriteRegister(0xD3,PARA);//-set display offsetoled_WriteRegister(0x00,PARA);//oled_WriteRegister(0xD5,PARA);//set osc divisionoled_WriteRegister(0x80,PARA);//oled_WriteRegister(0xD8,PARA);//set area color mode offoled_WriteRegister(0x05,PARA);//oled_WriteRegister(0xD9,PARA);//Set Pre-Charge Periodoled_WriteRegister(0xF1,PARA);//oled_WriteRegister(0xDA,PARA);//set com pin configuartionoled_WriteRegister(0x12,PARA);//oled_WriteRegister(0xDB,PARA);//set Vcomholed_WriteRegister(0x30,PARA);//oled_WriteRegister(0x8D,PARA);//set charge pump enableoled_WriteRegister(0x14,PARA);//oled_WriteRegister(0xAF,PARA);//--turn on oled paneloled_Clear();#if OLED_DEBUG  oled_SetCharSize( FONT_16 );  oled_PrintfString(6,0,(uint8_t*)"0.96' OLED TEST");  oled_SetCharSize( FONT_12 );oled_PrintfString(2,6,(uint8_t*)"ASCII:");  oled_PrintfString(60,6,(uint8_t*)"-CODE:");
#endif} void oled_SetCharSize( uint8_t val )
{charSize = val;
}void oled_SetPostion( uint8_t x, uint8_t y) 
{oled_WriteRegister(0xb0+y,PARA);oled_WriteRegister(((x&0xf0)>>4)|0x10,PARA);oled_WriteRegister((x&0x0f),PARA); 
}void oled_displayOn(void)
{oled_WriteRegister(0X8D,PARA); oled_WriteRegister(0X14,PARA); oled_WriteRegister(0XAF,PARA);
}void oled_DisplayOff(void)
{oled_WriteRegister(0X8D,PARA);oled_WriteRegister(0X10,PARA);oled_WriteRegister(0XAE,PARA);
}void oled_Clear(void)  
{  uint8_t i,n;for(i=0;i<8;i++)  {  oled_WriteRegister (0xb0+i,PARA);   oled_WriteRegister (0x00,PARA);oled_WriteRegister (0x10,PARA); for( n = 0;n < 128; n++){oled_WriteRegister(0,DATA);} } 
}void oled_UpScreenOn(void)  
{  uint8_t i,n;for(i=0;i<8;i++)  {  oled_WriteRegister (0xb0+i,PARA);oled_WriteRegister (0x00,PARA); oled_WriteRegister (0x10,PARA);for(n=0;n<128;n++){oled_WriteRegister(1,DATA); }} 
}void oled_PrintfChar(uint8_t x,uint8_t y,uint8_t val )
{      	uint8_t character = 0;uint8_t i=0;character = val-' ';if( x > X_WIDTH-1){x = 0;y += 2;}if( charSize == FONT_16 ){oled_SetPostion(x,y);	for( i = 0; i < 8; i++){oled_WriteRegister(F8X16[character*16+i],DATA);}oled_SetPostion(x,y+1);for(i=0;i<8;i++){oled_WriteRegister(F8X16[character*16+i+8],DATA);}}else {oled_SetPostion(x,y);for(i=0;i<6;i++){oled_WriteRegister(F6x8[character*6+i],DATA);}}
}void oled_PrintfString(uint8_t x,uint8_t y,uint8_t *str  )
{uint8_t index = 0;while ( str[index]!='\0' ){oled_PrintfChar(x,y,str[index] );x += 8;if( x > 120 ){  x=0;y+=2;}index++;}
}void oled_PrintmutiChar(uint8_t x,uint8_t y,uint8_t *str,  uint8_t length )
{for(uint8_t index = 0; index < length; index++ ){oled_PrintfChar(x,y,str[index] );x += 8;if( x > 120 ){  x=0;y+=2;}}
}/******************************************************************************
* LOCAL FUNCTIONS
******************************************************************************/
static void oled_WriteRegister(uint8_t val,  uint8_t reg)
{  fsp_err_t err;unsigned char buff[2];err = R_SCI_I2C_SlaveAddressSet( &g_i2c2_ctrl, OLED_ADDRESS, I2C_MASTER_ADDR_MODE_7BIT);assert(FSP_SUCCESS == err);buff[0] = reg;buff[1] = val;i2c2_write_bytes(buff, 2);
}
/* End of this file */

2)創建oled_drv.h文件,編寫如下代碼:

/** \file$Id: oled.h 40486 2018-08-12 13:50:21Z tangmingfei2013@126.com $Copyright (c)tangmingfei2013@126.com Holding B.V.
All Rights Reserved.This source code and any compilation or derivative thereof is the proprietary
information of mingfei.tang Holding B.V. and is confidential in nature.
Under no circumstances is this software to be combined with any
Open Source Software in any way or placed under an Open Source License
of any type without the express written permission of mingfei.tang Holding B.V.
*/
#ifndef __OLED_DRV_H
#define __OLED_DRV_H/******************************************************************************
* C++ DECLARATION WRAPPER
******************************************************************************/#ifdef __cplusplus
extern "C" {
#endif#include "hal_data.h"
/******************************************************************************
* LOCAL MACROS AND DEFINITIONS
******************************************************************************/
#define OLED_DEBUG      1
#define OLED_ADDRESS    0x3ctypedef enum
{FONT_16 = 0,FONT_12 = 1,
}OLED_CHARSIZE;typedef enum
{PARA = 0,DATA = 0x40,
}OLED_PARE_REG;typedef enum
{X_WIDTH = 128,Y_WIDTH = 64,
}OLED_SCREEN_SIZE;/******************************************************************************
* EXPORTED MACROS AND DEFINITIONS
******************************************************************************/ /******************************************************************************
* EXPORTED FUNCTIONS
******************************************************************************/
void oled_Clear(void) ;
void oled_Init(void);
void oled_UpScreenOn(void);void oled_PrintfString(uint8_t x,uint8_t y,uint8_t *str);
void oled_PrintfChar(uint8_t x,uint8_t y,uint8_t val);
void oled_SetPostion( uint8_t x, uint8_t y) ;
void oled_SetCharSize( uint8_t val );
void oled_PrintmutiChar(uint8_t x,uint8_t y,uint8_t *str,  uint8_t length);/******************************************************************************
* END OF C++ DECLARATION WRAPPER
******************************************************************************/#ifdef __cplusplus
}
#endif#endif /* __OLED_DRV_H */

3)?創建font.h文件,編寫如下代碼:

/** \file$Id: font.h 40486 2018-08-12 13:50:21Z tangmingfei2013@126.com $Copyright (c)tangmingfei2013@126.com Holding B.V.
All Rights Reserved.This source code and any compilation or derivative thereof is the proprietary
information of mingfei.tang Lighting Holding B.V. and is confidential in nature.
Under no circumstances is this software to be combined with any
Open Source Software in any way or placed under an Open Source License
of any type without the express written permission of mingfei.tang Holding B.V.
*/#ifndef __FONT_H
#define __FONT_H/*******************************************************************************
* EXPORT INCLUDE FILES
*******************************************************************************//******************************************************************************
* C++ DECLARATION WRAPPER
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endifconst unsigned char F6x8[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,// sp
0x00, 0x00, 0x00, 0x2f, 0x00, 0x00,// !
0x00, 0x00, 0x07, 0x00, 0x07, 0x00,// "
0x00, 0x14, 0x7f, 0x14, 0x7f, 0x14,// #
0x00, 0x24, 0x2a, 0x7f, 0x2a, 0x12,// $
0x00, 0x62, 0x64, 0x08, 0x13, 0x23,// %
0x00, 0x36, 0x49, 0x55, 0x22, 0x50,// &
0x00, 0x00, 0x05, 0x03, 0x00, 0x00,// '
0x00, 0x00, 0x1c, 0x22, 0x41, 0x00,// (
0x00, 0x00, 0x41, 0x22, 0x1c, 0x00,// )
0x00, 0x14, 0x08, 0x3E, 0x08, 0x14,// *
0x00, 0x08, 0x08, 0x3E, 0x08, 0x08,// +
0x00, 0x00, 0x00, 0xA0, 0x60, 0x00,// ,
0x00, 0x08, 0x08, 0x08, 0x08, 0x08,// -
0x00, 0x00, 0x60, 0x60, 0x00, 0x00,// .
0x00, 0x20, 0x10, 0x08, 0x04, 0x02,// /
0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E,// 0
0x00, 0x00, 0x42, 0x7F, 0x40, 0x00,// 1
0x00, 0x42, 0x61, 0x51, 0x49, 0x46,// 2
0x00, 0x21, 0x41, 0x45, 0x4B, 0x31,// 3
0x00, 0x18, 0x14, 0x12, 0x7F, 0x10,// 4
0x00, 0x27, 0x45, 0x45, 0x45, 0x39,// 5
0x00, 0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
0x00, 0x01, 0x71, 0x09, 0x05, 0x03,// 7
0x00, 0x36, 0x49, 0x49, 0x49, 0x36,// 8
0x00, 0x06, 0x49, 0x49, 0x29, 0x1E,// 9
0x00, 0x00, 0x36, 0x36, 0x00, 0x00,// :
0x00, 0x00, 0x56, 0x36, 0x00, 0x00,// ;
0x00, 0x08, 0x14, 0x22, 0x41, 0x00,// <
0x00, 0x14, 0x14, 0x14, 0x14, 0x14,// =
0x00, 0x00, 0x41, 0x22, 0x14, 0x08,// >
0x00, 0x02, 0x01, 0x51, 0x09, 0x06,// ?
0x00, 0x32, 0x49, 0x59, 0x51, 0x3E,// @
0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C,// A
0x00, 0x7F, 0x49, 0x49, 0x49, 0x36,// B
0x00, 0x3E, 0x41, 0x41, 0x41, 0x22,// C
0x00, 0x7F, 0x41, 0x41, 0x22, 0x1C,// D
0x00, 0x7F, 0x49, 0x49, 0x49, 0x41,// E
0x00, 0x7F, 0x09, 0x09, 0x09, 0x01,// F
0x00, 0x3E, 0x41, 0x49, 0x49, 0x7A,// G
0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F,// H
0x00, 0x00, 0x41, 0x7F, 0x41, 0x00,// I
0x00, 0x20, 0x40, 0x41, 0x3F, 0x01,// J
0x00, 0x7F, 0x08, 0x14, 0x22, 0x41,// K
0x00, 0x7F, 0x40, 0x40, 0x40, 0x40,// L
0x00, 0x7F, 0x02, 0x0C, 0x02, 0x7F,// M
0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F,// N
0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E,// O
0x00, 0x7F, 0x09, 0x09, 0x09, 0x06,// P
0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
0x00, 0x7F, 0x09, 0x19, 0x29, 0x46,// R
0x00, 0x46, 0x49, 0x49, 0x49, 0x31,// S
0x00, 0x01, 0x01, 0x7F, 0x01, 0x01,// T
0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F,// U
0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F,// V
0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F,// W
0x00, 0x63, 0x14, 0x08, 0x14, 0x63,// X
0x00, 0x07, 0x08, 0x70, 0x08, 0x07,// Y
0x00, 0x61, 0x51, 0x49, 0x45, 0x43,// Z
0x00, 0x00, 0x7F, 0x41, 0x41, 0x00,// [
0x00, 0x55, 0x2A, 0x55, 0x2A, 0x55,// 55
0x00, 0x00, 0x41, 0x41, 0x7F, 0x00,// ]
0x00, 0x04, 0x02, 0x01, 0x02, 0x04,// ^
0x00, 0x40, 0x40, 0x40, 0x40, 0x40,// _
0x00, 0x00, 0x01, 0x02, 0x04, 0x00,// '
0x00, 0x20, 0x54, 0x54, 0x54, 0x78,// a
0x00, 0x7F, 0x48, 0x44, 0x44, 0x38,// b
0x00, 0x38, 0x44, 0x44, 0x44, 0x20,// c
0x00, 0x38, 0x44, 0x44, 0x48, 0x7F,// d
0x00, 0x38, 0x54, 0x54, 0x54, 0x18,// e
0x00, 0x08, 0x7E, 0x09, 0x01, 0x02,// f
0x00, 0x18, 0xA4, 0xA4, 0xA4, 0x7C,// g
0x00, 0x7F, 0x08, 0x04, 0x04, 0x78,// h
0x00, 0x00, 0x44, 0x7D, 0x40, 0x00,// i
0x00, 0x40, 0x80, 0x84, 0x7D, 0x00,// j
0x00, 0x7F, 0x10, 0x28, 0x44, 0x00,// k
0x00, 0x00, 0x41, 0x7F, 0x40, 0x00,// l
0x00, 0x7C, 0x04, 0x18, 0x04, 0x78,// m
0x00, 0x7C, 0x08, 0x04, 0x04, 0x78,// n
0x00, 0x38, 0x44, 0x44, 0x44, 0x38,// o
0x00, 0xFC, 0x24, 0x24, 0x24, 0x18,// p
0x00, 0x18, 0x24, 0x24, 0x18, 0xFC,// q
0x00, 0x7C, 0x08, 0x04, 0x04, 0x08,// r
0x00, 0x48, 0x54, 0x54, 0x54, 0x20,// s
0x00, 0x04, 0x3F, 0x44, 0x40, 0x20,// t
0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C,// u
0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C,// v
0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C,// w
0x00, 0x44, 0x28, 0x10, 0x28, 0x44,// x
0x00, 0x1C, 0xA0, 0xA0, 0xA0, 0x7C,// y
0x00, 0x44, 0x64, 0x54, 0x4C, 0x44,// z
0x14, 0x14, 0x14, 0x14, 0x14, 0x14,// horiz lines
};/****************************************8*16************************************/
const unsigned char F8X16[]=  
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,// 00x00,0x00,0x00,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x30,0x00,0x00,0x00,//! 10x00,0x10,0x0C,0x06,0x10,0x0C,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//" 20x40,0xC0,0x78,0x40,0xC0,0x78,0x40,0x00,0x04,0x3F,0x04,0x04,0x3F,0x04,0x04,0x00,//# 30x00,0x70,0x88,0xFC,0x08,0x30,0x00,0x00,0x00,0x18,0x20,0xFF,0x21,0x1E,0x00,0x00,//$ 40xF0,0x08,0xF0,0x00,0xE0,0x18,0x00,0x00,0x00,0x21,0x1C,0x03,0x1E,0x21,0x1E,0x00,//% 50x00,0xF0,0x08,0x88,0x70,0x00,0x00,0x00,0x1E,0x21,0x23,0x24,0x19,0x27,0x21,0x10,//& 60x10,0x16,0x0E,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//' 70x00,0x00,0x00,0xE0,0x18,0x04,0x02,0x00,0x00,0x00,0x00,0x07,0x18,0x20,0x40,0x00,//( 80x00,0x02,0x04,0x18,0xE0,0x00,0x00,0x00,0x00,0x40,0x20,0x18,0x07,0x00,0x00,0x00,//) 90x40,0x40,0x80,0xF0,0x80,0x40,0x40,0x00,0x02,0x02,0x01,0x0F,0x01,0x02,0x02,0x00,//* 100x00,0x00,0x00,0xF0,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x1F,0x01,0x01,0x01,0x00,//+ 110x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xB0,0x70,0x00,0x00,0x00,0x00,0x00,//, 120x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x01,//- 130x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,0x00,0x00,//. 140x00,0x00,0x00,0x00,0x80,0x60,0x18,0x04,0x00,0x60,0x18,0x06,0x01,0x00,0x00,0x00,/// 150x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x0F,0x10,0x20,0x20,0x10,0x0F,0x00,//0 160x00,0x10,0x10,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//1 170x00,0x70,0x08,0x08,0x08,0x88,0x70,0x00,0x00,0x30,0x28,0x24,0x22,0x21,0x30,0x00,//2 180x00,0x30,0x08,0x88,0x88,0x48,0x30,0x00,0x00,0x18,0x20,0x20,0x20,0x11,0x0E,0x00,//3 190x00,0x00,0xC0,0x20,0x10,0xF8,0x00,0x00,0x00,0x07,0x04,0x24,0x24,0x3F,0x24,0x00,//4 200x00,0xF8,0x08,0x88,0x88,0x08,0x08,0x00,0x00,0x19,0x21,0x20,0x20,0x11,0x0E,0x00,//5 210x00,0xE0,0x10,0x88,0x88,0x18,0x00,0x00,0x00,0x0F,0x11,0x20,0x20,0x11,0x0E,0x00,//6 220x00,0x38,0x08,0x08,0xC8,0x38,0x08,0x00,0x00,0x00,0x00,0x3F,0x00,0x00,0x00,0x00,//7 230x00,0x70,0x88,0x08,0x08,0x88,0x70,0x00,0x00,0x1C,0x22,0x21,0x21,0x22,0x1C,0x00,//8 240x00,0xE0,0x10,0x08,0x08,0x10,0xE0,0x00,0x00,0x00,0x31,0x22,0x22,0x11,0x0F,0x00,//9 250x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x00,0x00,0x00,//: 260x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x60,0x00,0x00,0x00,0x00,//; 270x00,0x00,0x80,0x40,0x20,0x10,0x08,0x00,0x00,0x01,0x02,0x04,0x08,0x10,0x20,0x00,//< 280x40,0x40,0x40,0x40,0x40,0x40,0x40,0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x04,0x00,//= 290x00,0x08,0x10,0x20,0x40,0x80,0x00,0x00,0x00,0x20,0x10,0x08,0x04,0x02,0x01,0x00,//> 300x00,0x70,0x48,0x08,0x08,0x08,0xF0,0x00,0x00,0x00,0x00,0x30,0x36,0x01,0x00,0x00,//? 310xC0,0x30,0xC8,0x28,0xE8,0x10,0xE0,0x00,0x07,0x18,0x27,0x24,0x23,0x14,0x0B,0x00,//@ 320x00,0x00,0xC0,0x38,0xE0,0x00,0x00,0x00,0x20,0x3C,0x23,0x02,0x02,0x27,0x38,0x20,//A 330x08,0xF8,0x88,0x88,0x88,0x70,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x11,0x0E,0x00,//B 340xC0,0x30,0x08,0x08,0x08,0x08,0x38,0x00,0x07,0x18,0x20,0x20,0x20,0x10,0x08,0x00,//C 350x08,0xF8,0x08,0x08,0x08,0x10,0xE0,0x00,0x20,0x3F,0x20,0x20,0x20,0x10,0x0F,0x00,//D 360x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x20,0x23,0x20,0x18,0x00,//E 370x08,0xF8,0x88,0x88,0xE8,0x08,0x10,0x00,0x20,0x3F,0x20,0x00,0x03,0x00,0x00,0x00,//F 380xC0,0x30,0x08,0x08,0x08,0x38,0x00,0x00,0x07,0x18,0x20,0x20,0x22,0x1E,0x02,0x00,//G 390x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x20,0x3F,0x21,0x01,0x01,0x21,0x3F,0x20,//H 400x00,0x08,0x08,0xF8,0x08,0x08,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//I 410x00,0x00,0x08,0x08,0xF8,0x08,0x08,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,0x00,//J 420x08,0xF8,0x88,0xC0,0x28,0x18,0x08,0x00,0x20,0x3F,0x20,0x01,0x26,0x38,0x20,0x00,//K 430x08,0xF8,0x08,0x00,0x00,0x00,0x00,0x00,0x20,0x3F,0x20,0x20,0x20,0x20,0x30,0x00,//L 440x08,0xF8,0xF8,0x00,0xF8,0xF8,0x08,0x00,0x20,0x3F,0x00,0x3F,0x00,0x3F,0x20,0x00,//M 450x08,0xF8,0x30,0xC0,0x00,0x08,0xF8,0x08,0x20,0x3F,0x20,0x00,0x07,0x18,0x3F,0x00,//N 460xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x10,0x20,0x20,0x20,0x10,0x0F,0x00,//O 470x08,0xF8,0x08,0x08,0x08,0x08,0xF0,0x00,0x20,0x3F,0x21,0x01,0x01,0x01,0x00,0x00,//P 480xE0,0x10,0x08,0x08,0x08,0x10,0xE0,0x00,0x0F,0x18,0x24,0x24,0x38,0x50,0x4F,0x00,//Q 490x08,0xF8,0x88,0x88,0x88,0x88,0x70,0x00,0x20,0x3F,0x20,0x00,0x03,0x0C,0x30,0x20,//R 500x00,0x70,0x88,0x08,0x08,0x08,0x38,0x00,0x00,0x38,0x20,0x21,0x21,0x22,0x1C,0x00,//S 510x18,0x08,0x08,0xF8,0x08,0x08,0x18,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//T 520x08,0xF8,0x08,0x00,0x00,0x08,0xF8,0x08,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//U 530x08,0x78,0x88,0x00,0x00,0xC8,0x38,0x08,0x00,0x00,0x07,0x38,0x0E,0x01,0x00,0x00,//V 540xF8,0x08,0x00,0xF8,0x00,0x08,0xF8,0x00,0x03,0x3C,0x07,0x00,0x07,0x3C,0x03,0x00,//W 550x08,0x18,0x68,0x80,0x80,0x68,0x18,0x08,0x20,0x30,0x2C,0x03,0x03,0x2C,0x30,0x20,//X 560x08,0x38,0xC8,0x00,0xC8,0x38,0x08,0x00,0x00,0x00,0x20,0x3F,0x20,0x00,0x00,0x00,//Y 570x10,0x08,0x08,0x08,0xC8,0x38,0x08,0x00,0x20,0x38,0x26,0x21,0x20,0x20,0x18,0x00,//Z 580x00,0x00,0x00,0xFE,0x02,0x02,0x02,0x00,0x00,0x00,0x00,0x7F,0x40,0x40,0x40,0x00,//[ 590x00,0x0C,0x30,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x06,0x38,0xC0,0x00,//\ 600x00,0x02,0x02,0x02,0xFE,0x00,0x00,0x00,0x00,0x40,0x40,0x40,0x7F,0x00,0x00,0x00,//] 610x00,0x00,0x04,0x02,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//^ 620x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x80,0x80,//_ 630x00,0x02,0x02,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//` 640x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x19,0x24,0x22,0x22,0x22,0x3F,0x20,//a 650x08,0xF8,0x00,0x80,0x80,0x00,0x00,0x00,0x00,0x3F,0x11,0x20,0x20,0x11,0x0E,0x00,//b 660x00,0x00,0x00,0x80,0x80,0x80,0x00,0x00,0x00,0x0E,0x11,0x20,0x20,0x20,0x11,0x00,//c 670x00,0x00,0x00,0x80,0x80,0x88,0xF8,0x00,0x00,0x0E,0x11,0x20,0x20,0x10,0x3F,0x20,//d 680x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x22,0x22,0x22,0x22,0x13,0x00,//e 690x00,0x80,0x80,0xF0,0x88,0x88,0x88,0x18,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//f 700x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x6B,0x94,0x94,0x94,0x93,0x60,0x00,//g 710x08,0xF8,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//h 720x00,0x80,0x98,0x98,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//i 730x00,0x00,0x00,0x80,0x98,0x98,0x00,0x00,0x00,0xC0,0x80,0x80,0x80,0x7F,0x00,0x00,//j 740x08,0xF8,0x00,0x00,0x80,0x80,0x80,0x00,0x20,0x3F,0x24,0x02,0x2D,0x30,0x20,0x00,//k 750x00,0x08,0x08,0xF8,0x00,0x00,0x00,0x00,0x00,0x20,0x20,0x3F,0x20,0x20,0x00,0x00,//l 760x80,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x20,0x3F,0x20,0x00,0x3F,0x20,0x00,0x3F,//m 770x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x3F,0x21,0x00,0x00,0x20,0x3F,0x20,//n 780x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x00,0x1F,0x20,0x20,0x20,0x20,0x1F,0x00,//o 790x80,0x80,0x00,0x80,0x80,0x00,0x00,0x00,0x80,0xFF,0xA1,0x20,0x20,0x11,0x0E,0x00,//p 800x00,0x00,0x00,0x80,0x80,0x80,0x80,0x00,0x00,0x0E,0x11,0x20,0x20,0xA0,0xFF,0x80,//q 810x80,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x20,0x20,0x3F,0x21,0x20,0x00,0x01,0x00,//r 820x00,0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x33,0x24,0x24,0x24,0x24,0x19,0x00,//s 830x00,0x80,0x80,0xE0,0x80,0x80,0x00,0x00,0x00,0x00,0x00,0x1F,0x20,0x20,0x00,0x00,//t 840x80,0x80,0x00,0x00,0x00,0x80,0x80,0x00,0x00,0x1F,0x20,0x20,0x20,0x10,0x3F,0x20,//u 850x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x00,0x01,0x0E,0x30,0x08,0x06,0x01,0x00,//v 860x80,0x80,0x00,0x80,0x00,0x80,0x80,0x80,0x0F,0x30,0x0C,0x03,0x0C,0x30,0x0F,0x00,//w 870x00,0x80,0x80,0x00,0x80,0x80,0x80,0x00,0x00,0x20,0x31,0x2E,0x0E,0x31,0x20,0x00,//x 880x80,0x80,0x80,0x00,0x00,0x80,0x80,0x80,0x80,0x81,0x8E,0x70,0x18,0x06,0x01,0x00,//y 890x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x21,0x30,0x2C,0x22,0x21,0x30,0x00,//z 900x00,0x00,0x00,0x00,0x80,0x7C,0x02,0x02,0x00,0x00,0x00,0x00,0x00,0x3F,0x40,0x40,//{ 910x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,//| 920x00,0x02,0x02,0x7C,0x80,0x00,0x00,0x00,0x00,0x40,0x40,0x3F,0x00,0x00,0x00,0x00,//} 930x00,0x06,0x01,0x01,0x02,0x02,0x04,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,//~ 94
};/******************************************************************************
* END OF C++ DECLARATION WRAPPER
******************************************************************************/#ifdef __cplusplus
}
#endif#endif /* __FONT_H */  

4.2 編寫測試函數

功能介紹:

1)讀取HS3003傳感器數據,包括溫度和濕度數據

2)轉換溫濕度數據為ASCLL

3)實時顯示溫濕度數據到OLED上

?1)數據轉換函數

2)顯示數據UI

3) 讀取溫濕度值,并顯示數據到UI

4.3 源代碼

#include "hal_data.h"
#include "bsp_pwm.h"
#include "bsp_led.h"
#include "bsp_key.h"
#include "bsp_uart.h"
#include "bsp_timer.h"
#include "lcd_drv.h"
#include "hs3003_drv.h"
#include "oled_drv.h"#define OFFSET                     20FSP_CPP_HEADER
void R_BSP_WarmStart(bsp_warm_start_event_t event);
FSP_CPP_FOOTERstatic hs300x_data stru_hs300x;void lcd_test( void )
{uint16_t color_list[6]= {BRRED, BLUE, MAGENTA, RED, YELLOW, GREEN};static int index = 0;LCD_Clear( color_list[index] );index++;R_BSP_SoftwareDelay( 1, BSP_DELAY_UNITS_SECONDS);if( index > 6 )index = 0;
}/*******************************************************************************************************************//*** main() is generated by the RA Configuration editor and is used to generate threads if an RTOS is used.  This function* is called by main() when no RTOS is used.**********************************************************************************************************************/
static void ui_convert( int32_t inputVal, uint8_t *dataBuff )
{uint8_t temp;dataBuff[0] = (uint8_t)(inputVal/1000 + 0x30);dataBuff[1] = (uint8_t)((inputVal%1000)/100 + 0x30);dataBuff[2] = '.';temp = (uint8_t)((inputVal%1000)%100);dataBuff[3] = temp/10 + 0x30 ;dataBuff[4] = temp%10 + 0x30;
}void ui_init( void )
{oled_Clear();oled_SetCharSize( FONT_12 );oled_PrintfString(OFFSET,2,(uint8_t*)"TM(C): ");oled_SetCharSize( FONT_12 );oled_PrintfString(OFFSET,6,(uint8_t*)"HM(%): ");
}void ui_displayTempHumidy( void )
{static uint32_t cnt = 0;uint8_t dataBuff[5];int32_t _outVal;hs300x_read_value( &stru_hs300x );if( (cnt %50) == 0 ) {// tempetureif(stru_hs300x.fetch_bit.mask == HS300X_DATA_VALID){   _outVal = (int32_t)(stru_hs300x.tempval*100);memset((char*)dataBuff, ' ', sizeof(dataBuff));ui_convert(_outVal, dataBuff);oled_SetCharSize( FONT_16 );oled_PrintmutiChar(50+OFFSET,2,(uint8_t*)dataBuff, sizeof(dataBuff));}// humidityif(stru_hs300x.fetch_bit.mask == HS300X_DATA_VALID){   _outVal = (int32_t)(stru_hs300x.humival*100);memset((char*)dataBuff, ' ', sizeof(dataBuff));ui_convert(_outVal, dataBuff);oled_SetCharSize( FONT_16 );oled_PrintmutiChar(50+OFFSET,6,(uint8_t*)dataBuff, sizeof(dataBuff));}}cnt++;
}void bsp_Init( void )
{LED1_OFF;LED2_OFF;LED3_OFF;
}void hal_entry(void)
{/* TODO: add your own code here */timer1_Init();GPT_PWM_Init();bsp_Init();r_sci_uart_basic_init();disp_init();hs300x_init();oled_Init();R_BSP_SoftwareDelay(5, BSP_DELAY_UNITS_SECONDS);ui_init();while(1){if( Key_Scan(KEY1_SW2_PIN) == KEY_ON )  {LED1_TOGGLE; }if( Key_Scan(KEY2_SW3_PIN) == KEY_ON ){LED2_TOGGLE; }ui_displayTempHumidy();}
#if BSP_TZ_SECURE_BUILD/* Enter non-secure code */R_BSP_NonSecureEnter();
#endif
}/*******************************************************************************************************************//*** This function is called at various points during the startup process.  This implementation uses the event that is* called right before main() to set up the pins.** @param[in]  event    Where at in the start up process the code is currently at**********************************************************************************************************************/
void R_BSP_WarmStart (bsp_warm_start_event_t event)
{if (BSP_WARM_START_RESET == event){
#if BSP_FEATURE_FLASH_LP_VERSION != 0/* Enable reading from data flash. */R_FACI_LP->DFLCTL = 1U;/* Would normally have to wait tDSTOP(6us) for data flash recovery. Placing the enable here, before clock and* C runtime initialization, should negate the need for a delay since the initialization will typically take more than 6us. */
#endif}if (BSP_WARM_START_POST_C == event){/* C runtime environment and system clocks are setup. *//* Configure pins. */R_IOPORT_Open(&g_ioport_ctrl, g_ioport.p_cfg);}
}#if BSP_TZ_SECURE_BUILDBSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable ();/* Trustzone Secure Projects require at least one nonsecure callable function in order to build (Remove this if it is not required to build). */
BSP_CMSE_NONSECURE_ENTRY void template_nonsecure_callable ()
{}
#endif

5 測試

編譯代碼,并下載到板卡中,UI顯示數據如下:

使用手接觸到傳感器,UI上的數據會有變化

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/37938.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/37938.shtml
英文地址,請注明出處:http://en.pswp.cn/web/37938.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

谷粒商城篇章10 -- P262-P291/P295-P310 -- 訂單服務(支付)【分布式高級篇七】

目錄 1 頁面環境搭建 1.1 靜態資源上傳到nginx 1.2 SwitchHosts增加配置 1.3 網關配置 1.4 訂單模塊基礎配置 1.4.1 引入 thymeleaf 依賴 1.4.2 application.yml配置 1.4.3 bootstrap.properties配置 1.4.4 開啟nacos注冊發現和遠程調用 1.5 修改各個頁面的靜態資源路…

windows電腦開發ios的p12證書申請流程

很多同學在做ios打包的時候&#xff0c;發現ios打包需要一個p12格式的證書和一個證書profile文件&#xff0c;那么ios開發就一定需要使用mac電腦來申請ios證書嗎&#xff1f;其實申請ios證書并不一定需要mac電腦&#xff0c;因為證書是一個通用的技術&#xff0c;使用普通的ssl…

Perl 語言開發(二):變量與數據類型

目錄 1. 變量的基本概念 1.1 標量變量 1.2 數組變量 1.3 哈希變量 2. 數據類型詳解 2.1 標量數據類型 2.1.1 數字 2.1.2 字符串 2.2 數組數據類型 2.2.1 數組操作 2.3 哈希數據類型 2.3.1 哈希操作 3. 變量的作用域與生存期 3.1 全局變量 3.2 局部變量 3.3 詞法…

JavaScript將參數傳遞給事件處理程序

本篇文件我們將實現導航欄中&#xff0c;選中時候&#xff0c;會將您選中的進行高亮顯示&#xff1b; ● 首先我們來獲取我們想要的HTML元素 const nav document.querySelector(.nav);● 接著我們來寫選中的高亮顯示 nav.addEventListener(mouseover, function (e) { //鼠…

主干網絡篇 | YOLOv5/v7 更換主干網絡之 ShuffleNetv2 | 高效CNN架構設計的實用指南

主干網絡篇 | YOLOv5/v7 更換主干網絡之 ShuffleNetv2 | 高效CNN架構設計的實用指南 1. 簡介 近年來&#xff0c;深度卷積神經網絡&#xff08;CNN&#xff09;在圖像識別、目標檢測等領域取得了巨大進展。然而&#xff0c;隨著模型復雜度的不斷提升&#xff0c;模型訓練和部…

申請一張含100個域名的證書-免費SSL證書

挑戰一下&#xff0c;申請一張包含100個域名的證書 首先&#xff0c;我們訪問來此加密網站&#xff0c;進入登錄頁面&#xff0c;輸入我的賬號密碼。 登錄后&#xff0c;咱們就可以開始申請證書&#xff0c;首先說一下&#xff0c;咱賬號是SVIP哦&#xff0c;只有SVIP才可以申…

記一次EasyExcel的錯誤使用導致的頻繁FullGC

記一次EasyExcel的錯誤使用導致的頻繁FullGC 一、背景描述二、場景復現三、原因分析四、解決方案五、思考復盤 一、背景描述 繁忙的校招結束了&#xff0c;美好的大學四年也結束了&#xff0c;作者也有10個月沒有更新了。拿到心儀的offer之后也開始了苦B的打工生活。 最近接到…

Python海量數據處理腳本大集合:pyWhat

pyWhat&#xff1a;精簡海聯數據&#xff0c;直達數據弱點要害- 精選真開源&#xff0c;釋放新價值。 概覽 pyWhat是Github社區上一款比較實用的開源Python腳本工具。它能夠快速提取信息中的 IP 地址、郵箱、信用卡、數字貨幣錢包地址、YouTube 視頻等內容。當你遇到了一串莫名…

【golang】go mod私有倉庫配置

文章目錄 Golang版本控制go mod使用私有倉庫(gitlab)依賴設置配置代碼托管站點Go mod尋找代碼倉庫原理使用代理實現代碼托管站點訪問 Golang版本控制 go version v1.22.0 當我們新建一個go項目時&#xff0c;在項目根目錄下執行go mod init可以初始化go.mod文件用于管理包依賴。…

Spring Data與多數據源配置

Spring Data與多數據源配置 大家好&#xff0c;我是免費搭建查券返利機器人省錢賺傭金就用微賺淘客系統3.0的小編&#xff0c;也是冬天不穿秋褲&#xff0c;天冷也要風度的程序猿&#xff01;今天我們來探討如何在Spring Data中配置和使用多個數據源。 在現代應用程序中&…

計算機相關術語科普之什么叫網關(Gateway)

網關&#xff08;Gateway&#xff09;是一個在計算機網絡中起到關鍵作用的設備或系統&#xff0c;它扮演著網絡間連接器或協議轉換器的角色。 一、定義與功能 1&#xff09;定義&#xff1a; 網關是在不同網絡之間實現互連的復雜設備&#xff0c;僅用于兩個高層協議不同的網…

【PYG】Planetoid中邊存儲的格式,為什么打印前十條邊用edge_index[:, :10]

edge_index 是 PyTorch Geometric 中常用的表示圖邊的張量。它通常是一個形狀為 [2, num_edges] 的二維張量&#xff0c;其中 num_edges 表示圖中邊的數量。每一列表示一條邊&#xff0c;包含兩個節點的索引。 實際上這是COO存儲格式&#xff0c;官方文檔里也有寫&#xff0c;…

Web 品質標準

Web 品質標準 引言 隨著互聯網的快速發展,Web應用已經滲透到我們生活的方方面面。為了確保Web應用的質量,提高用戶體驗,Web品質標準應運而生。這些標準涵蓋了多個方面,包括性能、安全性、可訪問性、用戶體驗等。本文將詳細介紹這些標準,并探討它們在實際開發中的應用。 …

上位機圖像處理和嵌入式模塊部署(mcu 項目1:固件編寫)

【 聲明&#xff1a;版權所有&#xff0c;歡迎轉載&#xff0c;請勿用于商業用途。 聯系信箱&#xff1a;feixiaoxing 163.com】 說完了上位機的開發&#xff0c;接下來就是固件的開發。前面我們說過&#xff0c;目前使用的開發板是極海apm32f103的開發板。它自身包含了iap示例…

一些迷你型信息系統

只有一個表&#xff0c;比較簡單易用&#xff1b; 1 博物館信息查詢系統 信息錄入&#xff0c;瀏覽&#xff0c;添加&#xff0c;更新&#xff0c;刪除&#xff1b; 下載&#xff0c; https://download.csdn.net/download/bcbobo21cn/89505217

中國網絡安全審查認證和市場監管大數據中心數據合規官CCRC-DCO

關于CCRC-DCO證書的頒發機構&#xff0c;它是由中國網絡安全審查認證與市場監管大數據中心&#xff08;簡稱CCRC&#xff09;負責。 該中心在2006年得到中央機構編制委員會辦公室的批準成立&#xff0c;隸屬于國家市場監督管理總局&#xff0c;是其直轄的事業單位。 依據《網絡…

計算機的錯誤計算(十八)

摘要 計算機的錯誤計算&#xff08;四&#xff09;指出一元二次方程的計算精度問題。本節給出其一種解決方案。 計算機的錯誤計算&#xff08;四&#xff09;與&#xff08;十七&#xff09;分別指出一元二次方程的求解是具有挑戰性的難題&#xff0c;其出錯原因是因為相減相消…

YOLOv10(7):YOLOv10訓練(以訓練VOC數據集為例)

YOLOv10&#xff08;1&#xff09;&#xff1a;初探&#xff0c;訓練自己的數據_yolov10 訓練-CSDN博客 YOLOv10&#xff08;2&#xff09;&#xff1a;網絡結構及其檢測模型代碼部分閱讀_yolov10網絡結構圖-CSDN博客 YOLOv10&#xff08;4&#xff09;&#xff1a;損失&…

汽車之家論壇評論全面采集實戰指南:Python爬蟲篇

聚焦汽車之家&#xff0c;解鎖評論寶藏 在這個數據為王的時代&#xff0c;每一個角落的信息都可能成為寶貴的洞察來源。汽車之家&#xff0c;作為汽車行業內的權威論壇&#xff0c;其海量的用戶評論不僅是消費者購車的重要參考&#xff0c;也是汽車品牌與市場研究者不可忽視的…

【Android面試八股文】在你之前的Android項目中,你是如何進行性能優化的?

在之前的Android項目中,優化和提升性能是一個重要且常見的任務。 以下是一些常用的性能優化方法和策略: 分析和測量: 使用Android Studio中的Profiling工具(如Profiler、Trace等)進行性能分析,識別CPU、內存和網絡使用情況。使用第三方工具(如Systrace)來分析系統層面…