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