#include <uint16.h> uint16 u;uint16 is a 16-bit unsigned integer type, normally unsigned short.
#include <uint16.h> uint16_pack(s,u); uint16_unpack(s,&u); uint16 u; char s[2];uint16_pack finds integers u0 and u1 between 0 and 255 inclusive such that u equals u0+256*u1. It then stores u0 in s[0] and u1 in s[1].
uint16_unpack extracts u0 from s[0] and u1 from s[1]. It then sets u to u0+256*u1.
#include <uint16.h> uint16_pack_big(s,u); uint16_unpack_big(s,&u); uint16 u; char s[2];uint16_pack_big finds integers u0 and u1 between 0 and 255 inclusive such that u equals u0+256*u1. It then stores u0 in s[1] and u1 in s[0].
uint16_unpack_big extracts u0 from s[1] and u1 from s[0]. It then sets u to u0+256*u1.