当前位置: 首页 > news >正文

使用USI作为主SPI接口

代码;

lcd_drive.c

//*****************************************************************************
//
//  File........: LCD_driver.c
//
//  Author(s)...: ATMEL Norway
//
//  Target(s)...: ATmega169
//
//  Compiler....: AVR-GCC 3.3.1; avr-libc 1.0
//
//  Description.: Functions used to control the AVR Butterfly LCD
//
//  Revisions...: 1.0
//
//  YYYYMMDD - VER. - COMMENT                                       - SIGN.
//
//  20021015 - 1.0  - Written for STK502                            - JLL
//  20030116 - 2.0  - Code adapted to AVR Butterfly                 - KS
//  20031009          port to avr-gcc/avr-libc                      - M.Thomas
//
//*****************************************************************************#define REDUCED// Include files.
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <inttypes.h>
#include <avr/interrupt.h>
#include <avr/interrupt.h>// mt - for gButtonTimeout
// #include "button.h"#include "LCD_driver.h"#ifndef BOOL
#define BOOL    char
#define FALSE   0
#define TRUE    (!FALSE)
#endif// Variable from "button.c" to prevent button-bouncing
extern unsigned char gButtonTimeout;    volatile char gAutoPressJoystick = FALSE;// Used to indicate when the LCD interrupt handler should update the LCD
// mt jw char gLCD_Update_Required = FALSE;
volatile char gLCD_Update_Required = FALSE;// LCD display buffer (for double buffering).
volatile char LCD_Data[LCD_REGISTER_COUNT];// Buffer that contains the text to be displayed
// Note: Bit 7 indicates that this character is flashing
volatile char gTextBuffer[TEXTBUFFER_SIZE];// Only six letters can be shown on the LCD.
// With the gScroll and gScrollMode variables,
// one can select which part of the buffer to show
volatile signed char gScroll;
volatile char gScrollMode;Start-up delay before scrolling a string over the LCD
char gLCD_Start_Scroll_Timer = 0;// The gFlashTimer is used to determine the on/off
// timing of flashing characters
volatile char gFlashTimer = 0;// Turns on/off the colons on the LCD
char gColon = 0;// Look-up table used when converting ASCII to
// LCD display data (segment control)
// mt __flash unsigned int LCD_character_table[] =
unsigned int LCD_character_table[] PROGMEM =
{0x0A51,     // '*' (?)0x2A80,     // '+'0x0000,     // ',' (Not defined)0x0A00,     // '-'0x0A51,     // '.' Degree sign0x0000,     // '/' (Not defined)0x5559,     // '0'0x0118,     // '1'0x1e11,     // '20x1b11,     // '30x0b50,     // '40x1b41,     // '50x1f41,     // '60x0111,     // '70x1f51,     // '80x1b51,     // '9'0x0000,     // ':' (Not defined)0x0000,     // ';' (Not defined)0x0000,     // '<' (Not defined)0x0000,     // '=' (Not defined)0x0000,     // '>' (Not defined)0x0000,     // '?' (Not defined)0x0000,     // '@' (Not defined)0x0f51,     // 'A' (+ 'a')0x3991,     // 'B' (+ 'b')0x1441,     // 'C' (+ 'c')0x3191,     // 'D' (+ 'd')0x1e41,     // 'E' (+ 'e')0x0e41,     // 'F' (+ 'f')0x1d41,     // 'G' (+ 'g')0x0f50,     // 'H' (+ 'h')0x2080,     // 'I' (+ 'i')0x1510,     // 'J' (+ 'j')0x8648,     // 'K' (+ 'k')0x1440,     // 'L' (+ 'l')0x0578,     // 'M' (+ 'm')0x8570,     // 'N' (+ 'n')0x1551,     // 'O' (+ 'o')0x0e51,     // 'P' (+ 'p')0x9551,     // 'Q' (+ 'q')0x8e51,     // 'R' (+ 'r')0x9021,     // 'S' (+ 's')0x2081,     // 'T' (+ 't')0x1550,     // 'U' (+ 'u')0x4448,     // 'V' (+ 'v')0xc550,     // 'W' (+ 'w')0xc028,     // 'X' (+ 'x')0x2028,     // 'Y' (+ 'y')0x5009,     // 'Z' (+ 'z')0x0000,     // '[' (Not defined)0x0000,     // '\' (Not defined)0x0000,     // ']' (Not defined)0x0000,     // '^' (Not defined)0x0000      // '_'
};/*****************************************************************************
*
*   Function name : LCD_Init
*
*   Returns :       None
*
*   Parameters :    None
*
*   Purpose :       Initialize LCD_displayData buffer.
*                   Set up the LCD (timing, contrast, etc.)
*
*****************************************************************************/
void LCD_Init (void)
{LCD_AllSegments(FALSE);                     // Clear segment buffer.LCD_CONTRAST_LEVEL(LCD_INITIAL_CONTRAST);    //Set the LCD contrast level// Select asynchronous clock source, enable all COM pins and enable all// segment pins.LCDCRB = (1<<LCDCS) | (3<<LCDMUX0) | (7<<LCDPM0);// Set LCD prescaler to give a framerate of 32,0 HzLCDFRR = (0<<LCDPS0) | (7<<LCDCD0);    LCDCRA = (1<<LCDEN) | (1<<LCDAB);           // Enable LCD and set low power waveform//Enable LCD start of frame interruptLCDCRA |= (1<<LCDIE);gLCD_Update_Required = FALSE;}/*****************************************************************************
*
*   Function name : LCD_WriteDigit(char c, char digit)
*
*   Returns :       None
*
*   Parameters :    Inputs
*                   c: The symbol to be displayed in a LCD digit
*                   digit: In which digit (0-5) the symbol should be displayed
*                   Note: Digit 0 is the first used digit on the LCD,
*                   i.e LCD digit 2
*
*   Purpose :       Stores LCD control data in the LCD_displayData buffer.
*                   (The LCD_displayData is latched in the LCD_SOF interrupt.)
*
*****************************************************************************/
void LCD_WriteDigit(char c, char digit)
{unsigned int seg = 0x0000;                  // Holds the segment patternchar mask, nibble;volatile char *ptr;char i;if (digit > 5)                              // Skip if digit is illegalreturn;//Lookup character table for segmet dataif ((c >= '*') && (c <= 'z')){// c is a letterif (c >= 'a')                           // Convert to upper casec &= ~0x20;                         // if necessarryc -= '*';//mt seg = LCD_character_table[c];seg = (unsigned int) pgm_read_word(&LCD_character_table[(uint8_t)c]); }// Adjust mask according to LCD segment mappingif (digit & 0x01)mask = 0x0F;                // Digit 1, 3, 5elsemask = 0xF0;                // Digit 0, 2, 4ptr = LCD_Data + (digit >> 1);  // digit = {0,0,1,1,2,2}for (i = 0; i < 4; i++){nibble = seg & 0x000F;seg >>= 4;if (digit & 0x01)nibble <<= 4;*ptr = (*ptr & mask) | nibble;ptr += 5;}
}/*****************************************************************************
*
*   Function name : LCD_AllSegments(unsigned char input)
*
*   Returns :       None
*
*   Parameters :    show -  [TRUE;FALSE]
*
*   Purpose :       shows or hide all all LCD segments on the LCD
*
*****************************************************************************/
void LCD_AllSegments(char show)
{unsigned char i;if (show)show = 0xFF;// Set/clear all bits in all LCD registersfor (i=0; i < LCD_REGISTER_COUNT; i++)*(LCD_Data + i) = show;
}/*****************************************************************************
*
*   LCD Interrupt Routine
*
*   Returns :       None
*
*   Parameters :    None
*
*   Purpose: Latch the LCD_displayData and Set LCD_status.updateComplete
*
*****************************************************************************/SIGNAL(SIG_LCD)
{static char LCD_timer = LCD_TIMER_SEED;char c;char c_flash;char flash;char EOL;unsigned char i;#ifndef REDUCEDstatic char timeout_count;static char auto_joystick_count;
#endifc_flash=0; // mt#ifndef REDUCED
/**************** Button timeout for the button.c, START ****************/if(!gButtonTimeout){timeout_count++;if(timeout_count > 3){gButtonTimeout = TRUE;timeout_count = 0;}}/**************** Button timeout for the button.c, END ******************//**************** Auto press joystick for the main.c, START *************/if(gAutoPressJoystick == AUTO){auto_joystick_count++;if(auto_joystick_count > 16){gAutoPressJoystick = TRUE;auto_joystick_count = 15;}}elseauto_joystick_count = 0;/**************** Auto press joystick for the main.c, END ***************/    
#endifLCD_timer--;                    // Decreased every LCD frameif (gScrollMode){// If we are in scroll mode, and the timer has expired,// we will update the LCDif (LCD_timer == 0){if (gLCD_Start_Scroll_Timer == 0){gLCD_Update_Required = TRUE;}elsegLCD_Start_Scroll_Timer--;}}else    {   // if not scrolling,// disble LCD start of frame interrupt
//        cbi(LCDCRA, LCDIE);   //DEBUGgScroll = 0;}EOL = FALSE;if (gLCD_Update_Required == TRUE){// Duty cycle of flashing charactersif (gFlashTimer < (LCD_FLASH_SEED >> 1))flash = 0;elseflash = 1;// Repeat for the six LCD charactersfor (i = 0; i < 6; i++){if ((gScroll+i) >= 0 && (!EOL)){// We have some visible charactersc = gTextBuffer[i + gScroll];c_flash = c & 0x80 ? 1 : 0;c = c & 0x7F;if (c == '\0')EOL = i+1;      // End of character data}elsec = ' ';// Check if this character is flashingif (c_flash && flash)LCD_WriteDigit(' ', i);elseLCD_WriteDigit(c, i);}// Copy the segment buffer to the real segmentsfor (i = 0; i < LCD_REGISTER_COUNT; i++)*(pLCDREG + i) = *(LCD_Data+i);// Handle colonif (gColon)*(pLCDREG + 8) = 0x01;else*(pLCDREG + 8) = 0x00;// If the text scrolled off the display,// we have to start over again.if (EOL == 1)gScroll = -6;elsegScroll++;// No need to update anymoregLCD_Update_Required = FALSE;}// LCD_timer is used when scrolling textif (LCD_timer == 0){
/*        if ((gScroll <= 0) || EOL)LCD_timer = LCD_TIMER_SEED/2;else*/LCD_timer = LCD_TIMER_SEED;}// gFlashTimer is used when flashing charactersif (gFlashTimer == LCD_FLASH_SEED)gFlashTimer= 0;elsegFlashTimer++;}

lcd_functions.c

//*****************************************************************************
//
//  File........: LCD_functions.c
//
//  Author(s)...: ATMEL Norway
//
//  Target(s)...: ATmega169
//
//  Compiler....: AVR-GCC 3.3.1; avr-libc 1.0
//
//  Description.: Additional LCD functions, scrolling text and write data
//
//  Revisions...: 1.0
//
//  YYYYMMDD - VER. - COMMENT                                       - SIGN.
//
//  20021015 - 1.0  - Created                                       - LHM
//  20030116 - 2.0  - Code adapted to AVR Butterflyup               - KS
//  20031009          port to avr-gcc/avr-libc                      - M.Thomas
//
//*****************************************************************************#define REDUCED//  Include files
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <inttypes.h>
#include "LCD_driver.h"
#include "LCD_functions.h"#ifndef REDUCED
#include "BCD.h"
// mt only for KEY_* and ST_OPTIONS_DISPLAY* definitions:
#include "main.h"
#endif#define FALSE   0
#define TRUE    (!FALSE)// mt char CONTRAST = LCD_INITIAL_CONTRAST;
uint8_t CONTRAST = LCD_INITIAL_CONTRAST;// Start-up delay before scrolling a string over the LCD. "LCD_driver.c"
extern char gLCD_Start_Scroll_Timer;/****************************************************************************
*
*	Function name : LCD_puts_f
*
*	Returns :		None
*
*	Parameters :	pFlashStr: Pointer to the string in flash
*                   scrollmode: Not in use
*
*	Purpose :		Writes a string stored in flash to the LCD
*
*****************************************************************************/// mt void LCD_puts_f(char __flash *pFlashStr, char scrollmode)
void LCD_puts_f(const char *pFlashStr, char scrollmode)
{// char i;uint8_t i;while (gLCD_Update_Required);      // Wait for access to buffer// mt: for (i = 0; pFlashStr[i] && i < TEXTBUFFER_SIZE; i++)for (i = 0; (const char)(pgm_read_byte(&pFlashStr[i])) && i < TEXTBUFFER_SIZE; i++){// mt: gTextBuffer[i] = pFlashStr[i];gTextBuffer[i] = pgm_read_byte(&pFlashStr[i]);}gTextBuffer[i] = '\0';if (i > 6){gScrollMode = 1;        // Scroll if text is longer than display sizegScroll = 0;gLCD_Start_Scroll_Timer = 3;    //Start-up delay before scrolling the text}else{gScrollMode = 0;        gScroll = 0;}gLCD_Update_Required = 1;
}/****************************************************************************
*
*	Function name : LCD_puts
*
*	Returns :		None
*
*	Parameters :	pStr: Pointer to the string
*                   scrollmode: Not in use
*
*	Purpose :		Writes a string to the LCD
*
*****************************************************************************/
void LCD_puts(char *pStr, char scrollmode)
{uint8_t i; // char i;while (gLCD_Update_Required);      // Wait for access to bufferfor (i = 0; pStr[i] && i < TEXTBUFFER_SIZE; i++){gTextBuffer[i] = pStr[i];}gTextBuffer[i] = '\0';if (i > 6){gScrollMode = 1;        // Scroll if text is longer than display sizegScroll = 0;gLCD_Start_Scroll_Timer = 3;    //Start-up delay before scrolling the text}else{gScrollMode = 0;        gScroll = 0;}gLCD_Update_Required = 1;
}/****************************************************************************
*
*	Function name : LCD_putc
*
*	Returns :		None
*
*	Parameters :	digit: Which digit to write on the LCD
*                   character: Character to write
*
*	Purpose :		Writes a character to the LCD
*
*****************************************************************************/
// mt void LCD_putc(char digit, char character)
void LCD_putc(uint8_t digit, char character)
{if (digit < TEXTBUFFER_SIZE)gTextBuffer[digit] = character;
}/****************************************************************************
*
*	Function name : LCD_Clear
*
*	Returns :		None
*
*	Parameters :	None
*
*	Purpose :		Clear the LCD
*
*****************************************************************************/
void LCD_Clear(void)
{uint8_t i; // char i;for (i=0; i<TEXTBUFFER_SIZE; i++)gTextBuffer[i] = ' ';
}/****************************************************************************
*
*	Function name : LCD_Colon
*
*	Returns :		None
*
*	Parameters :	show: Enables the colon if TRUE, disable if FALSE
*
*	Purpose :		Enable/disable colons on the LCD
*
*****************************************************************************/
void LCD_Colon(char show)
{gColon = show;
}/****************************************************************************
*
*	Function name : LCD_UpdateRequired
*
*	Returns :		None
*
*	Parameters :	update: TRUE/FALSE
*                   scrollmode: not in use
*
*	Purpose :		Tells the LCD that there is new data to be presented
*
*****************************************************************************/
void LCD_UpdateRequired(char update, char scrollmode)
{while (gLCD_Update_Required);gScrollMode = scrollmode;gScroll = 0;gLCD_Update_Required = update;
}/****************************************************************************
*
*	Function name : LCD_FlashReset
*
*	Returns :		None
*
*	Parameters :	None
*
*	Purpose :		This function resets the blinking cycle of a flashing digit
*
*****************************************************************************/
void LCD_FlashReset(void)
{gFlashTimer = 0;
}#ifndef REDUCED/****************************************************************************
*
*	Function name : SetContrast
*
*   Returns :       char ST_state (to the state-machine)
*
*   Parameters :    char input (from joystick)
*
*	Purpose :		Adjust the LCD contrast
*
*****************************************************************************/
char SetContrast(char input)
{static char enter = 1;char CH, CL;if (enter){LCD_Clear();enter = 0;}CH = CHAR2BCD2(CONTRAST);CL = (CH & 0x0F) + '0';CH = (CH >> 4) + '0';LCD_putc(0, 'C');LCD_putc(1, 'T');LCD_putc(2, 'R');LCD_putc(3, ' ');LCD_putc(4, CH);LCD_putc(5, CL);LCD_UpdateRequired(TRUE, 0);if (input == KEY_PLUS)CONTRAST++;else if (input == KEY_MINUS)CONTRAST--;if (CONTRAST == 255)CONTRAST = 0;if (CONTRAST > 15)CONTRAST = 15;LCD_CONTRAST_LEVEL(CONTRAST);if (input == KEY_ENTER){enter = 1;return ST_OPTIONS_DISPLAY_CONTRAST;}return ST_OPTIONS_DISPLAY_CONTRAST_FUNC;
}#endif
// REDUCED

mian.c

/*《AVR专题精选》随书例程3.通信接口使用技巧项目:使用USI作为主SPI接口文件:main.c说明:主程序文件. 在AVR Bufferfly上演示USI做主SPI接口用法控制EEPROM 25AA010按键: 上  数据加下  数据减左  读取数据右  写数据中  随机数据作者:邵子扬时间:2012年12月15日*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <inttypes.h>
#include <stdio.h>// 系统时钟频率
#define F_CPU 1000000UL#include <util/delay.h>#include "LCD_functions.h"
#include "LCD_driver.h"#include "macromcu.h"// 定义端口
#define SS   B, 0
#define SCK  E, 4
#define MOSI E, 6
#define MISO E, 5// SPI初始化
void SPI_init()
{PINSET(SS);USIDR = 0;USISR = (1<<USIOIF);USICR = (1<<USIWM0)|(1<<USICLK)|(1<<USICLK);
}// SPI读写函数
unsigned char SPI_WR(unsigned char dat)
{unsigned char i;USIDR = dat; // 数据放入USI数据寄存器for(i = 0; i < 8; i++)  // 软件方式驱动时钟信号{USICR = (1<<USIWM0)|(1<<USITC);USICR = (1<<USIWM0)|(1<<USITC)|(1<<USICLK);}return USIDR; // 返回数据
}// 按键掩码
#define PINB_MASK ((1<<PINB4)|(1<<PINB6)|(1<<PINB7))
#define PINE_MASK ((1<<PINE2)|(1<<PINE3))// 读取按键状态
unsigned char getkey()
{unsigned char t;t = (~PINB) & PINB_MASK;t |= (~PINE) & PINE_MASK;return t;
}unsigned char dat = 0, cnt;
char s[] = "    00";// HEX数据转换为字符
unsigned char hexchr(unsigned char dat)
{if(dat > 15)return '0';if(dat < 10)return dat + '0';elsereturn dat - 10 + 'A';
}// HEX数据转换字符串
void hexbuf(unsigned char dat, char *buf)
{buf[0] = hexchr(dat/16);buf[1] = hexchr(dat%16);
}// 从EEPROM地址0读取一个字节
unsigned char ReadByte()
{unsigned char t;PINCLR(SS);    // 片选信号SPI_WR(0x03);  // 发读命令SPI_WR(0x00);  // 地址高位SPI_WR(0x00);  // 地址低位t = SPI_WR(0); // 数据PINSET(SS);    // 禁止片选return t;
}// 写入一个字节到EEPROM地址0
void WriteByte(unsigned char dat)
{PINCLR(SS);    // 使能片选SPI_WR(0x02);  // 发送写命令SPI_WR(0x00);  // 地址高位SPI_WR(0x00);  // 地址低位SPI_WR(dat);   // 数据PINSET(SS);    // 禁止片选
}// 允许写入EEPROM
void WREN(void)
{PINCLR(SS);    // 片选SPI_WR(0x06);  // 发送wren命令PINSET(SS);  
}// 主程序
int main()
{// IO 初始化PINDIR(SS,   PIN_OUTPUT);PINDIR(SCK,  PIN_OUTPUT);PINDIR(MOSI, PIN_OUTPUT);PINDIR(MISO, PIN_OUTPUT);PORTB |= PINB_MASK;PORTE |= PINE_MASK;// SPI初始化SPI_init(0, 0);// AVR Butterfly LCD初始化LCD_Init();// 开中断sei();// 显示地址和数据hexbuf(dat, s+4);LCD_puts(s, 0);while(1){_delay_ms(200);  // 延时cnt++;if(getkey())     // 读取按键{switch(getkey()){case 0x40://updat++;     // 数据递增s[0] = ' ';break;case 0x80://dndat--;     // 数据递减s[0] = ' ';break;case 0x04://lefts[0] = 'R';  // 左键代表读取数据dat = ReadByte();break;case 0x08://rights[0] = 'W';  // 右键写入数据WREN();WriteByte(dat);break;case 0x10://enter//dat = ReadStatus();//hexbuf(dat, s+2);dat = cnt;    // 回车键随机设置数据break;}hexbuf(dat, s+4);LCD_puts(s, 0);}}return 0;
}

仿真效果图:

相关文章:

使用USI作为主SPI接口

代码; lcd_drive.c //***************************************************************************** // // File........: LCD_driver.c // // Author(s)...: ATMEL Norway // // Target(s)...: ATmega169 // // Compiler....: AVR-GCC 3.3.1; avr-libc 1.0 // // D…...

AI播客下载:Eye on AI(AI深度洞察)

"Eye on A.I." 是一档双周播客节目&#xff0c;由长期担任《纽约时报》记者的 Craig S. Smith 主持。在每一集中&#xff0c;Craig 都会与在人工智能领域产生影响的人们交谈。该播客的目的是将渐进的进步置于更广阔的背景中&#xff0c;并考虑发展中的技术的全球影响…...

Flink 窗口触发器

参考&#xff1a; NoteWarehouse/05_BigData/09_Flink(1).md at main FGL12321/NoteWarehouse GitHub Flink系列 9. 介绍 Flink 窗口触发器、移除器和延迟数据等 | hnbian https://github.com/kinoxyz1/bigdata-learning-notes/blob/master/note/flink/Window%26%E6%97%B6…...

Java面试题:解释线程间如何通过wait、notify和notifyAll方法进行通信

在 Java 中&#xff0c;线程间的通信可以通过 wait()、notify() 和 notifyAll() 这三个方法实现。这些方法是 Java 线程 Thread 类的一部分&#xff0c;它们与 synchronized 关键字一起使用&#xff0c;以实现线程间的协调。 基本概念 wait()&#xff1a;当一个线程执行到 wa…...

【机器学习 复习】第9章 降维算法——PCA降维

一、概念 1.PCA &#xff08;1&#xff09;主成分分析&#xff08;Principal ComponentAnalysis&#xff0c;PCA&#xff09;一种经典的线性降维分析算法。 &#xff08;2&#xff09;原理&#xff0c;这里以二维转一维为例&#xff0c;原来的平面变成了一条直线 这是三维变二…...

Ubuntu系统docker gpu环境搭建

Ubuntu系统dockergpu环境搭建 安装步骤前置安装安装指定版本的依赖包用docker官方脚本安装Docker-ce添加稳定仓库和GPG秘钥更新源 安装docker安装nvidia-docker2重启docker服务阿里云镜像加速 相关命令网络 docker常用命令镜像容器 docker相关问题解决方案使用wsl时docker的容器…...

网络安全-如何设计一个安全的API(安全角度)

目录 API安全概述设计一个安全的API一个基本的API主要代码调用API的一些问题 BasicAuth认证流程主要代码问题 API Key流程主要代码问题 Bearer auth/Token auth流程 Digest Auth流程主要代码问题 JWT Token流程代码问题 Hmac流程主要代码问题 OAuth比较自定义请求签名身份认证&…...

微积分-导数1(导数与变化率)

切线 要求与曲线 C C C相切于 P ( a , f ( a ) ) P(a, f(a)) P(a,f(a))点的切线&#xff0c;我们可以在曲线上找到与之相近的一点 Q ( x , f ( x ) ) Q(x, f(x)) Q(x,f(x))&#xff0c;然后求出割线 P Q PQ PQ的斜率&#xff1a; m P Q f ( x ) − f ( a ) x − a m_{PQ} \…...

最新PHP仿猪八戒任务威客网整站源码/在线接任务网站源码

资源介绍 老规矩&#xff0c;截图为亲测&#xff0c;前后台显示正常&#xff0c;细节功能未测&#xff0c;有兴趣的自己下载。 PHP仿猪八戒整站源码下载&#xff0c;phpmysql环境。威客开源建站系统&#xff0c;其主要交易对象是以用户为主的技能、经验、时间和智慧型商品。经…...

Windows安装配置jdk和maven

他妈的远程连接不上公司电脑&#xff0c;只能在家重新配置一遍&#xff0c;在此记录一下后端环境全部配置 Windows安装配置JDK 1.8一、下载 JDK 1.8二、配置环境变量三、验证安装 Windows安装配置Maven 3.8.8一、下载安装 Maven并配置环境变量二、设置仓库镜像及本地仓库三、测…...

电子SOP实施(MQTT协议)

架构图 服务与程序 用docker启动mqtt broker(服务器) 访问&#xff1a;http://192.168.88.173:18083/#/dashboard/overview 用户名&#xff1a;admin 密码&#xff1a;*** 消息发布者(查找sop的url地址&#xff0c;发布出去) 修改url&#xff0c;重新发布消息 import ran…...

【Unity导航系统】Navigation组件的概念及其使用示例

Unity中的NavMeshObstacle组件是一个用于动态障碍物的组件&#xff0c;它可以实时地影响导航网格&#xff08;NavMesh&#xff09;。当游戏对象附加了NavMeshObstacle组件时&#xff0c;它可以在AI进行路径规划时被识别为障碍物&#xff0c;从而让AI避开这些动态变化的障碍。 …...

vue-cli 根据文字生成pdf格式文件 jsPDF

1.安装jspdf npm install jspdf --save 2.下载ttf格式文件 也可以用C:\Windows\Fonts下的字体文件&#xff0c;反正调一个需要的ttf字体文件就行&#xff0c;但有的字体存在部分字体乱码现象 微软雅黑ttf下载地址&#xff1a; FontsMarket.com - Download Microsoft YaHei …...

【嵌入式DIY实例】-Nokia 5110显示DS3231 RTC数据

Nokia 5110显示DS3231 RTC数据 文章目录 Nokia 5110显示DS3231 RTC数据1、硬件准备与接线2、代码实现本文将介绍如何使用 ESP8266 NodeMCU 板和 DS3231 RTC 模块制作一个简单的数字实时时钟,其中可以使用连接到 NodeMCU 的两个按钮设置时间和日期,并将它们打印在诺基亚 5110 …...

【十三】图解mybatis缓存模块之装饰器模式

图解mybatis缓存模块之装饰器模式 简介 之前有写过一篇博客介绍过mybatis的缓存模块设计【九】mybatis 缓存模块设计-CSDN博客 &#xff0c;当时着重讲解的是mybatis种一级缓存和二级缓存&#xff0c;本次博客补充讲解一下装饰器模式的应用&#xff0c;本篇主要分两部分讲解&a…...

字节大神强推千页PDF学习笔记,弱化学历问题,已拿意向书字节提前批移动端!

主要问java&#xff0c;以及虚拟机&#xff0c;问了一点android 1.实习项目有关的介绍以及问题回答 2.反射与代理的区别&#xff0c;动态代理&#xff0c;静态代理&#xff0c;二者的区别&#xff0c;以及代理模式的UML图 3.字节码技术 4.虚拟机的双亲委派&#xff0c;以及好…...

Python爬虫-贝壳二手房“改进版”

前言 本文是该专栏的第31篇,后面会持续分享python爬虫干货知识,记得关注。 在本专栏之前的文章《Python爬虫-贝壳二手房》中,笔者有详细介绍,基于python爬虫采集对应城市的二手房数据。 而在本文,笔者将基于该项目案例的基础上,进行一个项目代码的“改进版”。 具体实…...

zookeeper学习、配置文件参数详解

zookeeper学习、配置文件参数详解 zookeeper 配置文件参数详解tickTime 、session 的过期时间、maxSessionTimeout 三者之间的关系initLimit&#xff0c;syncLimit什么区别minSessionTimeout 默认值,**他的单位是ms** zookeeper 配置文件参数详解 ZooKeeper 是一个分布式协调服…...

SVG 模糊效果

SVG 模糊效果 SVG(Scalable Vector Graphics,可缩放矢量图形)是一种基于XML的图像格式,用于描述二维图形。它是一种矢量图形格式,因此可以无限放大而不失真。SVG广泛应用于网页设计、动画制作和图形编辑等领域。本文将介绍SVG中一种特殊的效果——模糊效果,以及如何使用…...

Electron+vite+vuetify项目搭建

最近想用Electron来进行跨平台的桌面应用开发。同时想用vuetify作为组件&#xff0c;于是想搭建一个这样的开发环境。其中踩了不少坑&#xff0c;总是会出现各种的编译错误和问题&#xff0c;依赖的各种问题&#xff0c;搞了好久最终环境终于弄好可正常开发了。这里分享下快速搭…...

洛谷:P1085 [NOIP2004 普及组] 不高兴的津津

1. 题目链接 https://www.luogu.com.cn/problem/P1085 P1085 [NOIP2004 普及组] 不高兴的津津 2. 题目描述 题目描述&#xff1a;津津每天要上课还要上辅导班&#xff0c;每天学习超过8小时就不开心&#xff0c;帮忙检查下津津的下周日程安排&#xff0c;然后告诉我她哪天不高…...

Webpack4从入门到精通以及和webpack5对比_webpack现在用的是哪个版本

3.1 打包样式资源css-loader、style-loader… {// 匹配哪些文件test: /\.less$/,// 使用哪些loader进行处理use: [// use数组中loader执行顺序&#xff1a;从右到左&#xff0c;从下到上&#xff0c;依次执行(先执行css-loader)// style-loader&#xff1a;创建style标签&#…...

巴鲁夫MacroBuilder2.0.0.0软件巴鲁夫和使用手侧

巴鲁夫MacroBuilder2.0.0.0软件巴鲁夫和使用手侧...

分享:Javascript开源桌面环境-Puter

Puter这是一个运行在浏览器里的桌面操作系统&#xff0c;提供了笔记本、代码编辑器、终端、画图、相机、录音等应用和一些小游戏。该项目作者出于性能方面的考虑没有选择 Vue 和 React 技术栈&#xff0c;而是采用的 JavaScript 和 jQuery 构建&#xff0c;支持 Docker 一键部署…...

【idea-jdk1.8】使用Spring Initializr 创建 Spring Boot项目没有JDK8

信息差真可怕&#xff01; 很久没创建springboot项目&#xff0c;今天使用idea的Spring Initializr 创建 Spring Boot项目时&#xff0c;发现java版本里&#xff0c;无法选择jdk1.8&#xff0c;只有17、21、22&#xff1b;前段时间也听说过&#xff0c;springboot将放弃java8&a…...

647. 回文子串(leetcode)

647. 回文子串&#xff08;leetcode&#xff09; 题目描述 给你一个字符串 s &#xff0c;请你统计并返回这个字符串中回文子串的数目。 回文字符串 是正着读和倒过来读一样的字符串。 子字符串 是字符串中的由连续字符组成的一个序列。 示例1 输入&#xff1a;s “abc” 输出…...

【车载开发系列】汽车嵌入式开发常用工具介绍

【车载开发系列】汽车嵌入式开发常用工具介绍 【车载开发系列】汽车嵌入式开发常用工具介绍 【车载开发系列】汽车嵌入式开发常用工具介绍一. ChipON IDE For KungFu32二. ChipON PRO KF32三. GIT四. JLink五. S32DS六. parasoft ctest七. TCANLINPro八. vector Canoe 一. Chip…...

python脚本获取本机IP的方式

#方法一&#xff1a; #!/usr/bin/python import socket import fcntl import struct def get_ip_address(ifname): s socket.socket(socket.AF_INET,socket.SOCK_DGRAM) return socket.inet_ntoa(fcntl.ioctl( s.fileno(), 0x8915, struct.pack(256s,ifna…...

查看LabVIEW及各个模块和驱动的版本号

要方便地查看当前计算机上安装的LabVIEW版本以及各个模块和驱动的版本号&#xff0c;可以使用以下几种方法&#xff1a; 1. 使用NI MAX (Measurement & Automation Explorer) NI MAX 是一个强大的工具&#xff0c;可以帮助你管理National Instruments硬件、软件和驱动程序…...

LLM主流架构和模型

本文参考自https://github.com/HqWu-HITCS/Awesome-Chinese-LLM?tabreadme-ov-file和Huggingface中的ModelCard&#xff08;https://huggingface.co/&#xff09; LLM主要类别架构 LLM本身基于transformer架构。自2017年&#xff0c;attention is all you need诞生起&#x…...

为企业提供动力:用于大型组织的WordPress

可扩展且灵活的架构可通过主题、插件和集成进行定制内置 SEO 功能和营销功能内容管理和协作工具支持多站点安装托管解决方案和面向平台的提供商采用现代前端技术的 Headless CMS 功能 拥有强大、灵活且可扩展的内容管理系统 (CMS) 对于大型组织至关重要。作为最受欢迎和广泛使用…...

Django框架数据库ORM查询操作

Django框架在生成数据库的models模型文件后&#xff0c;旧可以在应用中通过ORM来操作数据库了。今天抽空试了下查询语句。以下是常用的查询语句。 以下查询需要引入django的Sum&#xff0c;Count&#xff0c;Q模块 from django.db.models import Sum,Count,Q 导入生成的mode…...

font-spider按需生成字体文件

font-spider可以全局安装,也可以单个项目内安装,使用npm run xxxx的形式 npm i font-spider "dev": "font-spider ./*.html" <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name&…...

双叒叕-一个-Android-MVVM-组件化架构框架?

LifecycleViewModelLiveDataViewBindingAndroid KTXOkHttp:网络请求Retrofit:网络请求MMKV:腾讯基于 mmap 内存映射的 key-value 本地存储组件Glide:快速高效的Android图片加载库ARoute:阿里用于帮助 Android App 进行组件化改造的框架 —— 支持模块间的路由、通信、解耦BaseR…...

STM32单片机BKP备份寄存器和RTC实时时钟详解

文章目录 1. Unix时间戳 2. UTC/GMT 3. 时间戳转换 4. BKP简介 5. BKP基本结构 6. RTC简介 7. RTC框架图 8. RTC基本结构 9. 代码示例 1. Unix时间戳 实时时钟&#xff0c;本质上是一个定时器&#xff0c;专门用来产生年月日时分秒。 Unix 时间戳&#xff08;Unix T…...

vue3+ts 使用vue3-ace-editor实现Json编辑器

1、效果图 输入代码&#xff0c;点击格式化就出现以上效果&#xff0c;再点击压缩&#xff0c;是以下效果2、安装 npm i vue3-ace-editor 3、使用 新建aceConfig.js文件 // ace配置&#xff0c;使用动态加载来避免第一次加载开销 import ace from ace-builds// 导入不同的主…...

黑马HarmonyOS-NEXT星河版实战

"黑马HarmonyOS-NEXT星河版实战"课程旨在帮助学员深入了解HarmonyOS-NEXT星河版操作系统的开发和实际应用。学员将学习操作系统原理、应用开发技巧和界面设计&#xff0c;通过实战项目提升技能。课程注重实践与理论相结合&#xff0c;为学员提供全面的HarmonyOS开发经…...

PCL 三次样条插值(二维点)

一、简介 在插值计算中,最简单的分段多项式近似应该是分段线性插值,它由连接一组数据点组成,仅仅只需要将这些点一一用直线进行顺序相连即可。不过线性函数插值的缺点也很明显,就是在两个子区间变化的比较突兀,也就是没有可微性(不够光滑)。因此我们需要更为符合物理情况…...

HTTP/3 协议学习

前一篇&#xff1a; HTTP/2 协议学习-CSDN博客 HTTP/3 协议介绍 HTTP/3 是互联网上用于传输超文本的协议 HTTP 的第三个主要版本。它是 HTTP/2 的后继者&#xff0c;旨在进一步提高网络性能和安全性。HTTP/3 与前两个版本的主要区别在于它使用了一个完全不同的底层传输协议—…...

数据库-数据定义和操纵-DML语言的使用

为表的所有字段插入数据&#xff1a; INSERT INTO 表名 (字段名) VALUES (内容); 更新表中指定的内容: update语句三要素&#xff1a; 需要更新的表&#xff08;table&#xff09;名&#xff1b; 需要更新的字段&#xff08;column&#xff09;名和它的新内容&#xff08;valu…...

BeanUtils.populate()的用法总结

BeanUtils.populate()的用法总结 大家好&#xff0c;我是免费搭建查券返利机器人省钱赚佣金就用微赚淘客系统3.0的小编&#xff0c;也是冬天不穿秋裤&#xff0c;天冷也要风度的程序猿&#xff01; 在Java中&#xff0c;BeanUtils.populate()是Apache Commons BeanUtils库提供…...

IDEA 学习之 热加载问题(Hot Swap)

目录 1. IDEA 自带热加载1.1. 热加载快捷键1.2. 热加载范围 1. IDEA 自带热加载 1.1. 热加载快捷键 系统快捷键WINCtrl F9MACOPTIOIN F9 1.2. 热加载范围 资源类型是否影响影响范围Java部分方法签名内...

计算机组成原理----指令系统课后习题

对应的知识点&#xff1a; 指令系统 扩展操作码的计算&#xff1a; 公式&#xff1a; 对扩展操作码而言&#xff0c;若地址长度为n&#xff0c;上一层留出m种状态&#xff0c;下一层可扩展出 mx2^n 种状态 1.设计某指令系统时&#xff0c;假设采用 16 位定长指令字格式&#…...

yolov8环境搭建+训练自己数据集

一、yolov8环境搭建 1. 安装miniconda环境 地址&#xff1a;https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda 选择Python3.8版本 最好安装在C盘 勾选自动添加环境变量 ***以下操作安装过程中关闭代理软件 *** 2. 创建虚拟环境 conda create -n yolov8 python3…...

Eureka 学习笔记(1)

一 、contextInitialized() eureka-core里面&#xff0c;监听器的执行初始化的方法&#xff0c;是contextInitialized()方法&#xff0c;这个方法就是整个eureka-server启动初始化的一个入口。 Overridepublic void contextInitialized(ServletContextEvent event) {try {init…...

视觉新纪元:解码LED显示屏的视角、可视角、最佳视角的最终奥秘

在璀璨夺目的LED显示屏世界里&#xff0c;每一个绚烂画面的背后&#xff0c;都离不开三个关键概念&#xff1a;视角、可视角与最佳视角。这些术语不仅是衡量显示效果的重要标尺&#xff0c;也是连接观众与精彩内容的桥梁。让我们一起走进这场视觉盛宴&#xff0c;探索那些让LED…...

Benchmarking Panoptic Scene Graph Generation (PSG), ECCV‘22 场景图生成,利用PSG数据集

2080-ti显卡复现 源代码地址 Jingkang50/OpenPSG: Benchmarking Panoptic Scene Graph Generation (PSG), ECCV22 (github.com) 安装 pytorch 1.7版本 cuda10.1 按照readme的做法安装 我安装的过程如下图所示,这个截图是到了pip install openmim这一步 下一步 下一步 这一步…...

Linux 文件权限

优质博文&#xff1a;IT-BLOG-CN 一、使用者与群组的概念 【1】在Linux里面&#xff0c;任何一个文件都具有[User,Group及Other]三种身份的个别权限&#xff1a;不过需要注意的是root用户&#xff0c;具有所有权限。 ✔ User(文件拥有者)&#xff1a;只有文件拥有者&#xf…...

IOS Swift 从入门到精通:算术运算,运算符重载,符合赋值运算,比较运算,条件,结合条件,三元运算,Swift语句,范围运算

目录 算术运算符 运算符重载 复合赋值运算符 比较运算符 条件 结合条件 三元运算符 Switch 语句 范围运算符 总结 算术运算符 现在您已经了解了 Swift 中的所有基本类型&#xff0c;我们可以开始使用运算符将它们组合在一起。运算符是那些像和 这样的小数学符号-&…...

Flutter开发环境搭建和调试

[你的Flutter文件夹路径]\flutter\bin 这样我们的Flutter SDK的环境变量就配置完毕了。接下来在命令提示符窗口中输入命令&#xff1a; flutter doctor 它可以帮助我们检查Flutter环境变量是否设置成功&#xff0c;Android SDK是否下载以及配置好环境变量等等。如果有相关的…...