summaryrefslogtreecommitdiff
path: root/shared-bindings/microcontroller/Processor.c
diff options
context:
space:
mode:
authorDavePutz <dwputz@gmail.com>2020-05-19 10:32:32 -0500
committerGitHub <noreply@github.com>2020-05-19 10:32:32 -0500
commit7fa5009674c7741436fd45a3d2009019280aa6f6 (patch)
tree9b9197adc9dfc2a7f7a7466abcfc2259f842c16a /shared-bindings/microcontroller/Processor.c
parent114f06d8250b4250a7c035f3bb1a2820ca2720d2 (diff)
parent2c2b53303d17e07daa8f7a61740835d30f671a18 (diff)
Merge pull request #4 from adafruit/master
merge from adafruit
Diffstat (limited to 'shared-bindings/microcontroller/Processor.c')
-rw-r--r--shared-bindings/microcontroller/Processor.c48
1 files changed, 20 insertions, 28 deletions
diff --git a/shared-bindings/microcontroller/Processor.c b/shared-bindings/microcontroller/Processor.c
index 023f063e0..c4b249124 100644
--- a/shared-bindings/microcontroller/Processor.c
+++ b/shared-bindings/microcontroller/Processor.c
@@ -34,29 +34,24 @@
#include "py/runtime.h"
-//| .. currentmodule:: microcontroller
+//| class Processor:
+//| """Microcontroller CPU information and control
//|
-//| :class:`Processor` --- Microcontroller CPU information and control
-//| ------------------------------------------------------------------
+//| Usage::
//|
-//| Get information about the microcontroller CPU and control it.
-//|
-//| Usage::
-//|
-//| import microcontroller
-//| print(microcontroller.cpu.frequency)
-//| print(microcontroller.cpu.temperature)
+//| import microcontroller
+//| print(microcontroller.cpu.frequency)
+//| print(microcontroller.cpu.temperature)"""
//|
-//| .. class:: Processor()
-//|
-//| You cannot create an instance of `microcontroller.Processor`.
-//| Use `microcontroller.cpu` to access the sole instance available.
+//| def __init__(self, ):
+//| """You cannot create an instance of `microcontroller.Processor`.
+//| Use `microcontroller.cpu` to access the sole instance available."""
+//| ...
//|
-//| .. attribute:: frequency
-//|
-//| The CPU operating frequency as an `int`, in Hertz. (read-only)
+//| frequency: int = ...
+//| """The CPU operating frequency in Hertz. (read-only)"""
//|
STATIC mp_obj_t mcu_processor_get_frequency(mp_obj_t self) {
return mp_obj_new_int_from_uint(common_hal_mcu_processor_get_frequency());
@@ -72,11 +67,10 @@ const mp_obj_property_t mcu_processor_frequency_obj = {
},
};
-//| .. attribute:: temperature
+//| temperature: Any = ...
+//| """The on-chip temperature, in Celsius, as a float. (read-only)
//|
-//| The on-chip temperature, in Celsius, as a float. (read-only)
-//|
-//| Is `None` if the temperature is not available.
+//| Is `None` if the temperature is not available."""
//|
STATIC mp_obj_t mcu_processor_get_temperature(mp_obj_t self) {
float temperature = common_hal_mcu_processor_get_temperature();
@@ -93,9 +87,8 @@ const mp_obj_property_t mcu_processor_temperature_obj = {
},
};
-//| .. attribute:: uid
-//|
-//| The unique id (aka serial number) of the chip as a `bytearray`. (read-only)
+//| uid: Any = ...
+//| """The unique id (aka serial number) of the chip as a `bytearray`. (read-only)"""
//|
STATIC mp_obj_t mcu_processor_get_uid(mp_obj_t self) {
uint8_t raw_id[COMMON_HAL_MCU_PROCESSOR_UID_LENGTH];
@@ -113,11 +106,10 @@ const mp_obj_property_t mcu_processor_uid_obj = {
},
};
-//| .. attribute:: voltage
-//|
-//| The input voltage to the microcontroller, as a float. (read-only)
+//| voltage: Any = ...
+//| """The input voltage to the microcontroller, as a float. (read-only)
//|
-//| Is `None` if the voltage is not available.
+//| Is `None` if the voltage is not available."""
//|
STATIC mp_obj_t mcu_processor_get_voltage(mp_obj_t self) {
float voltage = common_hal_mcu_processor_get_voltage();