Prusa MINI Firmware overview
hex_print_routines.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * Based on Sprinter and grbl.
6  * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 #include <stdint.h>
25 
26 //
27 // Utility functions to create and print hex strings as nybble, byte, and word.
28 //
29 
31  return (n & 0xF) + ((n & 0xF) < 10 ? '0' : 'A' - 10);
32 }
33 char* hex_byte(const uint8_t b);
34 char* hex_word(const uint16_t w);
35 char* hex_address(const void * const w);
36 
37 void print_hex_nybble(const uint8_t n);
38 void print_hex_byte(const uint8_t b);
39 void print_hex_word(const uint16_t w);
40 void print_hex_address(const void * const w);
41 void print_hex_long(const uint32_t w, const char delimiter);
42 
43 #ifdef CPU_32_BIT
44  typedef uint32_t ptr_int_t;
45 #else
46  typedef uint16_t ptr_int_t;
47 #endif
SERIAL_CHAR
#define SERIAL_CHAR(x)
Definition: serial.h:69
hex_byte
char * hex_byte(const uint8_t b)
Definition: hex_print_routines.cpp:38
SERIAL_ECHO
#define SERIAL_ECHO(x)
Definition: serial.h:70
ptr_int_t
uint16_t ptr_int_t
Definition: hex_print_routines.h:46
print_hex_nybble
void print_hex_nybble(const uint8_t n)
Definition: hex_print_routines.cpp:76
print_hex_address
void print_hex_address(const void *const w)
Definition: hex_print_routines.cpp:79
_hex_word
void _hex_word(const uint16_t w)
Definition: hex_print_routines.cpp:44
hex_nybble
FORCE_INLINE char hex_nybble(const uint8_t n)
Definition: hex_print_routines.h:30
hex_print_routines.h
print_hex_byte
void print_hex_byte(const uint8_t b)
Definition: hex_print_routines.cpp:77
_hex
static char _hex[]
Definition: hex_print_routines.cpp:35
FORCE_INLINE
#define FORCE_INLINE
Definition: macros.h:40
print_hex_long
void print_hex_long(const uint32_t w, const char delimiter)
Definition: hex_print_routines.cpp:81
hex_word
char * hex_word(const uint16_t w)
Definition: hex_print_routines.cpp:51
void
void
Definition: png.h:1083
SERIAL_ECHOPGM
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
print_hex_address
void print_hex_address(const void *const w)
Definition: hex_print_routines.cpp:79
print_hex_long
void print_hex_long(const uint32_t w, const char delimiter)
Definition: hex_print_routines.cpp:81
print_hex_word
void print_hex_word(const uint16_t w)
Definition: hex_print_routines.cpp:78
uint8_t
const uint8_t[]
Definition: 404_html.c:3
hex_address
char * hex_address(const void *const w)
Definition: hex_print_routines.cpp:67
hex_byte
char * hex_byte(const uint8_t b)
Definition: hex_print_routines.cpp:38
print_hex_byte
void print_hex_byte(const uint8_t b)
Definition: hex_print_routines.cpp:77
print_hex_nybble
void print_hex_nybble(const uint8_t n)
Definition: hex_print_routines.cpp:76
byte_start
constexpr int byte_start
Definition: hex_print_routines.cpp:34
print_hex_word
void print_hex_word(const uint16_t w)
Definition: hex_print_routines.cpp:78
hex_address
char * hex_address(const void *const w)
Definition: hex_print_routines.cpp:67
hex_word
char * hex_word(const uint16_t w)
Definition: hex_print_routines.cpp:51
createSpeedLookupTable.b
list b
Definition: createSpeedLookupTable.py:30