USB-BDI
Defines | Functions
M:/USB-BDI/USB-BDI/Firmware/MPC555-USB-BDI/include/dispatch.h File Reference

headerfile for dispatch.c More...

#include "fx2regs.h"
#include "syncdelay.h"

Go to the source code of this file.

Defines

#define MTYPE_ERROR   0x01
#define MTYPE_BDI_555   0x02
#define MTYPE_BDI_332   0x03
#define MTYPE_UART   0x04
#define STYPE_ERROR_UNKNOWN_MTYPE   0x70
#define STYPE_ERROR_HEADER   0x71
#define STYPE_ERROR_PACKET_END   0x72
#define STYPE_BDI_GET_FREEZE   0x08
#define STYPE_BDI_555_35IN   0x01
#define STYPE_BDI_555_35OUT   0x02
#define STYPE_BDI_555_10IN   0x03
#define STYPE_BDI_555_10OUT   0x04
#define STYPE_BDI_555_FD_DATA   0x05
#define STYPE_BDI_555_HARD_RESET   0x06
#define STYPE_BDI_332_HARD_RESET   0x07
#define STYPE_BDI_332_IN   0x10
#define STYPE_BDI_332_OUT   0x11
#define STYPE_BDI_332_FILL_BYTE_WORD   0x12
#define STYPE_BDI_332_FILL_LONG   0x13
#define STYPE_BDI_332_DUMP   0x14
#define STYPE_BDI_SUCCESS_FD   0x60
#define STYPE_BDI_HARD_RESET_SUCCESS   0x61
#define STYPE_BDI_FREEZE_RESULT   0x62
#define STYPE_BDI_DUMP_DATA   0x63
#define STYPE_BDI_UNKNOWN_STYPE   0x70
#define STYPE_BDI_ERROR_FD_LENGTH   0x71
#define STYPE_BDI_ERROR_FD_GENERAL   0x72
#define STYPE_BDI_ERROR_TIMEOUT   0x73
#define STYPE_BDI_DUMP_ERROR   0x74
#define STYPE_UART_0_IN   0x11
#define STYPE_UART_0_OUT   0x22
#define STYPE_UART_SUCCESS   0x60
#define STYPE_UART_UNKNOWN_STYPE   0x70
#define STYPE_UART_DATA_TOO_LONG   0x71

Functions

void initPacket (unsigned char mainType, unsigned char subType, unsigned short dataLength)
 this method prepares a package before its send to the host
void dispatch (unsigned short dataLength)
 Handles the MSG from the host.

Detailed Description

headerfile for dispatch.c

Author:
Schlaepfer Stephan
Version:
1.0
Date:
24.10.2006

Definition in file dispatch.h.


Define Documentation

#define MTYPE_BDI_332   0x03

messages for mpc 332

Definition at line 36 of file dispatch.h.

#define MTYPE_BDI_555   0x02

messages for mpc 555

Definition at line 34 of file dispatch.h.

#define MTYPE_ERROR   0x01

general errors

Definition at line 32 of file dispatch.h.

#define MTYPE_UART   0x04

message to uart0 (sci1 msp555)

Definition at line 38 of file dispatch.h.

#define STYPE_BDI_332_DUMP   0x14

Dump target memory (Dump)

Definition at line 79 of file dispatch.h.

#define STYPE_BDI_332_FILL_BYTE_WORD   0x12

Fast Download Data (Fill)

Definition at line 75 of file dispatch.h.

#define STYPE_BDI_332_FILL_LONG   0x13

Fast Download Data (Fill)

Definition at line 77 of file dispatch.h.

#define STYPE_BDI_332_HARD_RESET   0x07

Hard Reset 332

Definition at line 69 of file dispatch.h.

#define STYPE_BDI_332_IN   0x10

17 Bit Packet to BDI

Definition at line 71 of file dispatch.h.

#define STYPE_BDI_332_OUT   0x11

