## CMSIS PWM Driver Function Documentation

### PWM_GetVersion

ARM_DRIVER_VERSION PWM_GetVersion()

Get driver version.

Location: Driver_PWM.c:21

Return

ARM_DRIVER_VERSION

### PWM_Initialize

int32_t PWM_Initialize()

Initialize PWM driver with default configuration.

Location: Driver_PWM.c:22

Return

execution_status

### PWM_Configure

int32_t PWM_Configure(PWM_SEL_t sel, const PWM_CFG_t * pwm_cfg)

Configure PWM common setting.

Location: Driver_PWM.c:23

Parameters

Direction | Name | Description
--- | --- | ---
in | sel | PWM to be configured PWM_SEL_t
in | pwm_cfg | Pointer to PWM_CFG_t

Return

execution_status

### PWM_SelectClock

int32_t PWM_SelectClock(uint8_t clock_src, uint8_t slowclk_prescale)

Select the PWM clock source.

Location: Driver_PWM.c:24

Parameters

Direction | Name | Description
--- | --- | ---
in | clock_src | Clock source for the PWM block
in | slowclk_prescale | Prescale to divide SYSCLK into SLOWCLK

Return

execution_status

### PWM_Reset

int32_t PWM_Reset(PWM_SEL_t sel)

Reset the PWM.

Location: Driver_PWM.c:25

Parameters

Direction | Name | Description
--- | --- | ---
in | sel | PWM to be reset PWM_SEL_t

Return

execution_status

### PWM_SetDithering

int32_t PWM_SetDithering(PWM_SEL_t sel, uint8_t dithering)

Set the PWM dithering.

Location: Driver_PWM.c:26

Parameters

Direction | Name | Description
--- | --- | ---
in | sel | PWM to be configured PWM_SEL_t
in | dithering | PWM dithering value

Return

execution_status

### PWM_SetPeriod

int32_t PWM_SetPeriod(PWM_SEL_t sel, uint16_t period)

Set the PWM period.

Location: Driver_PWM.c:27

Parameters

Direction | Name | Description
--- | --- | ---
in | sel | PWM to be configured PWM_SEL_t
in | period | Period value

Return

execution_status

### PWM_SetDutyCycle

int32_t PWM_SetDutyCycle(PWM_SEL_t sel, uint8_t duty_cycle)

Set the PWM duty cycle (expressed in percentage)

Location: Driver_PWM.c:28

Parameters

Direction | Name | Description
--- | --- | ---
in | sel | PWM to be configured PWM_SEL_t
in | duty_cycle | Duty cycle value (expressed in percentage)

Return

execution_status

### PWM_SetHighPeriod

int32_t PWM_SetHighPeriod(PWM_SEL_t sel, uint16_t high_period)

Set the PWM duty cycle (expressed in cycles).

Location: Driver_PWM.c:29

Parameters

Direction | Name | Description
--- | --- | ---
in | sel | PWM to be configured PWM_SEL_t
in | high_period | Duty cycle value (expressed in cycles)

Return

execution_status

### PWM_SetOffset

int32_t PWM_SetOffset(PWM_SEL_t sel, uint16_t offset)

Set the offset between PWM.

Location: Driver_PWM.c:30

Parameters

Direction | Name | Description
--- | --- | ---
in | sel | PWM to be configured PWM_SEL_t
in | offset | Offset between PWM

Return

execution_status

### PWM_Start

int32_t PWM_Start(PWM_SEL_t sel)

Start the PWM.

Location: Driver_PWM.c:31

Parameters

Direction | Name | Description
--- | --- | ---
in | sel | PWM to be started PWM_SEL_t

Return

execution_status

### PWM_Stop

int32_t PWM_Stop(PWM_SEL_t sel)

Stop the PWM.

Location: Driver_PWM.c:32

Parameters

Direction | Name | Description
--- | --- | ---
in | sel | PWM to be stopped PWM_SEL_t

Return

execution_status