Home
last modified time | relevance | path

Searched refs:pwm (Results 1 – 25 of 37) sorted by relevance

12

/AliOS-Things-master/components/drivers/peripheral/pwm/src/
A Dpwm.c40 aos_pwm_t *pwm; in aos_pwm_set_attr() local
64 ret = pwm->ops->apply(pwm, &l_attr); in aos_pwm_set_attr()
78 aos_pwm_t *pwm; in aos_pwm_get_attr() local
96 pwm->ops->unregister(pwm); in dev_pwm_unregister()
105 return pwm->ops->startup(pwm); in dev_pwm_get()
114 pwm->ops->shutdown(pwm); in dev_pwm_put()
115 pwm->period = 0; in dev_pwm_put()
117 pwm->enabled = 0; in dev_pwm_put()
134 if ((pwm->ops == NULL) || (pwm->ops->unregister == NULL) || in aos_pwm_register()
135 (pwm->ops->apply == NULL) || (pwm->ops->shutdown == NULL) || in aos_pwm_register()
[all …]
A Dpwm_csi.c10 static void pwm_csi_unregister(aos_pwm_t *pwm) in pwm_csi_unregister() argument
12 aos_pwm_csi_t *aos_csi_pwm = aos_container_of(pwm, aos_pwm_csi_t, aos_pwm); in pwm_csi_unregister()
17 static aos_status_t pwm_csi_startup(aos_pwm_t *pwm) in pwm_csi_startup() argument
22 static void pwm_csi_shutdown(aos_pwm_t *pwm) in pwm_csi_shutdown() argument
24 aos_pwm_csi_t *aos_csi_pwm = aos_container_of(pwm, aos_pwm_csi_t, aos_pwm); in pwm_csi_shutdown()
28 static aos_status_t pwm_csi_apply(aos_pwm_t *pwm, aos_pwm_attr_t const *attr) in pwm_csi_apply() argument
33 aos_pwm_csi_t *aos_csi_pwm = aos_container_of(pwm, aos_pwm_csi_t, aos_pwm); in pwm_csi_apply()
/AliOS-Things-master/components/amp_adapter/platform/aos/peripheral/
A Daos_hal_pwm.c24 if (!pwm || pwm->priv) in aos_hal_pwm_init()
56 pwm->priv = p_fd; in aos_hal_pwm_init()
75 if (!pwm) in aos_hal_pwm_start()
78 p_fd = (int32_t *)pwm->priv; in aos_hal_pwm_start()
100 if (!pwm) in aos_hal_pwm_stop()
103 p_fd = (int32_t *)pwm->priv; in aos_hal_pwm_stop()
125 if (!pwm) in aos_hal_pwm_para_chg()
128 p_fd = (int32_t *)pwm->priv; in aos_hal_pwm_para_chg()
156 if (!pwm || !pwm->priv) in aos_hal_pwm_finalize()
159 p_fd = (int32_t *)pwm->priv; in aos_hal_pwm_finalize()
[all …]
/AliOS-Things-master/hardware/chip/rtl872xd/hal/
A Dpwm.c45 int32_t hal_pwm_init(pwm_dev_t *pwm) in hal_pwm_init() argument
48 period_us = 1000000/pwm->config.freq; in hal_pwm_init()
50 pwm->priv = &(PWM[pwm->port]); in hal_pwm_init()
53 pwmout_init( pwm->priv , port2pin[pwm->port][1]); in hal_pwm_init()
55 pwmout_period_us(pwm->priv , period_us); in hal_pwm_init()
57 pwmout_write(pwm->priv , pwm->config.duty_cycle); in hal_pwm_init()
70 int32_t hal_pwm_start(pwm_dev_t *pwm) in hal_pwm_start() argument
72 pwmout_start(pwm->priv); in hal_pwm_start()
83 int32_t hal_pwm_stop(pwm_dev_t *pwm) in hal_pwm_stop() argument
85 pwmout_stop(pwm->priv); in hal_pwm_stop()
[all …]
/AliOS-Things-master/hardware/chip/haas1000/hal/
A Dpwm.c49 int32_t hal_pwm_init(pwm_dev_t *pwm) in hal_pwm_init() argument
52 if (pwm->priv != NULL) { in hal_pwm_init()
61 if (inited[pwm->port] == 0) { in hal_pwm_init()
62 hal_iomux_init(&pinmux_pwm[pwm->port], 1); in hal_pwm_init()
72 inited[pwm->port] = 1; in hal_pwm_init()
77 pwm->priv = (void *)_cfg; in hal_pwm_init()
89 int32_t hal_pwm_start(pwm_dev_t *pwm) in hal_pwm_start() argument
108 int32_t hal_pwm_stop(pwm_dev_t *pwm) in hal_pwm_stop() argument
148 int32_t hal_pwm_finalize(pwm_dev_t *pwm) in hal_pwm_finalize() argument
154 hal_pwm_stop(pwm); in hal_pwm_finalize()
[all …]
/AliOS-Things-master/components/py_engine/tests/haas/HaaS100/python-apps/driver/pwm/
A Dmain.py5 pwm = PWM() variable
6 pwm.open("pwm1")
7 duty = pwm.getDuty()
8 freq = pwm.getFreq()
12 duty = pwm.getDuty()
13 freq = pwm.getFreq()
16 pwm.setDuty(0.7)
17 pwm.setFreq(3260000)
18 duty = pwm.getDuty()
19 freq = pwm.getFreq()
[all …]
/AliOS-Things-master/components/py_engine/tests/haas/HaaSEdu/python-apps/driver/pwm/
A Dmain.py5 pwm = PWM() variable
6 pwm.open("pwm1")
7 duty = pwm.getDuty()
8 freq = pwm.getFreq()
12 duty = pwm.getDuty()
13 freq = pwm.getFreq()
16 pwm.setDuty(0.7)
17 pwm.setFreq(3260000)
18 duty = pwm.getDuty()
19 freq = pwm.getFreq()
[all …]
/AliOS-Things-master/components/csi/csi2/include/drv/
A Dpwm.h55 csi_error_t csi_pwm_init(csi_pwm_t *pwm, uint32_t idx);
62 void csi_pwm_uninit(csi_pwm_t *pwm);
73 csi_error_t csi_pwm_out_config(csi_pwm_t *pwm,
85 csi_error_t csi_pwm_out_start(csi_pwm_t *pwm, uint32_t channel);
93 void csi_pwm_out_stop(csi_pwm_t *pwm, uint32_t channel);
103 csi_error_t csi_pwm_capture_config(csi_pwm_t *pwm,
114 csi_error_t csi_pwm_capture_start(csi_pwm_t *pwm, uint32_t channel);
122 void csi_pwm_capture_stop(csi_pwm_t *pwm, uint32_t channel);
138 void csi_pwm_detach_callback(csi_pwm_t *pwm);
145 csi_error_t csi_pwm_enable_pm(csi_pwm_t *pwm);
[all …]
/AliOS-Things-master/hardware/chip/rtl872xd/csi_driver/pwm/
A Dpwm.c43 csi_error_t csi_pwm_init(csi_pwm_t *pwm, uint32_t idx) in csi_pwm_init() argument
45 if (!pwm) in csi_pwm_init()
52 pwm->dev.idx = idx << BIT_PWM_TIM_IDX_SHIFT; in csi_pwm_init()
57 void csi_pwm_uninit(csi_pwm_t *pwm) in csi_pwm_uninit() argument
59 uint32_t pwm_chan = pwm->dev.idx & (~BIT_PWM_TIM_IDX_FLAG); in csi_pwm_uninit()
60 uint8_t pwm_tim_idx = pwm->dev.idx >> BIT_PWM_TIM_IDX_SHIFT; in csi_pwm_uninit()
75 if (pwm && pwm->priv) { in csi_pwm_uninit()
76 free(pwm->priv); in csi_pwm_uninit()
77 pwm->priv = NULL; in csi_pwm_uninit()
106 pwm->dev.idx |= channel; in csi_pwm_out_config()
[all …]
/AliOS-Things-master/components/amp_adapter/platform/linux/peripheral/
A Daos_hal_pwm.c9 int32_t aos_hal_pwm_init(pwm_dev_t *pwm) in aos_hal_pwm_init() argument
12 printf ("[%s] freq = %d \r\n", __FUNCTION__, pwm->config.freq); in aos_hal_pwm_init()
13 printf ("[%s] duty_cycle = %d \r\n", __FUNCTION__, pwm->config.duty_cycle); in aos_hal_pwm_init()
18 int32_t aos_hal_pwm_start(pwm_dev_t *pwm) in aos_hal_pwm_start() argument
21 printf ("[%s] freq = %d \r\n", __FUNCTION__, pwm->port); in aos_hal_pwm_start()
26 int32_t aos_hal_pwm_stop(pwm_dev_t *pwm) in aos_hal_pwm_stop() argument
28 printf ("[%s] freq = %d \r\n", __FUNCTION__, pwm->port); in aos_hal_pwm_stop()
33 int32_t aos_hal_pwm_para_chg(pwm_dev_t *pwm, pwm_config_t para) in aos_hal_pwm_para_chg() argument
41 int32_t aos_hal_pwm_finalize(pwm_dev_t *pwm) in aos_hal_pwm_finalize() argument
/AliOS-Things-master/components/drivers/peripheral/pwm/
A DREADME.md1 @page pwm pwm
12 * /dev/pwm[CONFIG_PWM_NUM - 1]
22 pwm/
30 │   │   │   └── pwm.h
31 │   │   ├── pwm.h
38 ├── pwm.c
91 - pwm: master # helloworld_demo中引入pwm组件
101 aos install pwm
137 pwm_example # 执行pwm vfs api 示例
144 pwm comp output test success!
[all …]
/AliOS-Things-master/hardware/board/haaseduk1/board_test/
A Dpwm_test.c16 pwm_dev_t pwm = {0, {0.0, 25}, NULL}; in pwm_test_process() local
18 pwm.port = k; in pwm_test_process()
20 ret = hal_pwm_init(&pwm); in pwm_test_process()
26 ret = hal_pwm_start(&pwm); in pwm_test_process()
36 hal_pwm_para_chg(&pwm, para); in pwm_test_process()
41 hal_pwm_para_chg(&pwm, para); in pwm_test_process()
45 hal_pwm_stop(&pwm); in pwm_test_process()
46 hal_pwm_finalize(&pwm); in pwm_test_process()
/AliOS-Things-master/components/amp_adapter/include/peripheral/
A Daos_hal_pwm.h39 int32_t aos_hal_pwm_init(pwm_dev_t *pwm);
48 int32_t aos_hal_pwm_start(pwm_dev_t *pwm);
57 int32_t aos_hal_pwm_stop(pwm_dev_t *pwm);
67 int32_t aos_hal_pwm_para_chg(pwm_dev_t *pwm, pwm_config_t para);
76 int32_t aos_hal_pwm_finalize(pwm_dev_t *pwm);
/AliOS-Things-master/components/drivers/peripheral/pwm/include/aos/hal/
A Dpwm.h39 int32_t hal_pwm_init(pwm_dev_t *pwm);
48 int32_t hal_pwm_start(pwm_dev_t *pwm);
57 int32_t hal_pwm_stop(pwm_dev_t *pwm);
67 int32_t hal_pwm_para_chg(pwm_dev_t *pwm, pwm_config_t para);
76 int32_t hal_pwm_finalize(pwm_dev_t *pwm);
/AliOS-Things-master/components/drivers/peripheral/pwm/include/aos/
A Dpwm_core.h43 void (*unregister)(aos_pwm_t *pwm);
45 aos_status_t (*startup)(aos_pwm_t *pwm);
47 void (*shutdown)(aos_pwm_t *pwm);
49 aos_status_t (*apply)(aos_pwm_t *pwm, aos_pwm_attr_t const *attr);
63 aos_status_t aos_pwm_register(aos_pwm_t *pwm);
/AliOS-Things-master/hardware/chip/haas1000/aos_driver/pwm/
A Dpwm.c40 static void haas1000_pwm_uninit(haas1000_pwm_t *pwm) in haas1000_pwm_uninit() argument
45 int haas1000_pwm_out_config(haas1000_pwm_t *pwm, uint32_t channel, uint32_t period_ns, in haas1000_pwm_out_config() argument
81 static void haas1000_pwm_unregister(aos_pwm_t *pwm) in haas1000_pwm_unregister() argument
83 haas1000_pwm_t *pwm_dev = aos_container_of(pwm, haas1000_pwm_t, aos_pwm); in haas1000_pwm_unregister()
88 static int haas1000_pwm_startup(aos_pwm_t *pwm) in haas1000_pwm_startup() argument
93 static void haas1000_pwm_shutdown(aos_pwm_t *pwm) in haas1000_pwm_shutdown() argument
95 haas1000_pwm_t *pwm_dev = aos_container_of(pwm, haas1000_pwm_t, aos_pwm); in haas1000_pwm_shutdown()
99 static int haas1000_pwm_apply(aos_pwm_t *pwm, aos_pwm_attr_t const *attr) in haas1000_pwm_apply() argument
104 haas1000_pwm_t *pwm_dev = aos_container_of(pwm, haas1000_pwm_t, aos_pwm); in haas1000_pwm_apply()
/AliOS-Things-master/hardware/chip/haas1000/csi/
A Dpwm.c23 csi_error_t csi_pwm_init(csi_pwm_t *pwm, uint32_t idx) in csi_pwm_init() argument
28 void csi_pwm_uninit(csi_pwm_t *pwm) in csi_pwm_uninit() argument
33 csi_error_t csi_pwm_out_config(csi_pwm_t *pwm, uint32_t channel, uint32_t period_us, in csi_pwm_out_config() argument
51 csi_error_t csi_pwm_out_start(csi_pwm_t *pwm, uint32_t channel) in csi_pwm_out_start() argument
57 void csi_pwm_out_stop(csi_pwm_t *pwm, uint32_t channel) in csi_pwm_out_stop() argument
/AliOS-Things-master/components/libc_stub/compilers/armlibc/
A Dhal_stub.c25 WEAK int hal_pwm_finalize(pwm_dev_t *pwm) in hal_pwm_finalize() argument
30 WEAK int hal_pwm_init(pwm_dev_t *pwm) in hal_pwm_init() argument
36 WEAK int hal_pwm_start(pwm_dev_t *pwm) in hal_pwm_start() argument
42 WEAK int hal_pwm_stop(pwm_dev_t *pwm) in hal_pwm_stop() argument
/AliOS-Things-master/solutions/eduk1_demo/k1_apps/musicbox/
A Dmusicbox.md49 值得注意的是,在tone方法中,pwm的占空比固定设置为0.5,这代表在一个震动周期内,蜂鸣器的振膜总是一半时间在上,一半时间在下。在这里改变占空比并不会改变蜂鸣器的功率,所以音量大小不会改变。
55 pwm_dev_t pwm = {port, {0.5, frequency}, NULL}; // 设定pwm 频率为设定频率
56 if (frequency > 0) // 频率值合法才会初始化pwm
58 hal_pwm_init(&pwm);
59 hal_pwm_start(&pwm);
67 hal_pwm_stop(&pwm);
68 hal_pwm_finalize(&pwm);
74 pwm_dev_t pwm = {port, {0.5, 1}, NULL}; // 关闭对应端口的pwm输出
75 hal_pwm_stop(&pwm);
76 hal_pwm_finalize(&pwm);
/AliOS-Things-master/hardware/chip/rtl872xd/aos_driver/pwm/
A Dpwm.c166 static void rtl872xd_pwm_unregister(aos_pwm_t *pwm) in rtl872xd_pwm_unregister() argument
168 rtl872xd_pwm_t *pwm_dev = aos_container_of(pwm, rtl872xd_pwm_t, aos_pwm); in rtl872xd_pwm_unregister()
173 static int rtl872xd_pwm_startup(aos_pwm_t *pwm) in rtl872xd_pwm_startup() argument
178 static void rtl872xd_pwm_shutdown(aos_pwm_t *pwm) in rtl872xd_pwm_shutdown() argument
180 rtl872xd_pwm_t *pwm_dev = aos_container_of(pwm, rtl872xd_pwm_t, aos_pwm); in rtl872xd_pwm_shutdown()
184 static int rtl872xd_pwm_apply(aos_pwm_t *pwm, aos_pwm_attr_t const *attr) in rtl872xd_pwm_apply() argument
189 rtl872xd_pwm_t *pwm_dev = aos_container_of(pwm, rtl872xd_pwm_t, aos_pwm); in rtl872xd_pwm_apply()
/AliOS-Things-master/components/amp/example-js/
A Dpwm.js2 var pwm = require('pwm');
5 var pwm1 = pwm.open({
46 pwm1 = pwm.open({
/AliOS-Things-master/solutions/javascript_demo/board/haas600/
A Dpwm.js19 import * as pwm from 'pwm'
24 var pwm1 = pwm.open({
69 pwm1 = pwm.open({
/AliOS-Things-master/solutions/javascript_demo/board/haas-edu-k1/
A Dpwm.js19 import * as pwm from 'pwm'
24 var pwm1 = pwm.open({
/AliOS-Things-master/solutions/javascript_demo/board/haas100/
A Dpwm.js37 import * as pwm from 'pwm'
42 var pwm1 = pwm.open({
/AliOS-Things-master/hardware/chip/rtl872xd/hal/hal_test/pwm/
A Daos.mk5 $(NAME)_SUMMARY := testcase for pwm

Completed in 32 milliseconds

12