knx
ETS configurable knx-stack
bits.h File Reference
#include <cstddef>
#include <cstdint>
#include <arpa/inet.h>
#include <Arduino.h>
Include dependency graph for bits.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MIN(a, b)   ((a < b) ? (a) : (b))
 
#define MAX(a, b)   ((a > b) ? (a) : (b))
 
#define ABS(x)   ((x > 0) ? (x) : (-x))
 

Enumerations

enum  ParameterFloatEncodings { Float_Enc_DPT9 = 0 , Float_Enc_IEEE754Single = 1 , Float_Enc_IEEE754Double = 2 }
 

Functions

void print (const char[])
 
void print (char)
 
void print (unsigned char, int=DEC)
 
void print (int, int=DEC)
 
void print (unsigned int, int=DEC)
 
void print (long, int=DEC)
 
void print (unsigned long, int=DEC)
 
void print (long long, int=DEC)
 
void print (unsigned long long, int=DEC)
 
void print (double)
 
void println (const char[])
 
void println (char)
 
void println (unsigned char, int=DEC)
 
void println (int, int=DEC)
 
void println (unsigned int, int=DEC)
 
void println (long, int=DEC)
 
void println (unsigned long, int=DEC)
 
void println (long long, int=DEC)
 
void println (unsigned long long, int=DEC)
 
void println (double)
 
void println (void)
 
void printHex (const char *suffix, const uint8_t *data, size_t length, bool newline=true)
 
const uint8_t * popByte (uint8_t &b, const uint8_t *data)
 
const uint8_t * popWord (uint16_t &w, const uint8_t *data)
 
const uint8_t * popInt (uint32_t &i, const uint8_t *data)
 
const uint8_t * popByteArray (uint8_t *dst, uint32_t size, const uint8_t *data)
 
uint8_t * pushByte (uint8_t b, uint8_t *data)
 
uint8_t * pushWord (uint16_t w, uint8_t *data)
 
uint8_t * pushInt (uint32_t i, uint8_t *data)
 
uint8_t * pushByteArray (const uint8_t *src, uint32_t size, uint8_t *data)
 
uint16_t getWord (const uint8_t *data)
 
uint32_t getInt (const uint8_t *data)
 
void sixBytesFromUInt64 (uint64_t num, uint8_t *toByteArray)
 
uint64_t sixBytesToUInt64 (uint8_t *data)
 
uint16_t crc16Ccitt (uint8_t *input, uint16_t length)
 
uint16_t crc16Dnp (uint8_t *input, uint16_t length)
 

Macro Definition Documentation

◆ ABS

#define ABS (   x)    ((x > 0) ? (x) : (-x))

Definition at line 25 of file bits.h.

◆ MAX

#define MAX (   a,
 
)    ((a > b) ? (a) : (b))

Definition at line 21 of file bits.h.

◆ MIN

#define MIN (   a,
 
)    ((a < b) ? (a) : (b))

Definition at line 17 of file bits.h.

Enumeration Type Documentation

◆ ParameterFloatEncodings

Enumerator
Float_Enc_DPT9 
Float_Enc_IEEE754Single 
Float_Enc_IEEE754Double 

Definition at line 114 of file bits.h.

Function Documentation

◆ crc16Ccitt()

uint16_t crc16Ccitt ( uint8_t *  input,
uint16_t  length 
)

Definition at line 125 of file bits.cpp.

Here is the caller graph for this function:

◆ crc16Dnp()

uint16_t crc16Dnp ( uint8_t *  input,
uint16_t  length 
)

Definition at line 142 of file bits.cpp.

◆ getInt()

uint32_t getInt ( const uint8_t *  data)

Definition at line 89 of file bits.cpp.

Here is the caller graph for this function:

◆ getWord()

uint16_t getWord ( const uint8_t *  data)

Definition at line 84 of file bits.cpp.

Here is the caller graph for this function:

◆ popByte()

const uint8_t* popByte ( uint8_t &  b,
const uint8_t *  data 
)

Definition at line 4 of file bits.cpp.

Here is the caller graph for this function:

◆ popByteArray()

const uint8_t* popByteArray ( uint8_t *  dst,
uint32_t  size,
const uint8_t *  data 
)

