Maxim Integrated 7-bit Sink/Source Current DAC. DS4424, DS4422 input/output current Digital-to-Analog Converter Driver/library code.
Dependents: DS4424_Hello_Current_DAC_on_MAX32630FTHR
Diff: DS4424.cpp
- Revision:
- 1:a5d963a3c298
- Parent:
- 0:8002303900e6
- Child:
- 2:b7a81b724561
--- a/DS4424.cpp Tue Jul 03 20:09:09 2018 +0000 +++ b/DS4424.cpp Mon Sep 10 21:53:18 2018 +0000 @@ -79,14 +79,14 @@ //****************************************************************************** -int DS4424::readRaw(int32_t &result, ChannelRegAddr_e chan_addr) +int DS4424::read_raw(int32_t &result, ChannelRegAddr_e chan_addr) { uint8_t value; int ret = DS4424_ERROR; union ds4424_raw_data raw; if (chan_addr >= REG_OUT0 && chan_addr <= m_max_ch_reg_addr) - ret = readRegister(chan_addr, value); + ret = read_register(chan_addr, value); if (ret != 0) return DS4424_ERROR; @@ -101,7 +101,7 @@ //****************************************************************************** -int DS4424::writeRaw(int32_t value, ChannelRegAddr_e chan_addr) +int DS4424::write_raw(int32_t value, ChannelRegAddr_e chan_addr) { #define U8_MAX ((uint8_t)~0U) #define S8_MAX ((int8_t)(U8_MAX>>1)) @@ -118,7 +118,7 @@ raw.source_bit = DS4424_SINK_I; raw.dx = -value; } - ret = writeRegister(chan_addr, raw.bits); + ret = write_register(chan_addr, raw.bits); if (ret != 0) return DS4424_ERROR; @@ -130,7 +130,7 @@ //****************************************************************************** -int DS4424::readRegister(ChannelRegAddr_e reg, uint8_t &value) +int DS4424::read_register(ChannelRegAddr_e reg, uint8_t &value) { int32_t ret; @@ -147,7 +147,7 @@ printf("%s - failed - ret: %d\r\n", __func__, ret); return DS4424_ERROR; } - + value = data; return DS4424_NO_ERROR; @@ -155,7 +155,7 @@ //****************************************************************************** -int DS4424::writeRegister(ChannelRegAddr_e reg, uint8_t value) +int DS4424::write_register(ChannelRegAddr_e reg, uint8_t value) { int32_t ret;