RK3568平台 LT9211转接芯片调试笔记

news2024/11/14 21:39:06

一.简介

龙讯LT9211是一个高性能转换器,支持MIPI LVDS TTL两两之间转换。

使用此款芯片大部分为MIPI与LVDS进行互相转换。

下图为LT9211的典型应用图:

二.LT9211原理图

三.车载显示器和摄像头系统

四.调试LT9211输出 MIPI数据

(1)insmod加载ko文件后,ls /dev 查看是否生成新的video节点。

->如果没有生成video节点,查看ko是否加载失败,dts配置是否正确。

(2)查看设备是否成功挂载在IIC上

->i2cdetect -r -y 5 (lt9211在iic1上地址为ox2b)。

(3)查看LT9211_ChipID寄存器值


void LT9211_ChipID(void)
{
    lt8918_write_reg(0xff,0x81);//register bank
    pr_info("\r\nLT9211 Chip ID:%x,",lt8918_read_reg(0x00));//18
    pr_info("%x, ",lt8918_read_reg(0x01));//1
    pr_info("%x, ",lt8918_read_reg(0x02));//e4
}

(4)检查LT9211打印log

hfp,hbp,hsync,vfp,vbp,vysnc输出正确。

(5)测量mipi信号

MIPI data :1.8V的方波。

图像数据在soc mipi接收过程是需要检测到各个lane的LP11-LP10-LP00的一个状态切换后才会切换

到高速模式准备接收。

(6)确认mipi lane数与硬件连接的是否一致。

五.LT9211MCU程序

/******************************************************************************
  * @project: LT9211
  * @file: lt9211.c
  * @author: zll
  * @company: LONTIUM COPYRIGHT and CONFIDENTIAL
  * @date: 2019.04.10
/******************************************************************************/

#include	"include.h"

u16 hact, vact;
u16 hs, vs;
u16 hbp, vbp;
u16 htotal, vtotal;
u16 hfp, vfp;
u8 VideoFormat=0;
u32 lvds_clk_in = 0;

#define OFFSET 5

struct video_timing *pVideo_Format;

//hfp, hs, hbp, hact, htotal, vfp, vs, vbp, vact, vtotal, pixclk
struct video_timing video_640x480_60Hz     ={ 8, 96,  40, 640,   800, 33,  2,  10, 480,   525,  25000};
struct video_timing video_720x480_60Hz     ={16, 62,  60, 720,   858,  9,  6,  30, 480,   525,  27000};
struct video_timing video_1280x720_60Hz    ={110,40, 220,1280,  1650,  5,  5,  20, 720,   750,  74250};
struct video_timing video_1280x720_30Hz    ={110,40, 220,1280,  1650,  5,  5,  20, 720,   750,  74250};
struct video_timing video_1366x768_60Hz    ={26, 110,110,1366,  1592,  13, 6,  13, 768,   800,  81000};
struct video_timing video_1920x720_60Hz    ={148,44, 88, 1920,  2200, 28,  5,  12, 720,   765,  88000};
struct video_timing video_1920x1080_30Hz   ={88, 44, 148,1920,  2200,  4,  5,  36, 1080, 1125,  74250};
struct video_timing video_1920x1080_60Hz   ={88, 44, 148,1920,  2200,  4,  5,  36, 1080, 1125, 148500};
struct video_timing video_1920x1200_60Hz   ={48, 32,  80,1920,  2080,  3,  6,  26, 1200, 1235, 154000};
struct video_timing video_3840x2160_30Hz   ={176,88, 296,3840,  4400,  8,  10, 72, 2160, 2250, 297000};


void LT9211_ChipID(void)
{
    HDMI_WriteI2C_Byte(0xff,0x81);//register bank
    print("\r\nLT9211 Chip ID:%x,",HDMI_ReadI2C_Byte(0x00));
    print("%x,",HDMI_ReadI2C_Byte(0x01));
    print("%x",HDMI_ReadI2C_Byte(0x02));
}

/** video chk soft rst **/
void lt9211_vid_chk_rst(void)       
{
    HDMI_WriteI2C_Byte(0xff,0x81);	  
    HDMI_WriteI2C_Byte(0x10,0xbe); 
    Timer0_Delay1ms(10);
    HDMI_WriteI2C_Byte(0x10,0xfe); 
}

