User manual
 


Predefined Types, Macros and Constants

Processor Expert generates definitions of all hardware register structures to the file IO_Map.h. The Processor Expert type definitions are generated to the file PE_Types.h containing also definitions of macros used for a peripheral register access.

Types

Type Description
int8_t 8-bit signed integer
int16_t 16-bit signed integer
int32_t 32-bit signed integer
int64_t 32-bit signed integer
uint8_t 8-bit unsigned integer
uint16_t 16-bit unsigned integer
uint32_t 32-bit unsigned integer
uint64_t 64-bit unsigned integer
TPE_ErrCode Error code (uint8_t)
byte 8-bit unsigned integer (unsigned char)
bool Boolean value (unsigned char) (TRUE = any non-zero value / FALSE = 0)
word 16-bit unsigned integer (unsigned int)
dword 32-bit unsigned integer (unsigned long)

Structure for images

typedef struct {          /* Black&White Image  */
  word width;             /* Image width  */
  word height;            /* Image height */
  byte *pixmap;           /* Image pixel bitmap */
  word size;              /* Image size   */
  char *name;             /* Image name   */
} TIMAGE;
typedef TIMAGE* PIMAGE ;  /* Pointer to image */

Structure for 16-bit register:

/* 16-bit register (big endian format) */
typedef union {
   word w;
   struct {
     byte high,low;
   } b;
} TWREG;

Macros

__DI()             - Disable global interrupts
__EI()             - Enable global interrupts
SaveStatusReg()    - It saves CCR register and disable
                     global interrupts
RestoreStatusReg() - It restores CCR register saved
                     in SaveStatusReg()
for the list of macros used for Peripheral registers access.

Constants

Methods Error Codes

The error codes are defined in PE_Error module. Error code value is 8bit unsigned byte. Range 0 - 127 is reserved for PE, 128 - 255 for user

ERR_OK 0 OK
ERR_SPEED 1 This device does not work in the active speed mode
ERR_RANGE 2 Parameter out of range
ERR_VALUE 3 Parameter of incorrect value
ERR_OVERFLOW 4 Timer overflow
ERR_MATH 5 Overflow during evaluation
ERR_ENABLED 6 Device is enabled
ERR_DISABLED 7 Device is disabled
ERR_BUSY 8 Device is busy
ERR_NOTAVAIL 9 Requested value not available
ERR_RXEMPTY 10 No data in receiver
ERR_TXFULL 11 Transmitter is full
ERR_BUSOFF 12 Bus not available
ERR_OVERRUN 13 Overrun is present
ERR_FRAMING 14 Framing error is detected
ERR_PARITY 15 Parity error is detected
ERR_NOISE 16 Noise error is detected
ERR_IDLE 17 Idle error is detected
ERR_FAULT 18 Fault error is detected
ERR_BREAK 19 Break char is received during communication
ERR_CRC 20 CRC error is detected
ERR_ARBITR 21 A node loses arbitration. This error occurs if two nodes start transmission at the same time
ERR_PROTECT 22 Protection error is detected.
ERR_UNDERFLOW 23 Underflow error is detected.
ERR_UNDERRUN 24 Underrun error is detected.
ERR_COMMON 25 General unspecified error of a device. The user can get a specific error code using the method GetError.

 

[top of page]




©2005 UNIS, Ltd. All rights reserved.