Skip to main content

imp.setpoweren(state)

Attempts to change the state of certain imps’ POWER_EN pin

Availability

Device

Parameters

Name Type Description
state Bool Whether to enable (true) or disable (false) POWER_EN

Returns

Nothing

Description

When optimizing a design for lowest power, it is possible to take advantage of the fact that rest of the imp will run, offline, on lower voltages than that needed to power the WiFi chip. On certain solder-down imp modules only — specifically the imp002 (now out of production) and the imp003 (Murata part LBWA1ZV1CD) — the high-power (3.3V) mode that is necessary for the WiFi to work is driven by a specific pin, POWER_EN. When the WiFi is instructed to power down — when code calls server.disconnect(), for example — POWER_EN is set low.

Sometimes, however, the imp may require the 3.3V mode, even when the WiFi is off — to power a blue LED, for example. So for certain solder-down modules only (see list above), the imp API provides the ability to request POWER_EN explicitly. It is a request, not a command: POWER_EN is a shared resource, so calling

imp.setpoweren(false);

won’t drive the line low if it’s being driven high for other reasons: for instance, if the WiFi is currently powered on.

Parameter Description
true Require POWER_EN high
false Don’t require POWER_EN high

This function only exists on certain solder-down imps. Attempting to call this function on an imp001 card will cause an exception to be thrown. The imp005 module ignores this call.