From: Nathael Pajani Date: Thu, 17 Sep 2015 19:00:11 +0000 (+0200) Subject: Add cc1101_send_calibration_request() and cc1101_enter_fstxon_state() functions X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=c283591942b39d3b17e9f21a597f7423f0cedec2;p=soft%2Flpc122x%2Fcore Add cc1101_send_calibration_request() and cc1101_enter_fstxon_state() functions --- diff --git a/extdrv/cc1101.c b/extdrv/cc1101.c index 939dba3..5f81055 100644 --- a/extdrv/cc1101.c +++ b/extdrv/cc1101.c @@ -174,7 +174,15 @@ static uint8_t cc1101_enter_tx_mode(void) return 0; } +void cc1101_enter_fstxon_state(void) { + uint8_t status = (cc1101_read_status() & CC1101_STATE_MASK); + if (status != CC1101_STATE_FSTON) { + if ((status != CC1101_STATE_TX) && (status != CC1101_STATE_RX)) { + cc1101_send_cmd(CC1101_CMD(state_idle)); + } + cc1101_send_cmd(CC1101_CMD(start_freq_synth)); + } } @@ -197,6 +205,12 @@ uint8_t cc1101_get_link_quality(void) } +/* Request a calibration */ +void cc1101_send_calibration_request(void) +{ + cc1101_send_cmd(CC1101_CMD(synth_calibration)); +} + /***************************************************************************** */ /* Rx fifo state : * Return 0 when fifo is empty, or number of remaining bytes when non empty and no diff --git a/include/extdrv/cc1101.h b/include/extdrv/cc1101.h index 396e721..d3a02eb 100644 --- a/include/extdrv/cc1101.h +++ b/include/extdrv/cc1101.h @@ -186,6 +186,8 @@ uint8_t cc1101_read_pkt_status(void); /***************************************************************************** */ /* Enter Rx mode */ void cc1101_enter_rx_mode(void); +/* Prepare for entering Tx mode by moving to FSTXON state */ +void cc1101_enter_fstxon_state(void); /***************************************************************************** */ @@ -196,6 +198,8 @@ uint8_t cc1101_get_signal_strength_indication(void); /* Return the link quality indication based in the last packet received */ uint8_t cc1101_get_link_quality(void); +/* Request a calibration */ +void cc1101_send_calibration_request(void); /***************************************************************************** */ /* Rx fifo state :