mirror of
https://github.com/Fishwaldo/bl_mcu_sdk.git
synced 2025-07-23 05:08:45 +00:00
[fix][examples] modify some demos peripheral init parameters,update ld file
This commit is contained in:
parent
ee03cdc86e
commit
48479d0e20
33 changed files with 544 additions and 626 deletions
|
@ -45,9 +45,9 @@ int main(void)
|
|||
struct device *led_breath = device_find("led_breath");
|
||||
|
||||
if (led_breath) {
|
||||
PWM_DEV(led_breath)->period = 32; //frequence = 32M/1/32 = 1Mhz
|
||||
PWM_DEV(led_breath)->threshold_low = 16;
|
||||
PWM_DEV(led_breath)->threshold_high = 32;
|
||||
PWM_DEV(led_breath)->period = 10; //frequence = 32K/32/10 = 100HZ
|
||||
PWM_DEV(led_breath)->threshold_low = 5;
|
||||
PWM_DEV(led_breath)->threshold_high = 10;
|
||||
device_open(led_breath, DEVICE_OFLAG_STREAM_TX);
|
||||
pwm_channel_start(led_breath);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
**board/bl706_iot/pinmux_config.h** 中 **CONFIG_GPIO22_FUNC** 选择 **GPIO_FUN_PWM**
|
||||
|
||||
**board/bl706_iot/clock_config.h** 中
|
||||
**board/bl706_iot/clock_config.h** 中
|
||||
|
||||
- **BSP_PWM_CLOCK_SOURCE** 选择 **ROOT_CLOCK_SOURCE_XCLK**,
|
||||
- **BSP_PWM_CLOCK_DIV** 设置成 **1**
|
||||
- **BSP_PWM_CLOCK_SOURCE** 选择 **ROOT_CLOCK_SOURCE_32K_CLK**,
|
||||
- **BSP_PWM_CLOCK_DIV** 设置成 **32**
|
||||
|
||||
```bash
|
||||
|
||||
|
|
|
@ -39,13 +39,13 @@ int main(void)
|
|||
struct device *pwm = device_find("pwm");
|
||||
|
||||
if (pwm) {
|
||||
PWM_DEV(pwm)->period = 32; //frequence = 32M/1/32 = 1Mhz
|
||||
PWM_DEV(pwm)->threshold_low = 16;
|
||||
PWM_DEV(pwm)->threshold_high = 32;
|
||||
PWM_DEV(pwm)->it_pulse_count = 16;
|
||||
PWM_DEV(pwm)->period = 10; //frequence = 32k/32/10 = 100hz
|
||||
PWM_DEV(pwm)->threshold_low = 5;
|
||||
PWM_DEV(pwm)->threshold_high = 10;
|
||||
PWM_DEV(pwm)->it_pulse_count = 200; //after 2s go isr 2s = 1/100hz*200
|
||||
device_open(pwm, DEVICE_OFLAG_INT_TX);
|
||||
device_set_callback(pwm, pwm_irq_callback);
|
||||
//pwm_it_pulse_count_update(pwm, 16);
|
||||
//pwm_it_pulse_count_update(pwm, 200);
|
||||
pwm_channel_start(pwm);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
**board/bl706_iot/pinmux_config.h** 中 **CONFIG_GPIO22_FUNC** 选择 **GPIO_FUN_PWM**
|
||||
|
||||
**board/bl706_iot/clock_config.h** 中
|
||||
**board/bl706_iot/clock_config.h** 中
|
||||
|
||||
- **BSP_PWM_CLOCK_SOURCE** 选择 **ROOT_CLOCK_SOURCE_XCLK**,
|
||||
- **BSP_PWM_CLOCK_DIV** 设置成 **1**
|
||||
- **BSP_PWM_CLOCK_SOURCE** 选择 **ROOT_CLOCK_SOURCE_32K_CLK**,
|
||||
- **BSP_PWM_CLOCK_DIV** 设置成 **32**
|
||||
|
||||
```bash
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue