SX126x-Arduino  2.0.1
Macros | Functions
utilities.h File Reference
#include <Arduino.h>

Go to the source code of this file.

Macros

#define POW2(n)   (1 << n)
 Returns 2 raised to the power of n. More...
 
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
 
#define MAX(a, b)   ((a) < (b) ? (b) : (a))
 

Functions

void srand1 (uint32_t seed)
 Initializes the pseudo random generator initial value. More...
 
int32_t randr (int32_t min, int32_t max)
 Computes a random number between min and max. More...
 
void memcpy1 (uint8_t *dst, const uint8_t *src, uint16_t size)
 Copies size elements of src array to dst array. More...
 
void memcpyr (uint8_t *dst, const uint8_t *src, uint16_t size)
 Copies size elements of src array to dst array reversing the byte order. More...
 
void memset1 (uint8_t *dst, uint8_t value, uint16_t size)
 Set size elements of dst array with value. More...
 
int8_t Nibble2HexChar (uint8_t a)
 Converts a nibble to an hexadecimal character. More...
 

Macro Definition Documentation

◆ POW2

#define POW2 (   n)    (1 << n)

Returns 2 raised to the power of n.

Parameters
npower value
Return values
resultof raising 2 to the power n

◆ MIN

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

Leaves the minimum of the two 32-bit arguments

◆ MAX

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

Leaves the maximum of the two 32-bit arguments

Function Documentation

◆ srand1()

void srand1 ( uint32_t  seed)

Initializes the pseudo random generator initial value.

Parameters
seedPseudo random generator initial value

◆ randr()

int32_t randr ( int32_t  min,
int32_t  max 
)

Computes a random number between min and max.

Parameters
minrange minimum value
maxrange maximum value
Return values
randomrandom value in range min..max

◆ memcpy1()

void memcpy1 ( uint8_t *  dst,
const uint8_t *  src,
uint16_t  size 
)

Copies size elements of src array to dst array.

Remarks
STM32 Standard memcpy function only works on pointers that are aligned
Parameters
dstDestination array
srcSource array
sizeNumber of bytes to be copied

◆ memcpyr()

void memcpyr ( uint8_t *  dst,
const uint8_t *  src,
uint16_t  size 
)

Copies size elements of src array to dst array reversing the byte order.

Parameters
dstDestination array
srcSource array
sizeNumber of bytes to be copied

◆ memset1()

void memset1 ( uint8_t *  dst,
uint8_t  value,
uint16_t  size 
)

Set size elements of dst array with value.

Remarks
STM32 Standard memset function only works on pointers that are aligned
Parameters
dstDestination array
valueDefault value
sizeNumber of bytes to be copied

◆ Nibble2HexChar()

int8_t Nibble2HexChar ( uint8_t  a)

Converts a nibble to an hexadecimal character.

Parameters
aNibble to be converted
Return values
hexCharConverted hexadecimal character