Functions | Variables

sermsg.c File Reference

primitives for sending numbers over the serial link More...

#include "sermsg.h"
#include "serial.h"

Functions

void serwrite_hex4 (uint8_t v)
 write a single hex digit
void serwrite_hex8 (uint8_t v)
 write a pair of hex digits
void serwrite_hex16 (uint16_t v)
 write four hex digits
void serwrite_hex32 (uint32_t v)
 write eight hex digits
void serwrite_uint32 (uint32_t v)
 write decimal digits from a long unsigned int
void serwrite_int32 (int32_t v)
 write decimal digits from a long signed int

Variables

const uint32_t powers [] = {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000}
 list of powers of ten, used for dividing down decimal numbers for sending, and also for our crude floating point algorithm

Detailed Description

primitives for sending numbers over the serial link


Function Documentation

void serwrite_hex16 ( uint16_t  v )

write four hex digits

Parameters:
vword to write

Referenced by sersendf_P(), and serwrite_hex32().

void serwrite_hex32 ( uint32_t  v )

write eight hex digits

Parameters:
vlong word to write

Referenced by sersendf_P().

void serwrite_hex4 ( uint8_t  v )

write a single hex digit

Parameters:
vhex digit to write, higher nibble ignored

Referenced by serwrite_hex8().

void serwrite_hex8 ( uint8_t  v )

write a pair of hex digits

Parameters:
vbyte to write. One byte gives two hex digits

Referenced by process_gcode_command(), sersendf_P(), and serwrite_hex16().

void serwrite_int32 ( int32_t  v )

write decimal digits from a long signed int

Parameters:
vnumber to send

Referenced by gcode_parse_char(), and sersendf_P().

void serwrite_uint32 ( uint32_t  v )

write decimal digits from a long unsigned int

Parameters:
vnumber to send

Referenced by gcode_parse_char(), sersendf_P(), and serwrite_int32().

 All Data Structures Files Functions Variables Defines