system.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. File Name : system.h
  3. Author : Yichip
  4. Version : V1.0
  5. Date : 2019/11/13
  6. Description : none.
  7. */
  8. #ifndef __SYSTEM_H__
  9. #define __SYSTEM_H__
  10. #include <string.h>
  11. #include "yc11xx_uart.h"
  12. #include "yc11xx_gpio.h"
  13. #include "ycdef.h"
  14. //#define ENABLE_LOG //Debug switch
  15. //#define DEBUG_ADC
  16. //#define DEBUG_OTP
  17. //#define DEBUG_QSPI
  18. //#define DEBUG_SYS
  19. //#define DEBUG_DRV_BT
  20. #define PRINTPORT UARTB
  21. #define PRINTRXIO 14
  22. #define PRINTTXIO 6
  23. #define BIT_SET(a,b) ((a) |= (1<<(b)))
  24. #define BIT_CLEAR(a,b) ((a) &= ~(1<<(b)))
  25. #define BIT_FLIP(a,b) ((a) ^= (1<<(b))) //bit Negation
  26. #define BIT_GET(a,b) (((a) & (1<<(b)))>>(b))
  27. typedef struct printportStruct
  28. {
  29. USART_TypeDef print_port;
  30. uint8_t print_rxio;
  31. uint8_t print_txio;
  32. }printport_CB;
  33. /**
  34. * @brief Print format string to serial port 0.You need to initialize the serial port 0 before you use MyPrintf.
  35. *
  36. * @param format : format string
  37. * @param ...: format parameter
  38. */
  39. void printport_init(void);
  40. void setprintport(USART_TypeDef UARTx);
  41. void getprintportcb(printport_CB *printportx);
  42. void MyPrintf(char *format, ...);
  43. void open_log_print(uint8_t isopen);
  44. void log_print(char *format, ...);
  45. void log2_print(char *format, ...);
  46. #endif /*__SYSTEM_H__*/