LibDriver NRF905
Loading...
Searching...
No Matches
driver_nrf905.h File Reference

driver nrf905 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_nrf905.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nrf905_handle_s
 nrf905 handle structure definition More...
struct  nrf905_info_s
 nrf905 information structure definition More...

Macros

#define DRIVER_NRF905_LINK_INIT(HANDLE, STRUCTURE)
 initialize nrf905_handle_t structure
#define DRIVER_NRF905_LINK_SPI_INIT(HANDLE, FUC)
 link spi_init function
#define DRIVER_NRF905_LINK_SPI_DEINIT(HANDLE, FUC)
 link spi_deinit function
#define DRIVER_NRF905_LINK_SPI_READ(HANDLE, FUC)
 link spi_read function
#define DRIVER_NRF905_LINK_SPI_WRITE(HANDLE, FUC)
 link spi_write function
#define DRIVER_NRF905_LINK_SPI_TRANSMIT(HANDLE, FUC)
 link spi_transmit function
#define DRIVER_NRF905_LINK_CE_GPIO_INIT(HANDLE, FUC)
 link ce_gpio_init function
#define DRIVER_NRF905_LINK_CE_GPIO_DEINIT(HANDLE, FUC)
 link ce_gpio_deinit function
#define DRIVER_NRF905_LINK_CE_GPIO_WRITE(HANDLE, FUC)
 link ce_gpio_write function
#define DRIVER_NRF905_LINK_TX_EN_GPIO_INIT(HANDLE, FUC)
 link tx_en_gpio_init function
#define DRIVER_NRF905_LINK_TX_EN_GPIO_DEINIT(HANDLE, FUC)
 link tx_en_gpio_deinit function
#define DRIVER_NRF905_LINK_TX_EN_GPIO_WRITE(HANDLE, FUC)
 link tx_en_gpio_write function
#define DRIVER_NRF905_LINK_PWR_UP_GPIO_INIT(HANDLE, FUC)
 link pwr_up_gpio_init function
#define DRIVER_NRF905_LINK_PWR_UP_GPIO_DEINIT(HANDLE, FUC)
 link pwr_up_gpio_deinit function
#define DRIVER_NRF905_LINK_PWR_UP_GPIO_WRITE(HANDLE, FUC)
 link pwr_up_gpio_write function
#define DRIVER_NRF905_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_NRF905_LINK_DEBUG_PEINT(HANDLE, FUC)
 link debug_print function
#define DRIVER_NRF905_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
 link receive_callback function

Typedefs

typedef struct nrf905_handle_s nrf905_handle_t
 nrf905 handle structure definition
typedef struct nrf905_info_s nrf905_info_t
 nrf905 information structure definition

Enumerations

enum  nrf905_bool_t { NRF905_BOOL_FALSE = 0x00 , NRF905_BOOL_TRUE = 0x01 }
 nrf905 bool enumeration definition More...
enum  nrf905_pll_mode_t { NRF905_PLL_MODE_433_MHZ = 0x00 , NRF905_PLL_MODE_868_915_MHZ = 0x01 }
 nrf905 pll mode enumeration definition More...
enum  nrf905_output_power_t { NRF905_OUTPUT_POWER_NEGATIVE_10_DBM = 0x00 , NRF905_OUTPUT_POWER_NEGATIVE_2_DBM = 0x01 , NRF905_OUTPUT_POWER_6_DBM = 0x02 , NRF905_OUTPUT_POWER_10_DBM = 0x03 }
 nrf905 output power enumeration definition More...
enum  nrf905_rx_mode_t { NRF905_RX_MODE_NORMAL = 0x00 , NRF905_RX_MODE_REDUCED_POWER = 0x01 }
 nrf905 rx mode enumeration definition More...
enum  nrf905_address_width_t { NRF905_ADDRESS_WIDTH_1_BYTE = 0x01 , NRF905_ADDRESS_WIDTH_4_BYTE = 0x04 }
 nrf905 address width enumeration definition More...
