1 // ----------------------------------------------------------------------------
2 // psm/psm.h
3 //
4 // Support for Signal Montoring, CSMA, Transmit Inhibit (Busy Detection)
5 // Effect all transmission types, Keybord, ARQ and KISS interface.
6 //
7 // Copyright (c) 2016
8 //		Robert Stiles, KK5VD
9 //
10 // This file is part of fldigi.
11 //
12 // Fldigi is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // Fldigi is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with fldigi.  If not, see <http://www.gnu.org/licenses/>.
24 // ----------------------------------------------------------------------------
25 
26 #ifndef __psm_h__
27 #define __psm_h__
28 
29 enum {
30 	CSMA_PERSISTANCE = 0x01,
31 	CSMA_SLOT_TIME   = 0x02,
32 	CSMA_TX_DELAY    = 0x04,
33 	CSMA_ALL         = (CSMA_PERSISTANCE|CSMA_SLOT_TIME|CSMA_TX_DELAY)
34 };
35 
36 enum {
37 	PSM_STOP = 1,
38 	PSM_ABORT
39 };
40 
41 extern bool psm_thread_running;
42 
43 extern void psm_reset_histogram(void);
44 extern void psm_transmit(void);
45 extern void psm_transmit_ended(int flag);
46 extern void start_psm_thread(void);
47 extern void stop_psm_thread(void);
48 extern void signal_psm(void);
49 extern void update_kpsql_fractional_gain(int value);
50 extern void update_csma_io_config(int update_this);
51 
52 #endif /* __psm_h__ */
53