ensaht/include/opt4048.h

23 lines
506 B
C

// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 2026 A.M. Rowsell <amr@frzn.dev>
#ifndef OPT4048_H
#define OPT4048_H
#include "hardware/i2c.h"
#define OPT_ADDR 0x44
/* Structure to hold the calculated color and lux data */
typedef struct {
float x;
float y;
float z;
float lux;
} OPT4048_Data;
OPT4048_Data calculate_color_data(float ch0, float ch1, float ch2);
int initOPT(i2c_inst_t *i2c);
int getOPTData(i2c_inst_t *i2c, float *ch0, float *ch1, float *ch2);
#endif // OPT4048_H