si446x_api_lib.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /*!
  2. * File:
  3. * si446x_api_lib.h
  4. *
  5. * Description:
  6. * This file contains the Si446x API library.
  7. *
  8. * Silicon Laboratories Confidential
  9. * Copyright 2011 Silicon Laboratories, Inc.
  10. */
  11. #ifndef _SI446X_API_LIB_H_
  12. #define _SI446X_API_LIB_H_
  13. #include <stdint.h>
  14. #define RADIO_DRIVER_EXTENDED_SUPPORT
  15. #define RADIO_DRIVER_FULL_SUPPORT
  16. extern union si446x_cmd_reply_union Si446xCmd;
  17. extern uint8_t Pro2Cmd[];
  18. #define SI466X_FIFO_SIZE 64
  19. enum
  20. {
  21. SI446X_SUCCESS,
  22. SI446X_NO_PATCH,
  23. SI446X_CTS_TIMEOUT,
  24. SI446X_PATCH_FAIL,
  25. SI446X_COMMAND_ERROR
  26. };
  27. /* Minimal driver support functions */
  28. void si446x_reset(void);
  29. void si446x_power_up(uint8_t BOOT_OPTIONS, uint8_t XTAL_OPTIONS, uint32_t XO_FREQ);
  30. uint8_t si446x_configuration_init(const uint8_t* pSetPropCmd);
  31. uint8_t si446x_apply_patch(void);
  32. void si446x_part_info(void);
  33. void si446x_start_tx(uint8_t CHANNEL, uint8_t CONDITION, uint16_t TX_LEN);
  34. void si446x_start_rx(uint8_t CHANNEL, uint8_t CONDITION, uint16_t RX_LEN, uint8_t NEXT_STATE1, uint8_t NEXT_STATE2, uint8_t NEXT_STATE3);
  35. void si446x_get_int_status(uint8_t PH_CLR_PEND, uint8_t MODEM_CLR_PEND, uint8_t CHIP_CLR_PEND);
  36. void si446x_gpio_pin_cfg(uint8_t GPIO0, uint8_t GPIO1, uint8_t GPIO2, uint8_t GPIO3, uint8_t NIRQ, uint8_t SDO, uint8_t GEN_CONFIG);
  37. void si446x_set_property( uint8_t GROUP, uint8_t NUM_PROPS, uint8_t START_PROP, ... );
  38. void si446x_change_state(uint8_t NEXT_STATE1);
  39. #ifdef RADIO_DRIVER_EXTENDED_SUPPORT
  40. /* Extended driver support functions */
  41. void si446x_nop(void);
  42. void si446x_fifo_info(uint8_t FIFO);
  43. void si446x_write_tx_fifo( uint8_t numBytes, uint8_t* pData );
  44. void si446x_read_rx_fifo( uint8_t numBytes, uint8_t* pRxData );
  45. void si446x_get_property(uint8_t GROUP, uint8_t NUM_PROPS, uint8_t START_PROP);
  46. #ifdef RADIO_DRIVER_FULL_SUPPORT
  47. /* Full driver support functions */
  48. void si446x_func_info(void);
  49. void si446x_frr_a_read(uint8_t respByteCount);
  50. void si446x_frr_b_read(uint8_t respByteCount);
  51. void si446x_frr_c_read(uint8_t respByteCount);
  52. void si446x_frr_d_read(uint8_t respByteCount);
  53. void si446x_get_adc_reading(uint8_t ADC_EN);
  54. void si446x_get_packet_info(uint8_t FIELD_NUMBER_MASK, uint16_t LEN, int16_t DIFF_LEN );
  55. void si446x_get_ph_status(uint8_t PH_CLR_PEND);
  56. void si446x_get_modem_status( uint8_t MODEM_CLR_PEND );
  57. void si446x_get_chip_status( uint8_t CHIP_CLR_PEND );
  58. void si446x_ircal_manual(uint8_t IRCAL_AMP, uint8_t IRCAL_PH);
  59. void si446x_protocol_cfg(uint8_t PROTOCOL);
  60. void si446x_request_device_state(void);
  61. void si446x_tx_hop(uint8_t INTE, uint8_t FRAC2, uint8_t FRAC1, uint8_t FRAC0, uint8_t VCO_CNT1, uint8_t VCO_CNT0, uint8_t PLL_SETTLE_TIME1, uint8_t PLL_SETTLE_TIME0);
  62. void si446x_rx_hop(uint8_t INTE, uint8_t FRAC2, uint8_t FRAC1, uint8_t FRAC0, uint8_t VCO_CNT1, uint8_t VCO_CNT0);
  63. void si446x_start_tx_fast( void );
  64. void si446x_start_rx_fast( void );
  65. void si446x_get_int_status_fast_clear( void );
  66. void si446x_get_int_status_fast_clear_read( void );
  67. void si446x_gpio_pin_cfg_fast( void );
  68. void si446x_get_ph_status_fast_clear( void );
  69. void si446x_get_ph_status_fast_clear_read( void );
  70. void si446x_get_modem_status_fast_clear( void );
  71. void si446x_get_modem_status_fast_clear_read( void );
  72. void si446x_get_chip_status_fast_clear( void );
  73. void si446x_get_chip_status_fast_clear_read( void );
  74. void si446x_fifo_info_fast_reset(uint8_t FIFO);
  75. void si446x_fifo_info_fast_read(void);
  76. #endif
  77. #endif
  78. #endif //_SI446X_API_LIB_H_