Created
January 2, 2019 08:04
-
-
Save TG9541/4581956c0a1b590be7c18cc8724ac5b5 to your computer and use it in GitHub Desktop.
TM8 eForth MODBUS - stubs for bus media access
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ 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