#pragma once
#include "data_types.h"
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>

int64_t read_raw_m03(FILE *fp, int64_t n_frames, char *frame_out,
                     Header *header_out);

int64_t read_raw_m04(FILE *fp, int64_t n_frames, char *frame_out,
                     char *digital_out, Header *header_out);

void decode_moench03(const uint16_t *buf, uint16_t *out_buf);

void decode_moench04(const uint16_t *analog_data, const uint64_t *digital_data,
                     uint16_t *analog_frame, uint8_t *digital_frame);