/** lvds rx logic rst **/
void lt9211_lvdsrx_logic_rst(void)       
{
    HDMI_WriteI2C_Byte(0xff,0x81);	   
    HDMI_WriteI2C_Byte(0x0c,0xeb);
    Timer0_Delay1ms(10);
    HDMI_WriteI2C_Byte(0x0c,0xfb);
}

void LT9211_SystemInt(void)
{
    /* system clock init */		   
    HDMI_WriteI2C_Byte(0xff,0x82);
    HDMI_WriteI2C_Byte(0x01,0x18);
    
    HDMI_WriteI2C_Byte(0xff,0x86);
    HDMI_WriteI2C_Byte(0x06,0x61); 	
    HDMI_WriteI2C_Byte(0x07,0xa8); //fm for sys_clk
    
    HDMI_WriteI2C_Byte(0xff,0x87); //  ʼ   txpll  Ĵ    б Ĭ  ֵ      
    HDMI_WriteI2C_Byte(0x14,0x08); //default value
    HDMI_WriteI2C_Byte(0x15,0x00); //default value
    HDMI_WriteI2C_Byte(0x18,0x0f);
    HDMI_WriteI2C_Byte(0x22,0x08); //default value
    HDMI_WriteI2C_Byte(0x23,0x00); //default value
    HDMI_WriteI2C_Byte(0x26,0x0f); 
}

void LT9211_LvdsRxPhy(void)
{
    #ifdef INPUT_PORTA
    print("\r\nPort A PHY Config");
    HDMI_WriteI2C_Byte(0xff,0x82);
    HDMI_WriteI2C_Byte(0x02,0x8B);   //Port A LVDS mode enable
    HDMI_WriteI2C_Byte(0x05,0x21);   //port A CLK lane swap
    HDMI_WriteI2C_Byte(0x07,0x1f);   //port A clk enable
    HDMI_WriteI2C_Byte(0x04,0xa0);   //select port A clk as byteclk
    //HDMI_WriteI2C_Byte(0x09,0xFC); //port A P/N swap
        
    HDMI_WriteI2C_Byte(0xff,0x86);		
    HDMI_WriteI2C_Byte(0x33,0xe4);   //Port A Lane swap
    #endif
        
    #ifdef INPUT_PORTB
    print("\r\nPort B PHY Config");
    HDMI_WriteI2C_Byte(0xff,0x82);
    HDMI_WriteI2C_Byte(0x02,0x88);   //Port A/B LVDS mode enable
    HDMI_WriteI2C_Byte(0x05,0x21);   //port A CLK lane swap and rterm turn-off
    HDMI_WriteI2C_Byte(0x0d,0x21);   //port B CLK lane swap
    HDMI_WriteI2C_Byte(0x07,0x1f);   //port A clk enable  (ֻ  Portbʱ,porta  lane0 clkҪ  )
    HDMI_WriteI2C_Byte(0x0f,0x1f);   //port B clk enable
    //HDMI_WriteI2C_Byte(0x10,0x00);   //select port B clk as byteclk
    HDMI_WriteI2C_Byte(0x04,0xa1);   //reserve
    //HDMI_WriteI2C_Byte(0x11,0x01);   //port B P/N swap
    HDMI_WriteI2C_Byte(0x10,0xfc);
    
    HDMI_WriteI2C_Byte(0xff,0x86);		
    HDMI_WriteI2C_Byte(0x34,0xe4);   //Port B Lane swap
    
    HDMI_WriteI2C_Byte(0xff,0xd8);		
    HDMI_WriteI2C_Byte(0x16,0x80);
    #endif
    
    HDMI_WriteI2C_Byte(0xff,0x81);
    HDMI_WriteI2C_Byte(0x20,0x7f); 	
    HDMI_WriteI2C_Byte(0x20,0xff);  //mlrx calib reset
}

