#ifndef _ADCM_CHBUF_IMPL_H
#define _ADCM_CHBUF_IMPL_H 1

#ifdef __cplusplus
extern "C" {
#endif

#include "adcm16.h"

  struct adcm_chbuf_t {
    unsigned int flags;
    unsigned int ch; // channel number
    unsigned int len;
    unsigned int ts;
// decoded parameters
    unsigned int tp;            // threshold position
    float b;                    // baseline
    float i;                    // integral
    float dc;
    float rms;
    int pp;                     // peak index
    float fasttime;             // peak coarse time
    float fastnorm;             // coarse time fit norm
    float pt;                   // peak fine time
    float pa;                   // peak amplitude
    float pw;                   // peak width
    float pchi2;                // normalized by a and len
    int pniter;
    unsigned short w_bits;
    unsigned short w[ADCM_MAX_N_SAMP];
  };

#ifdef __cplusplus
}
#endif

#endif /* _ADCM_CHBUF_IMPL_H */
