 }
 
 /*
+===================================
+reads the current data channel
+@param byte - current data channel
+@return int - error code
+===================================
+*/
+int get_current_adc_data_channel(byte &channel) {
+    byte value[1];
+    /* read ADC status register */
+    get_adc_register(STATUS_REG, value, 1);
+    channel = value[0];
+    /* return error code */
+    return 0;
+}
+
+/*
 ============================================
 initializes the SPI connection with the ADC
 @return bool - is ADC ID valid

@return byte[] - the ADC register read result
=============================================
*/
int read_adc_register(byte reg, byte *value, int read_len) {
    /* when specified register is invalid */
    if (reg < 0x00 || reg > 0x3F) {
        if (DEBUG_ENABLED) {

int set_adc_setup_codig(byte setupcon, int coding_mode) {
    byte value[2];
    /* read the current register value */
    get_adc_register(setupcon, value, 2);
    /* set the coding mode to default */
    value[0] &= 0x7F;
    /* set the desired coding */
    value[0] |= (coding_mode << 7);
    /* write the new register value */
    set_adc_register(setupcon, value, 2);
    /* set to new coding mode */
    adc_setup_coding_output = coding_mode;
    /* return error code */