void LT9211_LvdsRxDigital(void)
{	  
    HDMI_WriteI2C_Byte(0xff,0x85);
    HDMI_WriteI2C_Byte(0x88,0x10);      //LVDS input, MIPI output
    
    HDMI_WriteI2C_Byte(0xff,0xd8);

    if(INPUT_PORT_NUM == 1)             //1Port LVDS Input
    {
        HDMI_WriteI2C_Byte(0x10,0x80);
        print("\r\nLVDS Port Num: 1");
    }
    else if(INPUT_PORT_NUM == 2)        //2Port LVDS Input
    {
        HDMI_WriteI2C_Byte(0x10,0x00);
        print("\r\nLVDS Port Num: 2");
    }
    else
    {
        print("\r\nPort Num Set Error");
    } 	

    lt9211_vid_chk_rst();              //video chk soft rst
    lt9211_lvdsrx_logic_rst();         //lvds rx logic rst		
	
    HDMI_WriteI2C_Byte(0xff,0x86);
    HDMI_WriteI2C_Byte(0x30,0x45);     //port AB input port sel	 
	
    if(LVDS_FORMAT == JEDIA_FORMAT)
    {
        HDMI_WriteI2C_Byte(0xff,0x85);
        HDMI_WriteI2C_Byte(0x59,0xd0); 	
        HDMI_WriteI2C_Byte(0xff,0xd8);
        HDMI_WriteI2C_Byte(0x11,0x40);
    }
}

int lt9211_lvds_clkstb_check(void)
{
    u8 porta_clk_state = 0;
    u8 portb_clk_state = 0;
    
    HDMI_WriteI2C_Byte(0xff,0x86);
    HDMI_WriteI2C_Byte(0x00,0x01);
    Timer0_Delay1ms(300);
    porta_clk_state = (HDMI_ReadI2C_Byte(0x08) & (0x20));
    
    HDMI_WriteI2C_Byte(0xff,0x86);
    HDMI_WriteI2C_Byte(0x00,0x02);
    Timer0_Delay1ms(300);
    portb_clk_state = (HDMI_ReadI2C_Byte(0x08) & (0x20));
    
    if(INPUT_PORT_NUM == 1)
    {
        #ifdef INPUT_PORTA
        if( porta_clk_state )
        {
            return 1;
        }
        else
        {
            return 0;
        }
        #endif
        #ifdef INPUT_PORTB
        if( portb_clk_state )
        {
            return 1;
        }
        else
        {
            return 0;
        }
        #endif
    }
    else if(INPUT_PORT_NUM == 2)
    {
        if(porta_clk_state && portb_clk_state)
        {
            return 1;
        }
        else
        {
            return 0;
        }
    }
}

void LT9211_ClockCheckDebug(void)
{
#ifdef _uart_debug_
    u32 fm_value;

    lvds_clk_in = 0;
    #ifdef INPUT_PORTA
    HDMI_WriteI2C_Byte(0xff,0x86);
    HDMI_WriteI2C_Byte(0x00,0x01);
    Timer0_Delay1ms(50);
    fm_value = 0;
    fm_value = (HDMI_ReadI2C_Byte(0x08) &(0x0f));
    fm_value = (fm_value<<8) ;
    fm_value = fm_value + HDMI_ReadI2C_Byte(0x09);
    fm_value = (fm_value<<8) ;
    fm_value = fm_value + HDMI_ReadI2C_Byte(0x0a);
    print("\r\nPort A lvds clock: ");
    printdec_u32(fm_value);
    lvds_clk_in = fm_value;
    #endif
	
    #ifdef INPUT_PORTB
    HDMI_WriteI2C_Byte(0xff,0x86);
    HDMI_WriteI2C_Byte(0x00,0x02);
    Timer0_Delay1ms(50);
    fm_value = 0;
    fm_value = (HDMI_ReadI2C_Byte(0x08) &(0x0f));
    fm_value = (fm_value<<8) ;
    fm_value = fm_value + HDMI_ReadI2C_Byte(0x09);
    fm_value = (fm_value<<8) ;
    fm_value = fm_value + HDMI_ReadI2C_Byte(0x0a);
    print("\r\nPort B lvds clock: ");
    printdec_u32(fm_value);
    lvds_clk_in = fm_value;
    #endif

#endif
}

