summaryrefslogtreecommitdiff
path: root/loragw_hal/inc/loragw_spi.h
diff options
context:
space:
mode:
Diffstat (limited to 'loragw_hal/inc/loragw_spi.h')
-rw-r--r--loragw_hal/inc/loragw_spi.h24
1 files changed, 12 insertions, 12 deletions
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