Prototype RF driver for STM Sub-1 GHz RF expansion board based on the SPSGRF-868 module for STM32 Nucleo.
Dependents: DISCO_IOT-wifi_client
Fork of stm-spirit1-rf-driver by
Revision 18:d6f789f6f4c9, committed 2016-11-07
- Comitter:
- Wolfgang Betz
- Date:
- Mon Nov 07 10:01:36 2016 +0100
- Parent:
- 17:5dd7fd4342e8
- Child:
- 19:42df12d5f750
- Commit message:
- Add 'RX_FIFO_THR_WA' RX FIFO threshold trigger workaround (for K64F boards)
Changed in this revision
--- a/SimpleSpirit1.cpp Mon Nov 07 08:52:02 2016 +0100 +++ b/SimpleSpirit1.cpp Mon Nov 07 10:01:36 2016 +0100 @@ -156,6 +156,10 @@ SPIRIT_GPIO_DIG_OUT_IRQ }; spirit_gpio_init(&x_gpio_init); + +#ifdef RX_FIFO_THR_WA + linear_fifo_set_almost_full_thr_rx(SPIRIT_MAX_FIFO_LEN-(MAX_PACKET_LEN+1)); +#endif } #ifdef CONTIKI // betzw - TODO
--- a/libs/Contiki_STM32_Library/spirit1-config.h Mon Nov 07 08:52:02 2016 +0100 +++ b/libs/Contiki_STM32_Library/spirit1-config.h Mon Nov 07 10:01:36 2016 +0100 @@ -42,13 +42,26 @@ #define SPIRIT_MAX_FIFO_LEN (96) // betzw - WAS: 600 /*---------------------------------------------------------------------------*/ +/* Define beyond macro when your network includes a platform - like the K64F from + * Freescale - which suffers from a not yet analyzed (HW) bug in delivering/receiving + * further interrupts by/from Spirit after having reached the RX FIFO threshold and + * elaborated the corresponding 'IRQ_RX_FIFO_ALMOST_FULL' interrupt. + * NOTE: this enables just a workaround!!! + */ +#define RX_FIFO_THR_WA + /** * The MAX_PACKET_LEN is an arbitrary value used to define the two array * spirit_txbuf and spirit_rxbuf. * The SPIRIT1 supports with its packet handler a length of 65,535 bytes, * and in direct mode (without packet handler) there is no limit of data. - */ + */ +#ifdef RX_FIFO_THR_WA +#define MAX_PACKET_LEN (SPIRIT_MAX_FIFO_LEN-1) +#else #define MAX_PACKET_LEN (255) // betzw - WAS: SPIRIT_MAX_FIFO_LEN, but LEN_WIDTH is set to 7 so the variable payload length is from 0 to 255 bytes +#endif + /*---------------------------------------------------------------------------*/ /** * Spirit1 IC version
