Difference: TerminalIO (5 vs. 6)

Revision 62020-05-18 - PeterSchmid

Line: 1 to 1
 
META TOPICPARENT name="WebHome"
%DASHBOARD{ section="banner"
Line: 16 to 16
 
Changed:
<
<
>
>

Terminal-IO

emit? 	     ( -- Flag ) 	Ready to send a character?
key? 	     ( -- Flag ) 	Checks if a key is waiting
key 	     ( -- Char ) 	Waits for and fetches the pressed key
emit 	     ( Char -- ) 	Emits a character
hook-emit?   ( -- a-addr ) 	Hooks for redirecting terminal IO on the fly
hook-key?
hook-key
hook-emit

: ascii ( -- ) 
  127 32 do 
    i emit 
  loop 
;

: crs-ascii ( -- ) 
  127 32 do 
    i crs-emit 
  loop 
  10 crs-emit / LF
;

 

USB-CDC Words (API)


Line: 27 to 57
  uart ( -- ) redirect console to serial interface (UART) cdc ( -- ) redirect console to USB-CDC
Added:
>
>
crs ( -- ) redirect console to BLE CRS

For console redirection see terminalhooks.s.

Default console is UART, but if you press button SW2 on reset, the console is redirected to the USB-CDC device, see mecrisp.s. Default console for the dongle is USB-CDC.

UART (Serial) Words (API)

serial-emit  ( c -- ) Emit one character
serial-key   ( -- c ) Receive one character
serial-emit? ( -- ? ) Ready to send a character
serial-key?  ( -- ? ) Is there a key press ?

baudrate     ( u -- ) set baud rate (e.g. 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200)
paritybit    ( u -- ) set parity bit 0 none, 1 odd, 2 even
wordlength   ( u -- ) set word length 7, 8, 9 (including parity)
stopbits     ( u -- ) set stop bits 1, 2

uart         ( -- )   redirect console to serial interface (UART)
cdc          ( -- )   redirect console to USB-CDC
crs          ( -- )   redirect console to BLE CRS

 

For console redirection see terminalhooks.s.

Line: 35 to 90
 
Added:
>
>

BLE Cable Replacement Words (API)

crs-emit   ( c -- ) Emit one character
crs-key    ( -- c ) Receive one character
crs-emit?  ( -- ? ) Ready to send a character
crs-key?   ( -- ? ) Is there a key press ?

uart       ( -- )   redirect console to serial interface (UART)
cdc        ( -- )   redirect console to USB-CDC
crs        ( -- )   redirect console to BLE CRS

For console redirection see terminalhooks.s.

Default console is UART, but if you press button SW2 on reset, the console is redirected to the USB-CDC device, see mecrisp.s. Default console for the dongle is USB-CDC.

 
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback