1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 05:12:57 +01:00

Merge pull request #13885 from akshaim/Kconfig_at86rf215

drivers/at86rf215 : Expose Configurations to Kconfig
This commit is contained in:
Leandro Lanzieri 2020-04-22 13:59:29 +02:00 committed by GitHub
commit ee7493429b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 10 deletions

View File

@ -5,6 +5,7 @@
# directory for more details.
menu "Network Device Drivers"
rsource "at86rf215/Kconfig"
rsource "cc110x/Kconfig"
rsource "dose/Kconfig"
rsource "mrf24j40/Kconfig"

41
drivers/at86rf215/Kconfig Normal file
View File

@ -0,0 +1,41 @@
# Copyright (c) 2020 Freie Universitaet Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
menuconfig KCONFIG_MODULE_AT86RF215
bool "Configure AT86RF215 driver"
depends on MODULE_AT86RF215
help
Configure the AT86RF215 driver using Kconfig.
if KCONFIG_MODULE_AT86RF215
config AT86RF215_USE_CLOCK_OUTPUT
bool "Enable clock output"
help
Enable this to enable the clock output pin of the AT86RF215 chip.
This way it can be used as a clock source in place of a separate crystal.
You also have to enable this if you want to measure the clock frequency
for trimming. After proper trim value is applied this may be disabled
if not used otherwise.
By Default it is turned off to save energy.
config AT86RF215_TRIM_VAL_EN
bool "Enable crystal oscillator trimming"
help
Enable crystal oscillator trimming.
config AT86RF215_TRIM_VAL
int "Trim value for the crystal oscillator"
range 0 15
default 0
depends on AT86RF215_TRIM_VAL_EN
help
Each increment adds 300nF capacitance between the crystal oscillator pins
TCXO and XTAL2.Tweak the value until the measured clock output matches
26 MHz the best.
For more information Refer Table 6-25 TRIM in Datasheet
endif # KCONFIG_MODULE_AT86RF215

View File

@ -25,6 +25,7 @@
#include "unaligned.h"
#include "at86rf215_internal.h"
#include "at86rf215_netdev.h"
#include "kernel_defines.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
@ -115,13 +116,12 @@ void at86rf215_reset(at86rf215_t *dev)
}
/* disable clock output */
#if AT86RF215_USE_CLOCK_OUTPUT == 0
if (!IS_ACTIVE(CONFIG_AT86RF215_USE_CLOCK_OUTPUT)){
at86rf215_reg_write(dev, RG_RF_CLKO, 0);
#endif
}
/* allow to configure board-specific trim */
#ifdef AT86RF215_TRIM_VAL
at86rf215_reg_write(dev, RG_RF_XOC, AT86RF215_TRIM_VAL | XOC_FS_MASK);
#ifdef CONFIG_AT86RF215_TRIM_VAL
at86rf215_reg_write(dev, RG_RF_XOC, CONFIG_AT86RF215_TRIM_VAL | XOC_FS_MASK);
#endif
/* enable TXFE & RXFE IRQ */

View File

@ -71,11 +71,11 @@ typedef void (*at86rf215_batmon_cb_t)(void *arg);
* as a clock source on the board.
* Otherwise it is turned off to save energy.
*/
#ifndef AT86RF215_USE_CLOCK_OUTPUT
#define AT86RF215_USE_CLOCK_OUTPUT (0)
#ifdef DOXYGEN
#define CONFIG_AT86RF215_USE_CLOCK_OUTPUT
#endif
#if defined(DOXYGEN) && !defined(AT86RF215_TRIM_VAL)
#if defined(DOXYGEN) && !defined(CONFIG_AT86RF215_TRIM_VAL)
/**
* @brief Trim value for the external crystal oscillator.
*
@ -84,11 +84,11 @@ typedef void (*at86rf215_batmon_cb_t)(void *arg);
*
* Range: 0..15
*
* Use in conjunction with @see AT86RF215_USE_CLOCK_OUTPUT and a frequency
* Use in conjunction with @see CONFIG_AT86RF215_USE_CLOCK_OUTPUT and a frequency
* meter connected to the clock output pin of the AT86RF215.
* Tweak the value until the measured clock output matches 26 MHz the best.
*/
#define AT86RF215_TRIM_VAL (0)
#define CONFIG_AT86RF215_TRIM_VAL (0)
#endif
/** @} */