libosmocore 1.9.0.196-9975
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
6struct 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
18extern const struct osmo_prbs osmo_prbs7;
19extern const struct osmo_prbs osmo_prbs9;
20extern const struct osmo_prbs osmo_prbs11;
21extern const struct osmo_prbs osmo_prbs15;
22
23void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs);
25int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state);
Osmocom bit level support code.
uint8_t ubit_t
unpacked bit (0 or 1): 1 bit per byte
Definition: bits.h:24
const struct osmo_prbs osmo_prbs7
PRBS-7 according ITU-T O.150.
Definition: prbs.c:14
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
const struct osmo_prbs osmo_prbs15
PRBS-15 according ITU-T O.150.
Definition: prbs.c:38
ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state)
Get the next bit out of given PRBS instance.
Definition: prbs.c:61
const struct osmo_prbs osmo_prbs9
PRBS-9 according ITU-T O.150.
Definition: prbs.c:22
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
const struct osmo_prbs osmo_prbs11
PRBS-11 according ITU-T O.150.
Definition: prbs.c:30
state of a given PRBS sequence generator
Definition: prbs.h:13
const struct osmo_prbs * prbs
Definition: prbs.h:14
uint64_t state
Definition: prbs.h:15
definition of a PRBS sequence
Definition: prbs.h:6
uint64_t coeff
coefficients
Definition: prbs.h:9
const char * name
human-readable name
Definition: prbs.h:7
unsigned int len
length in bits
Definition: prbs.h:8