MIT License

项目介绍

henriheimann/stm32-hal-eeprom 是一个托管在 GitHub 上的开源项目,主要使用 C 编写,采用 MIT License 许可证,目前获得 9 个 Star、4 次 Fork。

仓库全名
henriheimann/stm32-hal-eeprom
开源许可证
MIT License
Star 数
9
Fork 数
4

README 摘要

EEPROM Generic STM32 HAL driver for EEPROM devices. Usage For CMake based projects (for example when using STM32CubeMX projects with CLion) you can for example setup the driver as submodule and link to it: Getting Started After connecting the EEPROM to your microcontroller via I2C and initialising the bus using Cube you can use this library to interact with the EEPROM as shown in the following example: Supported…

完整内容见 GitHub 原始 README 或本页 。

常见问题

stm32-hal-eeprom 用什么语言开发?

主要使用 C 编写,采用 MIT License 许可证,目前有 9 个 Star。

stm32-hal-eeprom 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 stm32-hal-eeprom 的源码?

可以直接克隆仓库:git clone https://github.com/henriheimann/stm32-hal-eeprom.git;安装与运行步骤见仓库 README。

stm32-hal-eeprom 最近还在维护吗?

仓库最近一次更新为 2024年2月19日,当前没有未关闭的 Issue;Star 数为 9,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Generic driver for EEPROMs using STM32Cube HAL

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
26
价值分
7
活跃状态
活跃

语言占比

C
C++
CMake

README

EEPROM

Generic STM32 HAL driver for EEPROM devices.

Software License: MIT Build Status

Usage

For CMake based projects (for example when using STM32CubeMX projects with CLion) you can for example setup the driver as submodule and link to it:

add_subdirectory("<directory-to-driver>/eeprom")
target_link_libraries(<target-name> stm32-hal-eeprom)

Getting Started

After connecting the EEPROM to your microcontroller via I2C and initialising the bus using Cube you can use this library to interact with the EEPROM as shown in the following example:

// Create the handle for the EEPROM.
eeprom_handle_t handle = {
    .i2c_handle = &hi2c1,
    .device_address = EEPROM_24LC32A_ADDRESS,
    .page_size = EEPROM_24LC32A_PAGE_SIZE,
    .max_address = EEPROM_24LC32A_MAX_ADDRESS,
    .addressing_type = EEPROM_ADDRESSING_TYPE_16BIT
};

uint8_t[] buffer = {0xaa, 0x12, 0xbb, 0x34};

// Write bytes to the EEPROM pagewise.
if (!eeprom_write_bytes(&handle, 0x000, buffer, sizeof(buffer))) {
    printf("EEPROM write failed\n\r");
}

if (!eeprom_read_bytes(&handle, 0x000, buffer, sizeof(buffer))) {
    printf("EEPROM read failed\n\r");
} else {
    printf("Read back values from EEPROM: %02x %02x %02x %02x\n\r", buffer[0], buffer[1], buffer[2], buffer[3]);	
}

Supported Platforms

STM32L0, STM32L4 and STM32F4 microcontrollers are supported. Address, memory size and page size values for the 24LC32A EEPROM are predefined. The HAL header includes for other microcontrollers and defines for new EEPROM devices may be added in eeprom.h.

评论

暂无评论