J&W / WatchDogK64F
Committer:
Pythia
Date:
Tue Oct 29 10:55:27 2019 +0000
Revision:
0:9363a65b371b
WatchDog tested on the K64F

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pythia 0:9363a65b371b 1 #ifndef _WATCHDOG_H_
Pythia 0:9363a65b371b 2 #define _WATCHDOG_H_
Pythia 0:9363a65b371b 3
Pythia 0:9363a65b371b 4 #include "WatchDog_Base.h"
Pythia 0:9363a65b371b 5
Pythia 0:9363a65b371b 6 /*
Pythia 0:9363a65b371b 7 Implementation of watchdog class specialization for the Freescale K64F
Pythia 0:9363a65b371b 8 */
Pythia 0:9363a65b371b 9
Pythia 0:9363a65b371b 10 /*-
Pythia 0:9363a65b371b 11 * Copyright (c) 2019 Waldemar Dworakowski,
Pythia 0:9363a65b371b 12 *
Pythia 0:9363a65b371b 13 * All Rights Reserved
Pythia 0:9363a65b371b 14 *
Pythia 0:9363a65b371b 15 * Redistribution and use in source and binary forms, with or without
Pythia 0:9363a65b371b 16 * modification, are permitted provided that the following conditions are
Pythia 0:9363a65b371b 17 * met:
Pythia 0:9363a65b371b 18 * 1. Redistributions of source code must retain the above copyright notice,
Pythia 0:9363a65b371b 19 * this list of conditions and the following disclaimer.
Pythia 0:9363a65b371b 20 * 2. Redistributions in binary form must reproduce the above copyright
Pythia 0:9363a65b371b 21 * notice, this list of conditions and the following disclaimer in the
Pythia 0:9363a65b371b 22 * documentation and/or other materials provided with the distribution.
Pythia 0:9363a65b371b 23 * 3. Complete source form of any/all derivative/s and it's components must be
Pythia 0:9363a65b371b 24 * provided without any cost.
Pythia 0:9363a65b371b 25 * 4. Any derivative must use same licence.
Pythia 0:9363a65b371b 26 *
Pythia 0:9363a65b371b 27 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR
Pythia 0:9363a65b371b 28 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
Pythia 0:9363a65b371b 29 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Pythia 0:9363a65b371b 30 * DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
Pythia 0:9363a65b371b 31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
Pythia 0:9363a65b371b 32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
Pythia 0:9363a65b371b 33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
Pythia 0:9363a65b371b 34 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
Pythia 0:9363a65b371b 35 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
Pythia 0:9363a65b371b 36 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
Pythia 0:9363a65b371b 37 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Pythia 0:9363a65b371b 38 */
Pythia 0:9363a65b371b 39
Pythia 0:9363a65b371b 40
Pythia 0:9363a65b371b 41 class WatchDog : WatchDog_Base
Pythia 0:9363a65b371b 42 {
Pythia 0:9363a65b371b 43 public:
Pythia 0:9363a65b371b 44 WatchDog(void);
Pythia 0:9363a65b371b 45 virtual void Start(uint32_t Time_ms) ;
Pythia 0:9363a65b371b 46 virtual void Stop(void) ;
Pythia 0:9363a65b371b 47 virtual void Kick(void) ;
Pythia 0:9363a65b371b 48 virtual uint32_t RestartCounter(void);
Pythia 0:9363a65b371b 49 virtual enum RestartCauses RestartCause(void);
Pythia 0:9363a65b371b 50 virtual ~WatchDog();
Pythia 0:9363a65b371b 51 private:
Pythia 0:9363a65b371b 52 uint32_t c_SRS0; // reset reason
Pythia 0:9363a65b371b 53 uint32_t c_SRS1;
Pythia 0:9363a65b371b 54 uint32_t c_STCTRLH;
Pythia 0:9363a65b371b 55 uint32_t c_PRESC;
Pythia 0:9363a65b371b 56 uint32_t c_TOVALL;
Pythia 0:9363a65b371b 57 uint32_t c_TOVALH;
Pythia 0:9363a65b371b 58 uint32_t c_RSTCNT; // watchdog reset count
Pythia 0:9363a65b371b 59 };
Pythia 0:9363a65b371b 60
Pythia 0:9363a65b371b 61 #endif