LibDriver MAX44009
Loading...
Searching...
No Matches
driver_max44009.c File Reference

driver max44009 source file More...

#include "driver_max44009.h"
#include <math.h>
Include dependency graph for driver_max44009.c:

Go to the source code of this file.

Macros

#define CHIP_NAME   "Analog Devices MAX44009"
 chip information definition
#define MANUFACTURER_NAME   "Analog Devices"
#define SUPPLY_VOLTAGE_MIN   1.7f
#define SUPPLY_VOLTAGE_MAX   3.6f
#define MAX_CURRENT   0.0016f
#define TEMPERATURE_MIN   -40.0f
#define TEMPERATURE_MAX   85.0f
#define DRIVER_VERSION   1000
#define MAX44009_REG_INTERRUPT_STATUS   0x00
 chip register definition
#define MAX44009_REG_INTERRUPT_ENABLE   0x01
#define MAX44009_REG_CONFIGURATION   0x02
#define MAX44009_REG_LUX_READING_HIGH   0x03
#define MAX44009_REG_LUX_READING_LOW   0x04
#define MAX44009_REG_THRESHOLD_UPPER   0x05
#define MAX44009_REG_THRESHOLD_LOWER   0x06
#define MAX44009_REG_THRESHOLD_TIMER   0x07

Functions

uint8_t max44009_set_addr_pin (max44009_handle_t *handle, max44009_address_t addr_pin)
 set the address pin
uint8_t max44009_get_addr_pin (max44009_handle_t *handle, max44009_address_t *addr_pin)
 get the address pin
uint8_t max44009_get_interrupt_status (max44009_handle_t *handle, max44009_bool_t *enable)
 get interrupt status
uint8_t max44009_set_interrupt (max44009_handle_t *handle, max44009_bool_t enable)
 enable or disable interrupt
uint8_t max44009_get_interrupt (max44009_handle_t *handle, max44009_bool_t *enable)
 get interrupt status
uint8_t max44009_set_continuous_mode (max44009_handle_t *handle, max44009_bool_t enable)
 enable or disable continuous mode
uint8_t max44009_get_continuous_mode (max44009_handle_t *handle, max44009_bool_t *enable)
 get continuous mode stauts
uint8_t max44009_set_auto_range (max44009_handle_t *handle, max44009_bool_t enable)
 enable or disable auto range
uint8_t max44009_get_auto_range (max44009_handle_t *handle, max44009_bool_t *enable)
 get auto range
uint8_t max44009_set_current_div_8 (max44009_handle_t *handle, max44009_bool_t enable)
 enable or disable current div 8
uint8_t max44009_get_current_div_8 (max44009_handle_t *handle, max44009_bool_t *enable)
 get current div 8
uint8_t max44009_set_integration_time (max44009_handle_t *handle, max44009_integration_time_t t)
 set integration time
uint8_t max44009_get_integration_time (max44009_handle_t *handle, max44009_integration_time_t *t)
 get integration time
uint8_t max44009_set_interrupt_high_threshold (max44009_handle_t *handle, uint8_t threshold)
 set interrupt high threshold
uint8_t max44009_get_interrupt_high_threshold (max44009_handle_t *handle, uint8_t *threshold)
 get interrupt high threshold
uint8_t max44009_set_interrupt_low_threshold (max44009_handle_t *handle, uint8_t threshold)
 set interrupt low threshold
uint8_t max44009_get_interrupt_low_threshold (max44009_handle_t *handle, uint8_t *threshold)
 get interrupt low threshold
uint8_t max44009_set_threshold_timer (max44009_handle_t *handle, uint8_t t)
 set threshold timer
uint8_t max44009_get_threshold_timer (max44009_handle_t *handle, uint8_t *t)
 get threshold timer
uint8_t max44009_threshold_convert_to_register (max44009_handle_t *handle, float lux, uint8_t *reg)
 convert the threshold to the register raw data
