43 #ifndef MyTransportHAL_h
44 #define MyTransportHAL_h
46 #define INVALID_SNR ((int16_t)-256)
47 #define INVALID_RSSI ((int16_t)-256)
48 #define INVALID_PERCENT ((int16_t)-100)
49 #define INVALID_LEVEL ((int16_t)-256)
51 #if defined(MY_RX_MESSAGE_BUFFER_FEATURE)
52 #if defined(MY_RADIO_NRF5_ESB)
53 #error Receive message buffering not supported for NRF5 radio! Please define MY_NRF5_RX_BUFFER_SIZE
55 #if defined(MY_RADIO_RFM69)
56 #error Receive message buffering not supported for RFM69!
58 #if defined(MY_RADIO_RFM95)
59 #error Receive message buffering not supported for RFM95!
62 #error Receive message buffering not supported for RS485!
64 #elif defined(MY_RX_MESSAGE_BUFFER_SIZE)
65 #error Receive message buffering requires message buffering feature enabled!
87 bool transportHALInit(
void);
91 void transportHALSetAddress(
const uint8_t address);
95 uint8_t transportHALGetAddress(
void);
104 bool transportHALSend(
const uint8_t nextRecipient,
const MyMessage *outMsg,
const uint8_t len,
110 bool transportHALDataAvailable(
void);
115 bool transportHALSanityCheck(
void);
122 bool transportHALReceive(
MyMessage *inMsg, uint8_t *msgLength);
126 void transportHALPowerDown(
void);
130 void transportHALPowerUp(
void);
134 void transportHALSleep(
void);
138 void transportHALStandBy(
void);
143 int16_t transportHALGetSendingRSSI(
void);
148 int16_t transportHALGetReceivingRSSI(
void);
153 int16_t transportHALGetSendingSNR(
void);
158 int16_t transportHALGetReceivingSNR(
void);
163 int16_t transportHALGetTxPowerPercent(
void);
169 bool transportHALSetTxPowerPercent(
const uint8_t powerPercent);
174 int16_t transportHALGetTxPowerLevel(
void);
176 #endif // MyTransportHAL_h