repo_id
stringclasses 1
value | file_path
stringlengths 55
93
| content
stringlengths 18
151
| __index_level_0__
int64 0
0
|
---|---|---|---|
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | IOSTB = 0x00; // PBs设置为输出 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | PORTB = 0x00; // PBs输出低电平 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | eeprom_protect_unlock(); // 解锁EEPROM写保护 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | eeprom_write_timeout(addr, data, EETO_8ms_or_2ms); // 设置EEW超时为8ms,将数据写入EEPROM | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | eeprom_protect_lock(); // 锁定EEPROM写保护 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | while(1) // 主循环 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | read_tmp = eeprom_read(addr); // 从EEPROM地址读取EEPROM数据 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | if(addr != read_tmp) // 验证从EEPROM读取的数据 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | PORTB = 0x03; // EEPROM数据不正确 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | CLRWDT(); // 死循环 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Continuous Write.c | PORTB = 0x05; // EEPROM数据正确 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | PCON = 0xA8; // 启用WDT、LVR、LVD功能 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | PCON1 = 0x0C; // 设置LVDS[3:0]=0011b => LVD=2.4V | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | DISI(); // 关闭全局中断(GIE=PCON1[7]=0) | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | while(!(PCON1 & 0x40)) // 当PCON1[6]=1 => VDD>2.4V,允许写入EEPROM | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | IOSTB = 0x00; // PBs设置为输出 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | PORTB = 0x00; // PBs输出低电平 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | eeprom_protect_unlock(); // 解锁EEPROM写保护 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | eeprom_write_timeout(addr, data, EETO_8ms_or_2ms); // 设置EEW超时为8ms,并将数据写入EEPROM | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | while(1) // 主循环 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | read_tmp = eeprom_read(addr); // 从EEPROM地址读取数据 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | if(addr != read_tmp) // 验证从EEPROM读取的数据 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | PORTB = 0x03; // 如果EEPROM数据不正确 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | CLRWDT(); // 进入死循环 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\EEPROM_Write One Byte.c | PORTB = 0x05; // 如果EEPROM数据正确 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | PORTBbits.PB5 ^=1; // PB5 翻转 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | INTF= (unsigned char)~(C_INT_EXT); // 清除外部中断标志位 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | PORTBbits.PB4 ^=1; // PB4 翻转 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | INTF= (unsigned char)~(C_INT_PBKey);// 清除PortB输入变化中断标志位 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | BPHCON = (unsigned char)~(C_PB1_PHB | C_PB0_PHB); // 启用PB0和PB1的上拉电阻 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | BWUCON = C_PB1_Wakeup; // 启用PB1的输入变化唤醒功能 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | IOSTB = C_PB1_Input | C_PB0_Input; // 设置PB0和PB1为输入模式,其他为输出模式 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | PORTB = 0; // PORTB数据缓冲区设置为0(输出低电平) | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | T0MD = C_EXINT_Edge ; // 当PB0上升沿时设置外部中断 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | PCON = C_WDT_En | C_ExtINT_En | C_LVR_En; // PB0作为外部中断输入引脚 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | INTE = C_INT_EXT | C_INT_PBKey; // 启用外部中断和PortB输入变化中断 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | INTF = 0; // 清除所有中断标志位 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\External Interrupt_Level Change Interrupt.c | ENI(); // 启用所有未屏蔽中断 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO.c | BODCON = C_PB0_OD; // 设置PB0为开漏输出模式 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO.c | BPLCON = (unsigned char)~C_PB1_PLB; // 启用PB1下拉电阻,其他禁用 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO.c | BPHCON = (unsigned char)~C_PB4_PHB; // 启用PB4上拉电阻,其他禁用 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO.c | IOSTB = C_PB4_Input | C_PB1_Input; // 设置PB4和PB1为输入模式,其他设置为输出模式 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO.c | PORTB = 0x05; // PB2和PB0输出高电平 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO.c | CLRWDT(); // 清除看门狗定时器 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | IOSTB = 0xDF; // 设置PB4 ~ PB0为输入模式,PB5为输出模式 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | BPHCON = 0x0; // 设置PB0~PB4为上拉模式 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | PORTB = 0xFF; // 将PB5设置为高电平 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | KeyStatus = KeyScan() & 0x1F; // 获取PB4 ~ PB0键状态 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | if (KeyStatus != 0) // 检查是否有键被按下 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | if (KeyStatus & 0x1) // 如果PB0被按下 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | BlinkLED(1); // LED闪烁一次 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | else if (KeyStatus & 0x2) // 如果PB1被按下 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | BlinkLED(2); // LED闪烁两次 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | else if (KeyStatus & 0x4) // 如果PB2被按下 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | BlinkLED(3); // LED闪烁三次 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | else if (KeyStatus & 0x8) // 如果PB3被按下 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | BlinkLED(4); // LED闪烁四次 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | else if (KeyStatus & 0x10) // 如果PB4被按下 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | BlinkLED(5); // LED闪烁五次 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | CLRWDT(); // 清除看门狗定时器 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | KeyStatus = ~PORTB; // 读取PB端口状态并取反,得到按键状态 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | CLRWDT(); // 清除看门狗定时器 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | PORTB = 0xDF; // 将PB5设置为低电平,其余为高电平 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | delay(15000); // 延时 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | PORTB = 0xFF; // 将PB5设置为高电平 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Direct Input.c | delay(15000); // 延时 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_LED Pattern.c | const char pattern[30]={ //定义LED模式,使用const声明在ROM中 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_LED Pattern.c | IOSTB = 0; //设置PortB为输出模式 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_LED Pattern.c | PORTB=0xFF; //所有LED关闭 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_LED Pattern.c | PORTB = pattern[j]; //根据模式表点亮LED | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_LED Pattern.c | delay(15000); //延时 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_LED Pattern.c | CLRWDT(); //清除看门狗定时器 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | unsigned char KeyData = 0xff; // 消抖后的按键状态 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | unsigned char KeyResult = 0; // 存储扫描的按键结果 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | static const char KeyTable[9] = {0x09,0x0A,0x0C,0x11,0x12,0x14,0x21,0x22,0x24}; // 按键表 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | KeyData = KeyScan(); // 扫描按键 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | if(KeyData != 0xFF) // 如果有按键被按下 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | for(i = 0; i < 9; i++) // 检查按键 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | if(KeyData == KeyTable[i]) // 如果按键匹配 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | NOP(); // 空操作,等待 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | KeyData = 0xff; // 重置按键状态 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | CLRWDT(); // 清除看门狗定时器 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | IOSTB = 0x07; // 设置行为输出,列为输入 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | BPHCON = 0xF8; // 启用输入上拉 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | PORTB = 0x00; // 设置输出低电平 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | delay(10); // 等待端口/引脚稳定 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | KeyResult = (PORTB & 0x07); // 使用位掩码获取行状态,存储数据 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | IOSTB = 0xF8; // 设置列为输入,行为输出 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | BPHCON = 0x07; // 启用输入上拉 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | PORTB = 0x00; // 设置输出低电平 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | delay(10); // 等待端口/引脚稳定 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | KeyResult |= (PORTB & 0xF8); // 使用位掩码获取列状态,存储数据,不改变之前设置的低位 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | KeyResult |= 0xC0; // 设置高位为1 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\GPIO_Matrix Input.c | return ~KeyResult; // 反转位并返回结果 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\IIC_Master.c | CLRWDT(); // 清除看门狗定时器 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\IIC_Master.c | while (!(MSR & 0x80)); // 轮询MCF标志 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\IIC_Master.c | IOSTC = C_PC_Output; // 设置所有PORTC为输出模式 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\IIC_Master.c | IOSTB = C_PB_Output; // 设置所有PORTB为输出模式 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\IIC_Master.c | IOSTA = C_PA_Output; // 设置所有PORTA为输出模式 | 0 |
C://Users//IDEA//Desktop//workplace//LiuCode | C://Users//IDEA//Desktop//workplace//LiuCode//Liu\IIC_Master.c | PORTC = (unsigned char)~(C_PC_Data); // PORTC数据缓冲区=0x00(PC1~PC0输出低电平) | 0 |