EVE 1.0
si4455_api_lib.h
1 /*!
2  * File:
3  * si4455_api_lib.h
4  *
5  * Description:
6  * This file contains the Si4455 API library.
7  *
8  * Silicon Laboratories Confidential
9  * Copyright 2011 Silicon Laboratories, Inc.
10  */
11 
12 #ifndef _SI4455_API_LIB_H_
13 #define _SI4455_API_LIB_H_
14 
15 #define SI4455_FIFO_SIZE 64
16 
17 enum
18 {
19  SI4455_SUCCESS,
20  SI4455_NO_PATCH,
21  SI4455_CTS_TIMEOUT,
22  SI4455_PATCH_FAIL,
23  SI4455_COMMAND_ERROR
24 };
25 
26 /* Minimal driver support functions */
27 void si4455_reset(const struct si4455_t *radio);
28 void si4455_power_up(const struct si4455_t *radio, U8 BOOT_OPTIONS, U8 XTAL_OPTIONS, U32 XO_FREQ);
29 
30 U8 si4455_configuration_init(const struct si4455_t *radio, const U8* pSetPropCmd);
31 
32 void si4455_write_ezconfig_array(const struct si4455_t *radio, U8 numBytes, const U8* pEzConfigArray);
33 U8 si4455_ezconfig_check(const struct si4455_t *radio, U16 CHECKSUM);
34 
35 void si4455_start_tx(const struct si4455_t *radio, U8 CHANNEL, U8 CONDITION, U16 TX_LEN);
36 void si4455_start_rx(const struct si4455_t *radio, U8 CHANNEL, U8 CONDITION, U16 RX_LEN, U8 NEXT_STATE1, U8 NEXT_STATE2, U8 NEXT_STATE3);
37 
38 void si4455_get_int_status(const struct si4455_t *radio, struct si4455_reply_GET_INT_STATUS_map *reply, U8 PH_CLR_PEND, U8 MODEM_CLR_PEND, U8 CHIP_CLR_PEND);
39 
40 void si4455_gpio_pin_cfg(const struct si4455_t *radio, struct si4455_reply_GPIO_PIN_CFG_map *reply, U8 GPIO0, U8 GPIO1, U8 GPIO2, U8 GPIO3, U8 NIRQ, U8 SDO, U8 GEN_CONFIG);
41 
42 void si4455_set_property(const struct si4455_t *radio, U8 GROUP, U8 NUM_PROPS, U8 START_PROP, ... );
43 
44 void si4455_change_state(const struct si4455_t *radio, U8 NEXT_STATE1);
45 
46 #ifdef RADIO_DRIVER_EXTENDED_SUPPORT
47  /* Extended driver support functions */
48  void si4455_nop(const struct si4455_t *radio);
49 
50  void si4455_fifo_info(const struct si4455_t *radio, struct si4455_reply_FIFO_INFO_map *reply, U8 FIFO);
51  void si4455_part_info(const struct si4455_t *radio, struct si4455_reply_PART_INFO_map *reply);
52 
53  void si4455_write_tx_fifo(const struct si4455_t *radio, U8 numBytes, U8* pData);
54  void si4455_read_rx_fifo(const struct si4455_t *radio, U8 numBytes, U8* pRxData);
55 
56  void si4455_get_property(const struct si4455_t *radio, struct si4455_reply_GET_PROPERTY_map *reply, U8 GROUP, U8 NUM_PROPS, U8 START_PROP);
57 
58  #ifdef RADIO_DRIVER_FULL_SUPPORT
59  /* Full driver support functions */
60  void si4455_func_info(const struct si4455_t *radio, struct si4455_reply_FUNC_INFO_map *reply);
61 
62  void si4455_frr_a_read(const struct si4455_t *radio, struct si4455_reply_FRR_A_READ_map *reply, U8 respByteCount);
63  void si4455_frr_b_read(const struct si4455_t *radio, struct si4455_reply_FRR_B_READ_map *reply, U8 respByteCount);
64  void si4455_frr_c_read(const struct si4455_t *radio, struct si4455_reply_FRR_C_READ_map *reply, U8 respByteCount);
65  void si4455_frr_d_read(const struct si4455_t *radio, struct si4455_reply_FRR_D_READ_map *reply, U8 respByteCount);
66 
67  void si4455_read_cmd_buff(const struct si4455_t *radio, struct si4455_reply_READ_CMD_BUFF_map *reply);
68  void si4455_request_device_state(const struct si4455_t *radio, struct si4455_reply_REQUEST_DEVICE_STATE_map *reply);
69 
70  void si4455_get_adc_reading(const struct si4455_t *radio, struct si4455_reply_GET_ADC_READING_map *reply, U8 ADC_EN, U8 ADC_CFG);
71 
72  void si4455_get_ph_status(const struct si4455_t *radio, struct si4455_reply_GET_PH_STATUS_map *reply, U8 PH_CLR_PEND);
73  void si4455_get_modem_status(const struct si4455_t *radio, struct si4455_reply_GET_MODEM_STATUS_map *reply, U8 MODEM_CLR_PEND);
74  void si4455_get_chip_status(const struct si4455_t *radio, struct si4455_reply_GET_CHIP_STATUS_map *reply, U8 CHIP_CLR_PEND);
75 
76  #endif
77 #endif
78 
79 #endif //_SI4455_API_LIB_H_