Go to the documentation of this file.
20 #ifndef KW41ZRF_INTERN_H
21 #define KW41ZRF_INTERN_H
31 #define KW41ZRF_PM_BLOCKER KINETIS_PM_VLPS
34 #ifndef KW41ZRF_ENABLE_LEDS
35 #define KW41ZRF_ENABLE_LEDS (0)
38 #if KW41ZRF_ENABLE_LEDS
41 #if !defined(KW41ZRF_LED_RX_ON)
43 #define KW41ZRF_LED_RX_ON LED0_ON
44 #define KW41ZRF_LED_RX_OFF LED0_OFF
46 #define KW41ZRF_LED_RX_ON
47 #define KW41ZRF_LED_RX_OFF
50 #if !defined(KW41ZRF_LED_TX_ON)
53 #define KW41ZRF_LED_TX_ON LED1_ON
54 #define KW41ZRF_LED_TX_OFF LED1_OFF
55 #elif defined(LED0_ON)
57 #define KW41ZRF_LED_TX_ON LED0_ON
58 #define KW41ZRF_LED_TX_OFF LED0_OFF
60 #define KW41ZRF_LED_TX_ON
61 #define KW41ZRF_LED_TX_OFF
64 #if !defined(KW41ZRF_LED_NDSM_ON)
66 #define KW41ZRF_LED_NDSM_ON LED2_ON
67 #define KW41ZRF_LED_NDSM_OFF LED2_OFF
69 #define KW41ZRF_LED_NDSM_ON
70 #define KW41ZRF_LED_NDSM_OFF
73 #if !defined(KW41ZRF_LED_IRQ_ON)
75 #define KW41ZRF_LED_IRQ_ON LED3_ON
76 #define KW41ZRF_LED_IRQ_OFF LED3_OFF
78 #define KW41ZRF_LED_IRQ_ON
79 #define KW41ZRF_LED_IRQ_OFF
83 #define KW41ZRF_LED_NDSM_ON
84 #define KW41ZRF_LED_NDSM_OFF
85 #define KW41ZRF_LED_TX_ON
86 #define KW41ZRF_LED_TX_OFF
87 #define KW41ZRF_LED_RX_ON
88 #define KW41ZRF_LED_RX_OFF
89 #define KW41ZRF_LED_IRQ_ON
90 #define KW41ZRF_LED_IRQ_OFF
109 KW41ZRF_TIMEBASE_500000HZ = 0b010,
110 KW41ZRF_TIMEBASE_250000HZ = 0b011,
111 KW41ZRF_TIMEBASE_125000HZ = 0b100,
112 KW41ZRF_TIMEBASE_62500HZ = 0b101,
113 KW41ZRF_TIMEBASE_31250HZ = 0b110,
114 KW41ZRF_TIMEBASE_15625HZ = 0b111,
122 NVIC_DisableIRQ(Radio_1_IRQn);
123 NVIC_ClearPendingIRQ(Radio_1_IRQn);
132 NVIC_EnableIRQ(Radio_1_IRQn);
180 ZLL->PHY_CTRL = (ZLL->PHY_CTRL &
181 ~(ZLL_PHY_CTRL_XCVSEQ_MASK |
182 ZLL_PHY_CTRL_TC3TMOUT_MASK | ZLL_PHY_CTRL_TMRTRIGEN_MASK)) |
183 ZLL_PHY_CTRL_XCVSEQ(XCVSEQ_IDLE) | ZLL_PHY_CTRL_SEQMSK_MASK;
186 while (!(ZLL->SEQ_CTRL_STS & ZLL_SEQ_CTRL_STS_SEQ_IDLE_MASK)) {}
189 uint32_t irqsts = ZLL->IRQSTS;
190 ZLL->IRQSTS = irqsts;
201 return (RSIM->DSM_CONTROL & RSIM_DSM_CONTROL_ZIG_DEEP_SLEEP_STATUS_MASK);
213 ZLL->EVENT_TMR = ZLL_EVENT_TMR_EVENT_TMR(value) | ZLL_EVENT_TMR_EVENT_TMR_LD_MASK;
226 return (ZLL->EVENT_TMR & ZLL_EVENT_TMR_EVENT_TMR_MASK) >> ZLL_EVENT_TMR_EVENT_TMR_SHIFT;
240 *cmp_reg = now + timeout;
256 ZLL->TMR_PRESCALE = (ZLL->TMR_PRESCALE & ~ZLL_TMR_PRESCALE_TMR_PRESCALE_MASK) |
257 ZLL_TMR_PRESCALE_TMR_PRESCALE(tb);
275 return ZLL->TIMESTAMP;
static void kw41zrf_mask_irqs(void)
Mask all transceiver interrupts.
void kw41zrf_set_irq_callback(void(*cb)(void *arg), void *arg)
Set the callback function for the radio ISR.
Interface definition for the kw41zrf driver.
@ KW41ZRF_POWER_IDLE
All parts powered.
static uint32_t kw41zrf_get_timestamp(kw41zrf_t *dev)
Returns timestamp of the beginning of the most recently received packet.
static void kw41zrf_timer_set(kw41zrf_t *dev, volatile uint32_t *cmp_reg, uint32_t timeout)
Set a timeout value for the given compare register of the Event Timer.
static void kw41zrf_unmask_irqs(void)
Unmask all transceiver interrupts.
kw41zrf_timer_timebase
Timebase settings.
static uint32_t kw41zrf_timer_get(kw41zrf_t *dev)
Get current event timer counter value.
static void kw41zrf_timer_load(kw41zrf_t *dev, uint32_t value)
Set event timer counter value.
enum kw41zrf_timer_timebase kw41zrf_timer_timebase_t
Timebase settings.
static void kw41zrf_abort_sequence(kw41zrf_t *dev)
Abort the current autosequence.
get/set interfaces for kw41zrf driver
kw41zrf_powermode_t
KW41Z transceiver power modes.
void kw41zrf_set_sequence(kw41zrf_t *dev, uint32_t seq)
Set sequence state of device.
@ KW41ZRF_POWER_DSM
Deep sleep mode.
Device descriptor for KW41ZRF radio devices.
int kw41zrf_can_switch_to_idle(kw41zrf_t *dev)
Determine if the transceiver is busy doing TX or RX.
static uint32_t kw41zrf_is_dsm(void)
Check if the radio is in deep sleep mode.
void kw41zrf_set_power_mode(kw41zrf_t *dev, kw41zrf_powermode_t pm)
Set power mode for device.
static void kw41zrf_timer_init(kw41zrf_t *dev, kw41zrf_timer_timebase_t tb)
Initialize the Event Timer Block (up counter)