void LT9211_LvdsRxPll(void)
{
    u8 loopx = 0;
    
    HDMI_WriteI2C_Byte(0xff,0x82);
    HDMI_WriteI2C_Byte(0x25,0x05);
    HDMI_WriteI2C_Byte(0x27,0x02);	
	
    if(INPUT_PORT_NUM == 1)             //1Port LVDS Input
    {
        HDMI_WriteI2C_Byte(0x24,0x24); //RXPLL_LVDSCLK_MUXSEL,PIXCLK_MUXSEL	0x2c.
        HDMI_WriteI2C_Byte(0x28,0x44); //0x64
    }
    else if(INPUT_PORT_NUM == 2)        //2Port LVDS Input
    {
        HDMI_WriteI2C_Byte(0x24,0x2c); //RXPLL_LVDSCLK_MUXSEL,PIXCLK_MUXSEL	0x2c.
        HDMI_WriteI2C_Byte(0x28,0x64); //0x64
    }
    else
    {
        print("\r\n LvdsRxPll: lvds port count error");
    }
    Timer0_Delay1ms(10);
    HDMI_WriteI2C_Byte(0xff,0x87);
    HDMI_WriteI2C_Byte(0x05,0x00);
    HDMI_WriteI2C_Byte(0x05,0x80);
    Timer0_Delay1ms(100);
    for(loopx = 0; loopx < 10; loopx++) //Check Rx PLL cal
    {
        HDMI_WriteI2C_Byte(0xff,0x87);			
        if(HDMI_ReadI2C_Byte(0x12)& 0x80)
        {
            if(HDMI_ReadI2C_Byte(0x11)& 0x80)
            {
                print("\r\nLT9211 rx cal done");
            }
            else
            {
                print("\r\nLT9211 rx cal undone!!");
            }					
            print("\r\nLT9211 rx pll lock");
            break;
        }
        else
        {
            print("\r\nLT9211 rx pll unlocked");
        }
    }
}

void LT9211_VideoCheck(void)
{
    u8 sync_polarity;

    HDMI_WriteI2C_Byte(0xff,0x86);
    HDMI_WriteI2C_Byte(0x20,0x00);
	
    sync_polarity = HDMI_ReadI2C_Byte(0x70);
    vs = HDMI_ReadI2C_Byte(0x71);

    hs = HDMI_ReadI2C_Byte(0x72);
    hs = (hs<<8) + HDMI_ReadI2C_Byte(0x73);
	
    vbp = HDMI_ReadI2C_Byte(0x74);
    vfp = HDMI_ReadI2C_Byte(0x75);

    hbp = HDMI_ReadI2C_Byte(0x76);
    hbp = (hbp<<8) + HDMI_ReadI2C_Byte(0x77);

    hfp = HDMI_ReadI2C_Byte(0x78);
    hfp = (hfp<<8) + HDMI_ReadI2C_Byte(0x79);

    vtotal = HDMI_ReadI2C_Byte(0x7A);
    vtotal = (vtotal<<8) + HDMI_ReadI2C_Byte(0x7B);

    htotal = HDMI_ReadI2C_Byte(0x7C);
    htotal = (htotal<<8) + HDMI_ReadI2C_Byte(0x7D);

    vact = HDMI_ReadI2C_Byte(0x7E);
    vact = (vact<<8)+ HDMI_ReadI2C_Byte(0x7F);

    hact = HDMI_ReadI2C_Byte(0x80);
    hact = (hact<<8) + HDMI_ReadI2C_Byte(0x81);

    print("\r\nsync_polarity = %x", sync_polarity);
	if(!(sync_polarity & 0x01)) //hsync
	{
        HDMI_WriteI2C_Byte(0xff,0xd8);
        HDMI_WriteI2C_Byte(0x10, (HDMI_ReadI2C_Byte(0x10)| 0x10));
	}
	if(!(sync_polarity & 0x02)) //vsync
	{
        HDMI_WriteI2C_Byte(0xff,0xd8);
        HDMI_WriteI2C_Byte(0x10, (HDMI_ReadI2C_Byte(0x10)| 0x20));
	}

    print("\r\nhfp, hs, hbp, hact, htotal = ");
	printdec_u32(hfp);
	printdec_u32(hs);
	printdec_u32(hbp);
	printdec_u32(hact);
	printdec_u32(htotal);

	print("\r\nvfp, vs, vbp, vact, vtotal = ");
	printdec_u32(vfp);
	printdec_u32(vs);
	printdec_u32(vbp);
	printdec_u32(vact);
	printdec_u32(vtotal);
    
    if ((hact == video_1280x720_60Hz.hact ) &&( vact == video_1280x720_60Hz.vact ))
    {
        print("\r\nvideo_1280x720_60Hz"); 
        pVideo_Format = &video_1280x720_60Hz;
    }
    else if ((hact == video_1920x1080_60Hz.hact ) &&( vact == video_1920x1080_60Hz.vact ))
    {
        print("\r\nvideo_1920x1080_60Hz"); 
        pVideo_Format = &video_1920x1080_60Hz;
    }
    else 
    {
        pVideo_Format = NULL;
        print("\r\nvideo_none"); 
    }
}

