drv_rs485.h 584 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-10-24 thread-liu first version
  9. */
  10. #ifndef __DRV_RS485_H__
  11. #define __DRV_RS485_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #define RS485_SEND_MODE 0
  16. #define RS485_RECV_MODE 1
  17. extern rt_device_t rs485_serial;
  18. extern struct rt_semaphore rs485_rx_sem;
  19. extern int rs485_send_data(char *tbuf, rt_uint16_t t_len);
  20. extern int rs485_init(void);
  21. #ifdef __cplusplus
  22. }
  23. #endif
  24. #endif /* drv_rs485.h */