bl_drv_usart_2.h 626 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef DRV_USART2_H
  2. #define DRV_USART2_H
  3. #define TX_2_BUFFER_SIZE 128
  4. #define RX_2_BUFFER_SIZE 128
  5. #define UART_1_IDAR (0)
  6. #define USART_1_BAUND (USART_BAUND)
  7. extern DELAY_COMMON uart2_tout;
  8. __inline void Uart2_Time_Out(void)
  9. {
  10. //uart2
  11. if(uart2_tout.set)
  12. {
  13. if(uart2_tout.count)
  14. uart2_tout.count--;
  15. else
  16. {
  17. g_event |= RS485_2_RECEIVE_END_EVENT;
  18. uart2_tout.set = 0;
  19. uart2_tout.count = 0;
  20. }
  21. }
  22. }
  23. void Usart2_Initial(void);
  24. int8_t Send_Data_2_RS485(uint8_t*data,uint16_t size);
  25. uint16_t Get_RS485_2_Data(uint8_t * dbuf,uint16_t dbuf_len);
  26. #endif