void LT9211_MipiTxpll(void)
{
    u8 loopx;
	
    HDMI_WriteI2C_Byte(0xff,0x82);
    HDMI_WriteI2C_Byte(0x36,0x03); //b7:txpll_pd
    HDMI_WriteI2C_Byte(0x37,0x28);
    HDMI_WriteI2C_Byte(0x38,0x44);
    HDMI_WriteI2C_Byte(0x3a,0x93);
	
    HDMI_WriteI2C_Byte(0xff,0x87);
    HDMI_WriteI2C_Byte(0x13,0x00);
    HDMI_WriteI2C_Byte(0x13,0x80);
    Timer0_Delay1ms(100);
    for(loopx = 0; loopx < 10; loopx++) //Check Tx PLL cal done
    {
			
        HDMI_WriteI2C_Byte(0xff,0x87);			
        if(HDMI_ReadI2C_Byte(0x1f)& 0x80)
        {
            if(HDMI_ReadI2C_Byte(0x20)& 0x80)
            {
                print("\r\nLT9211 tx pll lock");
            }
            else
            {
                print("\r\nLT9211 tx pll unlocked");
            }					
            print("\r\nLT9211 tx pll cal done");
            break;
        }
        else
        {
            print("\r\nLT9211 tx pll unlocked");
        }
    }	 			
}

void LT9211_MipiTxPhy(void)
{		
    HDMI_WriteI2C_Byte(0xff,0x82);
    HDMI_WriteI2C_Byte(0x62,0x00); //ttl output disable
    HDMI_WriteI2C_Byte(0x3b,0x32); //mipi en	
    
    HDMI_WriteI2C_Byte(0xff,0x81);
    HDMI_WriteI2C_Byte(0x20,0xfb);
    Timer0_Delay1ms(10);
    HDMI_WriteI2C_Byte(0x20,0xff);   //tx rterm calibration
    
    //HDMI_WriteI2C_Byte(0x48,0x5f); //Port A Lane P/N Swap
    //HDMI_WriteI2C_Byte(0x49,0x92); 
    //HDMI_WriteI2C_Byte(0x52,0x5f); //Port B Lane P/N Swap
    //HDMI_WriteI2C_Byte(0x53,0x92); 
	
    HDMI_WriteI2C_Byte(0xff,0x86);	
    HDMI_WriteI2C_Byte(0x40,0x80); //tx_src_sel
    /*port src sel*/
    HDMI_WriteI2C_Byte(0x41,0x01);	
    HDMI_WriteI2C_Byte(0x42,0x23);
    HDMI_WriteI2C_Byte(0x43,0x40); //Port A MIPI Lane Swap
    HDMI_WriteI2C_Byte(0x44,0x12);
    HDMI_WriteI2C_Byte(0x45,0x34); //Port B MIPI Lane Swap
}

