Pull CPU-related constants from the CPU header (CC13xx/CC26xx)
This commit is contained in:
parent
fdde5dc669
commit
5c07cb02a8
@ -47,8 +47,6 @@
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define RTIMER_ARCH_SECOND 65536
|
||||
/*---------------------------------------------------------------------------*/
|
||||
rtimer_clock_t rtimer_arch_now(void);
|
||||
|
||||
/* HW oscillator frequency is 32 kHz, not 64 kHz and RTIMER_NOW() never returns
|
||||
|
@ -202,6 +202,7 @@
|
||||
#define ROM_BOOTLOADER_ENABLE 0
|
||||
#endif
|
||||
/** @} */
|
||||
#include "cc13xx-cc26xx-def.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name Button configurations
|
||||
@ -227,92 +228,6 @@
|
||||
/* Platform-specific define to signify sensor reading failure */
|
||||
#define CC26XX_SENSOR_READING_ERROR 0x80000000
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/**
|
||||
* \name Compiler configuration and platform-specific type definitions
|
||||
*
|
||||
* Those values are not meant to be modified by the user
|
||||
* @{
|
||||
*/
|
||||
#define CLOCK_CONF_SECOND 128
|
||||
|
||||
/* Compiler configurations */
|
||||
#define CCIF
|
||||
#define CLIF
|
||||
|
||||
/* Platform typedefs */
|
||||
typedef uint32_t clock_time_t;
|
||||
typedef uint32_t uip_stats_t;
|
||||
|
||||
/* Clock (time) comparison macro */
|
||||
#define CLOCK_LT(a, b) ((signed long)((a) - (b)) < 0)
|
||||
|
||||
/*
|
||||
* rtimer.h typedefs rtimer_clock_t as unsigned short. We need to define
|
||||
* RTIMER_CLOCK_DIFF to override this
|
||||
*/
|
||||
typedef uint32_t rtimer_clock_t;
|
||||
#define RTIMER_CLOCK_DIFF(a, b) ((int32_t)((a) - (b)))
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
/* TSCH related defines */
|
||||
|
||||
/* Delay between GO signal and SFD */
|
||||
#define RADIO_DELAY_BEFORE_TX ((unsigned)US_TO_RTIMERTICKS(81))
|
||||
/* Delay between GO signal and start listening.
|
||||
* This value is so small because the radio is constantly on within each timeslot. */
|
||||
#define RADIO_DELAY_BEFORE_RX ((unsigned)US_TO_RTIMERTICKS(15))
|
||||
/* Delay between the SFD finishes arriving and it is detected in software. */
|
||||
#define RADIO_DELAY_BEFORE_DETECT ((unsigned)US_TO_RTIMERTICKS(352))
|
||||
|
||||
/* Timer conversion; radio is running at 4 MHz */
|
||||
#define RADIO_TIMER_SECOND 4000000u
|
||||
#if (RTIMER_SECOND % 256) || (RADIO_TIMER_SECOND % 256)
|
||||
#error RADIO_TO_RTIMER macro must be fixed!
|
||||
#endif
|
||||
#define RADIO_TO_RTIMER(X) ((uint32_t)(((uint64_t)(X) * (RTIMER_SECOND / 256)) / (RADIO_TIMER_SECOND / 256)))
|
||||
#define USEC_TO_RADIO(X) ((X) * 4)
|
||||
|
||||
/* The PHY header (preamble + SFD, 4+1 bytes) duration is equivalent to 10 symbols */
|
||||
#define RADIO_IEEE_802154_PHY_HEADER_DURATION_USEC 160
|
||||
|
||||
/* Do not turn off TSCH within a timeslot: not enough time */
|
||||
#define TSCH_CONF_RADIO_ON_DURING_TIMESLOT 1
|
||||
|
||||
/* Disable TSCH frame filtering */
|
||||
#define TSCH_CONF_HW_FRAME_FILTERING 0
|
||||
|
||||
/* Use hardware timestamps */
|
||||
#ifndef TSCH_CONF_RESYNC_WITH_SFD_TIMESTAMPS
|
||||
#define TSCH_CONF_RESYNC_WITH_SFD_TIMESTAMPS 1
|
||||
#define TSCH_CONF_TIMESYNC_REMOVE_JITTER 0
|
||||
#endif
|
||||
|
||||
#ifndef TSCH_CONF_BASE_DRIFT_PPM
|
||||
/* The drift compared to "true" 10ms slots.
|
||||
* Enable adaptive sync to enable compensation for this.
|
||||
* Slot length 10000 usec
|
||||
* 328 ticks
|
||||
* Tick duration 30.517578125 usec
|
||||
* Real slot duration 10009.765625 usec
|
||||
* Target - real duration = -9.765625 usec
|
||||
* TSCH_CONF_BASE_DRIFT_PPM -977
|
||||
*/
|
||||
#define TSCH_CONF_BASE_DRIFT_PPM -977
|
||||
#endif
|
||||
|
||||
/* 10 times per second */
|
||||
#ifndef TSCH_CONF_CHANNEL_SCAN_DURATION
|
||||
#define TSCH_CONF_CHANNEL_SCAN_DURATION (CLOCK_SECOND / 10)
|
||||
#endif
|
||||
|
||||
/* Slightly reduce the TSCH guard time (from 2200 usec to 1800 usec) to make sure
|
||||
* the CC26xx radio has sufficient time to start up. */
|
||||
#ifndef TSCH_CONF_RX_WAIT
|
||||
#define TSCH_CONF_RX_WAIT 1800
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* board.h assumes that basic configuration is done */
|
||||
#include "board.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
Loading…
Reference in New Issue
Block a user