librpipPwmStatusWrite

uint32_t librpipPwmStatusWrite(uint32_t id, uint32_t status);

Description

Enables or disables a PWM. Note that as the PWM is hardware based, it will stay on even when librpip has been closed and your programme has quit.

Parameters

Returns

0 on failure, 1 on success.

Example

Configure then enable PWM0:

uint32_t feature_set, status;
feature_set = librpipInit(LIBRPIP_BOARD_DETECT, LIBRPIP_FLAG_DEBUG_ON, 0);
if(feature_set & LIBRPIP_FEATURE_PWM0) { 
        librpipPwmConfigWrite(0, 10000, 5000, LIBRPIP_PWM_FLAG_POLARITY_NORMAL);
        librpipPwmStatusWrite(0, LIBRPIP_PWM_STATUS_ON);
}
librpipClose();