GY-63_MS5611/libraries/DAC8550
2022-08-03 21:56:07 +02:00
..
.github add funding.yml 2022-08-03 21:56:07 +02:00
examples 0.1.1 DAC8550 2021-08-29 16:38:03 +02:00
test 0.1.2 DAC8550 2021-12-15 12:15:43 +01:00
.arduino-ci.yml 0.1.2 DAC8550 2021-12-15 12:15:43 +01:00
DAC8550.cpp 0.1.2 DAC8550 2021-12-15 12:15:43 +01:00
DAC8550.h 0.1.2 DAC8550 2021-12-15 12:15:43 +01:00
keywords.txt 0.1.2 DAC8550 2021-12-15 12:15:43 +01:00
library.json 0.1.2 DAC8550 2021-12-15 12:15:43 +01:00
library.properties 0.1.2 DAC8550 2021-12-15 12:15:43 +01:00
LICENSE 0.1.2 DAC8550 2021-12-15 12:15:43 +01:00
README.md 0.1.2 DAC8550 2021-12-15 12:15:43 +01:00

Arduino CI Arduino-lint JSON check License: MIT GitHub release

DAC8550 - experimental

Arduino library for DAC8550 SPI Digital Analog Convertor.

Description

The DAC8550 is a SPI based 16 bit DAC with one channel.

WARNING this library is not tested with real hardware yet. It is derived from the DAC8551 library.

Interface

Core

  • DAC8550(uint8_t slaveSelect) Constructor for hardware SPI, the slaveSelect pin needs to be defined.
  • DAC8550(uint8_t spiData, uint8_t spiClock, uint8_t slaveSelect) Constructor for the software SPI.
  • void begin() initializes all pins to default state.
  • void setValue(uint16_t value) set the value of the channel to 0 - 65535
  • uint16_t getValue() returns the last value written.

Hardware SPI

To be used only if one needs a specific speed.

  • void setSPIspeed(uint32_t speed) set SPI transfer rate.
  • uint32_t getSPIspeed() returns SPI transfer rate.
  • bool usesHWSPI() returns true if HW SPI is used.

ESP32 specific

  • void selectHSPI() in case hardware SPI, the ESP32 has two options HSPI and VSPI.
  • void selectVSPI() see above.
  • bool usesHSPI() returns true if HSPI is used.
  • bool usesVSPI() returns true if VSPI is used.

The selectVSPI() or the selectHSPI() needs to be called BEFORE the begin() function.

experimental

  • void setGPIOpins(uint8_t clk, uint8_t miso, uint8_t mosi, uint8_t select) overrule GPIO pins of ESP32 for hardware SPI. needs to be called AFTER the begin() function.

Power down

check datasheet for details.

  • void setPowerDown(uint8_t powerDownMode) sets power down mode. 0 - 3.
  • uint8_t getPowerDownMode() returns last written mode.
Power down mode Value
DAC8550_POWERDOWN_NORMAL 0
DAC8550_POWERDOWN_1K 1
DAC8550_POWERDOWN_100K 2
DAC8550_POWERDOWN_HIGH_IMP 3

Future

  • testing with real hardware

Operation

See examples