    LED screen.

******  ******

===  I/O ===
- PA11/12 - USB
- PA9(Tx), PA10(Rx) - USART1 -   /  RMC- GPS (. - bluetooth).
- PA2(Tx), PA3(Rx) - USART2 -  GPS-.
- PB10(Tx), PB11(Rx) - USART3 -     .

===   ===
- PA1  - PPS   GPS;        .
- PB0  - TRIG0 - (  ).
- PB1  - TRIG1 -   12.
- PB3  - TRIG2 - (  ).
- PA15 -  USB.
- PA8  - ( ) - bluetooth "state"
- PB8, PB9 -   (LED1, LED0 ).
- PC13 - .

===  ===
- LED0 -    PPS  ,  PPS  -  (  0.25   ).
- LED1 -  GPS:  ,    ;  ,    
( "V"    RMC-);     ( "A"   ).
   ,    LED0.


******  ******
 TRIG0/TRIG2  , ,  ,  .       !          ,     .
 TRIG1   12- ,    10.     ,       TRIG2,     12   .
         . 

    ,       -     -  .


******  ******
  ""  PL2303.

  PA9/PA10    USART<>USB,      Rx/Tx "" (PA9(Tx)   Rx, PA10(Rx) -  Tx)    bluetooth-.  USART   (   )       RMC- GPS- (   ,    ,   ,     ).

  LIDAR   ,        .     .

  PPS   ""    (   ,         2.6,     ,  ).

 I2C  SPI      .
"SPI":
- MOSI -   DATA (12)
- SCK -   CLK (10)
- MISO -   SCLK (10)  ENABLE (1)
"I2C":
- SCL -   A (2)
- SDA -   B (4)
-     .

   ,     ,     ,         .


******  ******
       (USB, USART1-Bluetooth, USART3-LIDAR).       USB-    Backspace     .
  ,    ,    .  :

btnstate - show triggers state
buzzerS - turn buzzer ON/OFF
cls - turn LED display off
curdist - show current LIDAR distance
deletelogs - delete logs from flash memory
distmin - min distance threshold (cm)
distmax - max distance threshold (cm)
dumpN - dump 20 last stored events (no x), all (x<1) or x
evtlenN - duration of the trigger event display (ms)
flash - FLASH info
gateS - check/not check triggers (1/0)
gpsproxyS - GPS proxy over USART1 on/off
gpsrestart - send Full Cold Restart to GPS
gpsstat - get GPS status
gpsstring - current GPS data string
ledsS - turn leds on/off (1/0)
lidarS - switch between LIDAR (1) or command TTY (0)
lidspdN - set LIDAR speed to N
mcutemp - MCU temperature
mesg str - show 'str' at display (no more than 7 chars)
ndumpN - dump Nth log & show on screen (-N - Nth from last)
nfree - warn when free logs space less than this number (0 - not warn)
reset - reset MCU
seS - save/don't save (1/0) trigger events into flash
showconf - show current configuration
showshutterS - show/not show trigger events
showtime - show current time
stautoX - auto start every X minutes (0 or absent - cancel, +/- - increase/decrease by 1min)
stonceX - delayed start after X minutes (like auto)
store - store new configuration in flash
stortest - add test trigger event record into flash
strendC - string ends with \n (C=n) or \r\n (C=r)
time - print current time
triglevelNS - working trigger N level S
trigpauseNP - pause (P, ms) after trigger N shots
trigtimeN - show last trigger N time
usartspdN - set USART1 speed to N
usbreset - reset USB connectioin
vdd - Vdd value


 (S    1  0,  ! N - ,   ): 
- btnstate -      PPS, :
	BTN0=0, BTN1=0, BTN2=0, PPS=0
	,      .        ,   .
	
- buzzer - buzzer1    , buzzer0 - .     
	BUZZER=ON
	
- cls -  .

- curdist -  ,  .

- deletelogs -   -      .

- distmin, distmax -    .

- dump -      20  (  N),  N  (N>0)  .

- evtlen -  ( ,   5000),            .

- flash -   -, :
	FLASHSIZE=128kB    	-   
	FLASH_BASE=0x08000000	-    
	Flash_Data=0x08007000	- ,     
	varslen=2048		-  ( ) -,    
	CONFsize=28		-  ( )  ""   
	Nconf_records=72	-  "" ,   ,   
	logsstart=0x08007800	- ,       ( )
	LOGsize=16		-   "" 
	Nlogs_records=6271	-   

