Home
last modified time | relevance | path

Searched refs:gpio (Results 1 – 25 of 46) sorted by relevance

12

/drivers/hdf_core/framework/support/platform/src/gpio/
Dgpio_if.c17 int32_t GpioRead(uint16_t gpio, uint16_t *val) in GpioRead() argument
20 struct GpioCntlr *cntlr = GpioCntlrGetByGpio(gpio); in GpioRead()
22 ret = GpioCntlrRead(cntlr, GpioCntlrGetLocal(cntlr, gpio), val); in GpioRead()
28 int32_t GpioWrite(uint16_t gpio, uint16_t val) in GpioWrite() argument
31 struct GpioCntlr *cntlr = GpioCntlrGetByGpio(gpio); in GpioWrite()
33 ret = GpioCntlrWrite(cntlr, GpioCntlrGetLocal(cntlr, gpio), val); in GpioWrite()
39 int32_t GpioSetDir(uint16_t gpio, uint16_t dir) in GpioSetDir() argument
42 struct GpioCntlr *cntlr = GpioCntlrGetByGpio(gpio); in GpioSetDir()
44 ret = GpioCntlrSetDir(cntlr, GpioCntlrGetLocal(cntlr, gpio), dir); in GpioSetDir()
50 int32_t GpioGetDir(uint16_t gpio, uint16_t *dir) in GpioGetDir() argument
[all …]
Dgpio_service.c23 uint16_t gpio; in GpioServiceIoRead() local
31 if (!HdfSbufReadUint16(data, &gpio)) { in GpioServiceIoRead()
36 ret = GpioRead(gpio, &value); in GpioServiceIoRead()
53 uint16_t gpio; in GpioServiceIoWrite() local
61 if (!HdfSbufReadUint16(data, &gpio)) { in GpioServiceIoWrite()
71 ret = GpioWrite(gpio, value); in GpioServiceIoWrite()
83 uint16_t gpio; in GpioServiceIoGetDir() local
91 if (!HdfSbufReadUint16(data, &gpio)) { in GpioServiceIoGetDir()
96 ret = GpioGetDir(gpio, &dir); in GpioServiceIoGetDir()
113 uint16_t gpio; in GpioServiceIoSetDir() local
[all …]
Dgpio_if_u.c46 int32_t GpioRead(uint16_t gpio, uint16_t *val) in GpioRead() argument
72 if (!HdfSbufWriteUint16(data, (uint16_t)gpio)) { in GpioRead()
99 int32_t GpioWrite(uint16_t gpio, uint16_t val) in GpioWrite() argument
117 if (!HdfSbufWriteUint16(data, (uint16_t)gpio)) { in GpioWrite()
140 int32_t GpioGetDir(uint16_t gpio, uint16_t *dir) in GpioGetDir() argument
171 if (!HdfSbufWriteUint16(data, (uint16_t)gpio)) { in GpioGetDir()
198 int32_t GpioSetDir(uint16_t gpio, uint16_t dir) in GpioSetDir() argument
216 if (!HdfSbufWriteUint16(data, (uint16_t)gpio)) { in GpioSetDir()
239 static int32_t GpioRegListener(struct HdfIoService *service, uint16_t gpio, GpioIrqFunc func, void … in GpioRegListener() argument
248 param->gpio = gpio; in GpioRegListener()
[all …]
Dgpio_manager.c219 uint16_t gpio = (uint16_t)(uintptr_t)data; in GpioCntlrFindMatch() local
222 if (gpio >= cntlr->start && gpio < (cntlr->start + cntlr->count)) { in GpioCntlrFindMatch()
228 struct GpioCntlr *GpioCntlrGetByGpio(uint16_t gpio) in GpioCntlrGetByGpio() argument
239 device = PlatformManagerFindDevice(gpioMgr, (void *)(uintptr_t)gpio, GpioCntlrFindMatch); in GpioCntlrGetByGpio()
241 HDF_LOGE("GpioCntlrGetByGpio: gpio %hu is not in any controllers!", gpio); in GpioCntlrGetByGpio()
/drivers/hdf_core/adapter/platform/gpio/
Dgpio_wm.c94 static int32_t GpioDevWrite(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t val);
95 static int32_t GpioDevRead(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t *val);
96 static int32_t GpioDevSetDir(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t dir);
97 static int32_t GpioDevSetIrq(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t mode);
98 static int32_t GpioDevUnSetIrq(struct GpioCntlr *cntlr, uint16_t gpio);
99 static int32_t GpioDevEnableIrq(struct GpioCntlr *cntlr, uint16_t gpio);
100 static int32_t GpioDevDisableIrq(struct GpioCntlr *cntlr, uint16_t gpio);
117 static int32_t GpioDevWrite(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t val) in GpioDevWrite() argument
122 if (gpio >= WM_IO_MAX_GPIO_PIN_NUM) { in GpioDevWrite()
123 HDF_LOGE("%s %d, error gpio:%hu", __func__, __LINE__, gpio); in GpioDevWrite()
[all …]
Dgpio_gr5xx.c64 static int32_t GpioDevSetDir(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t dir) in GpioDevSetDir() argument
71 if (gpio >= IO_NUM_MAX) { in GpioDevSetDir()
76 iotype = GpioDevPinMap(gpio, &pin); in GpioDevSetDir()
78 ioInit.pull = g_portCfg[gpio].pull; in GpioDevSetDir()
88 g_portCfg[gpio].mode = ioInit.mode; in GpioDevSetDir()
96 static int32_t GpioDevGetDir(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t *dir) in GpioDevGetDir() argument
99 if (gpio >= IO_NUM_MAX) { in GpioDevGetDir()
104 *dir = g_portCfg[gpio].mode; in GpioDevGetDir()
109 static int32_t GpioDevWrite(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t val) in GpioDevWrite() argument
115 if (gpio >= IO_NUM_MAX) { in GpioDevWrite()
[all …]
Dgpio_stm32f4xx.c128 static int32_t GpioDevWrite(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t val);
129 static int32_t GpioDevRead(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t *val);
130 static int32_t GpioDevSetDir(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t dir);
131 static int32_t GpioDevGetDir(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t *dir);
132 static int32_t GpioDevSetIrq(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t mode);
133 static int32_t GpioDevUnSetIrq(struct GpioCntlr *cntlr, uint16_t gpio);
134 static int32_t GpioDevEnableIrq(struct GpioCntlr *cntlr, uint16_t gpio);
135 static int32_t GpioDevDisableIrq(struct GpioCntlr *cntlr, uint16_t gpio);
452 static int32_t GpioDevWrite(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t val) argument
455 uint16_t realPin = g_gpioPinsMap[gpio].realPin;
[all …]
Dgpio_bes.c66 typedef int32_t (*oem_gpio_irq_handler_t)(uint16_t gpio, void *data);
116 static int32_t GpioDevWrite(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t val);
117 static int32_t GpioDevRead(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t *val);
118 static int32_t GpioDevSetDir(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t dir);
119 static int32_t GpioDevGetDir(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t *dir);
120 static int32_t GpioDevSetIrq(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t mode);
121 static int32_t GpioDevUnSetIrq(struct GpioCntlr *cntlr, uint16_t gpio);
122 static int32_t GpioDevEnableIrq(struct GpioCntlr *cntlr, uint16_t gpio);
123 static int32_t GpioDevDisableIrq(struct GpioCntlr *cntlr, uint16_t gpio);
355 static int32_t GpioDevWrite(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t val) argument
[all …]
Dgpio_asr.c81 uint16_t gpio = (uint16_t)arg; in OemGpioIrqHdl() local
83 dev = &g_gpioPinMap[gpio]; in OemGpioIrqHdl()
88 GpioCntlrIrqCallback(&g_gpioCntlr, gpio); in OemGpioIrqHdl()
103 static int32_t GpioDevWrite(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t val) in GpioDevWrite() argument
107 asr_gpio_dev_t *dev = &g_gpioPinMap[gpio]; in GpioDevWrite()
122 static int32_t GpioDevRead(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t *val) in GpioDevRead() argument
126 asr_gpio_dev_t *dev = &g_gpioPinMap[gpio]; in GpioDevRead()
140 static int32_t GpioDevSetDir(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t dir) in GpioDevSetDir() argument
144 asr_gpio_dev_t *dev = &g_gpioPinMap[gpio]; in GpioDevSetDir()
159 static int32_t GpioDevGetDir(struct GpioCntlr *cntlr, uint16_t gpio, uint16_t *dir) in GpioDevGetDir() argument
[all …]
/drivers/hdf_core/framework/include/platform/
Dgpio_if.h96 typedef int32_t (*GpioIrqFunc)(uint16_t gpio, void *data);
109 int32_t GpioRead(uint16_t gpio, uint16_t *val);
122 int32_t GpioWrite(uint16_t gpio, uint16_t val);
136 int32_t GpioSetDir(uint16_t gpio, uint16_t dir);
147 int32_t GpioGetDir(uint16_t gpio, uint16_t *dir);
165 int32_t GpioSetIrq(uint16_t gpio, uint16_t mode, GpioIrqFunc func, void *arg);
181 int32_t GpioUnsetIrq(uint16_t gpio, void *arg);
193 int32_t GpioEnableIrq(uint16_t gpio);
205 int32_t GpioDisableIrq(uint16_t gpio);
/drivers/hdf_core/adapter/khdf/uniproton/test/sample_driver/src/
Dgpio_test.c44 static int32_t TestCaseGpioIrqHandler1(uint16_t gpio, void *data) in TestCaseGpioIrqHandler1() argument
46 HDF_LOGE("%s: irq triggered! on gpio:%u", __func__, gpio); in TestCaseGpioIrqHandler1()
57 static int32_t TestCaseGpioIrqHandler2(uint16_t gpio, void *data) in TestCaseGpioIrqHandler2() argument
59 HDF_LOGE("%s: irq triggered! on gpio:%u", __func__, gpio); in TestCaseGpioIrqHandler2()
70 static int32_t TestCaseGpioIrqHandler3(uint16_t gpio, void *data) in TestCaseGpioIrqHandler3() argument
72 HDF_LOGE("%s: irq triggered! on gpio:%u", __func__, gpio); in TestCaseGpioIrqHandler3()
83 static int32_t TestCaseGpioIrqHandler4(uint16_t gpio, void *data) in TestCaseGpioIrqHandler4() argument
95 int32_t gpio; in TestCaseGpioDir() local
97 for (gpio = 0; gpio < GPIO_PIN_NUMS; gpio++) { in TestCaseGpioDir()
98 int32_t ret = GpioGetDir(gpio, &dir); in TestCaseGpioDir()
[all …]
/drivers/hdf_core/adapter/khdf/liteos/platform/src/
Dgpio_dev.c53 static int GpioExecCmd(uint16_t gpio, struct GpioBitInfo *info, int cmd) in GpioExecCmd() argument
60 ret = GpioSetDir(gpio, info->direction); in GpioExecCmd()
65 PLAT_LOGV("GpioExecCmd: gpio:%hu set dir:%u done!", gpio, info->direction); in GpioExecCmd()
68 ret = GpioGetDir(gpio, &tmp); in GpioExecCmd()
74 PLAT_LOGV("GpioExecCmd: gpio:%hu get dir:%u done!", gpio, info->direction); in GpioExecCmd()
77 ret = GpioRead(gpio, &tmp); in GpioExecCmd()
83 PLAT_LOGV("GpioExecCmd: gpio:%hu read:%u done!", gpio, info->value); in GpioExecCmd()
86 ret = GpioWrite(gpio, info->value); in GpioExecCmd()
91 PLAT_LOGV("GpioExecCmd: gpio:%hu write:%u done!", gpio, info->value); in GpioExecCmd()
103 uint16_t gpio; in GpioIoctl() local
[all …]
/drivers/hdf_core/adapter/khdf/linux/platform/gpio/
Dgpio_adapter.c118 int gpio = (int)(uintptr_t)data; in LinuxGpioIrqBridge() local
122 cntlr = GpioCntlrGetByGpio(gpio); in LinuxGpioIrqBridge()
123 GpioCntlrIrqCallback(cntlr, GpioCntlrGetLocal(cntlr, gpio)); in LinuxGpioIrqBridge()
133 uint16_t gpio; in LinuxGpioSetIrq() local
139 gpio = cntlr->start + local; in LinuxGpioSetIrq()
141 irq = gpio_to_irq(gpio); in LinuxGpioSetIrq()
143 HDF_LOGE("LinuxGpioSetIrq: gpio(%u) to irq fail:%d!", gpio, irq); in LinuxGpioSetIrq()
150 HDF_LOGI("LinuxGpioSetIrq: gona request normal irq:%d(%u)!\n", irq, gpio); in LinuxGpioSetIrq()
152 "LinuxIrqBridge", (void *)(uintptr_t)gpio); in LinuxGpioSetIrq()
154 HDF_LOGI("LinuxGpioSetIrq: gona request threaded irq:%d(%u)!\n", irq, gpio); in LinuxGpioSetIrq()
[all …]
DMakefile17 obj-y += $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/gpio/gpio_core.o \
18 $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/gpio/gpio_if.o \
19 $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/gpio/gpio_manager.o \
20 $(HDF_PLATFORM_FRAMEWORKS_ROOT)/src/gpio/gpio_service.o \
/drivers/hdf_core/framework/test/unittest/platform/common/
Dgpio_test.c96 …tester.cfg.gpio, tester.cfg.gpioIrq, tester.cfg.testUserApi, tester.cfg.gpioTestTwo, tester.cfg.te… in GpioTesterGet()
114 ret = GpioGetDir(tester->cfg.gpio, &tester->oldDir); in GpioTestSetUp()
119 ret = GpioRead(tester->cfg.gpio, &tester->oldVal); in GpioTestSetUp()
142 ret = GpioSetDir(tester->cfg.gpio, tester->oldDir); in GpioTestTearDown()
150 ret = GpioWrite(tester->cfg.gpio, tester->oldVal); in GpioTestTearDown()
175 ret = GpioSetDir(tester->cfg.gpio, dirSet); in GpioTestSetGetDir()
180 ret = GpioGetDir(tester->cfg.gpio, &dirGet); in GpioTestSetGetDir()
192 ret = GpioSetDir(tester->cfg.gpio, dirSet); in GpioTestSetGetDir()
197 ret = GpioGetDir(tester->cfg.gpio, &dirGet); in GpioTestSetGetDir()
222 ret = GpioSetDir(tester->cfg.gpio, GPIO_DIR_OUT); in GpioTestWriteRead()
[all …]
/drivers/hdf_core/framework/model/sensor/driver/ppg/
Dsensor_ppg_config.c148 struct GpiosPinSetCfg *gpio = NULL; in EnablePpgIrq() local
153 gpio = &config->pinCfg.gpios[gpioIndex]; in EnablePpgIrq()
154 CHECK_NULL_PTR_RETURN_VALUE(gpio, HDF_ERR_INVALID_PARAM); in EnablePpgIrq()
155 if ((gpio->gpioType == PPG_TYPE_IRQ) && (pinIndex == gpio->pinIndex)) { in EnablePpgIrq()
156 if (GpioEnableIrq(gpio->gpioNo) != 0) { in EnablePpgIrq()
169 struct GpiosPinSetCfg *gpio = NULL; in DisablePpgIrq() local
174 gpio = &config->pinCfg.gpios[gpioIndex]; in DisablePpgIrq()
175 CHECK_NULL_PTR_RETURN_VALUE(gpio, HDF_ERR_INVALID_PARAM); in DisablePpgIrq()
176 if ((gpio->gpioType == PPG_TYPE_IRQ) && (pinIndex == gpio->pinIndex)) { in DisablePpgIrq()
177 if (GpioDisableIrq(gpio->gpioNo) != 0) { in DisablePpgIrq()
[all …]
/drivers/hdf_core/framework/support/platform/src/fwk/
Dplatform_listener_u.c123 struct PlatformUserListenerGpioParam *gpio = NULL; in GpioOnDevEventReceive() local
133 gpio = (struct PlatformUserListenerGpioParam *)userListener->data; in GpioOnDevEventReceive()
134 if (gpio == NULL || gpio->data == NULL || gpio->func == NULL) { in GpioOnDevEventReceive()
144 HDF_LOGD("GpioOnDevEventReceive: event %d gpioId:%d == gpio:%d!", id, gpioId, gpio->gpio); in GpioOnDevEventReceive()
145 if ((id == PLATFORM_LISTENER_EVENT_GPIO_INT_NOTIFY) && (gpioId == gpio->gpio)) { in GpioOnDevEventReceive()
146 gpio->func(gpioId, gpio->data); in GpioOnDevEventReceive()
/drivers/hdf_core/framework/include/bluetooth/
Dhdf_chip_config.h37 struct HdfConfigGpioBasedSwitch gpio; member
53 struct HdfConfigGpioBasedSwitch gpio; member
/drivers/hdf_core/framework/support/platform/test/fuzztest/gpio_fuzzer/
Dgpio_fuzzer.cpp31 static int32_t GpioTestIrqHandler(uint16_t gpio, void *data) in GpioTestIrqHandler() argument
33 (void)gpio; in GpioTestIrqHandler()
/drivers/hdf_core/framework/model/network/bluetooth/
Dhdf_chip_config.c35 if (drsOps->GetUint16(node, "gpioId", &config->gpio.gpioId, 0) != HDF_SUCCESS) { in ParsePowerConfig()
39 if (drsOps->GetUint8(node, "activeLevel", &config->gpio.activeLevel, 0) != HDF_SUCCESS) { in ParsePowerConfig()
119 if (drsOps->GetUint16(node, "gpioId", &reset->gpio.gpioId, 0) != HDF_SUCCESS) { in ParseResetConfig()
124 if (drsOps->GetUint8(node, "activeLevel", &reset->gpio.activeLevel, 0) != HDF_SUCCESS) { in ParseResetConfig()
Dhdf_reset.c93 reset->gpioId = resetConfig->gpio.gpioId; in CreateVirtualReset()
94 reset->activeLevel = resetConfig->gpio.activeLevel; in CreateVirtualReset()
/drivers/hdf_core/framework/support/platform/include/gpio/
Dgpio_core.h201 struct GpioCntlr *GpioCntlrGetByGpio(uint16_t gpio);
210 static inline uint16_t GpioCntlrGetLocal(struct GpioCntlr *cntlr, uint16_t gpio) in GpioCntlrGetLocal() argument
212 return (cntlr == NULL) ? gpio : (gpio - cntlr->start); in GpioCntlrGetLocal()
/drivers/hdf_core/adapter/khdf/linux/
DREADME_zh.md31 │ ├── gpio #gpio接口
/drivers/hdf_core/framework/model/input/driver/
Dhdf_touch.c46 static int32_t SetGpioDirAndLevel(int gpio, int dir, int level) in SetGpioDirAndLevel() argument
50 ret = GpioSetDir(gpio, dir); in SetGpioDirAndLevel()
52 HDF_LOGE("%s: set gpio%d to %d dir failed, ret %d", __func__, gpio, dir, ret); in SetGpioDirAndLevel()
58 ret = GpioWrite(gpio, level); in SetGpioDirAndLevel()
60 HDF_LOGE("%s: pull gpio%d to %d level failed, ret %d", __func__, gpio, level, ret); in SetGpioDirAndLevel()
79 static int32_t SetGpio(uint16_t gpio, uint32_t dir, uint32_t status) in SetGpio() argument
81 int32_t ret = SetGpioDirAndLevel(gpio, dir, status); in SetGpio()
89 uint16_t gpio; in HandleResetEvent() local
106 gpio = chipDev->boardCfg->pins.intGpio; in HandleResetEvent()
107 ret = SetGpio(gpio, dir, status); in HandleResetEvent()
[all …]
/drivers/hdf_core/adapter/khdf/linux/platform/
DMakefile18 obj-$(CONFIG_DRIVERS_HDF_PLATFORM_GPIO) += gpio/

12