1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-26 18:46:04 +01:00
CommandStation-EX/EXRAIL2MacroReset.h

1339 lines
34 KiB
C
Raw Normal View History

/*
2025-02-02 17:25:28 +01:00
* © 2020-2025 Chris Harlow. All rights reserved.
* © 2022-2023 Colin Murdoch
2023-01-27 17:03:39 +01:00
* © 2023 Harald Barth
2025-01-09 20:40:07 +01:00
* © 2025 Morten Nielsen
*
* This file is part of CommandStation-EX
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* It is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with CommandStation. If not, see https://www.gnu.org/licenses/.
*/
// This file cleans and resets the RMFT2 Macros.
// It is used between passes to reduce complexity in RMFT2Macros.h
// DO NOT add an include guard to this file.
// Doxygen comments in this file are intended for the EXRAIL end user.
// Undefine all RMFT macros
#undef ACTIVATE
#undef ACTIVATEL
#undef AFTER
#undef AFTEROVERLOAD
#undef ALIAS
#undef AMBER
#undef ANOUT
2024-02-15 21:05:27 +01:00
#undef ASPECT
#undef AT
2022-03-18 14:46:07 +01:00
#undef ATGTE
#undef ATLT
2022-01-03 11:15:10 +01:00
#undef ATTIMEOUT
#undef AUTOMATION
#undef AUTOSTART
#undef BLINK
#undef BROADCAST
#undef CALL
2023-11-23 11:41:35 +01:00
#undef CLEAR_STASH
#undef CLEAR_ALL_STASH
#undef CLOSE
2024-02-09 12:54:53 +01:00
#undef CONFIGURE_SERVO
#undef DCC_SIGNAL
#undef DCCX_SIGNAL
2023-09-02 00:29:49 +02:00
#undef DCC_TURNTABLE
#undef DEACTIVATE
#undef DEACTIVATEL
#undef DELAY
#undef DELAYMINS
#undef DELAYRANDOM
#undef DONE
#undef DRIVE
2022-01-02 20:41:57 +01:00
#undef ELSE
#undef ENDEXRAIL
#undef ENDIF
#undef ENDTASK
2023-09-02 00:29:49 +02:00
#undef ESTOP
#undef EXRAIL
#undef EXTT_TURNTABLE
#undef FADE
#undef FOFF
#undef FOLLOW
#undef FON
2022-03-24 11:40:49 +01:00
#undef FORGET
#undef FTOGGLE
#undef FREE
#undef FWD
#undef GREEN
2022-06-15 12:44:46 +02:00
#undef HAL
2024-01-14 21:20:22 +01:00
#undef HAL_IGNORE_DEFAULTS
#undef IF
2022-04-17 10:58:32 +02:00
#undef IFAMBER
2021-12-29 12:15:31 +01:00
#undef IFCLOSED
2022-04-17 10:58:32 +02:00
#undef IFGREEN
2021-11-30 14:52:22 +01:00
#undef IFGTE
2023-01-26 16:55:58 +01:00
#undef IFLOCO
2021-11-30 14:52:22 +01:00
#undef IFLT
#undef IFNOT
#undef IFRANDOM
2022-04-17 10:58:32 +02:00
#undef IFRED
#undef IFRESERVE
2021-12-29 12:15:31 +01:00
#undef IFTHROWN
2022-01-03 11:15:10 +01:00
#undef IFTIMEOUT
2023-09-02 00:29:49 +02:00
#undef IFTTPOSITION
2022-12-30 00:46:42 +01:00
#undef IFRE
#undef INVERT_DIRECTION
2024-02-07 23:11:27 +01:00
#undef JMRI_SENSOR
#undef JOIN
#undef KILLALL
#undef LATCH
#undef LCD
#undef SCREEN
#undef LCC
#undef LCCX
#undef LCN
#undef MOVETT
NeoPixel support commit 2bbb5c111907cab37e5c068dc18e084f404f2a2e Author: Asbelos <asbelos@btinternet.com> Date: Fri Sep 20 12:13:21 2024 +0100 EXRAIL use neopixel range instead of loop commit 3aabb51888d61d88c3c26a3617eccaa74e3f64d4 Author: Asbelos <asbelos@btinternet.com> Date: Wed Sep 18 17:06:00 2024 +0100 Neopixel signals with blue-tint See Release Notes file commit 8e6fe6df21bc758ee1b715d97c254a4c1488ffe2 Author: Asbelos <asbelos@btinternet.com> Date: Thu Sep 12 08:35:26 2024 +0100 HAL write range commit 66e57b5ab2e7938bf5f97960ab73017749d8fc4b Author: Asbelos <asbelos@btinternet.com> Date: Sun Sep 8 09:26:37 2024 +0100 Killblink on neopixel set. commit 360c42667500fdd93e35e688c7461731bc8dc50d Merge: dd16e0d b026417 Author: Asbelos <asbelos@btinternet.com> Date: Sat Sep 7 16:45:29 2024 +0100 Merge branch 'devel' into devel-pauls-i2c-devices commit dd16e0da972a414cac66755b61b6922691f88030 Author: Asbelos <asbelos@btinternet.com> Date: Sat Sep 7 13:00:26 2024 +0100 Notes commit e823db3d244919f5529d22c71de8f4de834e21dd Author: Asbelos <asbelos@btinternet.com> Date: Sat Sep 7 11:16:30 2024 +0100 Neopixel change to 8,8,8 commit d3d6cc97fb68ee2314a3d4a3e10f92542044c124 Author: Asbelos <asbelos@btinternet.com> Date: Fri Sep 6 13:25:44 2024 +0100 Neopixel <o> cmd commit 03d8d5f93d477246e8ceecf6500133845a0d5129 Author: Asbelos <asbelos@btinternet.com> Date: Fri Sep 6 08:08:18 2024 +0100 Its working!! commit 235f3c82b5c8e94106bc63dfd5f2957b423f1601 Author: Asbelos <asbelos@btinternet.com> Date: Thu Sep 5 22:02:29 2024 +0100 Update IO_NeoPixel.h commit 530b77bbab4605a3fdfdec735ef01d0b56ef543c Author: Asbelos <asbelos@btinternet.com> Date: Tue Sep 3 15:04:40 2024 +0100 NEOPIXEL driver and macros commit 2a895fbbd531e3ee778962eec59144a602cba9bc Author: Asbelos <asbelos@btinternet.com> Date: Tue Sep 3 11:26:17 2024 +0100 First compile neopixel driver commit c6f2db79094d3b0a0c5322c859868e9025bcb6eb Merge: a7df84b 7395aa4 Author: Asbelos <asbelos@btinternet.com> Date: Tue Sep 3 10:07:12 2024 +0100 Merge branch 'devel' into devel-pauls-i2c-devices commit a7df84b01cc474c31356456bc1db220c800743cb Author: Asbelos <asbelos@btinternet.com> Date: Tue Sep 3 09:56:05 2024 +0100 NEOPIXEL EXRAIL commit ead6e5afa11d526d9a366eeb6013e7eaa16bcb76 Author: Asbelos <asbelos@btinternet.com> Date: Tue Sep 3 09:55:36 2024 +0100 NEOPIXEL EXRAIL commit 0cb175544e4771415c22d6bdc5ed0c331ce76f95 Author: pmantoine <pma-github@milleng.com.au> Date: Sat Feb 24 17:29:10 2024 +0800 More TCA8418 commit 208205180193aec382fcc25423fb6a81a078e407 Author: pmantoine <pma-github@milleng.com.au> Date: Sat Feb 24 13:02:34 2024 +0800 TCA8418 initial HAL driver scaffolding
2024-09-22 13:36:19 +02:00
#undef NEOPIXEL
#undef NEOPIXEL_OFF
#undef NEOPIXEL_SIGNAL
#undef ACON
#undef ACOF
#undef ONACON
#undef ONACOF
2024-03-08 21:33:11 +01:00
#undef MESSAGE
#undef ONACTIVATE
#undef ONACTIVATEL
#undef ONAMBER
#undef ONDEACTIVATE
#undef ONDEACTIVATEL
#undef ONCLOSE
#undef ONLCC
#undef ONTIME
#undef ONCLOCKTIME
#undef ONCLOCKMINS
#undef ONOVERLOAD
#undef ONGREEN
#undef ONRED
2023-09-02 00:29:49 +02:00
#undef ONROTATE
Squashed commit of the following: commit 3fc90c916c54ceae4364f79a4b9a2001bc75fcd5 Merge: 132e2d0 91e60b3 Author: Asbelos <asbelos@btinternet.com> Date: Fri Apr 12 15:08:49 2024 +0100 Merge branch 'devel' into devel_chris commit 132e2d0de2c6e72b1a3d85520936fb7cddd8d739 Author: Asbelos <asbelos@btinternet.com> Date: Fri Apr 12 15:07:31 2024 +0100 Revert "Merge branch 'master' into devel_chris" This reverts commit 23845f2df2035333c43b4aa05d76e9f7600efe29, reversing changes made to 76755993f146a1deaf46993d22e850b899dcf603. commit 23845f2df2035333c43b4aa05d76e9f7600efe29 Merge: 7675599 28d60d4 Author: Asbelos <asbelos@btinternet.com> Date: Fri Apr 12 14:38:22 2024 +0100 Merge branch 'master' into devel_chris commit 76755993f146a1deaf46993d22e850b899dcf603 Author: Asbelos <asbelos@btinternet.com> Date: Fri Apr 12 14:37:34 2024 +0100 ONSENSOR/ONBUTTON commit 8987d622e60fb27174203ce47b49462a01ecb61c Author: Asbelos <asbelos@btinternet.com> Date: Tue Apr 9 20:44:47 2024 +0100 doc note commit 8f0a5c1ec0fde18dbb262311a1ef5ef79d571807 Author: Asbelos <asbelos@btinternet.com> Date: Thu Apr 4 09:45:58 2024 +0100 Exrail notes commit 94083b9ab8a2322c39b7087c522730569194b732 Merge: 72ef199 02bf50b Author: Asbelos <asbelos@btinternet.com> Date: Thu Apr 4 09:08:26 2024 +0100 Merge branch 'devel' into devel_chris commit 72ef199315d1c7717331864abb11730890fd3162 Author: Asbelos <asbelos@btinternet.com> Date: Thu Apr 4 09:06:50 2024 +0100 TOGGLE_TURNOUT commit e69b777a2f62104dd8b74ba688b950fa92919d54 Author: Asbelos <asbelos@btinternet.com> Date: Wed Apr 3 15:17:40 2024 +0100 BLINK command commit c7ed47400d5d89c0b8425ec12b1828e710fb23ec Author: Asbelos <asbelos@btinternet.com> Date: Tue Apr 2 10:12:45 2024 +0100 FTOGGLE,XFTOGGLE commit 7a93cf7be856afd30f6976a483b1db4bfc4073a1 Author: Asbelos <asbelos@btinternet.com> Date: Fri Mar 29 13:21:35 2024 +0000 EXRAIL STEALTH_GLOBAL commit 28d60d49849c8fc4b0ff0f933222c052ba7c90aa Author: Peter Akers <akersp62@gmail.com> Date: Fri Feb 16 18:02:40 2024 +1000 Update README.md commit 3b162996ad42546486b812e22d3ed6daee857d19 Author: peteGSX <peteracole@outlook.com.au> Date: Sun Jan 21 07:13:53 2024 +1000 EX-IO fixes in version commit fb414a7a506f078d2a075d65c7b171ae4399ef63 Author: Harald Barth <haba@kth.se> Date: Thu Jan 18 08:20:33 2024 +0100 Bugfix: allocate enough bytes for digital pins. Add more sanity checks when allocating memory commit 818e05b4253a1a0980abb3a0bbef38a8c662bb1a Author: Harald Barth <haba@kth.se> Date: Wed Jan 10 08:37:54 2024 +0100 version 5.0.8 commit c5168f030fa64330a1f0e09d6637a3817fe5e067 Author: Harald Barth <haba@kth.se> Date: Wed Jan 10 08:15:30 2024 +0100 Do not crash on turnouts without description commit 387ea019bdc483667bcbcf45205a56330d615aee Author: Harald Barth <haba@kth.se> Date: Mon Nov 6 22:11:56 2023 +0100 version 5.0.7 commit a981f83bb9c376d01245c328c5de7d7bf25ebfb2 Author: Harald Barth <haba@kth.se> Date: Mon Nov 6 22:11:31 2023 +0100 Only flag 2.2.0.0-dev as broken, not 2.2.0.0 commit 749a859db551113567faae3248c575dbf6440ece Author: Asbelos <asbelos@btinternet.com> Date: Wed Nov 1 20:13:05 2023 +0000 Bugfix TURNOUTL commit 659c58b30766a7b8dd2b4d2677d90663af8fefcf Author: Harald Barth <haba@kth.se> Date: Sat Oct 28 19:20:33 2023 +0200 version 5.0.5 commit 0b9ec7460ba461d5602b6e06843d6be8468f385f Author: Harald Barth <haba@kth.se> Date: Sat Oct 28 19:18:59 2023 +0200 Bugfix version detection logic and better message
2024-04-13 09:12:35 +02:00
#undef ONBUTTON
#undef ONSENSOR
#undef ONTHROW
2022-12-30 00:46:42 +01:00
#undef ONCHANGE
2022-03-31 23:04:40 +02:00
#undef PARSE
#undef PAUSE
2023-11-23 11:41:35 +01:00
#undef PICKUP_STASH
#undef PIN_TURNOUT
#undef PRINT
#undef POM
#undef POWEROFF
#undef POWERON
#undef READ_LOCO
#undef RED
#undef RESERVE
#undef RESET
#undef RESUME
#undef RETURN
2021-12-26 19:24:04 +01:00
#undef REV
2023-09-02 00:29:49 +02:00
#undef ROSTER
#undef ROTATE
2023-09-08 23:22:10 +02:00
#undef ROTATE_DCC
#undef ROUTE
2023-11-09 20:27:52 +01:00
#undef ROUTE_ACTIVE
#undef ROUTE_INACTIVE
2023-11-07 17:27:26 +01:00
#undef ROUTE_HIDDEN
2023-11-17 11:45:36 +01:00
#undef ROUTE_DISABLED
2023-11-07 17:27:26 +01:00
#undef ROUTE_CAPTION
#undef SENDLOCO
#undef SEQUENCE
#undef SERIAL
#undef SERIAL1
#undef SERIAL2
#undef SERIAL3
#undef SERIAL4
#undef SERIAL5
#undef SERIAL6
#undef SERVO
#undef SERVO2
#undef SERVO_TURNOUT
#undef SERVO_SIGNAL
#undef SET
#undef SET_TRACK
#undef SET_POWER
#undef SETLOCO
#undef SETFREQ
#undef SIGNAL
2022-03-18 14:46:07 +01:00
#undef SIGNALH
#undef SPEED
#undef START
2023-11-23 11:41:35 +01:00
#undef STASH
2023-11-30 12:32:39 +01:00
#undef STEALTH
#undef STEALTH_GLOBAL
#undef STOP
2023-09-02 00:29:49 +02:00
#undef THROW
#undef TOGGLE_TURNOUT
2023-09-02 00:29:49 +02:00
#undef TT_ADDPOSITION
#undef TURNOUT
#undef TURNOUTL
#undef UNJOIN
#undef UNLATCH
#undef VIRTUAL_SIGNAL
2022-03-24 12:56:06 +01:00
#undef VIRTUAL_TURNOUT
#undef WAITFOR
2023-09-06 23:58:19 +02:00
#ifndef IO_NO_HAL
#undef WAITFORTT
#endif
2023-05-01 15:25:45 +02:00
#undef WITHROTTLE
#undef XFOFF
#undef XFON
#undef XFTOGGLE
2025-01-09 20:40:07 +01:00
#undef XREV
#undef XFWD
#ifndef RMFT2_UNDEF_ONLY
/**
* @def ACTIVATE(addr,subaddr)
2025-02-02 17:25:28 +01:00
* @brief Send DCC Accessory Activate packet (gate on then off)
* @param addr DCC short address of accessory
* @param subaddr DCC sub address
*/
#define ACTIVATE(addr,subaddr)
/**
* @def ACTIVATEL(linearaddr)
2025-02-02 17:25:28 +01:00
* @brief Send DCC Accessory Activate packet (gate on then off)
* @param linearaddr DCC linear address of accessory
*/
#define ACTIVATEL(linearaddr)
/**
* @def AFTER(vpin,timer...)
2025-02-02 17:25:28 +01:00
* @brief Wait for sensor activated, then decativated for given time
* @param vpin Virtual Pin number of sensor
2025-02-02 17:25:28 +01:00
* @param timer... optional wait in mS, default 500
*/
#define AFTER(vpin,timer...)
/**
* @def AFTEROVERLOAD(track_id)
2025-02-02 17:25:28 +01:00
* @brief Wait for overload to be resolved
* @param track_id A..H
*/
#define AFTEROVERLOAD(track_id)
/**
* @def ALIAS(name,value...)
2025-02-02 17:25:28 +01:00
* @brief defines a named numeric value.
* @param name c++ variable name that can be used throighout the script
2025-02-02 17:25:28 +01:00
* @param value... if omitted, a large negative value is created automatically
*/
#define ALIAS(name,value...)
/**
* @def AMBER(signal_id)
2025-02-02 17:25:28 +01:00
* @brief Sets a signal to amber state
* @see ONAMBER
* @param signal_id
*/
#define AMBER(signal_id)
/**
* @def ANOUT(vpin,value,param1,param2)
2025-02-02 17:25:28 +01:00
* @brief Writes to the HAL analog output interface of a device driver.
* Values and meanings of extra parameters depend on driver.
* @param vpin Virtual pin number of device
* @param value basic analog value
* @param param1 device dependent
* @param param2 device dependent
*/
#define ANOUT(vpin,value,param1,param2)
/**
* @def AT(vpin)
2025-02-02 17:25:28 +01:00
* @brief wait intil a sensor becomes active
* @param vpin Virtual pin of sensor. Use negative value for sensors that are HIGH when activated
*/
#define AT(vpin)
/**
* @def ASPECT(address,value)
2025-02-02 17:25:28 +01:00
* @brief Sends a DCC aspect value to an accessory address.
* May also change status of a signal defined using this aspect.
* @param address Linear DCC address of device
* @param value Aspect value (Device dependent)
*/
2024-02-15 21:05:27 +01:00
#define ASPECT(address,value)
/**
* @def ATGTE(vpin,value)
2025-02-02 17:25:28 +01:00
* @brief Wait for analog sensor to be greater than given value
* @param vpin Analog pin number
* @param value integer value to compare against
*/
#define ATGTE(vpin,value)
/**
* @def ATLT(vpin,value)
2025-02-02 17:25:28 +01:00
* @brief Wait for analog sensor value to be less than given value
* @param vpin Analog pin number
* @param value integer value to compare against
*/
#define ATLT(vpin,value)
/**
* @def ATTIMEOUT(vpin,timeout_ms)
2025-02-02 17:25:28 +01:00
* @brief Wait for sensor active, with timeout. Use IFTIMEOUT to determine whether the AT was satisfied.
* @see IFTIMEOUT
* @param vpin Sensor pin number
* @param timeout_ms Millseconds to wait before timeout
*/
#define ATTIMEOUT(vpin,timeout_ms)
/**
* @def AUTOMATION(sequence_id,description)
* @brief Defines starting point of a sequence that will be shown as an Automation by
2025-02-02 17:25:28 +01:00
* the throttles. Automations are started by the throttle handing over a loco id to be driven.
* @param sequence_id Unique sequence id value
2025-02-02 17:25:28 +01:00
* @param description (Quoted text) will be shown on throttle button
*/
#define AUTOMATION(sequence_id,description)
/**
* @def AUTOSTART
2025-02-02 17:25:28 +01:00
* @brief A new task will be created starting from this point at Command Station startup
*/
#define AUTOSTART
/**
* @def BLINK(vpin,onDuty,offDuty)
2025-02-02 17:25:28 +01:00
* @brief Starts a blinking process for a vpin (typically a LED)
* Stop blink with SET or RESET.
* @param vpin Pin to blink
2025-02-02 17:25:28 +01:00
* @param onDuty Milliseconds with LED ON
* @param offDuty Milliseconds with LED off
*/
#define BLINK(vpin,onDuty,offDuty)
/**
* @def BROADCAST(msg)
2025-02-02 17:25:28 +01:00
* @brief Send raw message text to all throttles using the DCC-EX protocol
* @see WITHROTTLE
* @param msg Quoted message
*/
#define BROADCAST(msg)
/**
* @def CALL(sequence_id)
2025-02-02 17:25:28 +01:00
* @brief transfer control to another sequence with expectation to return
* @see RETURN
* @param sequence_id SEQUENCE to jump processing to, must terminate or RETURN
2025-02-02 17:25:28 +01:00
*
*/
#define CALL(sequence_id)
/**
* @def CLEAR_STASH(stash_id)
* @brief Clears loco value stored in stash
* @param stash_id which stash to clear.
*/
#define CLEAR_STASH(stash_id)
/**
* @def CLEAR_ALL_STASH
* @brief Clears all stashed loco values
*/
#define CLEAR_ALL_STASH
/**
* @def CLOSE(turnout_id)
2025-02-02 17:25:28 +01:00
* @brief Close turnout by id
* @see THROW
* @param turnout_id
*/
#define CLOSE(turnout_id)
/**
* @def CONFIGURE_SERVO(vpin,pos1,pos2,profile)
2025-02-02 17:25:28 +01:00
* @brief setup servo movement parameters for non-turnout
* @param vpin must refer to a servo capable pin
* @param pos1 SET position of servo
* @param pos2 RESET position of servo
* @param profile Movement profile (Instant, Fast, Medium, Slow, Bounce)
*/
2024-02-09 12:54:53 +01:00
#define CONFIGURE_SERVO(vpin,pos1,pos2,profile)
/**
* @def DCC_SIGNAL(signal_id,addr,subaddr)
2025-02-02 17:25:28 +01:00
* @brief Define a DCC accessory signal with short address
* @param signal_id Id used for all signal manipulation commands
* @param addr DCC address
2025-02-02 17:25:28 +01:00
* @param subaddr DCC subaddress
*/
#define DCC_SIGNAL(signal_id,addr,subaddr)
/**
* @def DCCX_SIGNAL(signal_id,redAspect,amberAspect,greenAspect)
* @brief Dfeine advanced DCC accessory signal with aspects
* @param signal_id DCC Linear address AND Id used for all signal manipulation commands
* @param redAspect
* @param amberAspect
* @param greenAspect
*/
#define DCCX_SIGNAL(signal_id,redAspect,amberAspect,greenAspect)
/**
2025-02-13 12:27:32 +01:00
* @def DCC_TURNTABLE(turntable_id,homeAngle,description...)
* @brief defines a Turntable device
2025-02-13 12:27:32 +01:00
* @param turntable_id
* @param homeAngle the angle of the home position, valid angles are 0 - 3600
* @param description... Quoted text description of turntable
*/
2025-02-13 12:27:32 +01:00
#define DCC_TURNTABLE(turntable_id,home,description...)
/**
* @def DEACTIVATE(addr,subaddr)
* @brief Sends DCC Deactivate packet (gate on, gate off)
* @param addr DCC accessory address
* @param subaddr DCC accessory subaddress
*/
#define DEACTIVATE(addr,subaddr)
/**
* @def DEACTIVATEL(addr)
* @brief Sends DCC Deactivate packet (gate on, gate off)
* @param addr DCC Linear accessory address
*/
#define DEACTIVATEL(addr)
/**
* @def DELAY(delay_mS)
2025-02-02 17:25:28 +01:00
* @brief Waits for given milliseconds delay (This is not blocking)
* @param delay_mS Delay time in milliseconds
*/
#define DELAY(delay_ms)
/**
* @def DELAYMINS(delay_minutes)
2025-02-02 17:25:28 +01:00
* @brief Waits for given minutes delay (This is not blocking)
* @param delay_minutes
*/
#define DELAYMINS(delay_minutes)
/**
* @def DELAYRANDOM(mindelay,maxdelay)
2025-02-02 17:25:28 +01:00
* @brief Waits for random delay between min and max milliseconds (This is not blocking)
* @param mindelay minumum delay in mS
* @param maxdelay maximum delay in mS
*/
#define DELAYRANDOM(mindelay,maxdelay)
/**
* @def DONE
2025-02-02 17:25:28 +01:00
* @brief Stops task loco (if any) and terminates current task
*/
#define DONE
/**
* @def DRIVE(analogpin)
2025-02-02 17:25:28 +01:00
* @brief RESERVED do not use
* @param analogpin
*/
#define DRIVE(analogpin)
/**
* @def ELSE
* @brief introduces alternate processing path after any kind of IF
* @see IF
*/
2022-01-02 20:41:57 +01:00
#define ELSE
/**
* @def ENDIF
2025-02-02 17:25:28 +01:00
* @brief determines end of IF(any type) block.
* @see IF
2025-02-02 17:25:28 +01:00
* IF something ENDIF, or
* IF something ELSE something ENDIF
*/
#define ENDIF
/**
* @def ENDTASK
2025-02-02 17:25:28 +01:00
* @brief same as DONE
* @see DONE
*/
#define ENDTASK
/**
* @def ESTOP
2025-02-02 17:25:28 +01:00
* @brief Performs emergency stop on current task loco
*/
#define ESTOP
/**
2025-02-13 12:27:32 +01:00
* @def EXTT_TURNTABLE(turntable_id,vpin,homeAngle,description...)
* @brief This statement will create the EXTurntable turntable/traverser object only, so you will need a separate HAL() statement for an EXTurntable device driver.
* @param turntable_id
* @param vpin
2025-02-13 12:27:32 +01:00
* @param homeAngle the angle of the home position, valid angles are 0 - 3600
* @param description...
*/
#define EXTT_TURNTABLE(id,vpin,home,description...)
/**
* @def FADE(vpin,value,ms)
2025-02-02 17:25:28 +01:00
* @brief Modifies analog value slowly taking a given time
* @param vpin Servo virtual pin number
2025-02-02 17:25:28 +01:00
* @param value new target value
* @param ms time to reach value
*/
#define FADE(vpin,value,ms)
/**
* @def FOFF(func)
* @brief Turns off current loco function
2025-02-02 17:25:28 +01:00
* @see FON
* @param func
*/
#define FOFF(func)
/**
* @def FOLLOW(sequence_id)
2025-02-02 17:25:28 +01:00
* @brief Task processing follows given route or sequence (Effectively a GoTo)
* @param sequence_id
*/
#define FOLLOW(sequence_id)
/**
* @def FON(func)
* @brief Turn on current loco function
2025-02-02 17:25:28 +01:00
* @see FOFF
* @param func
*/
2022-03-24 11:40:49 +01:00
#define FON(func)
/**
* @def FORGET
2025-02-02 17:25:28 +01:00
* @brief Removes current loco from task and DCC reminders table.
*/
2022-03-24 11:40:49 +01:00
#define FORGET
/**
* @def FREE(token_id)
* @brief Frees logical token
2025-02-02 17:25:28 +01:00
* @see RESERVE
* @param token_id 0..255
*/
#define FREE(token_id)
/**
* @def FTOGGLE(func)
2025-02-02 17:25:28 +01:00
* @brief Toggles function for current loco
* @param func
*/
#define FTOGGLE(func)
/**
* @def FWD(speed)
2025-02-02 17:25:28 +01:00
* @brief Instructs current loco to set DCC speed
* @param speed 0..127 (1=ESTOP)
*/
#define FWD(speed)
/**
* @def GREEN(signal_id)
2025-02-02 17:25:28 +01:00
* @brief Sets signal to green state
* @param signal_id
*/
#define GREEN(signal_id)
/**
* @def HAL(haltype,params...)
2025-02-02 17:25:28 +01:00
* @brief Defines VPIN mapping for specific hardware drivers
* @param haltype driver name, normally device type
* @param params... depend on driver.
*/
2022-06-15 12:44:46 +02:00
#define HAL(haltype,params...)
/**
* @def HAL_IGNORE_DEFAULTS
* @brief System will ignore default HAL device mappings
*/
2024-01-14 21:20:22 +01:00
#define HAL_IGNORE_DEFAULTS
/**
* @def IF(vpin)
2025-02-02 17:25:28 +01:00
* @brief Checks sensor state, If false jumps to matching nested ELSE or ENDIF
* @param vpin VPIN of sensor. Negative VPIN will invert sensor state.
*/
#define IF(vpin)
/**
* @def IFAMBER(signal_id)
2025-02-02 17:25:28 +01:00
* @brief Checks if signal is in AMBER state.
* @see IF
* @param signal_id
*/
2022-04-17 10:58:32 +02:00
#define IFAMBER(signal_id)
/**
* @def IFCLOSED(turnout_id)
2025-02-02 17:25:28 +01:00
* @brief Checks if given turnout is in close state
* @see IF
* @param turnout_id
*/
2021-12-29 12:15:31 +01:00
#define IFCLOSED(turnout_id)
/**
* @def IFGREEN(signal_id)
2025-02-02 17:25:28 +01:00
* @brief Checks if given signal is in GREEN state
* @see IF
* @param signal_id
*/
2022-04-17 10:58:32 +02:00
#define IFGREEN(signal_id)
/**
* @def IFGTE(vpin,value)
* @brief Checks if analog vpin sensor >= value
2025-02-02 17:25:28 +01:00
* @see IF
* @param vpin
* @param value
*/
#define IFGTE(vpin,value)
/**
* @def IFLOCO(loco_id)
2025-02-02 17:25:28 +01:00
* @brief Checks if current task loco = loco_id
* @see IF
* @param loco_id
*/
2023-01-26 16:55:58 +01:00
#define IFLOCO(loco_id)
/**
* @def IFLT(sensor_id,value)
2025-02-02 17:25:28 +01:00
* @brief Checks if analog sensor < value
* @see IF
* @param vpin Analog vpin of sensor
* @param value
*/
#define IFLT(vpin,value)
/**
* @def IFNOT(vpin)
2025-02-02 17:25:28 +01:00
* @brief Inverse of IF
* @see IF
* @param vpin
*/
#define IFNOT(vpin)
/**
* @def IFRANDOM(percent)
2025-02-02 17:25:28 +01:00
* @brief randomly satisfield IF at given percent probability
* @see IF
* @param percent
*/
2021-12-29 12:15:31 +01:00
#define IFRANDOM(percent)
/**
* @def IFRED(signal_id)
2025-02-02 17:25:28 +01:00
* @brief Checks if given signal is in RED state
* @see IF
* @param signal_id
*/
2022-04-17 10:58:32 +02:00
#define IFRED(signal_id)
/**
* @def IFTHROWN(turnout_id)
2025-02-02 17:25:28 +01:00
* @brief Checks if given turnout is in THROWN state
* @see IF
* @param turnout_id
*/
2021-12-29 12:15:31 +01:00
#define IFTHROWN(turnout_id)
/**
* @def IFRESERVE(token_id)
* @brief Attempts to reserve token and if satisfiled the token remains reserved.
* @see IF RESERVE FREE
* @param token_id
*/
#define IFRESERVE(token_id)
/**
* @def IFTIMEOUT
2025-02-02 17:25:28 +01:00
* @brief Checks TIMEOUT state after an AT/AFTER request with timeout value.
* @see IF AT AFTER
*/
2022-01-03 11:15:10 +01:00
#define IFTIMEOUT
/**
* @def IFTTPOSITION(turntable_id,position)
* @brief Checks if Turntable is in given position
2025-02-02 17:25:28 +01:00
* @see IF
* @param turntable_id
* @param position
*/
2023-09-02 00:29:49 +02:00
#define IFTTPOSITION(turntable_id,position)
/**
2025-02-13 12:27:32 +01:00
* @def IFRE(vpin,value)
* @brief Checks external rotary encoder value
* @param vpin of device driver for rotary encoder
* @param value
*/
2025-02-13 12:27:32 +01:00
#define IFRE(vpin,value)
/**
* @def INVERT_DIRECTION
2025-02-02 17:25:28 +01:00
* @brief Marks current task so that FWD and REV commands are inverted.
*/
#define INVERT_DIRECTION
/**
* @def JMRI_SENSOR(vpin,count...)
2025-02-11 21:04:38 +01:00
* @brief Defines multiple JMRI <s> type sensor feedback definitions each with id matching vpin
* @param vpin first vpin number
2025-02-02 17:25:28 +01:00
* @param count... Number of consecutine VPINS for which to create JMRI sensor feedbacks. Default 1.
*/
2024-02-07 23:11:27 +01:00
#define JMRI_SENSOR(vpin,count...)
/**
* @def JOIN
2025-02-02 17:25:28 +01:00
* @brief Switches PROG track to receive MAIN track DCC packets. (Drive on PROG track)
*/
#define JOIN
/**
* @def KILLALL
2025-02-02 17:25:28 +01:00
* @brief Tertminates all running EXRAIL tasks
*/
#define KILLALL
/**
* @def LATCH(vpin)
* @brief Make all AT/AFTER/IF see vpin as HIGH without checking hardware
* @param vpin Must only be for VPINS 0..255
*/
#define LATCH(vpin)
/**
* @def LCC(eventid)
2025-02-02 17:25:28 +01:00
* @brief Issue event to LCC
* @param eventid
*/
#define LCC(eventid)
/**
* @def LCCX(senderid,eventid)
2025-02-02 17:25:28 +01:00
* @brief Issue LCC event while impersonating another sender
* @param senderid
* @param eventid
*/
#define LCCX(senderid,eventid)
/**
* @def LCD(row,msg)
2025-02-02 17:25:28 +01:00
* @brief Write message on row of default configured LCD/OLED
* @see SCREEN
* @param row
2025-02-02 17:25:28 +01:00
* @param msg Quoted text
*/
#define LCD(row,msg)
/**
* @def SCREEN(display,row,msg)
2025-02-02 17:25:28 +01:00
* @brief Send message to external display hadlers
* @param display number, 0=local display, others are handled by external
* displays which may have different display numbers on different devices.
* @param row
2025-02-02 17:25:28 +01:00
* @param msg Quoted text
*/
#define SCREEN(display,row,msg)
/**
* @def LCN(msg)
2025-02-11 21:04:38 +01:00
* @brief Reserved for LCN communication. Refer to their documentation.
* @param msg
*/
#define LCN(msg)
/**
* @def MESSAGE(msg)
2025-02-02 17:25:28 +01:00
* @brief Send a human readable message to all throttle users
* @param msg Quoted text
*/
2024-03-08 21:33:11 +01:00
#define MESSAGE(msg)
/**
2025-02-13 12:27:32 +01:00
* @def MOVETT(turntable_id,steps,activity)
* @brief Move Turntable to specific position
* @see ROTATE
* @param turntable_id
* @param steps position to move to
* @param activity see ROTATE
*/
2025-02-13 12:27:32 +01:00
#define MOVETT(turntable_id,steps,activity)
/**
* @def NEOPIXEL(vpin,r,g,b,count...)
2025-02-02 17:25:28 +01:00
* @brief Set a NEOPIXEL vpin to a given red/green/blue colour
* @param vpin VPIN of a pixel
2025-02-02 17:25:28 +01:00
* @param r red component 0-255
* @param g green component 0-255
* @param b blue component 0-255
* @param count... Number of consecutive pixels to set, Default 1.
*/
#define NEOPIXEL(vpin,r,g,b,count...)
/**
* @def NEOPIXEL_SIGNAL(signal_id,redcolour,ambercolour,greencolour)
2025-02-02 17:25:28 +01:00
* @brief Define a signal that uses a single multi colour pixel
* @see NEORGB
* @param vpin unique signal_id
* @param redcolour RGB colour use NEORGB(red,green,blue) to create values.
* @param ambercolour
* @param greencolour
*/
#define NEOPIXEL_SIGNAL(vpin,redcolour,ambercolour,greencolour)
/**
* @def ACON(eventid)
2025-02-02 17:25:28 +01:00
* @brief Send MERG CBUS ACON to Adapter
* @param eventid
*/
#define ACON(eventid)
/**
* @def ACOF(eventid)
2025-02-02 17:25:28 +01:00
* @brief Send MERG CBUS ACOF to Adapter
* @param eventid
*/
#define ACOF(eventid)
/**
* @def ONACON(eventid)
2025-02-02 17:25:28 +01:00
* @brief Start task here when ACON for event receied from MERG CBUS
* @param eventid
*/
#define ONACON(eventid)
/**
* @def ONACOF(eventid)
2025-02-02 17:25:28 +01:00
* @brief Start task here when ACOF for event receied from MERG CBUS
* @param eventid
*/
#define ONACOF(eventid)
/**
* @def ONACTIVATE(addr,subaddr)
2025-02-02 17:25:28 +01:00
* @brief Start task here when DCC Activate sent for short address
* @param addr
* @param subaddr
*/
#define ONACTIVATE(addr,subaddr)
/**
* @def ONACTIVATEL(linear)
2025-02-11 21:04:38 +01:00
* @brief Start task here when DCC Activate sent for linear address
* @param linear
*/
#define ONACTIVATEL(linear)
/**
* @def ONAMBER(signal_id)
2025-02-02 17:25:28 +01:00
* @brief Start task here when signal set to AMBER state
* @param signal_id
*/
#define ONAMBER(signal_id)
/**
* @def ONTIME(minute_in_day)
* @brief Start task here when fastclock matches
2025-02-11 21:04:38 +01:00
* @param minute_in_day (0..1439)
*/
#define ONTIME(minute_in_day)
/**
* @def ONCLOCKTIME(hours,mins)
2025-02-02 17:25:28 +01:00
* @brief Start task here when fastclock matches time
* @param hours
* @param mins
*/
#define ONCLOCKTIME(hours,mins)
/**
* @def ONCLOCKMINS(mins)
2025-02-02 17:25:28 +01:00
* @brief Start task here hourly when fastclock minutes matches
* @param mins
*/
#define ONCLOCKMINS(mins)
/**
* @def ONOVERLOAD(track_id)
2025-02-02 17:25:28 +01:00
* @brief Start task here when given track goes into overload
* @param track_id A..H
*/
#define ONOVERLOAD(track_id)
/**
* @def ONDEACTIVATE(addr,subaddr)
2025-02-02 17:25:28 +01:00
* @brief Start task here when DCC deactivate packet sent
* @param addr
* @param subaddr
*/
#define ONDEACTIVATE(addr,subaddr)
/**
* @def ONDEACTIVATEL(linear)
2025-02-02 17:25:28 +01:00
* @brief Start task here when DCC deactivate sent to linear address
* @param linear
*/
#define ONDEACTIVATEL(linear)
/**
* @def ONCLOSE(turnout_id)
2025-02-02 17:25:28 +01:00
* @brief Start task here when turnout closed
* @param turnout_id
*/
#define ONCLOSE(turnout_id)
/**
* @def ONLCC(sender,event)
2025-02-11 21:04:38 +01:00
* @brief Start task here when LCC event arrives from sender
* @param sender
* @param event
*/
#define ONLCC(sender,event)
/**
* @def ONGREEN(signal_id)
2025-02-02 17:25:28 +01:00
* @brief Start task here when signal set to GREEN state
* @param signal_id
*/
#define ONGREEN(signal_id)
/**
* @def ONRED(signal_id)
2025-02-02 17:25:28 +01:00
* @brief Start task here when signal set to RED state
* @param signal_id
*/
2023-09-02 00:29:49 +02:00
#define ONRED(signal_id)
/**
* @def ONROTATE(turntable_id)
2025-02-02 17:25:28 +01:00
* @brief Start task here when turntable is rotated
* @param turntable_id
*/
2023-09-02 00:29:49 +02:00
#define ONROTATE(turntable_id)
/**
* @def ONTHROW(turnout_id)
2025-02-02 17:25:28 +01:00
* @brief Start task here when turnout is Thrown
* @param turnout_id
*/
#define ONTHROW(turnout_id)
/**
2025-02-11 21:04:38 +01:00
* @def ONCHANGE(vpin)
2025-02-13 12:27:32 +01:00
* @brief Toratry encoder change starts task here (This is obscurely different from ONSENSOR which will be merged in a later release.)
2025-02-11 21:04:38 +01:00
* @param vpin
*/
2025-02-13 12:27:32 +01:00
#define ONCHANGE(vpin)
/**
2025-02-13 12:27:32 +01:00
* @def ONSENSOR(vpin)
2025-02-02 17:25:28 +01:00
* @brief Start task here when sensor changes state (debounced)
2025-02-13 12:27:32 +01:00
* @param vpin
*/
2025-02-13 12:27:32 +01:00
#define ONSENSOR(vpin)
/**
2025-02-13 12:27:32 +01:00
* @def ONBUTTON(vpin)
2025-02-02 17:25:28 +01:00
* @brief Start task here when sensor changes HIGH to LOW.
2025-02-13 12:27:32 +01:00
* @param vpin
*/
2025-02-13 12:27:32 +01:00
#define ONBUTTON(vpin)
/**
* @def PAUSE
2025-02-02 17:25:28 +01:00
* @brief Pauses all EXRAIL tasks except the curremnt one.
* Other tasks ESTOP their locos until RESUME issued
*/
#define PAUSE
/**
2025-02-13 12:27:32 +01:00
* @def PIN_TURNOUT(turnout_id,vpin,description...)
2025-02-11 21:04:38 +01:00
* @brief Defines a turnout which operates on a signle pin
2025-02-13 12:27:32 +01:00
* @param turnout_id
* @param vpin
2025-02-02 17:25:28 +01:00
* @param description... Quoted text (shown to throttles) or HIDDEN
*/
2025-02-11 21:04:38 +01:00
#define PIN_TURNOUT(id,vpin,description...)
/**
* @def PRINT(msg)
2025-02-02 17:25:28 +01:00
* @brief prints diagnostic message on USB serial
* @param msg Quoted text
*/
#define PRINT(msg)
/**
* @def PARSE(msg)
2025-02-02 17:25:28 +01:00
* @brief Executes <> command as if entered from serial
* @param msg Quoted text, preferably including <>
*/
2022-03-31 23:04:40 +02:00
#define PARSE(msg)
/**
2025-02-13 12:27:32 +01:00
* @def PICKUP_STASH(stash_id)
* @see STASH
2025-02-02 17:25:28 +01:00
* @brief Loads stashed value into current task loco
2025-02-13 12:27:32 +01:00
* @param stash_id position in stash where a loco id was previously saved.
*/
2025-02-13 12:27:32 +01:00
#define PICKUP_STASH(stash_id)
/**
* @def POM(cv,value)
2025-02-02 17:25:28 +01:00
* @brief Write value to cv on current tasks loco (Program on Main)
* @param cv
* @param value
*/
#define POM(cv,value)
/**
* @def POWEROFF
2025-02-02 17:25:28 +01:00
* @brief Powers off all tracks
*/
#define POWEROFF
/**
* @def POWERON
2025-02-02 17:25:28 +01:00
* @brief Powers ON all tracks
*/
#define POWERON
/**
* @def READ_LOCO
2025-02-11 21:04:38 +01:00
* @brief Reads loco Id from prog track and sets currenmt task loco id.
*/
#define READ_LOCO
/**
* @def RED(signal_id)
2025-02-02 17:25:28 +01:00
* @brief sets signal to RED state
* @param signal_id
*/
#define RED(signal_id)
/**
2025-02-11 21:04:38 +01:00
* @def RESERVE(token_id)
2025-02-02 17:25:28 +01:00
* @brief Waits for token for block. If not available immediately, current task loco is stopped.
2025-02-11 21:04:38 +01:00
* @param token_id
*/
2025-02-11 21:04:38 +01:00
#define RESERVE(token_id)
/**
2025-02-11 21:04:38 +01:00
* @def RESET(vpin,count...)
* @brief Sets output pin LOW
* @see SET
* @param vpin
2025-02-02 17:25:28 +01:00
* @param count... Number of consecutive pins, default 1
*/
2025-02-11 21:04:38 +01:00
#define RESET(vpin,count...)
/**
* @def RESUME
2025-02-02 17:25:28 +01:00
* @brief Resumes PAUSEd tasks
* @see PAUSE
*/
#define RESUME
/**
* @def RETURN
2025-02-02 17:25:28 +01:00
* @brief Returns to CALL
* @see CALL
*/
#define RETURN
/**
* @def REV(speed)
2025-02-02 17:25:28 +01:00
* @brief Issues DCC speed packet for current loco in reverse.
* @see FWD
* @param speed (0..127, 1=ESTOP)
*/
#define REV(speed)
/**
2025-02-13 12:27:32 +01:00
* @def ROTATE(turntable_id,position_id,activity)
2025-02-14 07:51:04 +01:00
* @brief Rotates an EX-Turntable to a given position
* @param turntable_id
2025-02-13 12:27:32 +01:00
* @param position_id
2025-02-13 23:45:27 +01:00
* @param activity
* - **Turn**: Rotate turntable, maintain phase
* - **Turn_PInvert**: Rotate turntable, invert phase
* - **Home**: Initiate homing
* - **Calibrate**: Initiate calibration sequence
* - **LED_On**: Turn LED on
* - **LED_Slow**: Set LED to a slow blink
* - **LED_Fast**: Set LED to a fast blink
* - **LED_Off**: Turn LED off
* - **Acc_On**: Turn accessory pin on
* - **Acc_Off**: Turn accessory pin off
*/
2023-09-02 00:29:49 +02:00
#define ROTATE(turntable_id,position,activity)
/**
2025-02-13 12:27:32 +01:00
* @def ROTATE_DCC(turntable_id,position_id)
2025-02-14 07:51:04 +01:00
* @brief Rotates turntable to a given position using DCC commands
* @param turntable_id
2025-02-13 12:27:32 +01:00
* @param position_id
*/
2025-02-13 12:27:32 +01:00
#define ROTATE_DCC(turntable_id,position_id)
/**
* @def ROSTER(cab,name,funcmap...)
2025-02-02 17:25:28 +01:00
* @brief Describes a loco roster entry visible to throttles
* @param cab loco DCC address or 0 for default entry
* @param name Quoted text
2025-02-11 21:04:38 +01:00
* @param funcmap... Quoted text, optional list of function names separated by / character with momentary function names prefixed with an *.
2025-02-02 17:25:28 +01:00
*
*/
2021-12-26 19:24:04 +01:00
#define ROSTER(cab,name,funcmap...)
/**
2025-02-11 21:04:38 +01:00
* @def ROUTE(sequence_id,description)
2025-02-02 17:25:28 +01:00
* @brief DEfines starting point of a sequence that will appear as a route on throttle buttons.
2025-02-11 21:04:38 +01:00
* @param sequence_id
2025-02-02 17:25:28 +01:00
* @param description Quoted text, throttle button capotion.
*/
2025-02-11 21:04:38 +01:00
#define ROUTE(sequence_id,description)
/**
2025-02-11 21:04:38 +01:00
* @def ROUTE_ACTIVE(sequence_id)
2025-02-02 17:25:28 +01:00
* @brief Tells throttle to display the route button as active
2025-02-11 21:04:38 +01:00
* @param sequence_id of ROUTE/AUTOMATION
*/
2025-02-11 21:04:38 +01:00
#define ROUTE_ACTIVE(sequence_id)
/**
2025-02-11 21:04:38 +01:00
* @def ROUTE_INACTIVE(sequence_id)
2025-02-02 17:25:28 +01:00
* @brief Tells throttle to display the route button as inactive
2025-02-11 21:04:38 +01:00
* @param sequence_id of ROUTE/AUTOMATION
*/
2025-02-11 21:04:38 +01:00
#define ROUTE_INACTIVE(sequence_id)
/**
2025-02-11 21:04:38 +01:00
* @def ROUTE_HIDDEN(sequence_id)
2025-02-02 17:25:28 +01:00
* @brief Tells throttle to hide the route button
2025-02-11 21:04:38 +01:00
* @param sequence_id of ROUTE/AUTOMATION
*/
2025-02-11 21:04:38 +01:00
#define ROUTE_HIDDEN(sequence_id)
/**
2025-02-11 21:04:38 +01:00
* @def ROUTE_DISABLED(sequence_id)
2025-02-02 17:25:28 +01:00
* @brief Tells throttle to display the route button as disabled
2025-02-11 21:04:38 +01:00
* @param sequence_id of ROUTE/AUTOMATION
*/
2025-02-11 21:04:38 +01:00
#define ROUTE_DISABLED(sequence_id)
/**
2025-02-11 21:04:38 +01:00
* @def ROUTE_CAPTION(sequence_id,caption)
2025-02-02 17:25:28 +01:00
* @brief Tells throttle to change thr route button caption
2025-02-11 21:04:38 +01:00
* @param sequence_id of ROUTE/AUTOMATION
* @param caption
*/
2025-02-11 21:04:38 +01:00
#define ROUTE_CAPTION(sequence_id,caption)
/**
2025-02-11 21:04:38 +01:00
* @def SENDLOCO(cab,sequence_id)
2025-02-02 17:25:28 +01:00
* @brief Start a new task to drive the loco
* @param cab loco to be driven
2025-02-11 21:04:38 +01:00
* @param route sequence_id of route, automation or sequence to drive
*/
2025-02-11 21:04:38 +01:00
#define SENDLOCO(cab,sequence_id)
/**
2025-02-11 21:04:38 +01:00
* @def SEQUENCE(sequence_id)
2025-02-02 17:25:28 +01:00
* @brief Provides a unique label than can be used to call, follow or start.
* @see CALL
* @see FOLLOW
* @see START
2025-02-11 21:04:38 +01:00
* @param sequence_id
*/
2025-02-11 21:04:38 +01:00
#define SEQUENCE(sequence_id)
/**
* @def SERIAL(msg)
2025-02-02 17:25:28 +01:00
* @brief Write direct to Serial output
* @param msg Quoted text
*/
#define SERIAL(msg)
/**
* @def SERIAL1(msg)
2025-02-02 17:25:28 +01:00
* @brief Write direct to Serial1 output
* @param msg Quoted text
*/
#define SERIAL1(msg)
/**
* @def SERIAL2(msg)
2025-02-02 17:25:28 +01:00
* @brief Write direct to Serial2 output
* @param msg Quoted text
*/
#define SERIAL2(msg)
/**
* @def SERIAL3(msg)
2025-02-02 17:25:28 +01:00
* @brief Write direct to Serial3 output
* @param msg Quoted text
*/
#define SERIAL3(msg)
/**
* @def SERIAL4(msg)
2025-02-02 17:25:28 +01:00
* @brief Write direct to Serial4 output
* @param msg Quoted text
*/
#define SERIAL4(msg)
/**
* @def SERIAL5(msg)
2025-02-02 17:25:28 +01:00
* @brief Write direct to Serial5 output
* @param msg Quoted text
*/
#define SERIAL5(msg)
/**
* @def SERIAL6(msg)
2025-02-02 17:25:28 +01:00
* @brief Write direct to Serial6 output
* @param msg Quoted text
*/
#define SERIAL6(msg)
/**
2025-02-11 21:04:38 +01:00
* @def SERVO(vpin,position,profile)
2025-02-02 17:25:28 +01:00
* @brief Move servo to given position
2025-02-11 21:04:38 +01:00
* @param vpin of servo
2025-02-13 12:27:32 +01:00
* @param position servo position (values are hardware dependent)
2025-02-11 21:04:38 +01:00
* @param profile movement profile (Instant, Fast, Medium, Slow, Bounce)
*/
2025-02-11 21:04:38 +01:00
#define SERVO(vpin,position,profile)
/**
* @def SERVO2(id,position,duration)
2025-02-02 17:25:28 +01:00
* @brief Move servo to given position taking time
2025-02-11 21:04:38 +01:00
* @param vpin of servo
2025-02-13 12:27:32 +01:00
* @param position servo position (values are hardware dependent)
2025-02-02 17:25:28 +01:00
* @param duration mS
*/
2025-02-11 21:04:38 +01:00
#define SERVO2(vpin,position,duration)
/**
* @def SERVO_SIGNAL(vpin,redpos,amberpos,greenpos)
2025-02-02 17:25:28 +01:00
* @brief Dedfine a servo based signal with 3 servo positions
2025-02-11 21:04:38 +01:00
* @param vpin of servo, acts as signal_id
2025-02-13 12:27:32 +01:00
* @param redpos servo position (values are hardware dependent)
* @param amberpos servo position (values are hardware dependent)
* @param greenpos servo position (values are hardware dependent)
*/
#define SERVO_SIGNAL(vpin,redpos,amberpos,greenpos)
/**
2025-02-11 21:04:38 +01:00
* @def SERVO_TURNOUT(turnout_id,vpin,activeAngle,inactiveAngle,profile,description...)
2025-02-02 17:25:28 +01:00
* @brief Define a servo driven turnout
2025-02-11 21:04:38 +01:00
* @param turnout_id used by THROW/CLOSE
* @param vpin for servo
2025-02-13 12:27:32 +01:00
* @param activeAngle servo position (values are hardware dependent)
* @param inactiveAngle servo position (values are hardware dependent)
2025-02-11 21:04:38 +01:00
* @param profile movement profile (Instant, Fast, Medium, Slow, Bounce)
2025-02-02 17:25:28 +01:00
* @param description... Quoted text shown to throttles or HIDDEN keyword to hide turnout button
*/
2025-02-11 21:04:38 +01:00
#define SERVO_TURNOUT(turnout_id,vpin,activeAngle,inactiveAngle,profile,description...)
/**
2025-02-11 21:04:38 +01:00
* @def SET(vpin,count...)
* @brief Set pin HIGH
* @see RESET
* @param vpin
2025-02-02 17:25:28 +01:00
* @param count... Number of sequential vpins to set. Default 1.
*/
2025-02-11 21:04:38 +01:00
#define SET(vpin,count...)
/**
* @def SET_TRACK(track,mode)
2025-02-02 17:25:28 +01:00
* @brief Set output track type
* @param track A..H
2025-02-13 12:27:32 +01:00
* @param mode NONE, MAIN, PROG, DC, EXT, BOOST, BOOST_INV, BOOST_AUTO, MAIN_INV, MAIN_AUTO, DC_INV, DCX
*/
#define SET_TRACK(track,mode)
/**
* @def SET_POWER(track,onoff)
2025-02-02 17:25:28 +01:00
* @brief Set track power mode
* @param track A..H
2025-02-13 12:27:32 +01:00
* @param onoff ON or OFF
*/
#define SET_POWER(track,onoff)
/**
* @def SETLOCO(loco)
2025-02-02 17:25:28 +01:00
* @brief Sets the loco being handled by the current task
* @param loco
*/
#define SETLOCO(loco)
/**
* @def SETFREQ(freq)
2025-02-02 17:25:28 +01:00
* @brief Sets the DC track PWM frequency
2025-02-13 12:27:32 +01:00
* @param freq Frequency is default 0, or 1..3
*/
2024-07-10 10:57:03 +02:00
#define SETFREQ(freq)
/**
* @def SIGNAL(redpin,amberpin,greenpin)
2025-02-13 12:27:32 +01:00
* @brief Define a Signal with LOW=on leds
2025-02-02 17:25:28 +01:00
* @see SIGNALH
2025-02-11 21:04:38 +01:00
* @param redpin vpin for RED state, also acts as signal_id
* @param amberpin
* @param greenpin
*/
#define SIGNAL(redpin,amberpin,greenpin)
/**
* @def SIGNALH(redpin,amberpin,greenpin)
2025-02-02 17:25:28 +01:00
* @brief define a signal with HIGH=ON leds
2025-02-11 21:04:38 +01:00
* @param redpin vpin for RED state, also acts as signal_id
* @param amberpin
* @param greenpin
*/
2022-03-18 14:46:07 +01:00
#define SIGNALH(redpin,amberpin,greenpin)
/**
* @def SPEED(speed)
2025-02-02 17:25:28 +01:00
* @brief Changes current tasks loco speed without changing direction
* @param speed 0..127 (1=ESTOP)
*/
#define SPEED(speed)
/**
2025-02-11 21:04:38 +01:00
* @def START(sequence_id)
2025-02-02 17:25:28 +01:00
* @brief Starts a new task at the given route/animation/sequence
2025-02-11 21:04:38 +01:00
* @param sequence_id
*/
2025-02-11 21:04:38 +01:00
#define START(sequence_id)
/**
2025-02-11 21:04:38 +01:00
* @def STASH(stash_id)
2025-02-02 17:25:28 +01:00
* @brief saves cuttent tasks loco id in the stash array
2025-02-11 21:04:38 +01:00
* @param stash_id position in stash array to save loco id
*/
2025-02-11 21:04:38 +01:00
#define STASH(stash_id)
/**
* @def STEALTH(code...)
2025-02-02 17:25:28 +01:00
* @brief Allows for embedding raw C++ code in context of current task.
2025-02-11 21:04:38 +01:00
* @param code... c++ code to be executed. This requires intimate understanding of the product acrhitecture.
*/
2023-11-30 12:32:39 +01:00
#define STEALTH(code...)
/**
* @def STEALTH_GLOBAL(code...)
2025-02-02 17:25:28 +01:00
* @brief Allows for embedding raw c++ code out of context.
2025-02-11 21:04:38 +01:00
* @param code... c++ code to be defined. This requires intimate understanding of the product acrhitecture.
*/
#define STEALTH_GLOBAL(code...)
/**
* @def STOP
2025-02-02 17:25:28 +01:00
* @brief Same as SPEED(0)
2025-02-11 21:04:38 +01:00
* @see SPEED
*/
#define STOP
/**
2025-02-11 21:04:38 +01:00
* @def THROW(turnout_id)
2025-02-02 17:25:28 +01:00
* @brief Throws given turnout
2025-02-11 21:04:38 +01:00
* @see CLOSE
* @param turnout_id
*/
2025-02-11 21:04:38 +01:00
#define THROW(turnout_id)
/**
2025-02-11 21:04:38 +01:00
* @def TOGGLE_TURNOUT(turnout_id)
2025-02-02 17:25:28 +01:00
* @brief Toggles given turnout
2025-02-11 21:04:38 +01:00
* @param tuirnout_id
*/
2025-02-11 21:04:38 +01:00
#define TOGGLE_TURNOUT(turnout_id)
/**
2025-02-13 12:27:32 +01:00
* @def TT_ADDPOSITION(turntable_id,position_id,value,angle,description...)
2025-02-02 17:25:28 +01:00
* @brief Defines a turntable track position
* @param turntable_id
2025-02-13 12:27:32 +01:00
* @param position_id each position is given an id
* @param address DCC accessory address
* @param angle Used only for throttles that may draw a visual representation of the turntable
* @param description... quoted text or HIDDEN
*/
2025-02-13 12:27:32 +01:00
#define TT_ADDPOSITION(turntable_id,position_id,value,angle,description...)
/**
2025-02-11 21:04:38 +01:00
* @def TURNOUT(turnout_id,addr,subaddr,description...)
2025-02-02 17:25:28 +01:00
* @brief Defines a DCC accessory turnout with legacy address
2025-02-11 21:04:38 +01:00
* @param turnout_id to be used in THROW/CLOSE etc
* @param addr DCC accessory address
* @param subaddr DCC accessory subaddress
2025-02-02 17:25:28 +01:00
* @param description... Quoted text or HIDDEN, appears on throttle buttons
*/
2025-02-11 21:04:38 +01:00
#define TURNOUT(turnout_id,addr,subaddr,description...)
/**
2025-02-11 21:04:38 +01:00
* @def TURNOUTL(turnout_id,addr,description...)
2025-02-02 17:25:28 +01:00
* @brief Defines a DCC accessory turnout with inear address
2025-02-11 21:04:38 +01:00
* @see TURNOUT
* @param turnout_id to be used in THROW/CLOSE etc
* @param addr DCC accessory linear address
* @param description... Quoted text or HIDDEN, appears on throttle buttons
*/
2025-02-11 21:04:38 +01:00
#define TURNOUTL(tirnout_id,addr,description...)
/**
* @def UNJOIN
2025-02-02 17:25:28 +01:00
* @brief Disconnects PROG track from MAIN
* @see JOIN
*/
#define UNJOIN
/**
2025-02-11 21:04:38 +01:00
* @def UNLATCH(vpin)
2025-02-02 17:25:28 +01:00
* @brief removes latched on flag
* @see LATCH
2025-02-11 21:04:38 +01:00
* @param vpin (limited to 0..255)
*/
2025-02-11 21:04:38 +01:00
#define UNLATCH(vpin)
/**
2025-02-11 21:04:38 +01:00
* @def VIRTUAL_SIGNAL(signal_id)
2025-02-13 12:27:32 +01:00
* @brief Defines a virtual (no hardware) signal, use ONhandlers to simulate hardware
* @see SIGNAL ONRED ONAMBER ONGREEN
2025-02-11 21:04:38 +01:00
* @param signal_id
*/
2025-02-11 21:04:38 +01:00
#define VIRTUAL_SIGNAL(signal_id)
/**
2025-02-11 21:04:38 +01:00
* @def VIRTUAL_TURNOUT(turnout_id,description...)
2025-02-13 12:27:32 +01:00
* @brief Defines a virtual (no hardware) turnout, use ONhandlers to simulate hardware
* @see TURNOUT ONCLOSE ONTHROW
2025-02-11 21:04:38 +01:00
* @param turnout_id
2025-02-13 12:27:32 +01:00
* @param description... quoted text or HIDDEN
*/
2022-03-24 12:56:06 +01:00
#define VIRTUAL_TURNOUT(id,description...)
/**
2025-02-11 21:04:38 +01:00
* @def WAITFOR(vpin)
* @brief WAits for completion of servo movement
* @param vpin
*/
#define WAITFOR(pin)
2023-09-06 23:58:19 +02:00
#ifndef IO_NO_HAL
/**
* @def WAITFORTT(turntable_id)
2025-02-11 21:04:38 +01:00
* @brief waits for completion of turntable movement
* @param turntable_id
*/
2023-09-06 23:58:19 +02:00
#define WAITFORTT(turntable_id)
#endif
/**
* @def WITHROTTLE(msg)
2025-02-02 17:25:28 +01:00
* @brief Broadcasts a string in Withrottle protocol format to all throttles using this protocol.
2025-02-11 21:04:38 +01:00
* @param msg quoted string
*/
2023-05-01 15:25:45 +02:00
#define WITHROTTLE(msg)
/**
* @def XFOFF(cab,func)
2025-02-02 17:25:28 +01:00
* @brief Turns function off for given loco
* @param cab
2025-02-11 21:04:38 +01:00
* @param func function number
*/
#define XFOFF(cab,func)
/**
* @def XFON(cab,func)
2025-02-02 17:25:28 +01:00
* @brief Turns function ON for given loco
* @param cab
* @param func
*/
#define XFON(cab,func)
/**
* @def XFTOGGLE(cab,func)
2025-02-02 17:25:28 +01:00
* @brief Toggles function state for given loco
* @param cab
* @param func
*/
#define XFTOGGLE(cab,func)
/**
* @def XFWD(cab,speed)
2025-02-02 17:25:28 +01:00
* @brief Sends DCC speed to loco in forward direction
* @param cab
2025-02-02 17:25:28 +01:00
* @param speed (0..127, 1=ESTOP)
*/
2025-01-09 20:40:07 +01:00
#define XFWD(cab,speed)
/**
* @def XREV(cab,speed)
2025-02-02 17:25:28 +01:00
* @brief Sends DCC speed to loco in reverse direction
* @param cab
2025-02-02 17:25:28 +01:00
* @param speed (0..127, 1=ESTOP)
*/
2025-01-09 20:40:07 +01:00
#define XREV(cab,speed)
#endif