nakagawa kit emurator (add CR) BaudRate 115200,p20

Dependencies:   mbed NetServicesMin

Committer:
recotana
Date:
Tue Apr 17 04:14:27 2012 +0000
Revision:
4:9daa308155d6
Parent:
0:e5342390978b

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
recotana 0:e5342390978b 1 /*----------------------------------------------------------------------------*/
recotana 0:e5342390978b 2 /* File Information */
recotana 0:e5342390978b 3 /*----------------------------------------------------------------------------*/
recotana 0:e5342390978b 4 /* Name : types.h */
recotana 0:e5342390978b 5 /* Type : C Programming Language Header */
recotana 0:e5342390978b 6 /*----------------------------------------------------------------------------*/
recotana 0:e5342390978b 7 /*----------------------------------------------------------------------------*/
recotana 0:e5342390978b 8
recotana 0:e5342390978b 9 #ifndef __TYPES_H__
recotana 0:e5342390978b 10 #define __TYPES_H__
recotana 0:e5342390978b 11
recotana 0:e5342390978b 12 #include "stdint.h"
recotana 0:e5342390978b 13 /*
recotana 0:e5342390978b 14 typedef char int8_t;
recotana 0:e5342390978b 15 typedef unsigned char uint8_t;
recotana 0:e5342390978b 16 typedef signed short int16_t;
recotana 0:e5342390978b 17 typedef unsigned short uint16_t;
recotana 0:e5342390978b 18 typedef signed int int32_t;
recotana 0:e5342390978b 19 typedef unsigned int uint32_t;
recotana 0:e5342390978b 20 typedef signed long long int64_t;
recotana 0:e5342390978b 21 typedef unsigned long long uint64_t;
recotana 0:e5342390978b 22 */
recotana 0:e5342390978b 23 //typedef bool bool_t;
recotana 0:e5342390978b 24 typedef enum{TRUE, FALSE} bool_t;
recotana 0:e5342390978b 25
recotana 0:e5342390978b 26 //=========================================================================
recotana 0:e5342390978b 27 // byte bit access
recotana 0:e5342390978b 28 //=========================================================================
recotana 0:e5342390978b 29 typedef union{ // BYTE/NIBBLE/BIT access
recotana 0:e5342390978b 30 uint8_t byte; // Byte access
recotana 0:e5342390978b 31 struct{ // Nibble access
recotana 0:e5342390978b 32 uint8_t lo : 4; // lower(Bit0 - 3)
recotana 0:e5342390978b 33 uint8_t hi : 4; // upper(Bit4 - 7)
recotana 0:e5342390978b 34 }nibble;
recotana 0:e5342390978b 35 struct{ // Bit access
recotana 0:e5342390978b 36 uint8_t b0 : 1; // Bit0
recotana 0:e5342390978b 37 uint8_t b1 : 1; // Bit1
recotana 0:e5342390978b 38 uint8_t b2 : 1; // Bit2
recotana 0:e5342390978b 39 uint8_t b3 : 1; // Bit3
recotana 0:e5342390978b 40 uint8_t b4 : 1; // Bit4
recotana 0:e5342390978b 41 uint8_t b5 : 1; // Bit5
recotana 0:e5342390978b 42 uint8_t b6 : 1; // Bit6
recotana 0:e5342390978b 43 uint8_t b7 : 1; // Bit7
recotana 0:e5342390978b 44 }bits;
recotana 0:e5342390978b 45 }byte_t;
recotana 0:e5342390978b 46
recotana 0:e5342390978b 47 //=========================================================================
recotana 0:e5342390978b 48 // word bit access
recotana 0:e5342390978b 49 //=========================================================================
recotana 0:e5342390978b 50 typedef union{ // WORD/BYTE/NIBBLE/BIT access
recotana 0:e5342390978b 51 uint16_t word; // Word access
recotana 0:e5342390978b 52 struct{ // Byte access
recotana 0:e5342390978b 53 uint8_t b0; // upper byte
recotana 0:e5342390978b 54 uint8_t b1; // lower byte
recotana 0:e5342390978b 55 }byte;
recotana 0:e5342390978b 56 struct { // Nibble access
recotana 0:e5342390978b 57 uint8_t n0 : 4; // lower byte low(Bit 0 - 3)
recotana 0:e5342390978b 58 uint8_t n1 : 4; // lower byte up (Bit 4 - 7)
recotana 0:e5342390978b 59 uint8_t n2 : 4; // upper byte low(Bit 8 - 11)
recotana 0:e5342390978b 60 uint8_t n3 : 4; // upper byte up (Bit12 - 15)
recotana 0:e5342390978b 61 }nibble;
recotana 0:e5342390978b 62 struct{ // Bit acces
recotana 0:e5342390978b 63 uint8_t b0 : 1; // Bit0
recotana 0:e5342390978b 64 uint8_t b1 : 1; // Bit1
recotana 0:e5342390978b 65 uint8_t b2 : 1; // Bit2
recotana 0:e5342390978b 66 uint8_t b3 : 1; // Bit3
recotana 0:e5342390978b 67 uint8_t b4 : 1; // Bit4
recotana 0:e5342390978b 68 uint8_t b5 : 1; // Bit5
recotana 0:e5342390978b 69 uint8_t b6 : 1; // Bit6
recotana 0:e5342390978b 70 uint8_t b7 : 1; // Bit7
recotana 0:e5342390978b 71 uint8_t b8 : 1; // Bit8
recotana 0:e5342390978b 72 uint8_t b9 : 1; // Bit9
recotana 0:e5342390978b 73 uint8_t b10: 1; // Bit10
recotana 0:e5342390978b 74 uint8_t b11: 1; // Bit11
recotana 0:e5342390978b 75 uint8_t b12: 1; // Bit12
recotana 0:e5342390978b 76 uint8_t b13: 1; // Bit13
recotana 0:e5342390978b 77 uint8_t b14: 1; // Bit14
recotana 0:e5342390978b 78 uint8_t b15: 1; // Bit15
recotana 0:e5342390978b 79 }bits;
recotana 0:e5342390978b 80 }word_t;
recotana 0:e5342390978b 81
recotana 0:e5342390978b 82
recotana 0:e5342390978b 83 //=========================================================================
recotana 0:e5342390978b 84 // ascii code
recotana 0:e5342390978b 85 //=========================================================================
recotana 0:e5342390978b 86 #define Z_NUL (0x00)
recotana 0:e5342390978b 87 #define Z_SOH (0x01)
recotana 0:e5342390978b 88 #define Z_STX (0x02)
recotana 0:e5342390978b 89 #define Z_ETX (0x03)
recotana 0:e5342390978b 90 #define Z_EOT (0x04)
recotana 0:e5342390978b 91 #define Z_ENQ (0x05)
recotana 0:e5342390978b 92 #define Z_ACK (0x06)
recotana 0:e5342390978b 93 #define Z_BEL (0x07)
recotana 0:e5342390978b 94
recotana 0:e5342390978b 95 #define Z_BS (0x08)
recotana 0:e5342390978b 96 #define Z_HT (0x09)
recotana 0:e5342390978b 97 #define Z_LF (0x0A)
recotana 0:e5342390978b 98 #define Z_HM (0x0B)
recotana 0:e5342390978b 99 #define Z_FF (0x0C)
recotana 0:e5342390978b 100 #define Z_CR (0x0D)
recotana 0:e5342390978b 101 #define Z_SO (0x0E)
recotana 0:e5342390978b 102 #define Z_SI (0x0F)
recotana 0:e5342390978b 103
recotana 0:e5342390978b 104 #define Z_DLE (0x10)
recotana 0:e5342390978b 105 #define Z_DC1 (0x11)
recotana 0:e5342390978b 106 #define Z_DC2 (0x12)
recotana 0:e5342390978b 107 #define Z_DC3 (0x13)
recotana 0:e5342390978b 108 #define Z_DC4 (0x14)
recotana 0:e5342390978b 109 #define Z_NAK (0x15)
recotana 0:e5342390978b 110 #define Z_SYN (0x16)
recotana 0:e5342390978b 111 #define Z_ETB (0x17)
recotana 0:e5342390978b 112
recotana 0:e5342390978b 113
recotana 0:e5342390978b 114 #endif /* __TYPES_H__*/