Type Alias rp2040_pac::pwm::ch::csr::W

source ·
pub type W = W<CSR_SPEC>;
Expand description

Register CSR writer

Aliased Type§

struct W { /* private fields */ }

Implementations§

source§

impl W

source

pub fn en(&mut self) -> EN_W<'_, CSR_SPEC>

Bit 0 - Enable the PWM channel.

source

pub fn ph_correct(&mut self) -> PH_CORRECT_W<'_, CSR_SPEC>

Bit 1 - 1: Enable phase-correct modulation. 0: Trailing-edge

source

pub fn a_inv(&mut self) -> A_INV_W<'_, CSR_SPEC>

Bit 2 - Invert output A

source

pub fn b_inv(&mut self) -> B_INV_W<'_, CSR_SPEC>

Bit 3 - Invert output B

source

pub fn divmode(&mut self) -> DIVMODE_W<'_, CSR_SPEC>

Bits 4:5

source

pub fn ph_ret(&mut self) -> PH_RET_W<'_, CSR_SPEC>

Bit 6 - Retard the phase of the counter by 1 count, while it is running.
Self-clearing. Write a 1, and poll until low. Counter must be running.

source

pub fn ph_adv(&mut self) -> PH_ADV_W<'_, CSR_SPEC>

Bit 7 - Advance the phase of the counter by 1 count, while it is running.
Self-clearing. Write a 1, and poll until low. Counter must be running
at less than full speed (div_int + div_frac / 16 > 1)

source

pub unsafe fn bits(&mut self, bits: u32) -> &mut Self

Writes raw bits to the register.

§Safety

Passing incorrect value can cause undefined behaviour. See reference manual