esp32 --- EDS32 に固有の機能

esp32 モジュールは、ESP32 モジュールに固有の制御を目的とした関数とクラスが含まれています。

関数

esp32.wake_on_touch(wake)

タッチでデバイスをスリープから復帰させるかどうかを設定します。 wake はブール型でなければなりません。

esp32.wake_on_ext0(pin, level)

EXT0 がデバイスをスリープから復帰させる方法を設定します。 pin には None あるいは有効な Pin オブジェクトを指定します。 level には esp32.WAKEUP_ALL_LOW または esp32.WAKEUP_ANY_HIGH を指定する必要があります。

esp32.wake_on_ext1(pins, level)

EXT1 がデバイスをスリープから復帰させる方法を設定します。 pin には None あるいは有効な Pin オブジェクトのタプル/リストを指定します。 level には esp32.WAKEUP_ALL_LOW または esp32.WAKEUP_ANY_HIGH を指定する必要があります。

esp32.raw_temperature()

内部温度センサーの素の値を読み、整数を返します。

esp32.hall_sensor()

内部ホールセンサーの素の値を読み、整数を返します。

Flash partitions

This class gives access to the partitions in the device's flash memory.

class esp32.Partition(id)

Create an object representing a partition. id can be a string which is the label of the partition to retrieve, or one of the constants: BOOT or RUNNING.

classmethod Partition.find(type=TYPE_APP, subtype=0xff, label=None)

Find a partition specified by type, subtype and label. Returns a (possibly empty) list of Partition objects.

Partition.info()

Returns a 6-tuple (type, subtype, addr, size, label, encrypted).

Partition.readblocks(block_num, buf)
Partition.writeblocks(block_num, buf)
Partition.ioctl(cmd, arg)

These methods implement the block protocol defined by uos.AbstractBlockDev.

Partition.set_boot()

Sets the partition as the boot partition.

Partition.get_next_update()

Gets the next update partition after this one, and returns a new Partition object.

定数

Partition.BOOT
Partition.RUNNING

Used in the Partition constructor to fetch various partitions.

Partition.TYPE_APP
Partition.TYPE_DATA

Used in Partition.find to specify the partition type.

超低消費電力コプロセッサ

class esp32.ULP

このクラスは超低消費電力コプロセッサへのアクセスを提供します。

ULP.set_wakeup_period(period_index, period_us)

起床期間を設定します。

ULP.load_binary(load_addr, program_binary)

与えた load_addrprogram_binary を ULP にロードします。

ULP.run(entry_point)

与えた entry_point で ULP を起動します。

定数

esp32.WAKEUP_ALL_LOW
esp32.WAKEUP_ANY_HIGH

ピンの起床レベル。