enum  nrf905_output_clock_frequency_t { NRF905_OUTPUT_CLOCK_FREQUENCY_4MHZ = 0x00 , NRF905_OUTPUT_CLOCK_FREQUENCY_2MHZ = 0x01 , NRF905_OUTPUT_CLOCK_FREQUENCY_1MHZ = 0x02 , NRF905_OUTPUT_CLOCK_FREQUENCY_500KHZ = 0x03 }
 nrf905 output clock frequency enumeration definition More...
enum  nrf905_crystal_oscillator_frequency_t {
  NRF905_CRYSTAL_OSCILLATOR_FREQUENCY_4MHZ = 0x00 , NRF905_CRYSTAL_OSCILLATOR_FREQUENCY_8MHZ = 0x01 , NRF905_CRYSTAL_OSCILLATOR_FREQUENCY_12MHZ = 0x02 , NRF905_CRYSTAL_OSCILLATOR_FREQUENCY_16MHZ = 0x03 ,
  NRF905_CRYSTAL_OSCILLATOR_FREQUENCY_20MHZ = 0x04
}
 nrf905 crystal oscillator frequency enumeration definition More...
enum  nrf905_crc_mode_t { NRF905_CRC_MODE_8 = 0x00 , NRF905_CRC_MODE_16 = 0x01 }
 nrf905 crc mode enumeration definition More...
enum  nrf905_mode_t { NRF905_MODE_RX = 0x00 , NRF905_MODE_TX = 0x01 }
 nrf905 mode enumeration definition More...
enum  nrf905_status_t { NRF905_STATUS_AM = 0x00 , NRF905_STATUS_TX_DONE = 0x01 , NRF905_STATUS_RX_DONE = 0x02 }
 nrf905 status enumeration definition More...

Functions

uint8_t nrf905_info (nrf905_info_t *info)
 get chip's information
uint8_t nrf905_irq_handler (nrf905_handle_t *handle)
 irq handler
uint8_t nrf905_init (nrf905_handle_t *handle)
 initialize the chip
uint8_t nrf905_deinit (nrf905_handle_t *handle)
 close the chip
uint8_t nrf905_set_power_up (nrf905_handle_t *handle, nrf905_bool_t enable)
 set the power up
uint8_t nrf905_set_enable (nrf905_handle_t *handle, nrf905_bool_t enable)
 enable or disable the chip
uint8_t nrf905_set_mode (nrf905_handle_t *handle, nrf905_mode_t mode)
 set the mode
uint8_t nrf905_send (nrf905_handle_t *handle, uint8_t *buf, uint8_t len)
 send data
uint8_t nrf905_write_conf (nrf905_handle_t *handle)
 write the conf
uint8_t nrf905_read_conf (nrf905_handle_t *handle, uint8_t conf[10])
 read the conf
uint8_t nrf905_update_conf (nrf905_handle_t *handle, uint8_t conf[10])
 update the conf
uint8_t nrf905_set_tx_payload (nrf905_handle_t *handle, uint8_t *buf, uint8_t len)
 set the tx payload
uint8_t nrf905_get_tx_payload (nrf905_handle_t *handle, uint8_t *buf, uint8_t len)
 get the tx payload
uint8_t nrf905_get_rx_payload (nrf905_handle_t *handle, uint8_t *buf, uint8_t len)
 get the rx payload
uint8_t nrf905_set_tx_address (nrf905_handle_t *handle, uint8_t *addr, uint8_t len)
 set the tx address
uint8_t nrf905_get_tx_address (nrf905_handle_t *handle, uint8_t *addr, uint8_t len)
 get the tx address
uint8_t nrf905_channel_config (nrf905_handle_t *handle, uint16_t freq, nrf905_pll_mode_t mode, nrf905_output_power_t power)
 config the channel
uint8_t nrf905_get_status (nrf905_handle_t *handle, uint8_t *status)
 get the status
uint8_t nrf905_set_frequency (nrf905_handle_t *handle, uint16_t freq)
 set the frequency
uint8_t nrf905_get_frequency (nrf905_handle_t *handle, uint16_t *freq)
 get the frequency
uint8_t nrf905_frequency_convert_to_register (nrf905_handle_t *handle, float mhz, uint16_t *reg)
 convert the frequency to the register raw data
uint8_t nrf905_frequency_convert_to_data (nrf905_handle_t *handle, uint16_t reg, float *mhz)
 convert the register raw data to the frequency
