|
@ -402,18 +402,12 @@ data to be converted on a channel. The data can be aligned as follows: |
|
|
@li right-aligned 12 bit data in bits 0-11 |
|
|
@li right-aligned 12 bit data in bits 0-11 |
|
|
@li left aligned 12 bit data in bits 4-15 |
|
|
@li left aligned 12 bit data in bits 4-15 |
|
|
|
|
|
|
|
|
This function can also be used to load the dual channel registers if the data is |
|
|
@param[in] dac_data u16 with appropriate alignment. |
|
|
formatted according to the datasheets: |
|
|
|
|
|
@li right-aligned 8 bit data in bits 0-7 for channel 1 and 8-15 for channel 2 |
|
|
|
|
|
@li right-aligned 12 bit data in bits 0-11 for channel 1 and 16-27 for channel 2 |
|
|
|
|
|
@li left aligned 12 bit data in bits 4-15 for channel 1 and 20-31 for channel 2 |
|
|
|
|
|
|
|
|
|
|
|
@param[in] dac_data u32 with appropriate alignment. |
|
|
|
|
|
@param[in] dac_data_format enum ::data_align. Alignment and size. |
|
|
@param[in] dac_data_format enum ::data_align. Alignment and size. |
|
|
@param[in] dac_channel enum ::data_channel. |
|
|
@param[in] dac_channel enum ::data_channel. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
void dac_load_data_buffer_single(u32 dac_data, data_align dac_data_format, data_channel dac_channel) |
|
|
void dac_load_data_buffer_single(u16 dac_data, data_align dac_data_format, data_channel dac_channel) |
|
|
{ |
|
|
{ |
|
|
if (dac_channel == CHANNEL_1) |
|
|
if (dac_channel == CHANNEL_1) |
|
|
{ |
|
|
{ |
|
@ -443,18 +437,6 @@ void dac_load_data_buffer_single(u32 dac_data, data_align dac_data_format, data_ |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
|
|
|
switch (dac_data_format) { |
|
|
|
|
|
case RIGHT8: |
|
|
|
|
|
DAC_DHR8RD = dac_data; |
|
|
|
|
|
break; |
|
|
|
|
|
case RIGHT12: |
|
|
|
|
|
DAC_DHR12RD = dac_data; |
|
|
|
|
|
break; |
|
|
|
|
|
case LEFT12: |
|
|
|
|
|
DAC_DHR12LD = dac_data; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------------*/ |
|
|
/*-----------------------------------------------------------------------------*/ |
|
@ -465,12 +447,12 @@ Loads the appropriate digital to analog converter dual data register with 12 or |
|
|
simultaneous or independent analog output. The data in both channels are aligned |
|
|
simultaneous or independent analog output. The data in both channels are aligned |
|
|
identically. |
|
|
identically. |
|
|
|
|
|
|
|
|
@param[in] dac_data1 u32 for channel 1 with appropriate alignment. |
|
|
@param[in] dac_data1 u16 for channel 1 with appropriate alignment. |
|
|
@param[in] dac_data2 u32 for channel 2 with appropriate alignment. |
|
|
@param[in] dac_data2 u16 for channel 2 with appropriate alignment. |
|
|
@param[in] dac_data_format enum ::data_align. Right or left aligned, and 8 or 12 bit. |
|
|
@param[in] dac_data_format enum ::data_align. Right or left aligned, and 8 or 12 bit. |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
void dac_load_data_buffer_dual(u32 dac_data1, u32 dac_data2, data_align dac_data_format) |
|
|
void dac_load_data_buffer_dual(u16 dac_data1, u16 dac_data2, data_align dac_data_format) |
|
|
{ |
|
|
{ |
|
|
switch (dac_data_format) { |
|
|
switch (dac_data_format) { |
|
|
case RIGHT8: |
|
|
case RIGHT8: |
|
|