mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
5523ec67f3
also remove `@file` parameters
100 lines
2.0 KiB
C
100 lines
2.0 KiB
C
/*
|
|
* Copyright (C) 2014 Thomas Eichinger <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
|
|
* @{
|
|
*
|
|
* @file
|
|
* @brief Low-level RTT (Real Time Timer) peripheral driver interface
|
|
* definitions
|
|
*
|
|
* @author Thomas Eichinger <thomas.eichinger@fu-berlin.de>
|
|
*/
|
|
|
|
#ifndef __RTT_H
|
|
#define __RTT_H
|
|
|
|
#include "periph_conf.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* guard file in case no RTC device was specified */
|
|
#if RTT_NUMOF
|
|
|
|
/**
|
|
* @brief Signature for alarm Callback
|
|
*
|
|
* @param[in] arg optional argument to put the callback in the right context
|
|
*/
|
|
typedef void(*rtt_alarm_cb_t)(void *arg);
|
|
|
|
/**
|
|
* @brief Initialize RTT module
|
|
*/
|
|
void rtt_init(void);
|
|
|
|
/**
|
|
* @brief Get the current RTT counter.
|
|
*
|
|
* @return Current value of the RTT counter.
|
|
*/
|
|
uint32_t rtt_get_counter(void);
|
|
|
|
/**
|
|
* @brief Set the RTT counter to a specified value.
|
|
*
|
|
* @param[in] counter The value to set the RTT to.
|
|
*/
|
|
void rtt_set_counter(uint32_t counter);
|
|
|
|
/**
|
|
* @brief Set an alarm for RTT to the specified value.
|
|
*
|
|
* @param[in] alarm The value to trigger an alarm when hit.
|
|
* @param[in] cb Callback executed when alarm is hit.
|
|
* @param[in] arg Argument passed to callback when alarm is hit.
|
|
*/
|
|
void rtt_set_alarm(uint32_t alarm, rtt_alarm_cb_t cb, void *arg);
|
|
|
|
/**
|
|
* @brief Get the value of a set alarm.
|
|
*
|
|
* If no alarm is set the return value is arbitrary.
|
|
*
|
|
* @return value the alarm is set to
|
|
*/
|
|
uint32_t rtt_get_alarm(void);
|
|
|
|
/**
|
|
* @brief Clear any set alarm, do nothing if nothing set
|
|
*/
|
|
void rtt_clear_alarm(void);
|
|
|
|
/**
|
|
* @brief Turns the RTC hardware module on
|
|
*/
|
|
void rtt_poweron(void);
|
|
|
|
/**
|
|
* @brief Turns the RTC hardware module off
|
|
*/
|
|
void rtt_poweroff(void);
|
|
|
|
#endif /* RTT_NUMOF */
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __RTT_H */
|
|
/** @} */
|