This is the documentation for the latest (main) development branch. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

PWM Output

Function Overview

Upon startup, this application performs the following operations:

  1. Initializes the PWM controller driver

  2. Binds and initializes GPIO 28 (PB12) to PWM channel 0

  3. Initializes PWM channel 0 in standalone output mode with specific parameters

  4. Starts standalone output on PWM channel 0

Environment Requirements

  1. Demo uses an EVB board

  2. board with onboard LED bind with the configured GPIO

Compilation and Flashing

Example location: examples/peripheral/pwm

For compilation and flashing instructions, refer to: Quick Start Guide

Running result

Successfully running will output the following logs

D/dt              [0.002] add device iflash
D/ptb             [0.002] partition table base 0xe000
D/ft              [0.002] ft_0 base 0, ft_1 base 1000
D/ft              [0.002] ft init too
D/ft              [0.004] ft init 1
D/main            [0.004] boot reason 0
D/main            [0.004] heap size 273032(266.63KB)
D/main            [0.004] flash size 0x200000(2MB)


 __          ____  __   _____   _______      ____   _____    _____ _          _ _ 
 \ \        / /  \/  | |_   _| |__   __|    / __ \ / ____|  / ____| |        | | |
  \ \  /\  / /| \  / |   | |  ___ | |______| |  | | (___   | (___ | |__   ___| | |
   \ \/  \/ / | |\/| |   | | / _ \| |______| |  | |\___ \   \___ \| '_ \ / _ \ | |
    \  /\  /  | |  | |  _| || (_) | |      | |__| |____) |  ____) | | | |  __/ | |
     \/  \/   |_|  |_| |_____\___/|_|       \____/|_____/  |_____/|_| |_|\___|_|_|
                                                                                  

W800: D/dt              [0.010] add device pwm
I/PWM DRV         [0.010] pwm channel initialize successfully!