void LT9211_MipiTxDigital(void)
{	
    HDMI_WriteI2C_Byte(0xff,0xd4);
	HDMI_WriteI2C_Byte(0x1c,0x30);  //hs_rqst_pre
	HDMI_WriteI2C_Byte(0x1d,0x0a);  //lpx
	HDMI_WriteI2C_Byte(0x1e,0x06);  //prpr
	HDMI_WriteI2C_Byte(0x1f,0x0a);  //trail
	HDMI_WriteI2C_Byte(0x21,0x00);  //[5]byte_swap,[0]burst_clk

    HDMI_WriteI2C_Byte(0xff,0xd4);	
	HDMI_WriteI2C_Byte(0x12,0x1E);
    HDMI_WriteI2C_Byte(0x15,0x01);
    HDMI_WriteI2C_Byte(0x16,0x55);	
    HDMI_WriteI2C_Byte(0x10,0x01);
    HDMI_WriteI2C_Byte(0x11,0x50); //read byteclk
    HDMI_WriteI2C_Byte(0x13,0x0f);	//bit[5:4]:lane num, bit[2]:bllp,bit[1:0]:vid_mode
    HDMI_WriteI2C_Byte(0x14,0x04); //bit[5:4]:data typ,bit[2:0]:fmt sel 000:rgb888
    HDMI_WriteI2C_Byte(0x21,0x02);
    HDMI_WriteI2C_Byte(0xff,0xd0);
    HDMI_WriteI2C_Byte(0x04,0x10);
}

void LT9211_SetTxTiming(void)
{
	u16 hact, vact;
    u16 hs, vs;
    u16 hbp, vbp;
    u16 htotal, vtotal;
    u16 hfp, vfp;	

    hact = pVideo_Format->hact;
    vact = pVideo_Format->vact;
    htotal = pVideo_Format->htotal;
    vtotal = pVideo_Format->vtotal;
    hs = pVideo_Format->hs;
    vs = pVideo_Format->vs;
    hfp = pVideo_Format->hfp;
    vfp = pVideo_Format->vfp; 
    hbp = pVideo_Format->hbp;
    vbp = pVideo_Format->vbp;

	HDMI_WriteI2C_Byte(0xff,0xd4);
	HDMI_WriteI2C_Byte(0x04,0x01); //hs[7:0] not care
	HDMI_WriteI2C_Byte(0x05,0x01); //hbp[7:0] not care
	HDMI_WriteI2C_Byte(0x06,0x01); //hfp[7:0] not care
	HDMI_WriteI2C_Byte(0x07,(u8)(hact>>8)); //hactive[15:8]
	HDMI_WriteI2C_Byte(0x08,(u8)(hact)); //hactive[7:0]
	
	HDMI_WriteI2C_Byte(0x09,(u8)(vs)+(u8)(vbp) - 1); //vfp[7:0]
	HDMI_WriteI2C_Byte(0x0a,0x00); //bit[3:0]:vbp[11:8]
	HDMI_WriteI2C_Byte(0x0b,0x01); //vbp[7:0]
	HDMI_WriteI2C_Byte(0x0c,(u8)(vact>>8)); //vcat[15:8]
	HDMI_WriteI2C_Byte(0x0d,(u8)(vact)); //vcat[7:0]
	HDMI_WriteI2C_Byte(0x0e,0x00); //vfp[11:8]
	HDMI_WriteI2C_Byte(0x0f,0x00); //vfp[7:0]
}
	
void LT9211_LVDS2MIPIDSI_Config(void)
{
    print("\r\n*************LT9211 LVDS2MIPIDSI Config*************");
    LT9211_ChipID();
    LT9211_SystemInt();
    LT9211_LvdsRxPhy();
    LT9211_LvdsRxDigital();
    LT9211_LvdsRxPll();
    LT9211_ClockCheckDebug();
    LT9211_VideoCheck();
    
    if( pVideo_Format != NULL )
    {
        /********MIPI OUTPUT CONFIG********/
        LT9211_MipiTxPhy();
        LT9211_MipiTxpll();
        LT9211_SetTxTiming();
        LT9211_MipiTxDigital();
    }
}
/******************************************************************************
  * @project: LT9211
  * @file: lt9211.h
  * @author: zll
  * @company: LONTIUM COPYRIGHT and CONFIDENTIAL
  * @date: 2019.04.10
/******************************************************************************/

#ifndef _LT9211_H
#define _LT9211_H

/******************* LVDS Input Config ********************/
#define INPUT_PORTA
#define INPUT_PORTB

#define INPUT_PORT_NUM 2

typedef enum LVDS_FORMAT_ENUM{
    VESA_FORMAT = 0,
    JEDIA_FORMAT
};
#define LVDS_FORMAT VESA_FORMAT