- gate -     ( ,   != '0')  .

- gpsproxy -    GPS  USART1 ( Bluetooth),    (  == '0').

- gpsrestart -  GPS,  "" .

- gpsstat -  GPS: "not found",      GPS; "waiting"    ; "no satellites"     (GPRMC   "not valid"); "valid time",   .

- gpsstring -     GPS.   ,    RMC 
	$GPRMC,124001.000,A,4340.9369,N,04127.5034,E,0.00,33.26,150819,,,A*5C
	  GPS    .

- leds - /   (   1  0).

- lidar -   USART3 (LIDAR):       '0',     ,  USART3     .      ,       .

- lidspd -    USART3 (LIDAR).

- mcutemp -    (degrC).

- mesg -      ( 7-8 ) .        ,           .          showtime.         8-.

- ndump -  N-     ( N<0,      : N==-1 -  , N==-2 -    ),  N      .       showtime,         eventlen .

- nfree -       ,            .  ,       ,        .     ,     deletelogs.

- reset -  .

- se -   '0'      -,        .

- showconf -   , :
	DISTMIN=50
	DISTMAX=1000
	TRIGLVL=0
	TRIGPAUSE={400, 400, 400, 300}
	USART1SPD=115200
	LIDARSPD=115200
	NFREE=100
	STREND=N
	SAVE_EVENTS=0
	GPSPROXY=0
	LIDAR=1
	EVTLEN=5000
	
	  DISTMIN/DISTMAX   .
	TRIGLVL -   ,  ,    (   ),  ,        1->0;  ,    0->1.
	TRIGPAUSE -    :        ,  ,     .
	USART1SPD, LIDARSPD -      ( "Bluetooth"  "LIDAR").
	NFREE -    -,            .
	STREND -  : N - "\n", RN - "\r\n".
	SAVE_EVENTS -      - .
	GPSPROXY -    GPS  USART1.
	LIDAR -     "LIDAR":  (1)    (0).
	EVTLEN -        .

	      showconf  ,    .
	 ,   ,    .         -    store,     .      GPS:     ,         11-12 ,      1-2    2-3   .

- showshutter -      '0'       ,        ,  .

- showtime -        (..   ,  ,    ).        "Chrono",       mesg,      cls,        .

- stauto -         N .      N     1  5.        ,    ,    N,    /,     N == '+'  '-'.      1     stauto-,   .    ,  stauto    ,  +/-  1..5.        .           ,       stonce. 

- stonce -        N .        28   .         ,  29     (  30 ),   59    "!".   -      -         :      ( )  ,   -  "A"    "O"   .

- store -     - .      ,    .    ,        "Success!",      "Error: can't save data!".

- stortest -   -     .

- strend -   : "\r\n" (  R  r)  "\n" (  N  n).

- time -    ,       , , 55725.961 (15:28:45).   UTC!!!   -         UTC,     .

- triglevel -   .  N -   (0..2), S -  (0/1). ,   0    1->0,   
	triglevel00
   2    0->1,
	triglevel21
	
- trigpause -     N,   .   0,   ,       .       ""     ""  .  50   .

- trigtimeN -      N, ,   trigtime0,   :
	TRIG0=45212.930 (12:33:32)
      ,  :
	TRIG2=0.000 (00:00:00)
	
- usartspd -    USART1 ("Bluetooth").

- usbreset -    USB ( DP  +3.3    ).

- vdd -     GPS (3.3).


******  ******

        "Chrono",     (     ,      buzzer).     -    (SAVE_EVENTS).   UART1  UART3   (USART1SPD  LIDARSPD).    (1->0  0->1)    (TRIGLVL). 

   ,   TRIGLVL ( ,   USART1SPD  LIDARSPD)       ,         store     reset   . 

        , ..    " ". 

         "showtime".        ,   ,     .

     "stonce"  "stauto".                .  30      ,     1   "!".
     ,    "!"    "stonce",             .

 "showshutter"  /      .  "gate"        .     -  ,   "se".

       "cls",    (7-8 )   "mesg".

          "dump"  ( N  )  "ndump" ( N- ,  N<0 -  |N|-    ).  "ndump"       (   "showtime").
