b49c9ab0c6
完整实现了以下模块: - 系统数据总线(sys_data_bus)模块间通信 - UART/USART/LPUART驱动 + RS485半双工 - I2C驱动(AS5600角度传感器 + AT24C02 EEPROM) - Modbus RTU从站协议 - 步进电机微步进控制(正弦/余弦换相+S曲线加减速) - 到位开关驱动(DI_MIN/DI_MAX) - PGA+ADC电流检测 - 系统监控任务(内存/串口/传感器/任务状态) - LED/Key外设驱动 - 基于CMake + arm-none-eabi-gcc构建系统
19 lines
496 B
C
19 lines
496 B
C
#ifndef EEPROM_DRIVER_H__
|
|
#define EEPROM_DRIVER_H__
|
|
|
|
#include "common_types.h"
|
|
#include <stdint.h>
|
|
|
|
#define EEPROM_DEV_ADDR 0xA0
|
|
#define EEPROM_PAGE_SIZE 8
|
|
#define EEPROM_TOTAL_SIZE 2048
|
|
|
|
ret_code_t eeprom_init(void);
|
|
ret_code_t eeprom_write(uint16_t addr, const uint8_t *data, uint32_t len);
|
|
ret_code_t eeprom_read(uint16_t addr, uint8_t *data, uint32_t len);
|
|
ret_code_t eeprom_get_last_error(void);
|
|
uint8_t eeprom_is_initialized(void);
|
|
void eeprom_reset_status(void);
|
|
|
|
#endif
|