<commit_before>/*
 * Copyright (C) 2014 <NAME> <thomas.eichinger@fu-berlin.de>
 *
 * 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.
 */

/**
 * @defgroup    driver_periph_rtt RTT
 * @ingroup     driver_periph
 * @brief       Low-level RTT (Real Time Timer) peripheral driver
 *
 * @{
 * @file
 * @brief       Low-level RTT (Real Time Timer) peripheral driver interface
 *              definitions
 *
 * @author      <NAME> <thomas.eichinger@fu-berlin.de>
 * @author      <NAME> <hauke.petersen@fu-berlin.de>
 */

#ifndef RTT_H
#define RTT_H

#include "periph_conf.h"

#ifdef __cplusplus
extern "C" {
#endif

/* guard file in case no RTT device was specified */
#if RTT_NUMOF<commit_msg>periph/rtt: add macros for time to tick conversion<commit_after>/*
 * Copyright (C) 2014 <NAME> <thomas.eichinger@fu-berlin.de>
 *
 * 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.
 */

/**
 * @defgroup    driver_periph_rtt RTT
 * @ingroup     driver_periph
 * @brief       Low-level RTT (Real Time Timer) peripheral driver
 *
 * @{
 * @file
 * @brief       Low-level RTT (Real Time Timer) peripheral driver interface
 *              definitions
 *
 * @author      <NAME> <thomas.eichinger@fu-berlin.de>
 * @author      <NAME> <hauke.petersen@fu-berlin.de>
 */

#ifndef RTT_H
#define RTT_H

#include "periph_conf.h"

#ifdef __cplusplus
extern "C" {
#endif

/* guard file in case no RTT device was specified */
#if RTT_NUMOF

#ifndef RTT_FREQUENCY
#warning "RTT_FREQUENCY undefined. Set RTT_FREQUENCY to the number of ticks" \
         "per second for the current architecture."
#endif

/**
 * @brief       Convert microseconds to rtt ticks
 * @param[in]   us number of microseconds
 * @return      rtt ticks
 */
#define RTT_US_TO_TICKS(us)     ((uint32_t)((uint64_t)(us) * RTT_FREQUENCY / 1000000UL))

/**
 * @brief       Convert milliseconds to rtt ticks
 * @param[in]   ms number of milliseconds
 * @return      rtt ticks
 */
#define RTT_MS_TO_TICKS(ms)     ( RTT_US_TO_TICKS((ms) * 1000) )

/**
 * @brief       Convert seconds to rtt ticks
 * @param[in]   sec number of seconds
 * @return      rtt ticks
 */
#define RTT_SEC_TO_TICKS(sec)   ( RTT_MS_TO_TICKS((sec) * 1000) )

/**
 * @brief       Convert minutes to rtt ticks
 * @param[in]   min number of minutes
 * @return      rtt ticks
 */
#define RTT_MIN_TO_TICKS(min)   ( RTT_SEC_TO_TICKS((min) * 60) )
{'fraction_non_alphanumeric': 0.11016621569385389, 'fraction_numerical': 0.012756088132972555, 'mean_word_length': 3.1144674085850554, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5367856', 'n_tokens_mistral': 957, 'n_tokens_neox': 908, 'n_words': 272}