BeRTOS
Functions
tlv5618.h File Reference

Texas instrument TLV5618 DAC driver. More...

#include <cfg/compiler.h>
#include <io/kfile.h>

Go to the source code of this file.

Functions

void tlv5618_setOutA (Tlv5618 *ctx, uint16_t val)
 Set DAC output A to val.
void tlv5618_setOutB (Tlv5618 *ctx, uint16_t val)
 Set DAC output B to val.
void tlv5618_setPowerDown (Tlv5618 *ctx)
 Set the TLV5618 in the power down state.
void tlv5618_init (Tlv5618 *ctx, KFile *ch, int pin)
 Init the TLV5618 with CS connected to cs_pin.

Detailed Description

Texas instrument TLV5618 DAC driver.

Author:
Francesco Sacchi <batt@develer.com>

Definition in file tlv5618.h.


Function Documentation

void tlv5618_init ( Tlv5618 *  ctx,
KFile ch,
int  cs_pin 
)

Init the TLV5618 with CS connected to cs_pin.

ch should be the SPI channel needed to communicate with the DAC. This SPI should also be correctly configured (the MOSI should change on the rising edge of the SCK clock).

Note:
the device is set in power down mode.

Definition at line 97 of file tlv5618.c.

void tlv5618_setOutA ( Tlv5618 *  ctx,
uint16_t  val 
)

Set DAC output A to val.

val ranges from 0 to 4095 (12 bit).

Note:
: if in power down, the device will be awaken.

Definition at line 64 of file tlv5618.c.

void tlv5618_setOutB ( Tlv5618 *  ctx,
uint16_t  val 
)

Set DAC output B to val.

val ranges from 0 to 4095 (12 bit).

Note:
: if in power down, the device will be awaken.

Definition at line 75 of file tlv5618.c.