Page 1 of 1

RS485 driver

Posted: Wed May 06, 2020 8:04 am
by mvdw
I am developing on a board with RS485 line drivers; these are half duplex where the direction is controlled by a DE pin. This is easy to configure iun STM32Cube IDE, but how do I translate this into micropython?

I'm thinking that it may be possible to subclass the uart class with the extra DE pin functionality? For my application the micropython device is the bus master so arbitrates the bus, making the design a little easier.

Before I go reinventing the wheel has anyone done anything with RS485 and micropython?

Re: RS485 driver

Posted: Thu May 07, 2020 4:54 am
by pythoncoder
I don't know if this has already been done - a forum search might be your friend.

Re implementation in Python:
In general subclassing built-in types is not well supported by MicroPython. It's usually best to use composition rather than inheritance.