summaryrefslogtreecommitdiffstats
path: root/src/prbs.h
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-30 11:30:35 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-10-30 11:30:35 +0100
commitb073c0eb1e5bf676a24f225779cc31d3c9f21fd4 (patch)
tree30255dfeaa30044ada8f7252712a29fc5a353e71 /src/prbs.h
parente7ad2e1fab9c51189fdc8b4f2d81f625da9dd422 (diff)
downloaddabmux-b073c0eb1e5bf676a24f225779cc31d3c9f21fd4.tar.gz
dabmux-b073c0eb1e5bf676a24f225779cc31d3c9f21fd4.tar.bz2
dabmux-b073c0eb1e5bf676a24f225779cc31d3c9f21fd4.zip
Use modern data types in prbs
Diffstat (limited to 'src/prbs.h')
-rw-r--r--src/prbs.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/prbs.h b/src/prbs.h
index 5b6b7c2..0c29965 100644
--- a/src/prbs.h
+++ b/src/prbs.h
@@ -30,7 +30,7 @@
class PrbsGenerator {
public:
- void setup(long polynomial);
+ void setup(uint32_t polynomial);
uint8_t step(void);
@@ -42,30 +42,30 @@ class PrbsGenerator {
void gen_prbs_table(void);
/* Update a 32-bit PRBS generator eight bits at a time. */
- unsigned long update_prbs(void);
+ uint32_t update_prbs(void);
/* Generate the weight table. */
void gen_weight_table(void);
/* Count the number of errors in a block of received data. */
size_t error_count(
- unsigned char *rx_data,
- int rx_data_length);
+ uint8_t *rx_data,
+ size_t rx_data_length);
void gen_sequence(
- unsigned char *tx_data,
- int tx_data_length,
- unsigned long polynomial);
+ uint8_t *tx_data,
+ size_t tx_data_length,
+ uint32_t polynomial);
// table of matrix products used to update a 32-bit PRBS generator
- unsigned long prbs_table [4] [256];
+ uint32_t prbs_table [4] [256];
// table of weights for 8-bit bytes
- unsigned char weight[256];
+ uint8_t weight[256];
// PRBS polynomial generator
- unsigned long polynomial;
+ uint32_t polynomial;
// PRBS generator polarity mask
- unsigned char polarity_mask;
+ uint8_t polarity_mask;
// PRBS accumulator
- unsigned long accum;
+ uint32_t accum;
};