Definition at line 41 of file bits.cpp.

Here is the caller graph for this function:

◆ popInt()

const uint8_t* popInt ( uint32_t &  i,
const uint8_t *  data 
)

Definition at line 34 of file bits.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ popWord()

const uint8_t* popWord ( uint16_t &  w,
const uint8_t *  data 
)

Definition at line 27 of file bits.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print() [1/10]

void print ( char  c)

Definition at line 148 of file arduino_platform.cpp.

◆ print() [2/10]

void print ( const char  [])

◆ print() [3/10]

void print ( double  num)

Definition at line 213 of file arduino_platform.cpp.

◆ print() [4/10]

void print ( int  num,
int  base = DEC 
)

Definition at line 168 of file arduino_platform.cpp.

◆ print() [5/10]

void print ( long long  ,
int  = DEC 
)

◆ print() [6/10]

void print ( long  num,
int  base = DEC 
)

Definition at line 188 of file arduino_platform.cpp.

◆ print() [7/10]

void print ( unsigned char  num,
int  base = DEC 
)

Definition at line 158 of file arduino_platform.cpp.

◆ print() [8/10]

void print ( unsigned int  num,
int  base = DEC 
)

Definition at line 178 of file arduino_platform.cpp.

◆ print() [9/10]

void print ( unsigned long long  num,
int  base = DEC 
)

Definition at line 208 of file arduino_platform.cpp.

Here is the call graph for this function:

◆ print() [10/10]

void print ( unsigned long  num,
int  base = DEC 
)

Definition at line 198 of file arduino_platform.cpp.

◆ printHex()

void printHex ( const char *  suffix,
const uint8_t *  data,
size_t  length,
bool  newline = true 
)

Definition at line 12 of file bits.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ println() [1/11]

void println ( char  c)

Definition at line 223 of file arduino_platform.cpp.

◆ println() [2/11]

void println ( const char  [])

◆ println() [3/11]

void println ( double  num)

Definition at line 290 of file arduino_platform.cpp.

◆ println() [4/11]

void println ( int  num,
int  base = DEC 
)

Definition at line 243 of file arduino_platform.cpp.

◆ println() [5/11]

void println ( long long  ,
int  = DEC 
)

◆ println() [6/11]

void println ( long  num,
int  base = DEC 
)

Definition at line 263 of file arduino_platform.cpp.

◆ println() [7/11]

void println ( unsigned char  num,
int  base = DEC 
)

Definition at line 233 of file arduino_platform.cpp.

◆ println() [8/11]

void println ( unsigned int  num,
int  base = DEC 
)

Definition at line 253 of file arduino_platform.cpp.

◆ println() [9/11]

void println ( unsigned long long  num,
int  base = DEC 
)

Definition at line 284 of file arduino_platform.cpp.

Here is the call graph for this function:

◆ println() [10/11]

void println ( unsigned long  num,
int  base = DEC 
)

Definition at line 273 of file arduino_platform.cpp.

◆ println() [11/11]

void println ( void  )

Definition at line 295 of file arduino_platform.cpp.

◆ pushByte()

uint8_t* pushByte ( uint8_t  b,
uint8_t *  data 
)

Definition at line 50 of file bits.cpp.

Here is the caller graph for this function:

◆ pushByteArray()

uint8_t* pushByteArray ( const uint8_t *  src,
uint32_t  size,
uint8_t *  data 
)

Definition at line 75 of file bits.cpp.

Here is the caller graph for this function:

◆ pushInt()

uint8_t* pushInt ( uint32_t  i,
uint8_t *  data 
)

Definition at line 65 of file bits.cpp.

Here is the caller graph for this function:

◆ pushWord()

uint8_t* pushWord ( uint16_t  w,
uint8_t *  data 
)

Definition at line 57 of file bits.cpp.

Here is the caller graph for this function:

◆ sixBytesFromUInt64()

void sixBytesFromUInt64 ( uint64_t  num,
uint8_t *  toByteArray 
)

Definition at line 94 of file bits.cpp.

◆ sixBytesToUInt64()

uint64_t sixBytesToUInt64 ( uint8_t *  data)

Definition at line 104 of file bits.cpp.