summaryrefslogtreecommitdiff
path: root/loragw_hal/inc
diff options
context:
space:
mode:
Diffstat (limited to 'loragw_hal/inc')
-rw-r--r--loragw_hal/inc/loragw_hal.h3
-rw-r--r--loragw_hal/inc/loragw_spi.h24
2 files changed, 14 insertions, 13 deletions
diff --git a/loragw_hal/inc/loragw_hal.h b/loragw_hal/inc/loragw_hal.h
index feecf5c..eeccaf2 100644
--- a/loragw_hal/inc/loragw_hal.h
+++ b/loragw_hal/inc/loragw_hal.h
@@ -43,7 +43,8 @@ Description:
#define LGW_PKT_FIFO_SIZE 8
#define LGW_DATABUFF_SIZE 1024
-#define LGW_RF_BANDWIDTH 800000
+#define LGW_RADIO_BW 500000 /* bandwidth of the radio */
+#define LGW_REF_BW 125000 /* typical bandwidth of data channel */
/*
SX1275 frequency setting :
diff --git a/loragw_hal/inc/loragw_spi.h b/loragw_hal/inc/loragw_spi.h
index 3ad857f..68d8bcf 100644
--- a/loragw_hal/inc/loragw_spi.h
+++ b/loragw_hal/inc/loragw_spi.h
@@ -35,57 +35,57 @@ Description:
/**
@brief Lora gateway SPI setup (configure I/O and peripherals)
-@param spi_device pointer to SPI file descriptor to be written
+@param spi_target_ptr pointer on a generic pointer to SPI target (implementation dependant)
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/
-int lgw_spi_open(int *spi_device);
+int lgw_spi_open(void **spi_target_ptr);
/**
@brief Lora gateway SPI close
-@param spi_device SPI file descriptor of the port to close
+@param spi_target generic pointer to SPI target (implementation dependant)
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/
-int lgw_spi_close(int spi_device);
+int lgw_spi_close(void *spi_target);
/**
@brief Lora gateway SPI single-byte write
-@param spi_device SPI file descriptor of the target port
+@param spi_target generic pointer to SPI target (implementation dependant)
@param address 7-bit register address
@param data data byte to write
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/
-int lgw_spi_w(int spi_device, uint8_t address, uint8_t data);
+int lgw_spi_w(void *spi_target, uint8_t address, uint8_t data);
/**
@brief Lora gateway SPI single-byte read
-@param spi_device SPI file descriptor of the target port
+@param spi_target generic pointer to SPI target (implementation dependant)
@param address 7-bit register address
@param data data byte to write
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/
-int lgw_spi_r(int spi_device, uint8_t address, uint8_t *data);
+int lgw_spi_r(void *spi_target, uint8_t address, uint8_t *data);
/**
@brief Lora gateway SPI burst (multiple-byte) write
-@param spi_device SPI file descriptor of the target port
+@param spi_target generic pointer to SPI target (implementation dependant)
@param address 7-bit register address
@param data pointer to byte array that will be sent to the Lora gateway
@param size size of the transfer, in byte(s)
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/
-int lgw_spi_wb(int spi_device, uint8_t address, uint8_t *data, uint16_t size);
+int lgw_spi_wb(void *spi_target, uint8_t address, uint8_t *data, uint16_t size);
/**
@brief Lora gateway SPI burst (multiple-byte) read
-@param spi_device SPI file descriptor of the target port
+@param spi_target generic pointer to SPI target (implementation dependant)
@param address 7-bit register address
@param data pointer to byte array that will be written from the Lora gateway
@param size size of the transfer, in byte(s)
@return status of register operation (LGW_SPI_SUCCESS/LGW_SPI_ERROR)
*/
-int lgw_spi_rb(int spi_device, uint8_t address, uint8_t *data, uint16_t size);
+int lgw_spi_rb(void *spi_target, uint8_t address, uint8_t *data, uint16_t size);
#endif