My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

debug_frmwrk.h 3.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**********************************************************************
  2. * $Id$ debug_frmwrk.h 2010-05-21
  3. *//**
  4. * @file debug_frmwrk.h
  5. * @brief Contains some utilities that used for debugging through UART
  6. * @version 2.0
  7. * @date 21. May. 2010
  8. * @author NXP MCU SW Application Team
  9. *
  10. * Copyright(C) 2010, NXP Semiconductor
  11. * All rights reserved.
  12. *
  13. ***********************************************************************
  14. * Software that is described herein is for illustrative purposes only
  15. * which provides customers with programming information regarding the
  16. * products. This software is supplied "AS IS" without any warranties.
  17. * NXP Semiconductors assumes no responsibility or liability for the
  18. * use of the software, conveys no license or title under any patent,
  19. * copyright, or mask work right to the product. NXP Semiconductors
  20. * reserves the right to make changes in the software without
  21. * notification. NXP Semiconductors also make no representation or
  22. * warranty that such application will be suitable for the specified
  23. * use without further testing or modification.
  24. * Permission to use, copy, modify, and distribute this software and its
  25. * documentation is hereby granted, under NXP Semiconductors'
  26. * relevant copyright in the software, without fee, provided that it
  27. * is used in conjunction with NXP Semiconductors microcontrollers. This
  28. * copyright, permission, and disclaimer notice must appear in all copies of
  29. * this code.
  30. **********************************************************************/
  31. #ifndef DEBUG_FRMWRK_H_
  32. #define DEBUG_FRMWRK_H_
  33. //#include <stdarg.h>
  34. #include "lpc17xx_uart.h"
  35. #define USED_UART_DEBUG_PORT 0
  36. #if (USED_UART_DEBUG_PORT==0)
  37. #define DEBUG_UART_PORT LPC_UART0
  38. #elif (USED_UART_DEBUG_PORT==1)
  39. #define DEBUG_UART_PORT LPC_UART1
  40. #endif
  41. #define _DBG(x) _db_msg(DEBUG_UART_PORT, x)
  42. #define _DBG_(x) _db_msg_(DEBUG_UART_PORT, x)
  43. #define _DBC(x) _db_char(DEBUG_UART_PORT, x)
  44. #define _DBD(x) _db_dec(DEBUG_UART_PORT, x)
  45. #define _DBD16(x) _db_dec_16(DEBUG_UART_PORT, x)
  46. #define _DBD32(x) _db_dec_32(DEBUG_UART_PORT, x)
  47. #define _DBH(x) _db_hex(DEBUG_UART_PORT, x)
  48. #define _DBH16(x) _db_hex_16(DEBUG_UART_PORT, x)
  49. #define _DBH32(x) _db_hex_32(DEBUG_UART_PORT, x)
  50. #define _DG _db_get_char(DEBUG_UART_PORT)
  51. //void _printf (const char *format, ...);
  52. extern void (*_db_msg)(LPC_UART_TypeDef *UARTx, const void *s);
  53. extern void (*_db_msg_)(LPC_UART_TypeDef *UARTx, const void *s);
  54. extern void (*_db_char)(LPC_UART_TypeDef *UARTx, uint8_t ch);
  55. extern void (*_db_dec)(LPC_UART_TypeDef *UARTx, uint8_t decn);
  56. extern void (*_db_dec_16)(LPC_UART_TypeDef *UARTx, uint16_t decn);
  57. extern void (*_db_dec_32)(LPC_UART_TypeDef *UARTx, uint32_t decn);
  58. extern void (*_db_hex)(LPC_UART_TypeDef *UARTx, uint8_t hexn);
  59. extern void (*_db_hex_16)(LPC_UART_TypeDef *UARTx, uint16_t hexn);
  60. extern void (*_db_hex_32)(LPC_UART_TypeDef *UARTx, uint32_t hexn);
  61. extern uint8_t (*_db_get_char)(LPC_UART_TypeDef *UARTx);
  62. void UARTPutChar (LPC_UART_TypeDef *UARTx, uint8_t ch);
  63. void UARTPuts(LPC_UART_TypeDef *UARTx, const void *str);
  64. void UARTPuts_(LPC_UART_TypeDef *UARTx, const void *str);
  65. void UARTPutDec(LPC_UART_TypeDef *UARTx, uint8_t decnum);
  66. void UARTPutDec16(LPC_UART_TypeDef *UARTx, uint16_t decnum);
  67. void UARTPutDec32(LPC_UART_TypeDef *UARTx, uint32_t decnum);
  68. void UARTPutHex (LPC_UART_TypeDef *UARTx, uint8_t hexnum);
  69. void UARTPutHex16 (LPC_UART_TypeDef *UARTx, uint16_t hexnum);
  70. void UARTPutHex32 (LPC_UART_TypeDef *UARTx, uint32_t hexnum);
  71. uint8_t UARTGetChar (LPC_UART_TypeDef *UARTx);
  72. void debug_frmwrk_init(void);
  73. #endif /* DEBUG_FRMWRK_H_ */