Add DAC setup code
Extract declarations to header file