/*
 * @Author: your name
 * @Date: 2022-04-21 15:13:48
 * @LastEditTime: 2022-04-21 17:23:06
 * @LastEditors: Please set LastEditors
 * @Description: ��koroFileHeader�鿴���� ��������: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \aithinker\HAL\project_config.h
 */
#ifndef __PROJECT_CONFIG_H__
#define __PROJECT_CONFIG_H__

#include <stdint.h>
#include <stdbool.h>
// ????semtech???????????
// ??????????? https://github.com/Lora-net/LoRaMac-node/tree/master/src/radio  ???????? 2021/2/3
#define SOFT_VERSION "SX127x driver V1.1.6"
//--------------------------------------------- ??????????? ---------------------------------------------
#define LORA_MODE MODEM_LORA
#define LORA_FRE 470500000				 // ??????
#define LORA_TX_OUTPUT_POWER 20			 //	127x power: 2~20dbm
#define LORA_BANDWIDTH 0				 // [0: 125 kHz,	????????????????sx126x??[0: 125 kHz,1: 250 kHz,2: 500 kHz,3: Reserved]
#define LORA_SPREADING_FACTOR 9		 // ???????????????????��7~12
#define LORA_CODINGRATE 1				 // ????????????????????[1: 4/5,2: 4/6,3: 4/7,4: 4/8]
#define LORA_PREAMBLE_LENGTH 50			 // ???????
#define LORA_SYMBOL_TIMEOUT 0	 // Symbols(sx126x???????0,127x???????5)
#define LORA_FIX_LENGTH_PAYLOAD_ON false // ????????????(??????sx126x?????)
#define LORA_IQ_INVERSION_ON false		 // ?????????????????��?????(??????sx126x?????)
#define LORA_RX_TIMEOUT_VALUE 1000
#define TCXO_CTRL_VOLTAGE 0 // setting TCXO voltage supply source [0: 1.6v, 1: 1.7v, 2: 1.8v, 3: 2.2v, 4: 2.4v, 5: 2.7v, 6: 3.0v, 7: 3.5v]
#define RF_WAKEUP_TIME 50	// setting RF wakeup time,in second
#define TX_INTERVAL 200          //default send interval is 2s
#define TX_BUFFER "Hello world" //default send buffer is "hello world"
#define TX_BUFFER_LEN 11 //default send buffer size is 11

/*!
 * Board MCU pins definitions
 */
// SPI
#define RADIO_NSS_PIN GPIO_Pin_4
#define RADIO_NSS_PORT GPIOA
#define RADIO_MOSI_PIN GPIO_Pin_7
#define RADIO_MOSI_PORT GPIOA
#define RADIO_MISO_PIN GPIO_Pin_6
#define RADIO_MISO_PORT GPIOA
#define RADIO_SCK_PIN GPIO_Pin_5
#define RADIO_SCK_PORT GPIOA
// RST??��??
#define RADIO_nRESET_PIN GPIO_Pin_14 // GPIO_Pin_1
#define RADIO_nRESET_PORT GPIOB
// DIO1 ????
#define RADIO_DIO1_PIN GPIO_Pin_1 // GPIO_Pin_11
#define RADIO_DIO1_PORT GPIOB
// BUSY/DIO4 ????
#define RADIO_DIO4_BUSY_PIN GPIO_Pin_0
#define RADIO_DIO4_BUSY_PORT GPIOA

// ???????????????????????????????????
// TXEN
#define RADIO_DIO0_TXEN_PIN GPIO_Pin_11 // GPIO_Pin_10
#define RADIO_DIO0_TXEN_PORT GPIOB
// DIO2
#define RADIO_DIO2_PIN GPIO_Pin_8
#define RADIO_DIO2_PORT GPIOB
// DIO3
#define RADIO_DIO3_PIN GPIO_Pin_9
#define RADIO_DIO3_PORT GPIOB
// RXEN
#define RADIO_DIO5_RXEN_PIN GPIO_Pin_1
#define RADIO_DIO5_RXEN_PORT GPIOA

typedef enum
{
    LOW = 0,
    HIGH,
    TOGGLE,
} LED_Status_t;

#endif // __PROJECT_CONFIG_H__
