MCP4725
1.0.0
MCP4725 library DAC for PICO rp2040
|
Library header file for MCP4725 PICO DAC library. More...
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/i2c.h"
#include <cmath>
Go to the source code of this file.
Classes | |
class | MCP4725_PICO |
Class for MCP4725_PIC0 DAC. More... | |
Macros | |
#define | MCP4725_I2C_DELAY 50000 |
#define | MCP4725_ERROR 0xFFFF |
#define | MCP4725_EEPROM_WRITE_TIME 25 |
#define | MCP4725_REFERENCE_VOLTAGE 3.3 |
#define | MCP4725_RESOLUTION 12 |
#define | MCP4725_STEPS pow(2, (MCP4725_RESOLUTION)) |
#define | MCP4725_MAX_VALUE ((MCP4725_STEPS) - 1) |
Enumerations | |
enum | MCP4725_I2C_Addr_e : uint8_t { MCP4725A0_Addr_A00 = 0x60 , MCP4725A0_Addr_A01 = 0x61 , MCP4725A1_Addr_A00 = 0x62 , MCP4725A1_Addr_A01 = 0x63 , MCP4725A2_Addr_A00 = 0x64 , MCP4725A2_Addr_A01 = 0x65 } |
enum | MCP4725_CmdType_e : uint8_t { MCP4725_FastMode = 0x00 , MCP4725_RegisterMode = 0x40 , MCP4725_EEPROM_Mode = 0x60 } |
enum | MCP4725_PowerDownType_e : uint8_t { MCP4725_PowerDown_Off = 0x00 , MCP4725_PowerDown_1kOhm = 0x01 , MCP4725_PowerDown_100kOhm = 0x02 , MCP4725_PowerDown_500kOhm = 0x03 } |
enum | MCP4725_ReadType_e : uint8_t { MCP4725_ReadSettings = 1 , MCP4725_ReadDACReg = 3 , MCP4725_ReadEEPROM = 5 } |
enum | MCP4725_GeneralCallType_e : uint8_t { MCP4725_GeneralCallAddress = 0x00 , MCP4725_GeneralCallReset = 0x06 , MCP4725_GeneralCallWakeUp = 0x09 } |
Library header file for MCP4725 PICO DAC library.
#define MCP4725_EEPROM_WRITE_TIME 25 |
mSec Memory write time, maximum 50 mSec
#define MCP4725_ERROR 0xFFFF |
returns this value if I2C bus error from some methods
#define MCP4725_I2C_DELAY 50000 |
uS delay , I2C timeout
#define MCP4725_MAX_VALUE ((MCP4725_STEPS) - 1) |
Max value = 4096 -1 , 0 to 4095
#define MCP4725_REFERENCE_VOLTAGE 3.3 |
supply-reference Voltage in volts
#define MCP4725_RESOLUTION 12 |
resolution in bits , 12-bit
#define MCP4725_STEPS pow(2, (MCP4725_RESOLUTION)) |
quantity of DAC steps 2^12-bits = 4096
enum MCP4725_CmdType_e : uint8_t |
enum MCP4725_GeneralCallType_e : uint8_t |
enum MCP4725_I2C_Addr_e : uint8_t |
enum MCP4725_PowerDownType_e : uint8_t |
DAC register, power down bits PD1 PD0 , BSY,POR,xx,xx,xx,PD1,PD0,xx
enum MCP4725_ReadType_e : uint8_t |