ModbusMaster  v2.0.1
Arduino library for communicating with Modbus slaves over RS232/485 (via RTU protocol).
word.h
Go to the documentation of this file.
1 
11 /*
12 
13  word.h - Utility Functions for Manipulating Words
14 
15  This file is part of ModbusMaster.
16 
17  ModbusMaster is free software: you can redistribute it and/or modify
18  it under the terms of the GNU General Public License as published by
19  the Free Software Foundation, either version 3 of the License, or
20  (at your option) any later version.
21 
22  ModbusMaster is distributed in the hope that it will be useful,
23  but WITHOUT ANY WARRANTY; without even the implied warranty of
24  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  GNU General Public License for more details.
26 
27  You should have received a copy of the GNU General Public License
28  along with ModbusMaster. If not, see <http://www.gnu.org/licenses/>.
29 
30  Written by Doc Walker (Rx)
31  Copyright © 2009-2015 Doc Walker <4-20ma at wvfans dot net>
32 
33 */
34 
35 
36 #ifndef _UTIL_WORD_H_
37 #define _UTIL_WORD_H_
38 
39 
46 static inline uint16_t lowWord(uint32_t ww)
47 {
48  return (uint16_t) ((ww) & 0xFFFF);
49 }
50 
51 
58 static inline uint16_t highWord(uint32_t ww)
59 {
60  return (uint16_t) ((ww) >> 16);
61 }
62 
63 
64 #endif /* _UTIL_WORD_H_ */
static uint16_t lowWord(uint32_t ww)
Return low word of a 32-bit integer.
Definition: word.h:46
static uint16_t highWord(uint32_t ww)
Return high word of a 32-bit integer.
Definition: word.h:58