Skip to content

Instantly share code, notes, and snippets.

@TG9541
Created January 2, 2019 08:04
Show Gist options
  • Save TG9541/4581956c0a1b590be7c18cc8724ac5b5 to your computer and use it in GitHub Desktop.
Save TG9541/4581956c0a1b590be7c18cc8724ac5b5 to your computer and use it in GitHub Desktop.
TM8 eForth MODBUS - stubs for bus media access
\ STM8 eForth MODBUS stubs for bus media access
\res MCU: STM8S103
\res export PB_ODR PB_DDR
#require ]B!
NVM
\ Set RS485 Driver to "RX"
: RS485rx ( -- )
[ 0 PB_ODR 5 ]B!
;
\ Set RS485 Driver to "TX"
: RS485tx ( -- )
[ 0 PB_ODR 5 ]B!
;
\ Initialize GPIO and RS485 Driver
: RS485DE ( -- )
RS485rx
[ 1 PB_DDR 5 ]B!
;
RAM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment