px-fwlib 0.10.0
Cross-platform embedded library and documentation for 8/16/32-bit microcontrollers generated with Doxygen 1.9.2
px_async_tmr.h
1#ifndef __PX_ASYNC_TMR_H__
2#define __PX_ASYNC_TMR_H__
3/* =============================================================================
4 ____ ___ ____ ___ _ _ ___ __ __ ___ __ __ TM
5 | _ \ |_ _| / ___| / _ \ | \ | | / _ \ | \/ | |_ _| \ \/ /
6 | |_) | | | | | | | | | | \| | | | | | | |\/| | | | \ /
7 | __/ | | | |___ | |_| | | |\ | | |_| | | | | | | | / \
8 |_| |___| \____| \___/ |_| \_| \___/ |_| |_| |___| /_/\_\
9
10 Copyright (c) 2014 Pieter Conradie <https://piconomix.com>
11
12 License: MIT
13 https://github.com/piconomix/px-fwlib/blob/master/LICENSE.md
14
15 Title: px_async_tmr.h : Asynchronous TMR connected to 32 kHz crystal
16 Author(s): Pieter Conradie
17 Creation Date: 2014-06-23
18
19============================================================================= */
20/**
21 * @ingroup AVR
22 * @defgroup AVR_ASYNC_TMR px_async_tmr.h : Asynchronous TMR connected to 32 kHz crystal
23 *
24 * This component provides basic time, calender and alarm functionality.
25 *
26 * File(s):
27 * - arch/avr/inc/px_async_tmr.h
28 * - arch/avr/inc/px_async_tmr_cfg_template.h
29 * - arch/avr/src/px_async_tmr.c
30 *
31 * Asynchronous 8-bit TMRx operation is selected to use an external
32 * 32768 Hz crystal. TMRx is configured to generate an interrupt and call a
33 * handler function.
34 *
35 * @{
36 */
37
38/* _____STANDARD INCLUDES____________________________________________________ */
39
40/* _____PROJECT INCLUDES_____________________________________________________ */
41#include "px_defs.h"
42
43// Include project specific configuration. See "px_async_tmr_cfg_template.h"
44#include "px_async_tmr_cfg.h"
45
46// Check that all project specific options have been specified in "px_async_tmr_cfg.h"
47#if ( !defined(ASYNC_TMR_CFG_PERIOD_MS) \
48 || !defined(ASYNC_TMR_CFG_ON_TICK ) )
49#error "One or more options not defined in 'px_async_tmr_cfg.h'"
50#endif
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55/* _____DEFINITIONS__________________________________________________________ */
56
57/* _____TYPE DEFINITIONS_____________________________________________________ */
58
59/* _____GLOBAL VARIABLES_____________________________________________________ */
60
61/* _____GLOBAL FUNCTION DECLARATIONS_________________________________________ */
62/**
63 * Initalises TMRx to use an external 32768 Hz crystal.
64 *
65 * TMRx is configured to generate an interrupt once a second, during which the
66 * date and time is updated and checked if an alarm has occurred.
67 */
68void px_async_tmr_init(void);
69
70/**
71 * Enable TMRx interrupt.
72 */
74
75/**
76 * Disable TMRx interrupt.
77 */
79
80/* _____MACROS_______________________________________________________________ */
81
82#ifdef __cplusplus
83}
84#endif
85
86/// @}
87#endif
void px_async_tmr_int_enable(void)
Enable TMRx interrupt.
Definition: px_async_tmr.c:99
bool px_async_tmr_int_disable(void)
Disable TMRx interrupt.
Definition: px_async_tmr.c:104
void px_async_tmr_init(void)
Initalises TMRx to use an external 32768 Hz crystal.
Definition: px_async_tmr.c:60