summaryrefslogtreecommitdiff
path: root/stacks/max25-bcpr/include/bcpr/bcpr_config.h
blob: 158bf7370ab4ec649ea636b1dd6085727f14883e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#ifndef BCPR_CONFIG_H
#define BCPR_CONFIG_H

#include "bcpr/bcpr.h"

/* TXD charge-pump policy (English INI: txd_bias=pulse|steady). */
enum {
    BCPR_TXD_PULSE = 0,  /* Sailer/default: THR←0x00 every tick (framing edges) */
    BCPR_TXD_STEADY = 1  /* TFPCX-class experiment: UART break ≈ continuous SPACE */
};

typedef struct bcpr_dev_config {
    int enabled;
    char serial[64];
    unsigned int iobase;
    unsigned int irq; /* real UART IRQ — must match setserial */
    unsigned int baud;
    char mode[16]; /* ser12* / ser12 / ser12+ */
    char kiss_link[256];
    int tx_delay;  /* 10 ms units */
    int tx_tail;
    int slottime;
    int ppersist;
    int fulldup;
    /*
     * FlexNet SER12.doc PTT watchdog mirror (cal / sustained key):
     * after ptt_wd_key_ms keyed → clear RTS ~ptt_wd_pause_ms → resume.
     * Defaults 14500 / 500. ptt_wd=0 disables.
     */
    int ptt_wd;
    int ptt_wd_key_ms;
    int ptt_wd_pause_ms;
    int txd_bias; /* BCPR_TXD_* */
    /*
     * Software TOT (host policy — not radio TOT):
     * max_key_ms = max continuous PTT per burst;
     * min_gap_ms = min idle between bursts (matches TX pace);
     * max_consecutive = back-to-back bursts (min_gap..session) before trip;
     * max_bursts = total bursts before trip (each burst <= max_key_ms).
     */
    int tot_enabled;
    int tot_max_key_ms;
    int tot_min_gap_ms;
    int tot_max_consecutive;
    int tot_max_bursts;
} bcpr_dev_config_t;

typedef struct bcpr_config {
    bcpr_dev_config_t dev[BCPR_MAX_DEVICES];
    int n_dev;
    int dry_run; /* no ioperm / no setserial */
    char state_dir[128];
    char run_user[64];
    char run_group[64];
    /* Global defaults copied onto devices that omit per-bcN keys. */
    int ptt_wd;
    int ptt_wd_key_ms;
    int ptt_wd_pause_ms;
    int txd_bias;
    int tot_enabled;
    int tot_max_key_ms;
    int tot_min_gap_ms;
    int tot_max_consecutive;
    int tot_max_bursts;
} bcpr_config_t;

int bcpr_config_load(bcpr_config_t *cfg, const char *path);
void bcpr_config_defaults(bcpr_config_t *cfg);

#endif
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com