MLC interface driver
Utils for DAC real time output.

Macros

#define DAC_CH_A   0
 
#define DAC_CH_B   1
 
#define DAC_CH_C   2
 
#define DAC_CH_D   3
 
#define DAC_CH_E   4
 
#define DAC_CH_F   5
 
#define DAC_CH_G   6
 
#define DAC_CH_H   7
 
#define dac_reset()   MLC_DAC_reset()
 
#define dac_control   MLC_DAC_control
 
#define dac_write   MLC_DAC_write
 
#define write_dac   MLC_DAC_write
 
#define dac_init()   MLC_DAC_init()
 
#define dac_sel_channel   dac_sel_ch
 
#define dac_variables   dac_values
 

Functions

void MLC_DAC_reset (void)
 
void MLC_DAC_control (uint16_t cmd)
 
void MLC_DAC_write (uint16_t count)
 
void MLC_DAC_init (void)
 

Variables

uint16_t dac_values [8]
 
uint16_t dac_sel_ch [8]
 

Detailed Description

Macro Definition Documentation

#define DAC_CH_A   0

Constant for access channel A of DAC.

Definition at line 722 of file MLC_drv.h.

Referenced by MLC_DAC_init().

#define DAC_CH_B   1

Constant for access channel B of DAC.

Definition at line 723 of file MLC_drv.h.

Referenced by MLC_DAC_init().

#define DAC_CH_C   2

Constant for access channel C of DAC.

Definition at line 724 of file MLC_drv.h.

Referenced by MLC_DAC_init().

#define DAC_CH_D   3

Constant for access channel D of DAC.

Definition at line 725 of file MLC_drv.h.

Referenced by MLC_DAC_init().

#define DAC_CH_E   4

Constant for access channel E of DAC.

Definition at line 726 of file MLC_drv.h.

Referenced by MLC_DAC_init().

#define DAC_CH_F   5

Constant for access channel F of DAC.

Definition at line 727 of file MLC_drv.h.

Referenced by MLC_DAC_init().

#define DAC_CH_G   6

Constant for access channel G of DAC.

Definition at line 728 of file MLC_drv.h.

Referenced by MLC_DAC_init().

#define DAC_CH_H   7

Constant for access channel H of DAC.

Definition at line 729 of file MLC_drv.h.

Referenced by MLC_DAC_init().

#define dac_control   MLC_DAC_control

Backward compatibility macro

Definition at line 754 of file MLC_drv.h.

#define dac_init ( )    MLC_DAC_init()

Backward compatibility macro

Definition at line 757 of file MLC_drv.h.

#define dac_reset ( )    MLC_DAC_reset()

Backward compatibility macro

Definition at line 753 of file MLC_drv.h.

#define dac_sel_channel   dac_sel_ch

Backward compatibility macro

Definition at line 758 of file MLC_drv.h.

#define dac_variables   dac_values

Backward compatibility macro

Definition at line 759 of file MLC_drv.h.

#define dac_write   MLC_DAC_write

Backward compatibility macro

Definition at line 755 of file MLC_drv.h.

#define write_dac   MLC_DAC_write

Backward compatibility macro

Definition at line 756 of file MLC_drv.h.

Function Documentation

void MLC_DAC_control ( uint16_t  cmd)

Sends control word to DAC, according to datasheet of AD5328.

Parameters
cmdword to send as configuration.

Definition at line 1494 of file MLC_drv.c.

void MLC_DAC_init ( void  )

Initializes DAC, setup it according to flags DAC_USE_x. It also set array of channels to default state, where value with index 0 will be send to DAC_CH_A etc. This means, that we do not need to write dac_sel_ch array.

Definition at line 1428 of file MLC_drv.c.

References DAC_CH_A, DAC_CH_B, DAC_CH_C, DAC_CH_D, DAC_CH_E, DAC_CH_F, DAC_CH_G, DAC_CH_H, dac_sel_ch, and MLC_DAC_reset().

Here is the call graph for this function:

void MLC_DAC_reset ( void  )

Reset DAC, this must be called before any access to DAC.

Definition at line 1506 of file MLC_drv.c.

References DELAY_US().

Referenced by MLC_DAC_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void MLC_DAC_write ( uint16_t  count)

Function to send data from buffer to DAC. It can be defined how many values we need to write out.

Parameters
countnumber in range <0,7>. It then send values from dac_values to channel defined in dac_sel_ch from 0 to count. I.e. count = 4 sends values from 0 to 4.

Definition at line 1551 of file MLC_drv.c.

References dac_sel_ch, and dac_values.

Variable Documentation

uint16_t dac_sel_ch[8]

Array which maps values from dac_values array to DAC outputs

Definition at line 115 of file MLC_drv.c.

Referenced by MLC_DAC_init(), and MLC_DAC_write().

uint16_t dac_values[8]

Array which stores values to send to channel defined in dac_sel_ch

Definition at line 114 of file MLC_drv.c.

Referenced by MLC_DAC_write().