0062a6cf673408258ec47f51a51e93e473ab4da5.svn-base 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #ifndef __N76_COMMON_H__
  2. #define __N76_COMMON_H__
  3. #ifdef N76E003_IAR
  4. #include "N76E003_iar.h"
  5. #else
  6. #include "N76E003.h"
  7. #endif
  8. #include "SFR_Macro.h"
  9. #include "Function_define.h"
  10. //#include "TypeDef.h"
  11. typedef bit BIT;
  12. typedef unsigned char UINT8;
  13. typedef unsigned int UINT16;
  14. typedef unsigned long UINT32;
  15. typedef unsigned char uint8_t;
  16. typedef unsigned int uint16_t;
  17. typedef unsigned long uint32_t;
  18. typedef unsigned char uint8;
  19. typedef unsigned int uint16;
  20. typedef unsigned long uint32;
  21. typedef signed char int8;
  22. typedef signed int int16;
  23. typedef signed long int32;
  24. typedef unsigned char u8;
  25. typedef unsigned int u16;
  26. typedef unsigned long u32;
  27. #define _DEBUG_ 1
  28. #if _DEBUG_
  29. #define DBG printf
  30. #else
  31. #define DBG
  32. #endif
  33. #define THIS_VER "V1.0"
  34. #define CID_READ 0x0B
  35. #define DID_READ 0x0C
  36. #define ERASE_APROM 0x22
  37. #define READ_APROM 0x00
  38. #define PROGRAM_APROM 0x21
  39. #define ERASE_LDROM
  40. #define READ_LDROM
  41. #define PROGRAM_LDROM
  42. #define READ_CFG 0xC0
  43. #define PROGRAM_CFG 0xE1
  44. #define READ_UID 0x04
  45. void InitialUART0_Timer1 ( uint32 u32Baudrate ); //T1M = 1, SMOD = 1
  46. void InitialUART0_Timer3 ( uint32 u32Baudrate ); //Timer3 as Baudrate, SMOD=1, Prescale=0
  47. void InitialUART1_Timer3 ( uint32 u32Baudrate );
  48. void Send_Data_To_UART0 ( uint8 c );
  49. uint8 Receive_Data_From_UART0 ( void );
  50. void Send_Data_To_UART1 ( uint8 c );
  51. uint8 Receive_Data_From_UART1 ( void );
  52. void Send_String_To_UART0( UINT8 *string );
  53. void InitialUART1 ( uint32 u32Baudrate );
  54. #ifdef N76E003_IAR
  55. void printf_UART ( uint8 *str, ... );
  56. #endif
  57. extern uint8 BIT_TMP;
  58. #endif