Modifications

Sauter à la navigation Sauter à la recherche
1 833 octets ajoutés ,  27 avril 2025 à 23:43
Ligne 208 : Ligne 208 :  
== PicoControler ==
 
== PicoControler ==
   −
'''PicoControler''' : Base class for myDin solution based on Raspberry-Pi Pico microcontroler. PicoControler inherits of DinControler (and all its behavior). At the PicoContoler level, we can create object related to microcontroler hardware that will be shared accross all the descendant classes. At the PicoControler level we can define the common I2C bus, RTC clock, internal temperature sensor, watchdog and other common ressources.
+
=== Header ===
 +
 
 +
{{prop|Ancestor| DinControler }}
 +
{{prop|Class | '''PicoControler'''}}
 +
{{prop|Module | pico }}
 +
{{prop|DIN Size | Any size }}
 +
{{prop|Descr | Base class for myDin solution based on Raspberry-Pi Pico microcontroler. }}
 +
 
 +
 
 +
PicoControler inherits of the DinControler behaviors.  
 +
 
 +
At the PicoContoler level, the class createse objects related to microcontroler hardware, objects that will be shared among all the PicoControler descendant.
 +
 
 +
PicoControler creates:
 +
* the common I2C bus,  
 +
* the MCU RTC clock,  
 +
* the status Pin,
 +
* access to internal temperature sensor,  
 +
* implementation for the watchdog.
 +
 
 +
=== Attributes ===
 +
==== status : Pin ====
 +
Allow to control the status pin. The status pin is usually connected to a status LED. It's status can be modified by the user code.
 +
 
 +
==== i2c : I2C ====
 +
Instance of the internal I2C bus connected to the RTC clock and other I2C components of the future controler implementations.
 +
 
 +
The internal I2C bus will also be exposed on the interfaces connectors. This way, the user code doesn't needs to create an instance of I2C bus and can reuse this existing instance.
 +
 
 +
==== mcu_rtc : RTC ====
 +
Internal MCU hardware clock. Access to its date information reliable and bus access pretty fast. Unfortunately, clock is reset to zero at each power cycle.
 +
 
 +
When the software starts, the myDin code copy time & date from and external RTC to the internal MCU RTC.
 +
 
 +
Remarks: the external RTC clock is not used for software operation because the I2C bus is quite slower compared to the internal MCU buses accessing the MCU RTC.
 +
 
 +
==== adc4 : ADC ====
 +
Access to the internal ADC (the 4th one) wired to the MCU temperature sensor. That instance doesn't need to be directly accessed (see the {{fname|internal_temperature}} property).
 +
 
 +
==== internal_temperature : float ====
 +
This property uses the {{fname|adc4}} connected to an analog temperature sensor place inside the die of the Pico MCU.
 +
 
 +
Even if not precise, this sensor can provide a rough idea of the temperature inside the DIN case. A high temperature may indicates a malfunctioning situation.
 +
 
 +
==== wdt: Watchdog ====
 +
Reference to the watchdog instance or None.
 +
 
 +
The instance of the watchdog is created only when the watchdog is configured ( with {{fname|setup_watchdog()}} ).
32 908

modifications

Menu de navigation