Add new TRAU frame sync code

This code is able to detect and sync against a variety of TRAU
frame sync patterns.  Focus is so far on those patterns present on
16k sub-slots, but 8k sub-slots are expected to be supported soon,
too.

A new codebase for this is required as the old OsmoNITB code had
conflated a 16k sub-slot multiplexer with TRAU frame synchronization,
so there was no way to separate those two parts and hence no way to
support 8k sub-slots.

Change-Id: Ia6fe6228b0b8b9a27999f37ce1115ed5558881ea
diff --git a/include/osmocom/trau/trau_sync.h b/include/osmocom/trau/trau_sync.h
new file mode 100644
index 0000000..46595be
--- /dev/null
+++ b/include/osmocom/trau/trau_sync.h
@@ -0,0 +1,19 @@
+#pragma once
+#include <osmocom/core/bits.h>
+#include <osmocom/core/fsm.h>
+
+enum osmo_tray_sync_pat_id {
+	OSMO_TRAU_SYNCP_16_FR_EFR,
+	OSMO_TRAU_SYNCP_8_HR,
+	OSMO_TRAU_SYNCP_8_AMR_LOW,
+	OSMO_TRAU_SYNCP_8_AMR_6K7,
+	OSMO_TRAU_SYNCP_8_AMR_7K4,
+};
+
+typedef void (*frame_out_cb_t)(void *user_data, const ubit_t *bits, unsigned int num_bits);
+
+struct osmo_fsm_inst *
+osmo_trau_sync_alloc(void *ctx, const char *name, frame_out_cb_t frame_out_cb,
+		     enum osmo_tray_sync_pat_id pat_id, void *user_data);
+
+void osmo_trau_sync_rx_ubits(struct osmo_fsm_inst *fi, const ubit_t *bits, size_t n_bits);