libosmocore 1.13.1.1-afb4 Osmocom core library

Functions | Variables
prbs.c File Reference
`#include <stdint.h>`
`#include <string.h>`
`#include "config.h"`
`#include <osmocom/core/bits.h>`
`#include <osmocom/core/prbs.h>`

## Functions
void | osmo_prbs_state_init (struct osmo_prbs_state *st, const struct osmo_prbs *prbs)
| Initialize the given caller-allocated PRBS state. More...
static void | osmo_prbs_process_bit (struct osmo_prbs_state *state, ubit_t bit)
ubit_t | osmo_prbs_get_ubit (struct osmo_prbs_state *state)
| Get the next bit out of given PRBS instance. More...
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. More...

## Variables
const struct osmo_prbs | osmo_prbs7
| PRBS-7 according ITU-T O.150. More...
const struct osmo_prbs | osmo_prbs9
| PRBS-9 according ITU-T O.150. More...
const struct osmo_prbs | osmo_prbs11
| PRBS-11 according ITU-T O.150. More...
const struct osmo_prbs | osmo_prbs15
| PRBS-15 according ITU-T O.150. More...

## Function Documentation

## ◆ osmo_prbs_get_ubit()

ubit_t osmo_prbs_get_ubit | ( | struct osmo_prbs_state * | state | ) |

Get the next bit out of given PRBS instance.

References osmo_prbs_process_bit(), and osmo_prbs_state::state.

Referenced by osmo_prbs_get_ubits().

## ◆ 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.

References osmo_prbs_get_ubit().

## ◆ osmo_prbs_process_bit()

static void osmo_prbs_process_bit | ( | struct osmo_prbs_state * | state,
|  | ubit_t | bit
| ) |  |
| static

References osmo_prbs::coeff, osmo_prbs_state::prbs, and osmo_prbs_state::state.

Referenced by osmo_prbs_get_ubit().

## ◆ 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.

References osmo_prbs_state::prbs, and osmo_prbs_state::state.

## Variable Documentation

## ◆ osmo_prbs11

const struct osmo_prbs osmo_prbs11

Initial value:
= {
.name = "PRBS-11",
.len = 11,
.coeff = (1<<10) | (1<<8),
}

PRBS-11 according ITU-T O.150.

## ◆ osmo_prbs15

const struct osmo_prbs osmo_prbs15

Initial value:
= {
.name = "PRBS-15",
.len = 15,
.coeff = (1<<14) | (1<<13),
}

PRBS-15 according ITU-T O.150.

## ◆ osmo_prbs7

const struct osmo_prbs osmo_prbs7

Initial value:
= {
.name = "PRBS-7",
.len = 7,
.coeff = (1<<6) | (1<<5),
}

PRBS-7 according ITU-T O.150.

## ◆ osmo_prbs9

const struct osmo_prbs osmo_prbs9

Initial value:
= {
.name = "PRBS-9",
.len = 9,
.coeff = (1<<8) | (1<<4),
}

PRBS-9 according ITU-T O.150.