mcauser / micropython-max7219

MicroPython driver for MAX7219 8x8 LED matrix modules, cascadable and with framebuf
MIT License
182 stars 57 forks source link

Add method to switch to shutdown mode #7

Open jose1711 opened 2 years ago

jose1711 commented 2 years ago

From datasheet:

The devices include a 150μA low-power shutdown mode.. .. Shutdown Mode When the MAX7219 is in shutdown mode, the scan oscillator is halted, all segment current sources are pulled to ground, and all digit drivers are pulled to V+, thereby blanking the display. The MAX7221 is identical, except the drivers are high-impedance. Data in the digit and control registers remains unaltered. Shutdown can be used to save power or as an alarm to flash the display by successively entering and leaving shutdown mode. For minimum supply current in shutdown mode, logic inputs should be at ground or V+ (CMOS-logic levels).

It is possible to initiate the shutdown mode by calling a private method:

display._write(const(12), 0)

but calling a public method (e. g. display.shutdown) would be nicer.