-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Legacy) develop_FW-866 OpenRadio interface #504
base: develop
Are you sure you want to change the base?
Changes from 1 commit
6ffee84
92a27e9
9035323
9999fe1
ff29667
eebd083
133dc1c
984444a
9273ca3
a6468d7
1669b80
999f50f
917665d
64006b5
0de94cb
185038e
ecc3bd2
56ed0cf
480f1dc
9226da2
6dda3e9
39a1bdc
f0d59e5
6bae185
75b7eb1
d2b9c40
0166d42
aa7237b
2464d80
f23a799
4882b35
c9f560e
e5fdab3
4e484f2
74ca322
48f3080
6ecca16
49d565f
a506320
6a8f446
5e6ca11
ba85ad8
c861218
5110952
5538db7
1a1926b
cdf2911
e5b34b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,92 +75,33 @@ | |
#define MAX_RADIOS 7 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no need for this. You have a variable which holds your timeslot templates, and can derive the number of templates from there (by dividing by the length of one.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is not for templates, it is for radioSetting array openradio lookup table in radio.c |
||
|
||
//===== IEEE802154E timing | ||
|
||
#if SLOT_TEMPLATE==10 | ||
// time-slot related | ||
#define SLOTDURATION 10 // ms | ||
#define PORT_TsSlotDuration 328 // counter counts one extra count, see datasheet | ||
// execution speed related | ||
#define PORT_maxTxDataPrepare 10 // 305us (measured 82us) | ||
#define PORT_maxRxAckPrepare 10 // 305us (measured 83us) | ||
#define PORT_maxRxDataPrepare 4 // 122us (measured 22us) | ||
#define PORT_maxTxAckPrepare 10 // 122us (measured 94us) | ||
// radio speed related | ||
#ifdef L2_SECURITY_ACTIVE | ||
#define PORT_delayTx 14 // 366us (measured xxxus) | ||
#else | ||
#define PORT_delayTx 12 // 366us (measured xxxus) | ||
#endif | ||
#define PORT_delayRx 0 // 0us (can not measure) | ||
// radio watchdog | ||
#endif | ||
|
||
#if SLOT_TEMPLATE==20 | ||
#define SLOTDURATION 20 // ms | ||
#define PORT_TsSlotDuration 1310 //655 // 20ms | ||
|
||
// execution speed related | ||
#define PORT_maxTxDataPrepare 110 // 3355us (not measured) | ||
#define PORT_maxRxAckPrepare 20 // 610us (not measured) | ||
#define PORT_maxRxDataPrepare 33 // 1000us (not measured) | ||
#define PORT_maxTxAckPrepare 50 // 1525us (not measured) | ||
|
||
// radio speed related | ||
#define PORT_delayTx 18 // 549us (not measured) | ||
#define PORT_delayRx 0 // 0us (can not measure) | ||
#endif | ||
|
||
//40ms slot for 24ghz cc2538 | ||
#if SLOT_TEMPLATE==41 | ||
#define SLOTDURATION 40 // ms | ||
#define PORT_TsSlotDuration 1310 // 40ms | ||
|
||
// execution speed related | ||
#define PORT_maxTxDataPrepare 10 // 305us | ||
#define PORT_maxRxAckPrepare 10 // 305us | ||
#define PORT_maxRxDataPrepare 4 // 122us | ||
#define PORT_maxTxAckPrepare 10 // 305us | ||
// radio speed related | ||
#ifdef L2_SECURITY_ACTIVE | ||
#define PORT_delayTx 14 // 366us (measured xxxus) | ||
#else | ||
#define PORT_delayTx 12 // 366us (measured xxxus) | ||
#endif | ||
#define PORT_delayRx 0 // 0us (can not measure) | ||
// radio watchdog | ||
#endif | ||
|
||
//40ms slot for FSK | ||
#if SLOT_TEMPLATE==42 | ||
#define SLOTDURATION 40 // ms | ||
#define PORT_TsSlotDuration 1310 // 40ms | ||
|
||
typedef struct { | ||
uint8_t SLOTDURATION; | ||
uint8_t PORT_TsSlotDuration; | ||
|
||
// execution speed related | ||
#define PORT_maxTxDataPrepare 50 // 1525 us (based on measurement) | ||
#define PORT_maxRxAckPrepare 10 // 305µs (based on measurement) | ||
#define PORT_maxRxDataPrepare 10 // 305µs (based on measurement) | ||
#define PORT_maxTxAckPrepare 33 // 1000µs (based on measurement) | ||
// radio speed related | ||
#define PORT_delayTx 66 // 2000µs (based on measurement) | ||
#define PORT_delayRx 16 // 488µs. This parameter is usually set to 0, however for Atmel on openmote-b, it takes at least 1ms for the transmission to occure because of spi delay (or other implementation specific overhead), so reciver is expected to wait a little more before turning on the radio. | ||
#endif | ||
|
||
|
||
//40ms slot for OFDM1 MCS0-3 | ||
#if SLOT_TEMPLATE==43 | ||
#define SLOTDURATION 40 // ms | ||
#define PORT_TsSlotDuration 1310 // 40ms | ||
// also implementation related (e.g. SoC radio or spi-connected radio because of the time to load a packet to/from radio) | ||
uint8_t PORT_maxTxDataPrepare; | ||
uint8_t PORT_maxRxAckPrepare; | ||
uint8_t PORT_maxRxDataPrepare; | ||
uint8_t PORT_maxTxAckPrepare; | ||
|
||
// execution speed related | ||
#define PORT_maxTxDataPrepare 50 //1525us (based on measurement) | ||
#define PORT_maxRxAckPrepare 10 //305us (based on measurement) | ||
#define PORT_maxRxDataPrepare 10 //305us (based on measurement) | ||
#define PORT_maxTxAckPrepare 33 //1000us (based on measurement) | ||
// radio speed related | ||
#define PORT_delayTx 41 //1251us (based on measurement) | ||
#define PORT_delayRx 16 // 488µs. This parameter is usually set to 0, however for Atmel on openmote-b, it takes at least 1ms for the transmission to occure because of spi delay (or other implementation specific overhead), so reciver is expected to wait a little more before turning on the radio. | ||
#endif | ||
|
||
// also implementation related (because the time to execute the Tx/Rx command is highly dependent on the radio AND the configuration) | ||
uint8_t PORT_delayTx; | ||
uint8_t PORT_delayRx; | ||
} slot_board_vars_t; //board specific slot vars | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make sense defining this in typedef struct {
uint8_t SLOTDURATION;
uint8_t PORT_TsSlotDuration;
uint8_t PORT_maxTxDataPrepare;
uint8_t PORT_maxRxAckPrepare;
uint8_t PORT_maxRxDataPrepare;
uint8_t PORT_maxTxAckPrepare;
uint8_t PORT_delayTx;
uint8_t PORT_delayRx;
} slot_board_vars_t;
/* This would be a default configuration */
#ifndef 10MS_SLOTDURATION
#define 10MS_SLOTDURATION 20 /* in miliseconds */
#endif
#ifndef 10MS_PORT_TsSlotDuration
#define 10MS_PORT_TsSlotDuration 655 /* 655 ticks at @32768Hz */
#endif
#ifndef 10MS_PORT_maxTxDataPrepare
#define 10MS_PORT_maxTxDataPrepare 110 /* 3355us (not measured) */
#endif
#ifndef 10MS_PORT_maxRxAckPrepare
#define 10MS_PORT_maxRxAckPrepare 20 /* 610us (not measured) */
#endif
#ifndef 10MS_PORT_maxRxDataPrepare
#define 10MS_PORT_maxRxDataPrepare 33 /* 1000us (not measured) */
#endif
#ifndef 10MS_PORT_maxTxAckPrepare
#define 10MS_PORT_maxTxAckPrepare 50 /* 1525us (not measured) */
#endif
#ifndef 10MS_PORT_delayTx
#define 10MS_PORT_delayTx 10 /* 549us (not measured) */
#endif
#ifndef 10MS_PORT_delayRx
#define 10MS_PORT_delayRx 0 /* 0us (can not measure) */
#endif
#define SLOT_10_MS_BOARD_CONFIG_DEFAULT { .SLOTDURATION = 10MS_SLOTDURATION, \
.PORT_TsSlotDuration = 10MS_PORT_TsSlotDuration, \
.PORT_maxTxDataPrepare = 10MS_PORT_maxTxDataPrepare, \
.PORT_maxRxAckPrepare = 10MS_PORT_maxRxAckPrepare, \
.PORT_maxRxDataPrepare = 10MS_PORT_maxRxDataPrepare, \
.PORT_maxTxAckPrepare = 10MS_PORT_maxTxAckPrepare, \
.PORT_delayTx = 10MS_PORT_delayTx, \
.PORT_delayRx = 10MS_PORT_delayRx, \
}
static const slot_board_vars_t slot_10ms_board_vars[] =
{
#ifdef SLOT_10MS_BOARD_VARS
SLOT_10MS_BOARD_VARS,
#else
SLOT_10MS_BOARD_VARS_DEFAULT,
#endif
...
/* that for all slots */
...
#ifdef SLOT_40MS_OFDM1MCS0_3_SUBGHZ_BOARD_VARS
SLOT_40MS_OFDM1MCS0_3_SUBGHZ_BOARD_VARS,
#else
SLOT_40MS_OFDM1MCS0_3_SUBGHZ_BOARD_VARS_DEFAULT,
#endif
}; And then per #define SLOT_10MS_BOARD_VARS { .SLOTDURATION = 10MS_SLOTDURATION, \
.PORT_TsSlotDuration =10MS_ PORT_TsSlotDuration, \
.PORT_maxTxDataPrepare = 10MS_PORT_maxTxDataPrepare, \
.PORT_maxRxAckPrepare =10MS_ PORT_maxRxAckPrepare, \
.PORT_maxRxDataPrepare = 10MS_PORT_maxRxDataPrepare, \
.PORT_maxTxAckPrepare = 10MS_PORT_maxTxAckPrepare, \
.PORT_delayTx = 10MS_PORT_delayTx, \
.PORT_delayRx = 10MS_PORT_delayRx, \
} I think this would also make the migration easier and the init function could void board_init_slot_vars(const slot_board_config_t *slot_board_config) {
slot_board_vars = *slot_board_config;
} The nice thing is this change could be split from this PR, and since currently only one
|
||
|
||
// available slot templates | ||
typedef enum{ | ||
SLOT_10ms, | ||
SLOT_20ms_24GHZ, | ||
SLOT_40ms_24GHZ, | ||
SLOT_40ms_FSK_SUBGHZ, | ||
SLOT_40ms_OFDM1MCS0_3_SUBGHZ, | ||
MAX_SLOT_TYPES, | ||
} slotType_t; | ||
|
||
//===== adaptive_sync accuracy | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't care about anything than 3 settings, and 40ms timeslots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the 10ms and 20ms are used in other board, should I definitely remove them? @changtengfei @TimothyClaeys