typedef enum LVDS_MODE_ENUM{
    DE_MODE = 0,
    SYNC_MODE
};
#define LVDS_MODE SYNC_MODE


typedef struct video_timing{
u16 hfp;
u16 hs;
u16 hbp;
u16 hact;
u16 htotal;
u16 vfp;
u16 vs;
u16 vbp;
u16 vact;
u16 vtotal;
u32 pclk_khz;
};

void LT9211_LVDS2MIPIDSI_Config(void);

#endif

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

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

相关文章

【Linux install】Ubuntu和win双系统安装及可能遇到的所有问题

文章目录 1.前期准备1.1关闭快速启动和安全启动1.1.1 shell命令行进入BIOS1.1.2 windows设置中高级启动1.1.3 在开机时狂按某个键进入BIOS1.1.4 关闭Fast boot和Secure boot 1.2 制作启动盘1.3 划分磁盘空间1.3.1 查看目前的虚拟内存大小 2.开始安装2.1 使用启动盘启动2.1.1 法…

洛谷NOIP2002 普及组 选数 +NOIP1999普及组 回文数

两道日常的练习题&#xff0c;废话不多说&#xff0c;直接上题上代码&#xff1a; 这道题目的难点在于怎样去根据一个不同的k值&#xff0c;通过代码来实现将所有符合题目要求的数字相加并且不重复的功能。下面请看代码&#xff0c;会有详细的讲解&#xff1a; #include<io…

又聊代码重构

今天有幸和一位朋友聊了一下代码的重构。回来之后感觉不够尽兴&#xff0c;所以决定再来输出一篇。 代码来至于今天下午的提交。 重构是对代码的觉知和业务的逻辑的进一步归纳总结 只有开发者对代码的不断觉察和理解&#xff0c;才会产生重构代码的念头。因此&#xff0c;驱动…

GO 中如何防止 goroutine 泄露

文章目录 概述如何监控泄露一个简单的例子泄露情况分类chanel 引起的泄露发送不接收接收不发送nil channel真实的场景 传统同步机制MutexWaitGroup 总结参考资料 今天来简单谈谈&#xff0c;Go 如何防止 goroutine 泄露。 概述 Go 的并发模型与其他语言不同&#xff0c;虽说它…

小白水平理解面试经典题目LeetCode 121 Best Time to Buy and Sell Stock

121 Best Time to Buy and Sell Stock (买卖股票的最佳时机) 你好&#xff0c;2024年的第一个月&#xff0c;又是秋风萧瑟天气凉&#xff0c;草木摇落露为霜。.。。在这个特殊的时代&#xff0c;作为我们普通的一个打工人&#xff0c;我们用这道题&#xff0c;开启对这个不符合…

菜鸟关于做前、后端的整理(html、js),以及疑问

涉及到后端的接口py&#xff0c;前端html和js 这三部分就按照如下格式放到server项目主路径下&#xff0c;这样后端机可以作为一个前端server main.pystaticmain.jsmain.htmlhtml 首先是html要设定网页的显示 <!DOCTYPE html> <html> <head><title>…

小米,我请你不要将卖手机那套话术带进汽车圈

文 | AUTO芯球 ​作者 | 雷歌 当你们用卖手机时那一套营销话术玩汽车&#xff0c;整个汽车圈都被你们逗乐了。 这不&#xff0c;在被用户问到“贵公司汽车有哪些驾驶模式”时&#xff0c;你们声称自己有16.8亿种驾驶模式。 你小米说这话的逻辑&#xff0c;不就是将加速、转…

网络安全最大的威胁:洞察数字时代的风险之巅

在数字化时代&#xff0c;网络安全问题越发突显&#xff0c;企业和个人都面临着来自多方面的威胁。究竟网络安全领域的最大威胁是什么&#xff1f;本文将深入探讨这一问题&#xff0c;揭示数字空间中最为严重的威胁。 1. 恶意软件的肆虐&#xff1a; 恶意软件一直是网络安全的…

29、WEB攻防——通用漏洞SQL注入增删改查盲注延迟布尔报错

