# MAX44009 **Repository Path**: libdriver/max44009 ## Basic Information - **Project Name**: MAX44009 - **Description**: 适用于通用MCU和Linux系统的MAX44009全功能驱动 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-08-15 - **Last Updated**: 2026-08-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: IIC, 光强 ## README [English](/README.md) | [ 简体中文](/README_zh-Hans.md) | [繁體中文](/README_zh-Hant.md) | [日本語](/README_ja.md) | [Deutsch](/README_de.md) | [한국어](/README_ko.md)
## LibDriver MAX44009 [![MISRA](https://img.shields.io/badge/misra-compliant-brightgreen.svg)](/misra/README.md) [![API](https://img.shields.io/badge/api-reference-blue.svg)](https://www.libdriver.com/docs/max44009/index.html) [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](/LICENSE) MAX44009环境光传感器具有I2C数字输出,非常适合智能手机、笔记本电脑和工业传感器等多种便携式应用。在小于1μA的工作电流下,它是业界功率最低的环境光传感器,具有0.045勒克斯至188000勒克斯的超宽22位动态范围。低光操作允许在深色玻璃应用中轻松操作。片上光电二极管的光谱响应经过优化,可以模拟人眼对环境光的感知,并具有红外和紫外阻断能力。自适应增益块会自动选择正确的勒克斯范围,以优化计数/勒克斯。 LibDriver MAX44009是LibDriver推出的MAX44009全功能驱动,该驱动提供亮度读取、亮度中断检测等功能并且它符合MISRA标准。 ### 目录 - [说明](#说明) - [安装](#安装) - [使用](#使用) - [example basic](#example-basic) - [example interrupt](#example-interrupt) - [文档](#文档) - [贡献](#贡献) - [版权](#版权) - [联系我们](#联系我们) ### 说明 /src目录包含了LibDriver MAX44009的源文件。 /interface目录包含了LibDriver MAX44009与平台无关的IIC总线模板。 /test目录包含了LibDriver MAX44009驱动测试程序,该程序可以简单的测试芯片必要功能。 /example目录包含了LibDriver MAX44009编程范例。 /doc目录包含了LibDriver MAX44009离线文档。 /datasheet目录包含了MAX44009数据手册。 /project目录包含了常用Linux与单片机开发板的工程样例。所有工程均采用shell脚本作为调试方法,详细内容可参考每个工程里面的README.md。 /misra目录包含了LibDriver MISRA代码扫描结果。 ### 安装 参考/interface目录下与平台无关的IIC总线模板,完成指定平台的IIC总线驱动。 将/src目录,您使用平台的接口驱动和您开发的驱动加入工程,如果您想要使用默认的范例驱动,可以将/example目录加入您的工程。 ### 使用 您可以参考/example目录下的编程范例完成适合您的驱动,如果您想要使用默认的编程范例,以下是它们的使用方法。 #### example basic ```C #include "driver_max44009_basic.h" uint8_t res; uint32_t i; /* basic init */ res = max44009_basic_init(MAX44009_ADDRESS_0); if (res != 0) { return 1; } ... /* delay 1000ms */ max44009_interface_delay_ms(1000); /* loop */ for (i = 0; i < 3; i++) { float lux; /* basic read */ res = max44009_basic_read(&lux); if (res != 0) { (void)max44009_basic_deinit(); return 1; } /* output */ max44009_interface_debug_print("%d/%d.\n", i + 1, 3); max44009_interface_debug_print("%.2flux.\n", lux); /* delay 1000ms */ max44009_interface_delay_ms(1000); ... } ... /* deinit */ (void)max44009_basic_deinit(); return 0; ``` #### example interrupt ```C #include "driver_max44009_interrupt.h" uint8_t res; uint32_t i; float low_threshold = 100.0f; float high_threshold = 1000.0f; /* output */ max44009_interface_debug_print("max44009: low threshold is %0.2f lux.\n", low_threshold); max44009_interface_debug_print("max44009: high threshold is %0.2f lux.\n", high_threshold); ... /* interrupt init */ res = max44009_interrupt_init(MAX44009_ADDRESS_0, low_threshold, high_threshold, 500.0f); if (res != 0) { return 1; } ... /* loop */ for (i = 0; i < 3; i++) { float lux; /* interrupt read */ res = max44009_interrupt_read(&lux); if (res != 0) { (void)max44009_interrupt_deinit(); return 1; } /* output */ max44009_interface_debug_print("%d/%d.\n", i + 1, 3); max44009_interface_debug_print("%.2flux.\n", lux); /* check the result */ if (lux < low_threshold) { /* output */ max44009_interface_debug_print("max44009: low threshold %0.2flux and please check int pin.\n", lux); break; } if (lux > high_threshold) { /* output */ max44009_interface_debug_print("max44009: high threshold %0.2flux and please check int pin.\n", lux); break; } /* delay 1000ms */ max44009_interface_delay_ms(1000); ... } ... /* deinit */ max44009_interrupt_deinit(); return 0; ``` ### 文档 在线文档: [https://www.libdriver.com/docs/max44009/index.html](https://www.libdriver.com/docs/max44009/index.html)。 离线文档: /doc/html/index.html。 ### 贡献 请参考CONTRIBUTING.md。 ### 版权 版权 (c) 2015 - 现在 LibDriver 版权所有 MIT 许可证(MIT) 特此免费授予任何获得本软件副本和相关文档文件(下称“软件”)的人不受限制地处置该软件的权利,包括不受限制地使用、复制、修改、合并、发布、分发、转授许可和/或出售该软件副本,以及再授权被配发了本软件的人如上的权利,须在下列条件下: 上述版权声明和本许可声明应包含在该软件的所有副本或实质成分中。 本软件是“如此”提供的,没有任何形式的明示或暗示的保证,包括但不限于对适销性、特定用途的适用性和不侵权的保证。在任何情况下,作者或版权持有人都不对任何索赔、损害或其他责任负责,无论这些追责来自合同、侵权或其它行为中,还是产生于、源于或有关于本软件以及本软件的使用或其它处置。 ### 联系我们 请联系lishifenging@outlook.com。