- synchronize STM8 application and external flash layout updates\n- add assembly bootloader and assembly application test projects\n- add UART1 interrupt receive ring buffer\n- parse JDY-28M Mesh outer frames and source addresses\n- add CRC-16/MODBUS validation\n- implement relay control command 0x01 and response 0x81\n- support unicast and broadcast relay control frames\n- update host protocol, OTA documents, and serial tools
27 lines
1003 B
C
27 lines
1003 B
C
/**
|
|
* @file w25q64.h
|
|
* @brief W25Q80BV 硬件SPI访问接口。
|
|
*/
|
|
#ifndef STM8_BOOTLOADER_W25Q64_H
|
|
#define STM8_BOOTLOADER_W25Q64_H
|
|
|
|
#include <stdint.h>
|
|
|
|
/** 初始化STM8硬件SPI和W25Q64片选;当前片选引脚为PD4。 */
|
|
uint8_t W25Q64_Init(void);
|
|
/** 读取W25Q64 JEDEC ID,便于启动时确认芯片存在。 */
|
|
uint32_t W25Q64_ReadJedecId(void);
|
|
/** 从W25Q64连续读取数据。 */
|
|
void W25Q64_Read(uint32_t address, uint8_t *buffer, uint16_t length);
|
|
/** 擦除包含指定地址的4KB扇区。 */
|
|
uint8_t W25Q64_EraseSector(uint32_t address);
|
|
/** 向W25Q64页内写入数据,长度不能跨越256字节页边界。 */
|
|
uint8_t W25Q64_PageProgram(uint32_t address, const uint8_t *data,
|
|
uint16_t length);
|
|
/** 将升级元数据中的request字节清零,表示升级已处理。 */
|
|
uint8_t W25Q64_ClearUpgradeRequest(void);
|
|
/** 写入Bootloader升级结果码,供主程序启动后上报。 */
|
|
uint8_t W25Q64_WriteUpgradeResult(uint8_t result);
|
|
|
|
#endif
|