/* set GPIO0 for RSSI interrupt / CCA */
txbuf[0] = CMD_GPIO_PIN_CFG;
txbuf[1] = 27; /* GPIO[0] = 27: CCA or 37: CCA_LATCH */
txbuf[2] = 0; /* GPIO[1] = DONOTHING */
txbuf[3] = 0; /* GPIO[2] = DONOTHING */
txbuf[4] = 0; /* GPIO[3] = DONOTHING */
txbuf[5] = 0; /* NIRQ = behavior not modified */
txbuf[6] = 0; /* SDO = behavior not modified*/
txbuf[7] = 0; /* GEN_CONFIG = GPIO outputs will have the highest drive strength*/
si446x_SendCommand(8, txbuf);
si446x_WaitForCTS();
/* set RSSI threshold */
txbuf[0] = CMD_SET_PROPERTY;
txbuf[1] = PROP_MODEM_GROUP;
txbuf[2] = 0x03; /* num of property */
txbuf[3] = PROP_MODEM_RSSI_THRESH;/* start address */
txbuf[4] = 30; /* MODEM_RSSI_THRESH: if < 30, CCA GPIO0 becomes low */
txbuf[5] = 0x0c; /* MODEM_RSSI_JUMP_THRESH: default */
txbuf[6] = 0x22; /* MODEM_RSSI_CONTROL: check thresh after latch, latch RSSI when sync word is detected */
si446x_SendCommand(5, txbuf);
si446x_WaitForCTS();