PWM¶
4G LTE Module PWM Channel Mapping¶
PWM Channel |
EC600U |
EC200U |
N58 |
N716 |
L610 |
|---|---|---|---|---|---|
PWM CH 0 |
Pin 70 |
Pin 135 |
Pin 39 |
Pin 38 |
Pin 135 |
PWM CH 1 |
Pin 54 |
Pin 5 |
– |
Pin 67 |
Pin 5 |
GSM/NB-IoT Module PWM Channel Mapping¶
PWM Channel |
MC20U Pin
|
M56 Pin |
MC60 Pin
|
M66 Pin |
BC20 Pin |
SIM868 Pin |
|---|---|---|---|---|---|---|
PWM CH 0 |
Pin 47 |
Pin 12 |
Pin 47 |
Pin 16 |
Pin 47 |
Pin 6 |
PWM CH 1 |
Pin 28 |
Pin 27 |
Pin 28 |
– |
Pin 3 |
Pin 57 |
PWM CH 2 |
– |
– |
– |
– |
Pin 36 |
– |
PWM CH 4 |
– |
– |
– |
– |
Pin 61 |
– |
API Reference¶
Header File¶
Functions¶
-
int
pwm_init(int ch)¶ Initialize PWM channel and setup pin-muxing. This function must be called before calling any other PWM function.
- Return
0 on success, negative value on error
- Parameters
ch: PWM Channel pwmch_e
-
int
pwm_config(int ch, unsigned int freq, unsigned int cycle)¶ Configure PWM channel parameters
- Return
0 on success, negative value on error
- Parameters
ch: PWM Channel to configure pwmch_efreq: PWM Frequency to setcycle: PWM Duty cycle
-
int
pwm_start(int ch)¶ Start PWM output
- Return
0 on success, negative value on error
- Parameters
ch: PWM Channel to start pwmch_e
-
int
pwm_stop(int ch)¶ Stop PWM output
- Return
0 on success, negative value on error
- Parameters
ch: PWM Channel to stop pwmch_e
-
int
pwm_free(int ch)¶ Release PWM channel and IO function changed to GPIO
- Return
0 on success, negative value on error
- Parameters
ch: PWM Channel to free pwmch_e
Note
Please refer header file for actual number of channels available for respective board.
Header File¶
Enumerations¶
-
enum
pwm1_prd_e¶ PWM Channel 1 - Fixed Period in milliseconds
- Note
: Only for Platform with RDA8910 SoC
Values:
-
enumerator
PWM1_PRD_125MS¶
-
enumerator
PWM1_PRD_250MS¶
-
enumerator
PWM1_PRD_500MS¶
-
enumerator
PWM1_PRD_1000MS¶
-
enumerator
PWM1_PRD_1500MS¶
-
enumerator
PWM1_PRD_2000MS¶
-
enumerator
PWM1_PRD_2500MS¶
-
enumerator
PWM1_PRD_3000MS¶
-
enum
pwm1_duty_e¶ PWM Channel 1 - Fixed Ontime/Duty cycle in milliseconds
- Note
: Only for Platform with RDA8910 SoC
Values:
-
enumerator
PWM1_DUTY_UNDEFINE¶
-
enumerator
PWM1_DUTY_15_6MS¶
-
enumerator
PWM1_DUTY_31_2MS¶
-
enumerator
PWM1_DUTY_46_8MS¶
-
enumerator
PWM1_DUTY_62MS¶
-
enumerator
PWM1_DUTY_78MS¶
-
enumerator
PWM1_DUTY_94MS¶
-
enumerator
PWM1_DUTY_110MS¶
-
enumerator
PWM1_DUTY_125MS¶
-
enumerator
PWM1_DUTY_140MS¶
-
enumerator
PWM1_DUTY_156MS¶
-
enumerator
PWM1_DUTY_172MS¶
-
enumerator
PWM1_DUTY_188MS¶
-
enumerator
PWM1_DUTY_200MS¶
-
enumerator
PWM1_DUTY_218MS¶
-
enumerator
PWM1_DUTY_234MS¶
