Loading...
Searching...
No Matches
prbs.h
Go to the documentation of this file.
#pragma once
#include <stdint.h>
#include <osmocom/core/bits.h>
struct osmo_prbs {
const char *name;
unsigned int len;
uint64_t coeff;
};
struct osmo_prbs_state {
const struct osmo_prbs *prbs;
uint64_t state;
};
extern const struct osmo_prbs osmo_prbs7;
extern const struct osmo_prbs osmo_prbs9;
extern const struct osmo_prbs osmo_prbs11;
extern const struct osmo_prbs osmo_prbs15;
void osmo_prbs_state_init(struct osmo_prbs_state *st, const struct osmo_prbs *prbs);
ubit_t osmo_prbs_get_ubit(struct osmo_prbs_state *state);
int osmo_prbs_get_ubits(ubit_t *out, unsigned int out_len, struct osmo_prbs_state *state);
bits.h
Osmocom bit level support code.
ubit_t
uint8_t ubit_t
unpacked bit (0 or 1): 1 bit per byte
Definition bits.h:24
osmo_prbs7
const struct osmo_prbs osmo_prbs7
PRBS-7 according ITU-T O.150.
Definition prbs.c:15
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:47
osmo_prbs15
const struct osmo_prbs osmo_prbs15
PRBS-15 according ITU-T O.150.
Definition prbs.c:39
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:62
osmo_prbs9
const struct osmo_prbs osmo_prbs9
PRBS-9 according ITU-T O.150.
Definition prbs.c:23
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:71
osmo_prbs11
const struct osmo_prbs osmo_prbs11
PRBS-11 according ITU-T O.150.
Definition prbs.c:31
osmo_prbs_state
state of a given PRBS sequence generator
Definition prbs.h:13
osmo_prbs_state::prbs
const struct osmo_prbs * prbs
Definition prbs.h:14
osmo_prbs_state::state
uint64_t state
Definition prbs.h:15
osmo_prbs
definition of a PRBS sequence
Definition prbs.h:6
osmo_prbs::coeff
uint64_t coeff
coefficients
Definition prbs.h:9
osmo_prbs::name
const char * name
human-readable name
Definition prbs.h:7
osmo_prbs::len
unsigned int len
length in bits
Definition prbs.h:8