mrf24j40_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Neo Nenaco <neo@nenaco.de>
3  * Copyright (C) 2017 Koen Zandberg <koen@bergzand.net>
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
21 #ifndef MRF24J40_INTERNAL_H
22 #define MRF24J40_INTERNAL_H
23 
24 #include <stdint.h>
25 
26 #include "mrf24j40.h"
27 #include "kernel_defines.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 
41 int mrf24j40_init(mrf24j40_t *dev);
42 
51 uint8_t mrf24j40_reg_read_short(mrf24j40_t *dev, const uint8_t addr);
52 
60 void mrf24j40_reg_write_short(mrf24j40_t *dev, const uint8_t addr, const uint8_t value);
61 
70 uint8_t mrf24j40_reg_read_long(mrf24j40_t *dev, const uint16_t addr);
71 
79 void mrf24j40_reg_write_long(mrf24j40_t *dev, const uint16_t addr, const uint8_t value);
80 
89 void mrf24j40_tx_normal_fifo_write(mrf24j40_t *dev, const uint16_t offset, const uint8_t *data, const size_t len);
90 
99 void mrf24j40_rx_fifo_read(mrf24j40_t *dev, const uint16_t offset, uint8_t *data, const size_t len);
100 
107 
114 
121 
127 #if IS_ACTIVE(CONFIG_MRF24J40_USE_EXT_PA_LNA)
129 #else
130 static inline void mrf24j40_enable_auto_pa_lna(mrf24j40_t *dev) { (void) dev; }
131 #endif
132 
138 #if IS_ACTIVE(CONFIG_MRF24J40_USE_EXT_PA_LNA)
140 #else
141 static inline void mrf24j40_disable_auto_pa_lna(mrf24j40_t *dev) { (void) dev; }
142 #endif
143 
149 #if IS_ACTIVE(CONFIG_MRF24J40_USE_EXT_PA_LNA)
151 #else
152 static inline void mrf24j40_enable_lna(mrf24j40_t *dev) { (void) dev; }
153 #endif
154 
155 #ifdef __cplusplus
156 }
157 #endif
158 
159 #endif /* MRF24J40_INTERNAL_H */
160 
mrf24j40_reg_write_long
void mrf24j40_reg_write_long(mrf24j40_t *dev, const uint16_t addr, const uint8_t value)
Write to a register at address addr from device dev.
kernel_defines.h
Common macros and compiler attributes/pragmas configuration.
mrf24j40_enable_lna
static void mrf24j40_enable_lna(mrf24j40_t *dev)
Enable only the External Low Noise Amplifier.
Definition: mrf24j40_internal.h:152
mrf24j40_hardware_reset
void mrf24j40_hardware_reset(mrf24j40_t *dev)
Trigger a hardware reset.
mrf24j40_rx_fifo_read
void mrf24j40_rx_fifo_read(mrf24j40_t *dev, const uint16_t offset, uint8_t *data, const size_t len)
Read a chunk of data from the RX_FIFO area of the given device.
mrf24j40_tx_normal_fifo_write
void mrf24j40_tx_normal_fifo_write(mrf24j40_t *dev, const uint16_t offset, const uint8_t *data, const size_t len)
Write a chunk of data into the TX Normal FIFO area of the given device.
mrf24j40_init
int mrf24j40_init(mrf24j40_t *dev)
initialization as described in datasheet
mrf24j40_update_tasks
void mrf24j40_update_tasks(mrf24j40_t *dev)
Check for pending interrupts and update task list.
mrf24j40_reg_read_short
uint8_t mrf24j40_reg_read_short(mrf24j40_t *dev, const uint8_t addr)
Read from a register with a at address addr from device dev.
mrf24j40_reg_write_short
void mrf24j40_reg_write_short(mrf24j40_t *dev, const uint8_t addr, const uint8_t value)
Write to a register at address addr from device dev.
mrf24j40_enable_auto_pa_lna
static void mrf24j40_enable_auto_pa_lna(mrf24j40_t *dev)
Enable automatic External Power Amplifier & Low Noise Amplifier control.
Definition: mrf24j40_internal.h:130
mrf24j40.h
Interface definition for MRF24J40 based drivers.
mrf24j40_reg_read_long
uint8_t mrf24j40_reg_read_long(mrf24j40_t *dev, const uint16_t addr)
Read from a register with a at address addr from device dev.
mrf24j40_reset_tasks
void mrf24j40_reset_tasks(mrf24j40_t *dev)
Reset the pending task list of a device.
mrf24j40_t
Device descriptor for MRF24J40 radio devices.
Definition: mrf24j40.h:163
mrf24j40_disable_auto_pa_lna
static void mrf24j40_disable_auto_pa_lna(mrf24j40_t *dev)
Disable automatic External Power Amplifier & Low Noise Amplifier control.
Definition: mrf24j40_internal.h:141