beautypg.com

Maxim Integrated 71M6534 Energy Meter IC Family Software User Manual

Page 44

background image

71M653X Software User’s Guide

The demo software defines standard integers in util\stdint.h following the industry-standard notation.

General data type definitions:

typedef unsigned char

uint8_t; // an 8-bit byte, unsigned

typedef unsigned short

uint16_t; // a 16-bit unsigned integer

typedef unsigned long

uint32_t; // a 32-bit unsigned integer

typedef signed char

int8_t; // a signed 8-bit integer

typedef signed short

int16_t; // a signed 16-bit integer

typedef signed long

int32_t; // a signed 32-bit integer

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;

Internal data is the fastest available memory (except registers), not battery-backed-up, but competes with stack,
registers, booleans, and idata for space.

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;

Bit addressable memory is the fastest available memory, but it is not battery-backed-up. It competes with stack,
registers, bools, data, and idata for space. The space is valuable for boolean globals and should not be wasted.

Booleans are not a normal part of stdint.h, but they are 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

v1.1v1.1

TERIDIAN Proprietary

44 of 116

© Copyright 2005-2008 TERIDIAN Semiconductor Corporation

This manual is related to the following products: