# Path: nanpy/arduinoboard.py
# def arduinomethod(param):
#     is_func = hasattr(param, '__call__')
#     if is_func:
#         funct = param
#         name = None
#         return _wrapper3(name)(funct)
#     else:
#         name = param
#         return _wrapper3(name)
# 
# class FirmwareClass(object):
#     connection = None
#     firmware_id = None
#     cfg_h_name = 'missing implementation!'
# 
#     @classmethod
#     def get_firmware_id(cls):
#         if cls.firmware_id:
#             return cls.firmware_id
#         else:
#             return cls.__name__
# 
#     def __init__(self, connection=None):
#         self.connection = connection
# 
# Path: nanpy/classinfo.py
# def check4firmware(cls):
#     if not hasattr(check4firmware, 'names'):
#         check4firmware.names = dict()
#     cls_name = cls.get_firmware_id()
#     assert cls_name not in check4firmware.names.keys()
#     check4firmware.names[cls_name] = cls
# 
#     def getinstance(connection):
#         if cls_name == 'Info':
#             return cls(connection)
# 
#         if connection is not None:
#             if not hasattr(connection, 'classinfo'):
#                 connection.classinfo = ClassInfo(connection)
#             if cls_name not in connection.classinfo.firmware_id_list:
#                 raise FirmwareMissingFeatureError(
#                     '''%s ['%s'] is missing from firmware! 
# Please enable it in your cfg.h:
# #define  %s  1
#                     ''' %
#                     (cls, cls_name, cls.cfg_h_name))
#         return cls(connection)
# #     getinstance.__name__ = cls.__name__
#     return getinstance


from nanpy.arduinoboard import arduinomethod, FirmwareClass
from nanpy.classinfo import check4firmware


@check4firmware
class Watchdog(FirmwareClass):

    """Direct access to watchdog timer.

    Details: http://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html

    """
    cfg_h_name = 'USE_Watchdog'

    WDTO_15MS = 0
    WDTO_30MS = 1
    WDTO_60MS = 2
    WDTO_120MS = 3
    WDTO_250MS = 4
    WDTO_500MS = 5
    WDTO_1S = 6
    WDTO_2S = 7
    WDTO_4S = 8
    WDTO_8S = 9


# Path: nanpy/arduinoboard.py
# def arduinomethod(param):
#     is_func = hasattr(param, '__call__')
#     if is_func:
#         funct = param
#         name = None
#         return _wrapper3(name)(funct)
#     else:
#         name = param
#         return _wrapper3(name)
# 
# class FirmwareClass(object):
#     connection = None
#     firmware_id = None
#     cfg_h_name = 'missing implementation!'
# 
#     @classmethod
#     def get_firmware_id(cls):
#         if cls.firmware_id:
#             return cls.firmware_id
#         else:
#             return cls.__name__
# 
#     def __init__(self, connection=None):
#         self.connection = connection
# 
# Path: nanpy/classinfo.py
# def check4firmware(cls):
#     if not hasattr(check4firmware, 'names'):
#         check4firmware.names = dict()
#     cls_name = cls.get_firmware_id()
#     assert cls_name not in check4firmware.names.keys()
#     check4firmware.names[cls_name] = cls
# 
#     def getinstance(connection):
#         if cls_name == 'Info':
#             return cls(connection)
# 
#         if connection is not None:
#             if not hasattr(connection, 'classinfo'):
#                 connection.classinfo = ClassInfo(connection)
#             if cls_name not in connection.classinfo.firmware_id_list:
#                 raise FirmwareMissingFeatureError(
#                     '''%s ['%s'] is missing from firmware! 
# Please enable it in your cfg.h:
# #define  %s  1
#                     ''' %
#                     (cls, cls_name, cls.cfg_h_name))
#         return cls(connection)
# #     getinstance.__name__ = cls.__name__
#     return getinstance


# Path: nanpy/watchdog.py
from nanpy.arduinoboard import arduinomethod, FirmwareClass
from nanpy.classinfo import check4firmware



@check4firmware
class Watchdog(FirmwareClass):

    """Direct access to watchdog timer.

    Details: http://www.nongnu.org/avr-libc/user-manual/group__avr__watchdog.html

    """
    cfg_h_name = 'USE_Watchdog'

    WDTO_15MS = 0
    WDTO_30MS = 1
    WDTO_60MS = 2
    WDTO_120MS = 3
    WDTO_250MS = 4
    WDTO_500MS = 5
    WDTO_1S = 6
    WDTO_2S = 7
    WDTO_4S = 8
    WDTO_8S = 9


    @arduinomethod