文章目录 盲注增删改查 盲注 概念&#xff1a;在注入过程中&#xff0c;获取的数据不能回显至前端页面&#xff0c;此时我们需要利用一些方法进行判断或尝试&#xff0c;这个过程被称为盲注。 解决&#xff1a;常规的联合查询注入不行的情况。 分类&#xff1a; 基于布尔的SQ…

Leetcode2957. 消除相邻近似相等字符

Every day a Leetcode 题目来源&#xff1a;2957. 消除相邻近似相等字符 解法1&#xff1a;遍历 分类讨论 遍历字符串 word&#xff0c;比较相邻的 3 个元素 word[i - 1]、word[i] 和 word[i 1]&#xff0c;记 left_distance abs(mid - left)&#xff0c;right_distance…

739.每日温度 496.下一个更大元素 I

739.每日温度 496.下一个更大元素 I 739.每日温度 力扣题目链接(opens new window) 请根据每日 气温 列表&#xff0c;重新生成一个列表。对应位置的输出为&#xff1a;要想观测到更高的气温&#xff0c;至少需要等待的天数。如果气温在这之后都不会升高&#xff0c;请在该位…

(初研) Sentence-embedding fine-tune notebook

由于工作需要&#xff0c;需要对embedding模型进行微调&#xff0c;我调用了几种方案&#xff0c;都比较繁琐。先记录一个相对简单的方案。以下内容并不一定正确&#xff0c;请刷到的大佬给予指正&#xff0c;不胜感激&#xff01;&#xff01;&#xff01; 一.对BGE模型&…

OpenHarmonyOS-gn与Ninja

GN语法及在鸿蒙的使用 [gnninja学习 0x01]gn和ninja是什么 ohos_sdk/doc/subsys-build-gn-coding-style-and-best-practice.md GN 语言与操作 一、gn简介 gn是generate ninja的缩写&#xff0c;它是一个元编译系统&#xff08;meta-build system&#xff09;,是ninja的前端&am…

Python入门到精通(三)——Python循环语句

Python循环语句 一、while 循环 1、基础语法 2、嵌套应用 二、for 循环 1、基础语法 2、嵌套应用 三、循环中断&#xff1a;break 和 continue 1、break 2、continue 四、综合案例 一、while 循环 1、基础语法 while的条件需得到布尔类型&#xff0c;True表示继续循环…

linux C语言socket函数send

在Linux中&#xff0c;使用C语言进行网络编程时&#xff0c;send函数是用于发送数据到已连接的套接字的重要函数之一。它通常用于TCP连接&#xff0c;但也可以用于UDP&#xff08;尽管对于UDP&#xff0c;通常更推荐使用sendto&#xff0c;因为它允许你指定目标地址和端口&…

定时关机应用V2.1

# 在ShutDown_2.0的基础上&#xff0c;作了如下改进&#xff1a; # 1) 修正了默认模式无法选择其他时间的bug&#xff0c;还增加了2.5小时和3小时两个选项&#xff1b; # 2&#xff09;自定义模式将计时单位从“秒”改为“分钟”&#xff0c;倒计时显示也优化为“小时:分钟:秒”…

小白水平理解面试经典题目LeetCode 125 Valid Palindrome(验证回文串)

125 验证回文串 说到公司面试&#xff0c;那就是得考出高度&#xff0c;考出水平&#xff0c;什么兼顾这两者呢&#xff0c;那就得看这道 原题描述&#xff1a; 给定一个字符串&#xff0c;判断它是否是回文串。回文串是指正读和反读都一样的字符串。 输入: “A man, a pla…

JS-WebAPIS(四)

日期对象&#xff08;常用&#xff09; • 实例化 在代码中发现了 new 关键字时&#xff0c;一般将这个操作称为实例化创建一个时间对象并获取时间 获得当前时间 获得指定时间 • 时间对象方法 使用场景&#xff1a;因为日期对象返回的数据我们不能直接使用&#xff0c;所以…

Android Studio安卓开发--ListView学习整理

ListView允许用户通过手指上下滑动的方式将屏幕外的数据滚动到屏幕内&#xff0c;同时屏幕上原有的数据则会滚动出屏幕。 1.ListView的简单用法 &#xff08;1&#xff09;activity_main.xml布局中加入ListView控件&#xff1a;&#xff08;先占满整个布局的空间&#xff09;…