29 lines
1.0 KiB
C
29 lines
1.0 KiB
C
#ifndef PROTO_H
|
|
#define PROTO_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
#include "commons.h"
|
|
|
|
#define SET_WRITE() do { RS_MODE_SetHigh();} while(0)
|
|
#define SET_READ() do { RS_MODE_SetLow();} while(0)
|
|
|
|
/*=****************************************************************************/
|
|
bool byte_in (uint8_t in, uint8_t* p_cmd, uint16_t* p_led1, uint16_t* p_led2);
|
|
|
|
/*=****************************************************************************/
|
|
errors_t send_model (uint8_t peer_id, uint8_t model);
|
|
|
|
/*=****************************************************************************/
|
|
errors_t send_data (uint8_t peer_id, uint16_t moisture, uint16_t light);
|
|
|
|
/*=****************************************************************************/
|
|
errors_t send_error (uint8_t peer_id, errors_t err);
|
|
|
|
/*=****************************************************************************/
|
|
errors_t uart_rx_byte (uint8_t* p_byte);
|
|
|
|
/*=****************************************************************************/
|
|
errors_t uart_tx_byte (uint8_t byte);
|
|
|
|
#endif |