Energy Meter IC Family Software Instruction Manual

71M652X Software User’s Guide
Revision 1.7 TERIDIAN Proprietary 38 of 138
© Copyright 2005-2007 TERIDIAN Semiconductor Corporation
General data type definitions:
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed long int32_t
Type definitions for internal data, lower 128 bytes, addressed directly:
typedef unsigned char data uint8d_t;
typedef unsigned short data uint16d_t;
typedef unsigned long data uint32d_t;
typedef signed char data int8d_t;
typedef signed short data int16d_t;
typedef signed long data int32d_t;
This is the fastest available memory (except registers), not battery-backed-up, but competes with stack, registers,
booleans, and idata.
Note: For portability, see uint_fast8_t and its sisters, which are POSIX standard.
Type definitions for internal data, 16 bytes (0x20 to0x2F), addressed directly, and bit addressable
:
typedef unsigned char bdata uint8b_t;
typedef unsigned short bdata uint16b_t;
typedef unsigned long bdata uint32b_t;
typedef signed char bdata int8b_t;
typedef signed short bdata int16b_t;
typedef signed long bdata int32b_t;
This is the fastest available memory, but it is not battery-backed-up. It competes with stack, registers, bools, data, and
idata. The space is valuable for boolean globals and should not be wasted.
Booleans are not a normal part of stdint.h, but fairly portable. When using the Keil compiler, the Booleans are stored in
the address range 0x20 to 0x2F. Keil functions return bools in the carry bit, which makes code that's fast and small.
typedef bit bool;
#define TRUE 1
#define FALSE 0
#define ON 1
#define OFF 0