uint8_t max44009_threshold_convert_to_data (max44009_handle_t *handle, uint8_t reg, float *lux)
 convert the register raw data to the threshold
uint8_t max44009_timer_convert_to_register (max44009_handle_t *handle, float ms, uint8_t *reg)
 convert the timer to the register raw data
uint8_t max44009_timer_convert_to_data (max44009_handle_t *handle, uint8_t reg, float *ms)
 convert the register raw data to timer
uint8_t max44009_init (max44009_handle_t *handle)
 initialize the chip
uint8_t max44009_deinit (max44009_handle_t *handle)
 close the chip
uint8_t max44009_read (max44009_handle_t *handle, uint16_t *raw, float *lux)
 read data
uint8_t max44009_set_reg (max44009_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t max44009_get_reg (max44009_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register
uint8_t max44009_info (max44009_info_t *info)
 get chip's information

Detailed Description

driver max44009 source file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2026-09-30

history

Date Version Author Description
2026/09/30 1.0 Shifeng Li first upload

Definition in file driver_max44009.c.

Macro Definition Documentation

◆ CHIP_NAME

#define CHIP_NAME   "Analog Devices MAX44009"

chip information definition

chip name

Definition at line 43 of file driver_max44009.c.

◆ DRIVER_VERSION

#define DRIVER_VERSION   1000

driver version

Definition at line 50 of file driver_max44009.c.

◆ MANUFACTURER_NAME

#define MANUFACTURER_NAME   "Analog Devices"

manufacturer name

Definition at line 44 of file driver_max44009.c.

◆ MAX44009_REG_CONFIGURATION

#define MAX44009_REG_CONFIGURATION   0x02

configuration register

Definition at line 57 of file driver_max44009.c.

◆ MAX44009_REG_INTERRUPT_ENABLE

#define MAX44009_REG_INTERRUPT_ENABLE   0x01

interrupt enable register

Definition at line 56 of file driver_max44009.c.

◆ MAX44009_REG_INTERRUPT_STATUS

#define MAX44009_REG_INTERRUPT_STATUS   0x00

chip register definition

interrupt status register

Definition at line 55 of file driver_max44009.c.

◆ MAX44009_REG_LUX_READING_HIGH

#define MAX44009_REG_LUX_READING_HIGH   0x03

lux reading high register

Definition at line 58 of file driver_max44009.c.

◆ MAX44009_REG_LUX_READING_LOW

#define MAX44009_REG_LUX_READING_LOW   0x04

lux reading low register

Definition at line 59 of file driver_max44009.c.

◆ MAX44009_REG_THRESHOLD_LOWER

#define MAX44009_REG_THRESHOLD_LOWER   0x06

lower threshold register

Definition at line 61 of file driver_max44009.c.

◆ MAX44009_REG_THRESHOLD_TIMER

#define MAX44009_REG_THRESHOLD_TIMER   0x07

threshold timer register

Definition at line 62 of file driver_max44009.c.

◆ MAX44009_REG_THRESHOLD_UPPER

#define MAX44009_REG_THRESHOLD_UPPER   0x05

upper threshold register

Definition at line 60 of file driver_max44009.c.

◆ MAX_CURRENT

#define MAX_CURRENT   0.0016f

chip max current

Definition at line 47 of file driver_max44009.c.

◆ SUPPLY_VOLTAGE_MAX

#define SUPPLY_VOLTAGE_MAX   3.6f

chip max supply voltage

Definition at line 46 of file driver_max44009.c.

◆ SUPPLY_VOLTAGE_MIN

#define SUPPLY_VOLTAGE_MIN   1.7f

chip min supply voltage

Definition at line 45 of file driver_max44009.c.

◆ TEMPERATURE_MAX

#define TEMPERATURE_MAX   85.0f

chip max operating temperature

Definition at line 49 of file driver_max44009.c.

◆ TEMPERATURE_MIN

#define TEMPERATURE_MIN   -40.0f

chip min operating temperature

Definition at line 48 of file driver_max44009.c.