GNU Radio's SATELLITES Package
ra_config.h
Go to the documentation of this file.
1 /* -*- c -*- */
2 /*
3  * Copyright 2015-2019 Miklos Maroti
4  * Copyright 2019 Daniel Estevez <daniel@destevez.net> (reentrant version)
5  *
6  * This file is part of gr-satellites
7  *
8  * SPDX-License-Identifier: GPL-3.0-or-later
9  *
10  */
11 
12 #ifndef RA_CONFIG_H
13 #define RA_CONFIG_H
14 
15 #include <stdint.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 typedef uint16_t ra_word_t; /* use uint16_t for SSE4.1 soft decoder */
22 typedef uint16_t ra_index_t; /* use uint16_t for RA_PACKET_LENGTH >= 256 */
23 
24 enum {
25  /* number of words, must be at least 4 */
27 
28  /* 1 for rate 1/4, 2 for 2/5, 3 for 1/2, 5 for 5/8 */
30 
31  /* use the test program to verify it */
33 };
34 
35 enum { RA_BITCOUNT = 8 * sizeof(ra_word_t), RA_BITSHIFT = RA_BITCOUNT - 1 };
36 
37 struct ra_context {
38  ra_index_t ra_data_length;
39  ra_index_t ra_code_length;
40  ra_index_t ra_chck_length;
41  uint16_t ra_lfsr_masks[4];
42  uint8_t ra_lfsr_highbit;
43 
44  // for ra_lfsr
45  ra_index_t ra_lfsr_mask;
46  ra_index_t ra_lfsr_state;
47  ra_index_t ra_lfsr_offset;
48 
49  // for ra_decoder_gen
53 
54  // for ra_encoder
55  const ra_word_t* ra_packet;
56  ra_word_t ra_nextword;
57  uint8_t ra_passno;
58 };
59 
60 /* data length in words */
61 void ra_length_init(struct ra_context* ctx, ra_index_t data_length);
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif // RA_CONFIG_H
const ra_word_t * ra_packet
Definition: ra_config.h:55
ra_index_t ra_lfsr_mask
Definition: ra_config.h:45
Definition: ra_config.h:29
Definition: ra_config.h:32
ra_index_t ra_chck_length
Definition: ra_config.h:40
uint8_t ra_lfsr_highbit
Definition: ra_config.h:42
Definition: ra_config.h:35
uint8_t ra_passno
Definition: ra_config.h:57
ra_index_t ra_data_length
Definition: ra_config.h:38
Definition: ra_config.h:35
ra_index_t ra_lfsr_offset
Definition: ra_config.h:47
void ra_length_init(struct ra_context *ctx, ra_index_t data_length)
uint16_t ra_word_t
Definition: ra_config.h:21
Definition: ra_config.h:37
float ra_forward_gen[RA_MAX_DATA_LENGTH *RA_BITCOUNT]
Definition: ra_config.h:52
ra_index_t ra_code_length
Definition: ra_config.h:39
Definition: ra_config.h:26
ra_index_t ra_lfsr_state
Definition: ra_config.h:46
uint16_t ra_index_t
Definition: ra_config.h:22
ra_word_t ra_nextword
Definition: ra_config.h:56
uint16_t ra_lfsr_masks[4]
Definition: ra_config.h:41
float ra_dataword_gen[RA_MAX_DATA_LENGTH *RA_BITCOUNT]
Definition: ra_config.h:50
float ra_codeword_gen[RA_MAX_CODE_LENGTH *RA_BITCOUNT]
Definition: ra_config.h:51