Initial commit - sync AliceRC to Gitea

This commit is contained in:
2026-08-03 15:54:25 +08:00
commit 493b7d81d7
1510 changed files with 185319 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
/**
* @file eeprom.h
* @brief IAP (在应用编程) 模拟 EEPROM
* STC8H 的 IAP 允许读/写/擦除 Flash 的某个扇区 (512 字节)
* 我们用最后 1 个扇区 (512B @ IAP_EEPROM_BASE)
*
* 存储布局:
* [0..3] magic "L3" + 版本
* [4] mode (RxMode_e)
* [5] rf_channel
* [6..10] rf_address (5 字节)
* [11] checksum
*/
#ifndef __EEPROM_H
#define __EEPROM_H
#include "stc8h.h"
#include <stdint.h>
#define EEPROM_OK 0
#define EEPROM_ERR 1
uint8_t eeprom_init(void);
uint8_t eeprom_read(uint8_t *mode, uint8_t *ch, uint8_t addr[5]);
uint8_t eeprom_write(uint8_t mode, uint8_t ch, const uint8_t addr[5]);
uint8_t eeprom_format(void); /* 恢复默认 */
#endif