64 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			64 lines
		
	
	
		
			2.1 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /****************************************************************************
 | |
| 
 | |
| Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
 | |
| 
 | |
| This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
 | |
| be copied by any method or incorporated into another program without
 | |
| the express written consent of Aerospace C.Power. This Information or any portion
 | |
| thereof remains the property of Aerospace C.Power. The Information contained herein
 | |
| is believed to be accurate and Aerospace C.Power assumes no responsibility or
 | |
| liability for its use in any way and conveys no license or title under
 | |
| any patent or copyright and makes no representation or warranty that this
 | |
| Information is free from patent or copyright infringement.
 | |
| 
 | |
| ****************************************************************************/
 | |
| #ifndef IOT_BRM_MF_RS485_H
 | |
| #define IOT_BRM_MF_RS485_H
 | |
| 
 | |
| #ifdef __cplusplus
 | |
| extern "C" {
 | |
| #endif
 | |
| 
 | |
| #if (IOT_BRM_ENABLE)
 | |
| 
 | |
| /* multifunction rs485 port work modes */
 | |
| typedef enum _iot_brm_mf_rs485_mode {
 | |
|     /* slave mode */
 | |
|     iot_brm_mf_rs485_mode_slave = 0,
 | |
|     /* mode value limit */
 | |
|     iot_brm_mf_rs485_mode_max,
 | |
| } iot_brm_mf_rs485_mode_t;
 | |
| 
 | |
| /**
 | |
|  * @brief iot_brm_mf_rs485_recv_handle() - to handle the data message whitch to
 | |
|  *                          multifunction rs485 port.
 | |
|  * @param pkt:              the data packet.
 | |
|  */
 | |
| void iot_brm_mf_rs485_recv_handle(iot_pkt_t *pkt);
 | |
| 
 | |
| /**
 | |
|  * @brief iot_brm_mf_rs485_send() - sned data through multifunction rs485 port.
 | |
|  * @param pkt:              the data packet to send.
 | |
|  */
 | |
| void iot_brm_mf_rs485_send(iot_pkt_t *pkt);
 | |
| 
 | |
| /**
 | |
|  * @brief iot_brm_mf_rs485_set_mode() - set the work mode of multifunction
 | |
|  *                          rs485 port.
 | |
|  * @param mode:             work mode, see IOT_BRM_MF_RS485_MODE_XXX.
 | |
|  */
 | |
| void iot_brm_mf_rs485_set_mode(uint8_t mode);
 | |
| 
 | |
| /**
 | |
|  * @brief iot_brm_mf_rs485_init() - initial all multifunction rs485 ports.
 | |
|  */
 | |
| void iot_brm_mf_rs485_init();
 | |
| 
 | |
| #endif /* IOT_BRM_ENABLE */
 | |
| 
 | |
| #ifdef __cplusplus
 | |
| }
 | |
| #endif
 | |
| 
 | |
| #endif
 |