#ifndef __LORA_H #define __LORA_H #include "stdint.h" #include "fifo.h" #define LORA_DATA_LENGTH 128 enum LORAWAN_STATE{ LORA_RESET = 0, LORA_P2P, LORA_NOT_JOIN, LORA_JOINED, LORA_JOINED_ABP }; enum LORAWAN_RECV_STATE{ LORA_NRECV = 0, LORA_RECV, }; typedef struct lora_control_st{ //osSemaphoreId recvBinarySemHandle; uint8_t type; RingBuff_t recvRingBuff; uint8_t loraData[LORA_DATA_LENGTH]; uint8_t data_length; void (*function) (RingBuff_t *ringBuff); }lroa_ctrl_t; extern lroa_ctrl_t lora; void InitLoraModule(lroa_ctrl_t *lora); void ReadLoraData(RingBuff_t *ringBuff); void reset_lora(void); void open_lora(void); void close_lora(void); void NetConfig_Lora(void); #endif /* __LORA_H */