17 Bit Packet from BDI

Definition at line 73 of file dispatch.h.

#define STYPE_BDI_555_10IN   0x03

10 Bit Packet to BDI

Definition at line 60 of file dispatch.h.

#define STYPE_BDI_555_10OUT   0x04

10 Bit Packet from BDI

Definition at line 62 of file dispatch.h.

#define STYPE_BDI_555_35IN   0x01

35 Bit Packet to BDI

Definition at line 56 of file dispatch.h.

#define STYPE_BDI_555_35OUT   0x02

35 Bit Packet from BDI

Definition at line 58 of file dispatch.h.

#define STYPE_BDI_555_FD_DATA   0x05

Fast Download Data

Definition at line 64 of file dispatch.h.

#define STYPE_BDI_555_HARD_RESET   0x06

Hard Reset 555

Definition at line 66 of file dispatch.h.

#define STYPE_BDI_DUMP_DATA   0x63

Dump Data

Definition at line 89 of file dispatch.h.

#define STYPE_BDI_DUMP_ERROR   0x74

Dump error

Definition at line 100 of file dispatch.h.

#define STYPE_BDI_ERROR_FD_GENERAL   0x72

General FD Error

Definition at line 96 of file dispatch.h.

#define STYPE_BDI_ERROR_FD_LENGTH   0x71

Error if length in FD (Fast Download) packet too small

Definition at line 94 of file dispatch.h.

#define STYPE_BDI_ERROR_TIMEOUT   0x73

Timeout (DSDO not low)

Definition at line 98 of file dispatch.h.

#define STYPE_BDI_FREEZE_RESULT   0x62

Freeze-Signal status (length = 1 byte)

Definition at line 87 of file dispatch.h.

#define STYPE_BDI_GET_FREEZE   0x08

Get status of Freeze-Signal

Definition at line 53 of file dispatch.h.

#define STYPE_BDI_HARD_RESET_SUCCESS   0x61

HARD_RESET done

Definition at line 85 of file dispatch.h.

#define STYPE_BDI_SUCCESS_FD   0x60

Fast Download successfully finished

Definition at line 83 of file dispatch.h.

#define STYPE_BDI_UNKNOWN_STYPE   0x70

Unknown STYPE

Definition at line 92 of file dispatch.h.

#define STYPE_ERROR_HEADER   0x71

Header of packet wrong

Definition at line 45 of file dispatch.h.

#define STYPE_ERROR_PACKET_END   0x72

Packet end wrong

Definition at line 47 of file dispatch.h.

#define STYPE_ERROR_UNKNOWN_MTYPE   0x70

Unknown MTYPE

Definition at line 43 of file dispatch.h.

#define STYPE_UART_0_IN   0x11

Data to UART 0 (received from pc)

Definition at line 104 of file dispatch.h.

#define STYPE_UART_0_OUT   0x22

Data from UART 0 (sent to pc)

Definition at line 106 of file dispatch.h.

#define STYPE_UART_DATA_TOO_LONG   0x71

Data too long to put in UART Buffer (currently not used)

Definition at line 115 of file dispatch.h.

#define STYPE_UART_SUCCESS   0x60

Last uart command successfully executed (currently not used)

Definition at line 110 of file dispatch.h.

#define STYPE_UART_UNKNOWN_STYPE   0x70

Unknown STYPE

Definition at line 113 of file dispatch.h.


Function Documentation

void dispatch ( unsigned short  dataLength)

Handles the MSG from the host.

Parameters:
dataLengthLength of the attached data

Definition at line 56 of file dispatch.c.

void initPacket ( unsigned char  mainType,
unsigned char  subType,
unsigned short  dataLength 
)

this method prepares a package before its send to the host

Parameters:
mainTypeType of the package
subTypeSubtype of the package
dataLengthLength of the attached data

Definition at line 41 of file dispatch.c.

 All Files Functions Variables Defines