Design Pattern Examples
Overview of object-oriented design patterns
helpers/uint32_to_binary.h File Reference

Declaration of the uint32_to_binary() function, that converts a 32-bit unsigned integer to a binary string. Need this since C does not normally provide a printf() converter to binary. More...

#include <stdint.h>
Include dependency graph for helpers/uint32_to_binary.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __UINT32_TO_BINARY_H__
 

Functions

void uint32_to_binary (uint32_t number, char *buffer, size_t bufferSize)
 Function to convert a 32-bit unsigned integer into a string representation containing all 32 bits.
 

Detailed Description

Declaration of the uint32_to_binary() function, that converts a 32-bit unsigned integer to a binary string. Need this since C does not normally provide a printf() converter to binary.

Definition in file helpers/uint32_to_binary.h.

Macro Definition Documentation

◆ __UINT32_TO_BINARY_H__

#define __UINT32_TO_BINARY_H__

Definition at line 9 of file helpers/uint32_to_binary.h.

Function Documentation

◆ uint32_to_binary()

void uint32_to_binary ( uint32_t  number,
char *  buffer,
size_t  bufferSize 
)

Function to convert a 32-bit unsigned integer into a string representation containing all 32 bits.

Need this since C does not normally provide a printf() converter to binary.

Parameters
numberThe number to convert to a string representation in binary.
bufferA buffer to store the string representation.
bufferSizeThe size of the buffer. Should be at least 33 characters.

Definition at line 16 of file uint32_to_binary.c.

Referenced by ObserverForBinary_NumberChanged().