Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.pwm

PROTOCOLS

Pwm

Defined in fuchsia.hardware.pwm/pwm.fidl

Disable

Disables the PWM. @Returns : |s| : ZX_OK if success.

Request

NameType

Response

NameType
s zx/status

Enable

Enables the PWM. @Returns : |s| : ZX_OK if success.

Request

NameType

Response

NameType
s zx/status

GetConfig

Gets the current config of the PWM. @Returns : |s| : ZX_OK if success. @Returns : |config| : current config of PWM.

Request

NameType

Response

NameType
s zx/status
config PwmConfig

SetConfig

Sets the configurations of the PWM |config| : Configurations. @Returns : |s| : ZX_OK if success.

Request

NameType
config PwmConfig

Response

NameType
s zx/status

PwmImpl

Defined in fuchsia.hardware.pwm/pwm.fidl

Disable

Disables the PWM. |idx| : Index of requested PWM. @Returns : |s| : ZX_OK if success.

Request

NameType
idx uint32

Response

NameType
s zx/status

Enable

Enables the PWM. |idx| : Index of requested PWM. @Returns : |s| : ZX_OK if success.

Request

NameType
idx uint32

Response

NameType
s zx/status

GetConfig

Gets the current config of the PWM. |idx| : Index of requested PWM. @Returns: |s| : ZX_OK if success. @Returns : |config| : current config of PWM.

Request

NameType
idx uint32

Response

NameType
s zx/status
config PwmConfig

SetConfig

Sets the configurations of the PWM. |idx| : Index of requested PWM. |config| : Configurations. @Returns : |s| : ZX_OK if success.

Request

NameType
idx uint32
config PwmConfig

Response

NameType
s zx/status

STRUCTS

PwmConfig

Defined in fuchsia.hardware.pwm/pwm.fidl

NameTypeDescriptionDefault
polarity bool No default
period_ns uint32 No default
duty_cycle float32

duty_cycle range: [0.0, 100.0]

No default
mode_config vector<uint8>

mode_config should be mode specific parameters. The first parameter should always be mode. For example, a PWM supporting regular mode and 2 timer mode should have: struct mode_config_regular {};

struct mode_config_two_timer { uint32_t period_ns2; float duty_cycle2; uint8_t timer1; uint8_t timer2; };

struct mode_config { uint32_t mode; union { struct mode_config_regular regular; struct mode_config_two_timer two_timer; }; };

No default