diff options
author | Sylvain Miermont <smiermont@semtech.com> | 2013-08-08 15:49:31 +0200 |
---|---|---|
committer | Sylvain Miermont <smiermont@semtech.com> | 2013-10-23 11:03:07 +0200 |
commit | ddac0aa483dd5f7bca31b0c042949eca370a8fdc (patch) | |
tree | 339b16655dbb9b6cca0e972454a8591256330900 /loragw_hal/inc/loragw_spi.h | |
parent | e588fccf2b13065c25c95c70be191614cd23b005 (diff) | |
download | lora_gateway-ddac0aa483dd5f7bca31b0c042949eca370a8fdc.tar.gz lora_gateway-ddac0aa483dd5f7bca31b0c042949eca370a8fdc.tar.bz2 lora_gateway-ddac0aa483dd5f7bca31b0c042949eca370a8fdc.zip |
Beta 3v1.b3
- modified 'native' SPI module to align with the way resource pointers are managed in 'ftdi' variant (void pointers)
- better check of channel frequency + bandwidth vs. authorized band
- improved Makefile
Diffstat (limited to 'loragw_hal/inc/loragw_spi.h')
-rw-r--r-- | loragw_hal/inc/loragw_spi.h | 24 |
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 |