예제 #1
0
파일: si446x_api_lib.c 프로젝트: x893/WDS
/*!
 * Sets the chip up for specified protocol.
 *
 * @param PROTOCOL    0 = Packet format is generic, no dynamic reprogramming of packet handler properties.
                      1 = Packet format is IEEE802.15.4g compliant. The following properties are overriden:
                      PKT_CRC_CONFIG, CRC_ENDIAN/BIT_ORDER in PKT_CONFG1 for TX and RX, PKT_FIELD_1_CRC_CONFIG for RX.
                      Other applicable properties in the packet handler group still need to be programmed. Field 1 should
                      have the length of 16 bits to contain the PHR with PKT_LEN_FIELD_SOURCE set to 1 for RX. PSDU field
                      shall use Field 2 with variable length. Field 2 length should be set to the maximum allowed including
                      the anticipated FCS length. It is anticipated that the FCS will be calculated by the host and transmitted
                      over the air. Si4440 will receive PHR and put FCS in the FIFO for the host to retrieve and check.
                      Therefore, CRC shouldn't be enabled on Si4440.
 */
void si446x_protocol_cfg(U8 PROTOCOL)
{
    Pro2Cmd[0] = SI446X_CMD_ID_PROTOCOL_CFG;
    Pro2Cmd[1] = PROTOCOL;

    radio_comm_SendCmd( SI446X_CMD_ARG_COUNT_PROTOCOL_CFG, Pro2Cmd );
}
예제 #2
0
파일: si4455_api_lib.c 프로젝트: x893/WDS
void si4455_change_state(U8 NEXT_STATE1)
{
    radioCmd[0] = SI4455_CMD_ID_CHANGE_STATE;
    radioCmd[1] = NEXT_STATE1;

    radio_comm_SendCmd( SI4455_CMD_ARG_COUNT_CHANGE_STATE, radioCmd );
}
예제 #3
0
파일: si446x_api_lib.c 프로젝트: x893/WDS
/*!
 * This command is used to allow override of the AGC.
 *
 * @param AGC_OVERRIDE  AGC override parameters.
 */
void si446x_agc_override(U8 AGC_OVERRIDE)
{
  Pro2Cmd[0] = SI446X_CMD_ID_AGC_OVERRIDE;
  Pro2Cmd[1] = AGC_OVERRIDE;

  radio_comm_SendCmd( SI446X_CMD_ARG_COUNT_AGC_OVERRIDE, Pro2Cmd );
}
예제 #4
0
파일: si446x_api_lib.c 프로젝트: x893/WDS
/*!
 * Issue a change state command to the radio.
 *
 * @param NEXT_STATE1 Next state.
 */
void si446x_change_state(U8 NEXT_STATE1)
{
    Pro2Cmd[0] = SI446X_CMD_ID_CHANGE_STATE;
    Pro2Cmd[1] = NEXT_STATE1;

    radio_comm_SendCmd( SI446X_CMD_ARG_COUNT_CHANGE_STATE, Pro2Cmd );
}
예제 #5
0
파일: si4455_api_lib.c 프로젝트: x893/WDS
void si4455_start_tx(U8 CHANNEL, U8 CONDITION, U16 TX_LEN)
{
    radioCmd[0] = SI4455_CMD_ID_START_TX;
    radioCmd[1] = CHANNEL;
    radioCmd[2] = CONDITION;
    radioCmd[3] = (U8)(TX_LEN >> 8);
    radioCmd[4] = (U8)(TX_LEN);

    radio_comm_SendCmd( SI4455_CMD_ARG_COUNT_START_TX, radioCmd );
}
예제 #6
0
파일: si446x_api_lib.c 프로젝트: x893/WDS
/*! Sends START_TX command to the radio.
 *
 * @param CHANNEL   Channel number.
 * @param CONDITION Start TX condition.
 * @param TX_LEN    Payload length (exclude the PH generated CRC).
 */
