Files
RP2350_MIDI_Lighter/Firmware/INA260.h
Chris 128d42c586 - Fixed drawing of round objects (Circles, Rounded Rects) using a lookup table
- Added function to read out the display_buffer via USB-Serial
 - Added basic structure and files for later complete firmware (still in progress)
 - Added Doc folder with schematic in it
 - Added Python script and batch file to read out the display buffer and open the image in gimp
2025-09-07 08:55:39 +02:00

44 lines
1.4 KiB
C

/*
* File: INA260.h
* Created: Created: Sunday August 2025 21:52:19
* Author: Chris
*/
#ifndef INA260_H
#define INA260_H
// ============================================================================================
// Includes
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
// ============================================================================================
// Defines
#define INA260_REG_CONFIG 0x00 ///< Configuration register
#define INA260_REG_CURRENT 0x01 ///< Current measurement register (signed) in mA
#define INA260_REG_BUSVOLTAGE 0x02 ///< Bus voltage measurement register in mV
#define INA260_REG_POWER 0x03 ///< Power calculation register in mW
#define INA260_REG_MASK_ENABLE 0x06 ///< Interrupt/Alert setting and checking register
#define INA260_REG_ALERT_LIMIT 0x00 ///< Alert limit value register
#define INA260_REG_MFG_UID 0xFE ///< Manufacturer ID Register
#define INA260_REG_DIE_UID 0xFF ///< Die ID and Revision Register
// ============================================================================================
// Datatypes
// ============================================================================================
// Function Declarations
void INA260_Init();
void INA260_Read_BusVoltage();
void INA260_Read_Current();
uint16_t INA260_Get_BusVoltage_mV();
uint16_t INA260_Get_Current_mA();
#endif // INA260_H