uint8_t nrf905_set_pll_mode (nrf905_handle_t *handle, nrf905_pll_mode_t mode)
 set the pll mode
uint8_t nrf905_get_pll_mode (nrf905_handle_t *handle, nrf905_pll_mode_t *mode)
 get the pll mode
uint8_t nrf905_set_output_power (nrf905_handle_t *handle, nrf905_output_power_t output_power)
 set the output power
uint8_t nrf905_get_output_power (nrf905_handle_t *handle, nrf905_output_power_t *output_power)
 get the output power
uint8_t nrf905_set_rx_mode (nrf905_handle_t *handle, nrf905_rx_mode_t mode)
 set the rx mode
uint8_t nrf905_get_rx_mode (nrf905_handle_t *handle, nrf905_rx_mode_t *mode)
 get the rx mode
uint8_t nrf905_set_auto_retransmit (nrf905_handle_t *handle, nrf905_bool_t enable)
 enable or disable the auto retransmit
uint8_t nrf905_get_auto_retransmit (nrf905_handle_t *handle, nrf905_bool_t *enable)
 get the auto retransmit status
uint8_t nrf905_set_rx_address_width (nrf905_handle_t *handle, nrf905_address_width_t width)
 set the rx address width
uint8_t nrf905_get_rx_address_width (nrf905_handle_t *handle, nrf905_address_width_t *width)
 get the rx address width
uint8_t nrf905_set_tx_address_width (nrf905_handle_t *handle, nrf905_address_width_t width)
 set the tx address width
uint8_t nrf905_get_tx_address_width (nrf905_handle_t *handle, nrf905_address_width_t *width)
 get the tx address width
uint8_t nrf905_set_rx_payload_width (nrf905_handle_t *handle, uint8_t width)
 set the rx payload width
uint8_t nrf905_get_rx_payload_width (nrf905_handle_t *handle, uint8_t *width)
 get the rx payload width
uint8_t nrf905_set_tx_payload_width (nrf905_handle_t *handle, uint8_t width)
 set the tx payload width
uint8_t nrf905_get_tx_payload_width (nrf905_handle_t *handle, uint8_t *width)
 get the tx payload width
uint8_t nrf905_set_rx_address (nrf905_handle_t *handle, uint8_t addr[4])
 set the rx address
uint8_t nrf905_get_rx_address (nrf905_handle_t *handle, uint8_t addr[4])
 get the rx address
uint8_t nrf905_set_output_clock_frequency (nrf905_handle_t *handle, nrf905_output_clock_frequency_t freq)
 set the output clock frequency
uint8_t nrf905_get_output_clock_frequency (nrf905_handle_t *handle, nrf905_output_clock_frequency_t *freq)
 get the output clock frequency
uint8_t nrf905_set_output_clock (nrf905_handle_t *handle, nrf905_bool_t enable)
 enable or disable the output clock
uint8_t nrf905_get_output_clock (nrf905_handle_t *handle, nrf905_bool_t *enable)
 get the output clock status
uint8_t nrf905_set_crystal_oscillator_frequency (nrf905_handle_t *handle, nrf905_crystal_oscillator_frequency_t freq)
 set the crystal oscillator frequency
uint8_t nrf905_get_crystal_oscillator_frequency (nrf905_handle_t *handle, nrf905_crystal_oscillator_frequency_t *freq)
 get the crystal oscillator frequency
uint8_t nrf905_set_crc (nrf905_handle_t *handle, nrf905_bool_t enable)
 enable or disable the crc
uint8_t nrf905_get_crc (nrf905_handle_t *handle, nrf905_bool_t *enable)
 get the crc status
uint8_t nrf905_set_crc_mode (nrf905_handle_t *handle, nrf905_crc_mode_t mode)
 set the crc mode
uint8_t nrf905_get_crc_mode (nrf905_handle_t *handle, nrf905_crc_mode_t *mode)
 get the crc mode
uint8_t nrf905_set_reg (nrf905_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t nrf905_get_reg (nrf905_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver nrf905 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2022-03-31

history

Date Version Author Description
2022/03/31 1.0 Shifeng Li first upload

Definition in file driver_nrf905.h.