void si446x_start_tx(U8 CHANNEL, U8 CONDITION, U16 TX_LEN)
{
    Pro2Cmd[0] = SI446X_CMD_ID_START_TX;
    Pro2Cmd[1] = CHANNEL;
    Pro2Cmd[2] = CONDITION;
    Pro2Cmd[3] = (U8)(TX_LEN >> 8);
    Pro2Cmd[4] = (U8)(TX_LEN);

    radio_comm_SendCmd( SI446X_CMD_ARG_COUNT_START_TX, Pro2Cmd );
}
예제 #7
0
파일: si4455_api_lib.c 프로젝트: x893/WDS
void si4455_power_up(U8 BOOT_OPTIONS, U8 XTAL_OPTIONS, U32 XO_FREQ)
{
    radioCmd[0] = SI4455_CMD_ID_POWER_UP;
    radioCmd[1] = BOOT_OPTIONS;
    radioCmd[2] = XTAL_OPTIONS;
    radioCmd[3] = (U8)(XO_FREQ >> 24);
    radioCmd[4] = (U8)(XO_FREQ >> 16);
    radioCmd[5] = (U8)(XO_FREQ >> 8);
    radioCmd[6] = (U8)(XO_FREQ);

    radio_comm_SendCmd( SI4455_CMD_ARG_COUNT_POWER_UP, radioCmd );
}
예제 #8
0
파일: si446x_api_lib.c 프로젝트: x893/WDS
/*!
 * While in RX state this will hop to the frequency specified by the parameters and start searching for a preamble.
 *
 * @param INTE      New INTE register value.
 * @param FRAC2     New FRAC2 register value.
 * @param FRAC1     New FRAC1 register value.
 * @param FRAC0     New FRAC0 register value.
 * @param VCO_CNT1  New VCO_CNT1 register value.
 * @param VCO_CNT0  New VCO_CNT0 register value.
 */
void si446x_rx_hop(U8 INTE, U8 FRAC2, U8 FRAC1, U8 FRAC0, U8 VCO_CNT1, U8 VCO_CNT0)
{
    Pro2Cmd[0] = SI446X_CMD_ID_RX_HOP;
    Pro2Cmd[1] = INTE;
    Pro2Cmd[2] = FRAC2;
    Pro2Cmd[3] = FRAC1;
    Pro2Cmd[4] = FRAC0;
    Pro2Cmd[5] = VCO_CNT1;
    Pro2Cmd[6] = VCO_CNT0;

    radio_comm_SendCmd( SI446X_CMD_ARG_COUNT_RX_HOP, Pro2Cmd );
}
예제 #9
0
파일: si4455_api_lib.c 프로젝트: x893/WDS
void si4455_start_rx(U8 CHANNEL, U8 CONDITION, U16 RX_LEN, U8 NEXT_STATE1, U8 NEXT_STATE2, U8 NEXT_STATE3)
{
    radioCmd[0] = SI4455_CMD_ID_START_RX;
    radioCmd[1] = CHANNEL;
    radioCmd[2] = CONDITION;
    radioCmd[3] = (U8)(RX_LEN >> 8);
    radioCmd[4] = (U8)(RX_LEN);
    radioCmd[5] = NEXT_STATE1;
    radioCmd[6] = NEXT_STATE2;
    radioCmd[7] = NEXT_STATE3;

    radio_comm_SendCmd( SI4455_CMD_ARG_COUNT_START_RX, radioCmd );
}
예제 #10
0
파일: si4455_api_lib.c 프로젝트: x893/WDS
void si4455_set_property( U8 GROUP, U8 NUM_PROPS, U8 START_PROP, ... )
{
    va_list argList;
    U8 cmdIndex;

    radioCmd[0] = SI4455_CMD_ID_SET_PROPERTY;
    radioCmd[1] = GROUP;
    radioCmd[2] = NUM_PROPS;
    radioCmd[3] = START_PROP;

    va_start (argList, START_PROP);
    cmdIndex = 4;
    while(NUM_PROPS--)
    {
        radioCmd[cmdIndex] = va_arg (argList, U8);
        cmdIndex++;
    }
    va_end(argList);

    radio_comm_SendCmd( cmdIndex, radioCmd );
}
예제 #11
0
/*!
 * Sends a command to the radio chip and gets a response
 *
 * @param cmdByteCount  Number of bytes in the command to send to the radio device
 * @param pCmdData      Pointer to the command data
 * @param respByteCount Number of bytes in the response to fetch
 * @param pRespData     Pointer to where to put the response data
 *
 * @return CTS value
 */
U8 radio_comm_SendCmdGetResp(U8 cmdByteCount, U8* pCmdData, U8 respByteCount, U8* pRespData)
{
    radio_comm_SendCmd(cmdByteCount, pCmdData);
    return radio_comm_GetResp(respByteCount, pRespData);
}
예제 #12
0
파일: si4455_api_lib.c 프로젝트: x893/WDS
void si4455_nop(void)
{
    radioCmd[0] = SI4455_CMD_ID_NOP;

    radio_comm_SendCmd( SI4455_CMD_ARG_COUNT_NOP, radioCmd );
}
예제 #13
0
파일: si446x_api_lib.c 프로젝트: x893/WDS
/*!
 * Sends NOP command to the radio. Can be used to maintain SPI communication.
 */
void si446x_nop(void)
{
    Pro2Cmd[0] = SI446X_CMD_ID_NOP;

    radio_comm_SendCmd( SI446X_CMD_ARG_COUNT_NOP, Pro2Cmd );
}
예제 #14
0
void Clear_int_status(void)
{
  U8 send_cmd;
  send_cmd=SI446X_CMD_ID_GET_INT_STATUS;
  radio_comm_SendCmd(0x01,&send_cmd);
}