ModbusMaster  v2.0.1
Arduino library for communicating with Modbus slaves over RS232/485 (via RTU protocol).
"util/word.h": Utility Functions for Manipulating Words

Functions

static uint16_t lowWord (uint32_t ww)
 Return low word of a 32-bit integer. More...
 
static uint16_t highWord (uint32_t ww)
 Return high word of a 32-bit integer. More...
 

Detailed Description

#include "util/word.h"

This header file provides utility functions for manipulating words.

Function Documentation

§ lowWord()

static uint16_t lowWord ( uint32_t  ww)
inlinestatic

Return low word of a 32-bit integer.

Parameters
uint32_tww (0x00000000..0xFFFFFFFF)
Returns
low word of input (0x0000..0xFFFF)
Examples:
examples/Basic/Basic.pde, and examples/PhoenixContact_nanoLC/PhoenixContact_nanoLC.pde.
47 {
48  return (uint16_t) ((ww) & 0xFFFF);
49 }

§ highWord()

static uint16_t highWord ( uint32_t  ww)
inlinestatic

Return high word of a 32-bit integer.

Parameters
uint32_tww (0x00000000..0xFFFFFFFF)
Returns
high word of input (0x0000..0xFFFF)
Examples:
examples/Basic/Basic.pde, and examples/PhoenixContact_nanoLC/PhoenixContact_nanoLC.pde.
59 {
60  return (uint16_t) ((ww) >> 16);
61 }