Keisuke Sehara
/
STM32_Whisking
fast-feedback virtual target task code on STM Nucleo
states.h@32:1416e015016c, 2018-12-13 (annotated)
- Committer:
- gwappa
- Date:
- Thu Dec 13 07:18:43 2018 +0000
- Revision:
- 32:1416e015016c
- Parent:
- 31:b320ca61a8c0
change to use the Staged state
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gwappa | 4:fcf597f82632 | 1 | #ifndef STATES_H_ |
gwappa | 4:fcf597f82632 | 2 | #define STATES_H_ |
gwappa | 4:fcf597f82632 | 3 | |
gwappa | 9:e136394bdb39 | 4 | #include "mbed.h" |
gwappa | 9:e136394bdb39 | 5 | |
gwappa | 4:fcf597f82632 | 6 | struct Delay { |
gwappa | 4:fcf597f82632 | 7 | static void setup(); |
gwappa | 4:fcf597f82632 | 8 | static void teardown(); |
gwappa | 4:fcf597f82632 | 9 | }; |
gwappa | 4:fcf597f82632 | 10 | |
gwappa | 11:897ecd5413e0 | 11 | /** |
gwappa | 11:897ecd5413e0 | 12 | * lick is not allowed during this period. |
gwappa | 11:897ecd5413e0 | 13 | * if the animal licks, the state transits to Abort. |
gwappa | 11:897ecd5413e0 | 14 | */ |
gwappa | 7:6744ec9ccc25 | 15 | struct Prepare { |
gwappa | 7:6744ec9ccc25 | 16 | static void setup(); |
gwappa | 7:6744ec9ccc25 | 17 | static void teardown(); |
gwappa | 7:6744ec9ccc25 | 18 | }; |
gwappa | 7:6744ec9ccc25 | 19 | |
gwappa | 32:1416e015016c | 20 | /** |
gwappa | 32:1416e015016c | 21 | * comes to this state in response to a too early licking |
gwappa | 32:1416e015016c | 22 | * (e.g. during Prepare period). |
gwappa | 32:1416e015016c | 23 | * goes to the end of the trial without a reward delivery. |
gwappa | 32:1416e015016c | 24 | */ |
gwappa | 7:6744ec9ccc25 | 25 | struct Abort { |
gwappa | 7:6744ec9ccc25 | 26 | static void setup(); |
gwappa | 7:6744ec9ccc25 | 27 | static void teardown(); |
gwappa | 7:6744ec9ccc25 | 28 | }; |
gwappa | 7:6744ec9ccc25 | 29 | |
gwappa | 11:897ecd5413e0 | 30 | /** |
gwappa | 32:1416e015016c | 31 | * used during the Stage/Associate/Motion mode. |
gwappa | 32:1416e015016c | 32 | * the auditory cue is delivered here. |
gwappa | 32:1416e015016c | 33 | */ |
gwappa | 32:1416e015016c | 34 | struct Staged { |
gwappa | 32:1416e015016c | 35 | static void setup(); |
gwappa | 32:1416e015016c | 36 | static void logCatch(); |
gwappa | 32:1416e015016c | 37 | static void teardown(); |
gwappa | 32:1416e015016c | 38 | }; |
gwappa | 32:1416e015016c | 39 | |
gwappa | 32:1416e015016c | 40 | /** |
gwappa | 32:1416e015016c | 41 | * used only for the Pair mode. |
gwappa | 32:1416e015016c | 42 | * except for during the 'testing' trial, reward is delivered unconditionally. |
gwappa | 32:1416e015016c | 43 | */ |
gwappa | 32:1416e015016c | 44 | struct Paired { |
gwappa | 32:1416e015016c | 45 | static void setup(); |
gwappa | 32:1416e015016c | 46 | static void teardown(); |
gwappa | 32:1416e015016c | 47 | }; |
gwappa | 32:1416e015016c | 48 | |
gwappa | 32:1416e015016c | 49 | /** |
gwappa | 32:1416e015016c | 50 | * comes to this state during the Pair mode if the mouse licks before the |
gwappa | 32:1416e015016c | 51 | * end of the visual stimulus. |
gwappa | 32:1416e015016c | 52 | * the reward is delivered in response. |
gwappa | 32:1416e015016c | 53 | */ |
gwappa | 32:1416e015016c | 54 | struct Hit { |
gwappa | 32:1416e015016c | 55 | static void setup(); |
gwappa | 32:1416e015016c | 56 | static void teardown(); |
gwappa | 32:1416e015016c | 57 | }; |
gwappa | 32:1416e015016c | 58 | |
gwappa | 32:1416e015016c | 59 | /** |
gwappa | 32:1416e015016c | 60 | * post-reward monitoring period for the Pair mode. |
gwappa | 32:1416e015016c | 61 | */ |
gwappa | 32:1416e015016c | 62 | struct Monitored { |
gwappa | 32:1416e015016c | 63 | static void setup(); |
gwappa | 32:1416e015016c | 64 | static void teardown(); |
gwappa | 32:1416e015016c | 65 | }; |
gwappa | 32:1416e015016c | 66 | |
gwappa | 32:1416e015016c | 67 | /** |
gwappa | 21:e51733fc1c36 | 68 | * used to present reward-related conditioning cue(s) (visual, auditory). |
gwappa | 21:e51733fc1c36 | 69 | * necessary whisk/lick/stimulus-related callbacks are also used. |
gwappa | 11:897ecd5413e0 | 70 | */ |
gwappa | 4:fcf597f82632 | 71 | struct Cued { |
gwappa | 4:fcf597f82632 | 72 | static void setup(); |
gwappa | 7:6744ec9ccc25 | 73 | static void gate(); |
gwappa | 4:fcf597f82632 | 74 | static void teardown(); |
gwappa | 4:fcf597f82632 | 75 | }; |
gwappa | 4:fcf597f82632 | 76 | |
gwappa | 21:e51733fc1c36 | 77 | /** |
gwappa | 32:1416e015016c | 78 | * if the animal licked during Paired/Cued/Monitor period, the automaton transits to this state. |
gwappa | 32:1416e015016c | 79 | * unless it is in the Paired mode, reward is delivered here. |
gwappa | 21:e51733fc1c36 | 80 | */ |
gwappa | 4:fcf597f82632 | 81 | struct WithResp { |
gwappa | 4:fcf597f82632 | 82 | static void setup(); |
gwappa | 4:fcf597f82632 | 83 | static void teardown(); |
gwappa | 4:fcf597f82632 | 84 | }; |
gwappa | 4:fcf597f82632 | 85 | |
gwappa | 4:fcf597f82632 | 86 | struct NoResp { |
gwappa | 4:fcf597f82632 | 87 | static void setup(); |
gwappa | 4:fcf597f82632 | 88 | static void teardown(); |
gwappa | 4:fcf597f82632 | 89 | }; |
gwappa | 4:fcf597f82632 | 90 | |
gwappa | 8:973dcd190672 | 91 | struct TestReward { |
gwappa | 8:973dcd190672 | 92 | static void setup(); |
gwappa | 8:973dcd190672 | 93 | static void teardown(); |
gwappa | 8:973dcd190672 | 94 | }; |
gwappa | 8:973dcd190672 | 95 | |
gwappa | 30:5f975f572ffb | 96 | struct ClearTrialIndex { |
gwappa | 30:5f975f572ffb | 97 | static void setup(); |
gwappa | 30:5f975f572ffb | 98 | static void teardown(); |
gwappa | 30:5f975f572ffb | 99 | }; |
gwappa | 30:5f975f572ffb | 100 | |
gwappa | 4:fcf597f82632 | 101 | #endif |