DCCpp
This is the library version of a program for Arduino to control railroading DCC devices.
DCCpp.h
Go to the documentation of this file.
1 //-------------------------------------------------------------------
2 #ifndef __DCCpp_H__
3 #define __DCCpp_H__
4 //-------------------------------------------------------------------
5 
425 #define DCCPP_LIBRARY_VERSION "VERSION DCCpp library: 1.4.0"
426 
428 // Add a '//' at the beginning of the line to be in production mode.
429 //#define DCCPP_DEBUG_MODE
430 
432 // Verbose mode lets you see all actions done by the
433 // library, but with a real flood of text to console...
434 // Has no effect if DCCPP_DEBUG_MODE is not activated.
435 //#define DCCPP_DEBUG_VERBOSE_MODE
436 
438 // The function DCCpp::showConfiguration()
439 // is very heavy in program memory. So to avoid problems
440 // you can make this function available by uncomment the next line, only when necessary.
441 //#define DCCPP_PRINT_DCCPP
442 
444 // This define gets rid of 2 timers and uses only Timer2 to tick every 58us and change logic levels on both tracks.
445 // Zero bit is changed every 2 ticks, "one" bit changes every tick; this makes timings roughly equal to DCC specs.
446 // This frees one timer and 2 pins to be used for something else, though PWM pins controlled by Timer2
447 // cannot be used for hardware - PWM(they can, however, be used to output DCC signal using proposed method since
448 // it is effectively a software - PWM).Jumpers for shields are not needed anymore. This is done at the RAM cost of
449 // 2 bytes per RegisterList and 2 extra pointers in DCCppConfig (pointers might not be needed, they are used for
450 // direct IO port manipulation to bypass arduino's digitalWrite).
451 //#define USE_ONLY1_INTERRUPT
452 
453 // Inclusion area
454 //
455 
456 //#define USE_TURNOUT
457 //#define USE_EEPROM
458 //#define USE_OUTPUT
459 //#define USE_SENSOR
460 //#define USE_TEXTCOMMAND
461 //#define USE_ETHERNET_WIZNET_5100
462 //#define USE_ETHERNET_WIZNET_5500
463 //#define USE_ETHERNET_WIZNET_5200
464 //#define USE_ETHERNET_ENC28J60
465 
466 #ifdef DOXYGEN_SPECIFIC
467  // DO NOT CHANGE THESE LINES IN THIS BLOCK 'DOXYGEN_SPECIFIC' : Only here for documentation !
468 
470  #define USE_TURNOUT
471 
472  #define USE_EEPROM
473 
474  #define USE_OUTPUT
475 
476  #define USE_SENSOR
477 
478  #define USE_TEXTCOMMAND
479 
480  #define USE_ETHERNET_WIZNET_5100
481 
482  #define USE_ETHERNET_WIZNET_5500
483 
484  #define USE_ETHERNET_WIZNET_5200
485 
486  #define USE_ETHERNET_ENC28J60
487 
488  #undef USE_TURNOUT
489  #undef USE_EEPROM
490  #undef USE_OUTPUT
491  #undef USE_SENSOR
492  #undef USE_TEXTCOMMAND
493  #undef USE_ETHERNET_WIZNET_5100
494  #undef USE_ETHERNET_WIZNET_5500
495  #undef USE_ETHERNET_WIZNET_5200
496  #undef USE_ETHERNET_ENC28J60
497 
501  #define DCCPP_DEBUG_MODE
502 
504  #define DCCPP_DEBUG_VERBOSE_MODE
505 
510  #define DCCPP_PRINT_DCCPP
511 
518  #define USE_ONLY1_INTERRUPT
519 #endif
520 
521 #if defined(USE_ETHERNET_WIZNET_5100) || defined(USE_ETHERNET_WIZNET_5500) || defined(USE_ETHERNET_WIZNET_5200) || defined(USE_ETHERNET_ENC28J60)
522 #define USE_ETHERNET
523 #endif
524 
526 
527 #include "DCCpp_Uno.h"
528 #include "PacketRegister.h"
529 #include "CurrentMonitor.h"
530 #include "Config.h"
531 #include "Comm.h"
532 #ifdef USE_TURNOUT
533 #include "Turnout.h"
534 #endif
535 #ifdef USE_EEPROM
536 #include "EEStore.h"
537 #endif
538 #ifdef USE_OUTPUT
539 #include "Outputs.h"
540 #endif
541 #ifdef USE_SENSOR
542 #include "Sensor.h"
543 #endif
544 #ifdef USE_TEXTCOMMAND
545 #include "TextCommand.h"
546 #endif
547 
548 #include "DCCpp.hpp"
549 #endif