123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- /*
- File Name : system.h
- Author : Yichip
- Version : V1.0
- Date : 2019/11/13
- Description : none.
- */
- #ifndef __SYSTEM_H__
- #define __SYSTEM_H__
- #include <string.h>
- #include "yc11xx_uart.h"
- #include "yc11xx_gpio.h"
- #include "ycdef.h"
- #include "yc_timer.h"
- //#define ENABLE_LOG //Debug switch
- //#define DEBUG_ADC
- //#define DEBUG_OTP
- //#define DEBUG_QSPI
- //#define DEBUG_SYS
- //#define DEBUG_DRV_BT
- #define NEC_ENABLE 1
- #if (NEC_ENABLE==1)
- #define NEC_GPIO 31
- #endif
- #define DEBUG_USART 0
- #define DEBUG_BLE_PRINTF 0
- #if (DEBUG_USART==1)
- #define PRINTPORT UARTB
- #define PRINTRXIO 6
- #define PRINTTXIO 0
- #else
- #define PRINTPORT UARTB
- #define PRINTRXIO 6
- #define PRINTTXIO 7
- #endif
- #define BLE_SEND_HANDLE 0x001e
- #define ADC_GET_GPIOx 23
- #define BIT_SET(a,b) ((a) |= (1<<(b)))
- #define BIT_CLEAR(a,b) ((a) &= ~(1<<(b)))
- #define BIT_FLIP(a,b) ((a) ^= (1<<(b))) //bit Negation
- #define BIT_GET(a,b) (((a) & (1<<(b)))>>(b))
- extern uint8_t Bt_CONNECTED_State;
- typedef struct printportStruct
- {
- USART_TypeDef print_port;
- uint8_t print_rxio;
- uint8_t print_txio;
- }printport_CB;
- /**
- * @brief Print format string to serial port 0.You need to initialize the serial port 0 before you use MyPrintf.
- *
- * @param format : format string
- * @param ...: format parameter
- */
- void printport_init(void);
- void setprintport(USART_TypeDef UARTx);
- void getprintportcb(printport_CB *printportx);
- void MyPrintf(char *format, ...);
- void open_log_print(uint8_t isopen);
- void log_print(char *format, ...);
- void log2_print(char *format, ...);
- void printfsend(uint8_t* buf, int len);
- void delay_us(uint32_t num);
- #endif /*__SYSTEM_H__*/
|