libosmocore  1.5.1
Osmocom core library
prbs.h
Go to the documentation of this file.
1 #pragma once
2 #include <stdint.h>
3 #include <osmocom/core/bits.h>
4 
6 struct osmo_prbs {
7  const char *name;
8  unsigned int len;
9  uint64_t coeff;
10 };
11 
14  const struct osmo_prbs *prbs;
15  uint64_t state;
16 };
17 
18 extern const struct osmo_prbs osmo_prbs7;
19 extern const struct osmo_prbs osmo_prbs9;
20 extern const struct osmo_prbs osmo_prbs11;
21 extern const struct osmo_prbs osmo_prbs15;
22 
23 void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs);
25 int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state);
osmo_prbs_state::prbs
const struct osmo_prbs * prbs
Definition: prbs.h:14
osmo_prbs::name
const char * name
human-readable name
Definition: prbs.h:7
osmo_prbs_state_init
void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs)
Initialize the given caller-allocated PRBS state.
Definition: prbs.c:46
osmo_prbs_get_ubit
ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state)
Get the next bit out of given PRBS instance.
Definition: prbs.c:61
bits.h
osmo_prbs_get_ubits
int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state)
Fill buffer of unpacked bits with next bits out of given PRBS instance.
Definition: prbs.c:70
osmo_prbs
definition of a PRBS sequence
Definition: prbs.h:6
osmo_prbs::coeff
uint64_t coeff
coefficients
Definition: prbs.h:9
osmo_prbs9
const struct osmo_prbs osmo_prbs9
PRBS-9 according ITU-T O.150.
Definition: prbs.c:22
osmo_prbs7
const struct osmo_prbs osmo_prbs7
PRBS-7 according ITU-T O.150.
Definition: prbs.c:14
osmo_prbs::len
unsigned int len
length in bits
Definition: prbs.h:8
ubit_t
uint8_t ubit_t
unpacked bit (0 or 1): 1 bit per byte
Definition: bits.h:24
osmo_prbs15
const struct osmo_prbs osmo_prbs15
PRBS-15 according ITU-T O.150.
Definition: prbs.c:38
osmo_prbs_state::state
uint64_t state
Definition: prbs.h:15
osmo_prbs11
const struct osmo_prbs osmo_prbs11
PRBS-11 according ITU-T O.150.
Definition: prbs.c:30
osmo_prbs_state
state of a given PRBS sequence generator
Definition: prbs.h:13