| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions
LTC2662.cpp File Reference
Digital-to-Analog Converters (DAC) » LTC2662 5-Channel 16-/12-Bit 300mA SoftSpan Current Source DACs

LTC2662: 5-Channel 16-/12-Bit 300mA SoftSpan Current Source DACs. More...

## Detailed Description

LTC2662: 5-Channel 16-/12-Bit 300mA SoftSpan Current Source DACs.

Definition in file LTC2662.cpp.

Go to the source code of this file.

## Functions
int8_t | LTC2662_write (uint8_t cs, uint8_t dac_command, uint8_t dac_address, uint16_t dac_code)
| Write the 16-bit dac_code to the LTC2662. More...
uint16_t | LTC2662_current_to_code (float dac_current, float max_output)
| Calculate a LTC2662 DAC code given the desired output current. More...
float | LTC2662_code_to_current (uint16_t dac_code, float max_output)
| Calculate the LTC2662 DAC output current given the DAC code and max output. More...

## Function Documentation

## ◆ LTC2662_code_to_current()

float LTC2662_code_to_current | ( | uint16_t | dac_code,
|  | float | max_output
| ) |  |

Calculate the LTC2662 DAC output current given the DAC code and max output.

Returns
  the output voltage

Parameters

  dac_code | DAC code value
  max_output | Full scale current

Definition at line 102 of file LTC2662.cpp.

## ◆ LTC2662_current_to_code()

uint16_t LTC2662_current_to_code | ( | float | dac_current,
|  | float | max_output
| ) |  |

Calculate a LTC2662 DAC code given the desired output current.

Returns
  The 16 bit code to send to the DAC

Parameters

  dac_current | Desired current
  max_output | Full scale current

Definition at line 88 of file LTC2662.cpp.

## ◆ LTC2662_write()

int8_t LTC2662_write | ( | uint8_t | cs,
|  | uint8_t | dac_command,
|  | uint8_t | dac_address,
|  | uint16_t | dac_code
| ) |  |

Write the 16-bit dac_code to the LTC2662.

Returns
  Zero if readback (SDO) data matches the value previously sent, One if mismatched (indicating data error somewhere)

Parameters

  cs | Chip select
  dac_command | DAC command word
  dac_address | DAC channel address
  dac_code | 2 byte dac code

Definition at line 70 of file LTC2662.cpp.