Home
last modified time | relevance | path

Searched refs:resource (Results 1 – 25 of 45) sorted by relevance

12

/drivers/hdf_core/adapter/platform/spi/
Dspi_stm32f4xx.c158 SpiResource resource; member
229 SpiResource *resource = NULL; in HalSpiSend() local
237 resource = &spiDevice->resource; in HalSpiSend()
238 if (resource == NULL) { in HalSpiSend()
243 if (resource->transMode == SPI_TRANSFER_DMA) { in HalSpiSend()
261 SpiResource *resource = NULL; in HalSpiRecv() local
268 resource = &spiDevice->resource; in HalSpiRecv()
269 if (resource == NULL) { in HalSpiRecv()
279 (void)memset_s(cmd, len, resource->dummyByte, len); in HalSpiRecv()
281 if (resource->transMode == SPI_TRANSFER_DMA) { in HalSpiRecv()
[all …]
Dspi_bes.c114 struct SpiResource *resource = NULL; in SpiIomuxInit() local
123 resource = &spiDevice->resource; in SpiIomuxInit()
124 if (resource == NULL) { in SpiIomuxInit()
133 spiDevCfg->rate = resource->speed; in SpiIomuxInit()
137 pinMuxSpi[SPI_PIN_0].pin = resource->spiMisoPin; in SpiIomuxInit()
138 pinMuxSpi[SPI_PIN_1].pin = resource->spiClkPin; in SpiIomuxInit()
139 pinMuxSpi[SPI_PIN_2].pin = resource->spiCsPin; in SpiIomuxInit()
140 pinMuxSpi[SPI_PIN_3].pin = resource->spiMosiPin; in SpiIomuxInit()
142 spiCtx[spiPort].spiPinCS0 = resource->spiCsPin; in SpiIomuxInit()
147 if (resource->spiCsSoft) { in SpiIomuxInit()
[all …]
Dspi_wm.c39 struct SpiResource resource; member
45 struct SpiResource *resource = NULL; in SpiIomuxInit() local
54 resource = &spiDevice->resource; in SpiIomuxInit()
55 if (resource == NULL) { in SpiIomuxInit()
62 if (resource->spiCsSoft) { in SpiIomuxInit()
63 tls_gpio_cfg(WM_IO_PB_00 + resource->spiCsPin, WM_GPIO_DIR_OUTPUT, WM_GPIO_ATTR_PULLHIGH); in SpiIomuxInit()
87 struct SpiResource *resource = NULL; in HalSpiSend() local
96 resource = &spiDevice->resource; in HalSpiSend()
97 if (resource == NULL) { in HalSpiSend()
133 struct SpiResource *resource = NULL; in HalSpiRecv() local
[all …]
/drivers/hdf_core/adapter/platform/i2c/
Di2c_bes.c51 static void I2cDeviceIomuxInit(uint32_t i2cId, const struct I2cResource *resource) in I2cDeviceIomuxInit() argument
53 if (i2cId > HAL_I2C_ID_NUM || resource == NULL) { in I2cDeviceIomuxInit()
80 pinMuxI2c[0].pin = resource->sclPin; in I2cDeviceIomuxInit()
81 pinMuxI2c[1].pin = resource->sdaPin; in I2cDeviceIomuxInit()
89 struct I2cResource *resource = NULL; in InitI2cDevice() local
96 resource = &device->resource; in InitI2cDevice()
97 if (resource == NULL) { in InitI2cDevice()
108 device->port = resource->port; in InitI2cDevice()
125 I2cDeviceIomuxInit(i2cPort, resource); in InitI2cDevice()
136 #define I2C_FIND_CONFIG(node, name, resource, result, tempPin) \ argument
[all …]
Di2c_wm.c35 struct I2cResource resource; member
65 struct I2cResource *resource = NULL; in InitI2cDevice() local
72 resource = &device->resource; in InitI2cDevice()
73 device->port = resource->port; in InitI2cDevice()
90 if ((resource->sclPin == WM_IO_PA_01) && (resource->sdaPin == WM_IO_PA_04)) { in InitI2cDevice()
99 tls_i2c_init(resource->speed); in InitI2cDevice()
106 struct I2cResource *resource = NULL; in HostRestI2cDevice() local
113 resource = &device->resource; in HostRestI2cDevice()
114 if (resource == NULL) { in HostRestI2cDevice()
118 device->port = resource->port; in HostRestI2cDevice()
[all …]
Di2c_stm32f4xx.c67 #define I2C_FIND_CONFIG(node, name, resource) \ argument
70 resource->port = HCS_PROP(node, port); \
71 resource->devMode = HCS_PROP(node, devMode); \
72 resource->devAddr = HCS_PROP(node, devAddr); \
73 resource->speed = HCS_PROP(node, speed); \
82 struct RealI2cResource *resource = NULL; in GetI2cDeviceResource() local
87 resource = i2cResource; in GetI2cDeviceResource()
89 HCS_FOREACH_CHILD_VARGS(PLATFORM_I2C_CONFIG, I2C_FIND_CONFIG, deviceMatchAttr, resource); in GetI2cDeviceResource()
Di2c_bes.h42 struct I2cResource resource; member
/drivers/hdf_core/framework/sample/platform/uart/src/
Duart_sample.c100 regMap = (struct UartRegisterMap *)device->resource.physBase; in SampleUartHostWrite()
123 regMap = (struct UartRegisterMap *)device->resource.physBase; in SampleUartHostSetBaud()
158 struct UartResource *resource = &device->resource; in InitUartDevice() local
159 struct UartRegisterMap *regMap = (struct UartRegisterMap *)resource->physBase; in InitUartDevice()
160 if ((resource->uartClk == 0) || (resource->baudrate == 0)) { in InitUartDevice()
164 device->uartClk = resource->uartClk; in InitUartDevice()
169 err = UartPl011SetBaudrate(regMap, resource->uartClk, resource->baudrate); in InitUartDevice()
174 UartPl011SetDataFormat(regMap, resource->wlen, resource->parity, resource->stopBit); in InitUartDevice()
185 struct UartResource *resource = &device->resource; in GetUartDeviceResource() local
193 if (dri->GetUint32(resourceNode, "num", &resource->num, 0) != HDF_SUCCESS) { in GetUartDeviceResource()
[all …]
Duart_dispatch_sample.c22 struct UartRegisterMap *regMap = (struct UartRegisterMap *)device->resource.physBase; in SampleDispatchWrite()
33 regMap = (struct UartRegisterMap *)device->resource.physBase; in SampleDispatchWrite()
/drivers/hdf_core/adapter/platform/gpio/
Dgpio_stm32f4xx.c100 GpioResource resource; member
194 uint32_t halGpio = g_stmRealPinMaps[device->resource.realPin]; in InitGpioDevice()
201 InitGpioClock(device->resource.group); in InitGpioDevice()
203 GPIO_TypeDef* goiox = g_gpioxMaps[device->resource.group]; in InitGpioDevice()
204 if (device->resource.mode & LL_GPIO_MODE_OUTPUT) { in InitGpioDevice()
209 gpioInitStruct.Mode = device->resource.mode; in InitGpioDevice()
210 gpioInitStruct.Pull = device->resource.pull; in InitGpioDevice()
211 gpioInitStruct.Speed = device->resource.speed; in InitGpioDevice()
212 gpioInitStruct.OutputType = device->resource.outputType; in InitGpioDevice()
213 gpioInitStruct.Alternate = device->resource.alternate; in InitGpioDevice()
[all …]
Dgpio_asr.c65 struct GpioResource resource; member
281 struct GpioResource *resource = NULL; in GetGpioDeviceResource() local
286 resource = &device->resource; in GetGpioDeviceResource()
287 if (resource == NULL) { in GetGpioDeviceResource()
291 resource->pinNum = HCS_PROP(PLATFORM_GPIO_CONFIG, pinNum); in GetGpioDeviceResource()
295 for (size_t i = 0; i < resource->pinNum; i++) { in GetGpioDeviceResource()
296 resource->pin = pins[i]; in GetGpioDeviceResource()
297 resource->realPin = realPins[i]; in GetGpioDeviceResource()
298 resource->config = configs[i]; in GetGpioDeviceResource()
300 relPin = resource->realPin;// / DECIMALNUM * OCTALNUM + resource->realPin % DECIMALNUM; in GetGpioDeviceResource()
[all …]
Dgpio_bes.c62 struct GpioResource resource; member
169 struct GpioResource *resource = NULL; in GetGpioDeviceResource() local
174 resource = &device->resource; in GetGpioDeviceResource()
175 if (resource == NULL) { in GetGpioDeviceResource()
179 resource->pinNum = HCS_PROP(PLATFORM_GPIO_CONFIG, pinNum); in GetGpioDeviceResource()
183 for (size_t i = 0; i < resource->pinNum; i++) { in GetGpioDeviceResource()
184 resource->pin = pins[i]; in GetGpioDeviceResource()
185 resource->realPin = realPins[i]; in GetGpioDeviceResource()
186 resource->config = configs[i]; in GetGpioDeviceResource()
188 relPin = resource->realPin / DECIMALNUM * OCTALNUM + resource->realPin % DECIMALNUM; in GetGpioDeviceResource()
[all …]
Dgpio_wm.c54 struct GpioResource resource; member
258 struct GpioResource *resource = NULL; in GetGpioDeviceResource() local
265 resource = &device->resource; in GetGpioDeviceResource()
266 if (resource == NULL) { in GetGpioDeviceResource()
276 if (dri->GetUint32(resourceNode, "groupNum", &resource->groupNum, 0) != HDF_SUCCESS) { in GetGpioDeviceResource()
281 if (dri->GetUint32(resourceNode, "pinNum", &resource->pinNum, 0) != HDF_SUCCESS) { in GetGpioDeviceResource()
286 for (size_t i = 0; i < resource->groupNum; i++) { in GetGpioDeviceResource()
287 … if (dri->GetUint32ArrayElem(resourceNode, "config", i, &resource->config, 0) != HDF_SUCCESS) { in GetGpioDeviceResource()
292 device->config = resource->config; in GetGpioDeviceResource()
318 gpioCntlr->count = gpioDevice->resource.pinNum; in AttachGpioDevice()
/drivers/hdf_core/adapter/platform/pwm/
Dpwm_bes.c62 struct PwmResource *resource = NULL; in InitPwmDevice() local
69 resource = &pwmDevice->resource; in InitPwmDevice()
70 if (resource == NULL) { in InitPwmDevice()
79 pinMuxPwm->pin = resource->pwmPin; in InitPwmDevice()
80 pinMuxPwm->function = g_pwmFunction[resource->pwmId]; in InitPwmDevice()
88 #define PWM_FIND_CONFIG(node, name, resource) \ argument
92 resource->pwmPin = ((tempPin / DEC_TEN) * PIN_GROUP_NUM) + (tempPin % DEC_TEN); \
93 resource->pwmId = HCS_PROP(node, pwmId); \
102 struct PwmResource *resource = NULL; in GetPwmDeviceResource() local
107 resource = &device->resource; in GetPwmDeviceResource()
[all …]
Dpwm_stm32f4xx.c68 PwmResource resource; member
198 #define PWM_FIND_CONFIG(node, name, resource) \ argument
204 resource->pwmCh = ch; \
205 resource->pwmTim = tim; \
206 resource->prescaler = prescaler; \
215 PwmResource *resource = NULL; in GetPwmDeviceResource() local
220 resource = &device->resource; in GetPwmDeviceResource()
222 HCS_FOREACH_CHILD_VARGS(PLATFORM_PWM_CONFIG, PWM_FIND_CONFIG, deviceMatchAttr, resource); in GetPwmDeviceResource()
234 PwmResource *resource = NULL; in GetPwmDeviceResource() local
241 resource = &device->resource; in GetPwmDeviceResource()
[all …]
Dpwm_wm.c26 struct PwmResource resource; member
54 pwmCfg->channel = prvPwm->resource.channel; in PwmDevSetConfig()
55 freq = prvPwm->resource.freq; in PwmDevSetConfig()
68 struct PwmResource *resource = NULL; in GetPwmDeviceResource() local
74 resource = &device->resource; in GetPwmDeviceResource()
75 if (resource == NULL) { in GetPwmDeviceResource()
86 if (dri->GetUint32(resourceNode, "channel", &resource->channel, 0) != HDF_SUCCESS) { in GetPwmDeviceResource()
91 if (dri->GetUint32(resourceNode, "freq", &resource->freq, 0) != HDF_SUCCESS) { in GetPwmDeviceResource()
Dpwm_bes.h32 struct PwmResource resource; member
/drivers/hdf_core/adapter/platform/uart/
Duart_stm32f4xx.c145 UartResource resource; member
329 UartResource *resource = NULL; in InitUartDevice() local
337 resource = &uartDevice->resource; in InitUartDevice()
338 if (resource == NULL) { in InitUartDevice()
347 InitContextTransMode(&g_uartCtx[uartDevice->uartId - 1], resource->transMode); in InitUartDevice()
371 const struct DeviceResourceNode *resourceNode, UartResource *resource) in GetUartHcs() argument
373 if (dri->GetUint8(resourceNode, "num", &resource->num, 0) != HDF_SUCCESS) { in GetUartHcs()
377 if (dri->GetUint32(resourceNode, "baudRate", &resource->baudRate, 0) != HDF_SUCCESS) { in GetUartHcs()
381 if (dri->GetUint8(resourceNode, "dataWidth", &resource->dataWidth, 0) != HDF_SUCCESS) { in GetUartHcs()
385 if (dri->GetUint8(resourceNode, "stopBit", &resource->stopBit, 0) != HDF_SUCCESS) { in GetUartHcs()
[all …]
Duart_asr.c68 struct UartResource resource; member
208 asr_pinmux_config(udd->resource.pin_tx_pin, udd->resource.pin_tx_mux); in Asr582xUartConfig()
209 asr_pinmux_config(udd->resource.pin_rx_pin, udd->resource.pin_rx_mux); in Asr582xUartConfig()
211 params->port = udd->resource.port; in Asr582xUartConfig()
216 params->config.mode = udd->resource.tx_rx; in Asr582xUartConfig()
217 params->priv = (void *)g_evtHandler[udd->resource.port]; in Asr582xUartConfig()
240 port = udd->resource.port; in UartHostDevRead()
277 HDF_LOGE("%s: uart_%d not useable", __func__, udd->resource.port); in UartHostDevWrite()
281 LOS_MuxPend(g_uartTxMutex[udd->resource.port], LOS_WAIT_FOREVER); in UartHostDevWrite()
284 LOS_MuxPost(g_uartTxMutex[udd->resource.port]); in UartHostDevWrite()
[all …]
Duart_bes.c429 struct UartResource *resource = NULL; in InitUartDevice() local
437 resource = &uartDevice->resource; in InitUartDevice()
438 if (resource == NULL) { in InitUartDevice()
447 uint32_t uartId = resource->num; in InitUartDevice()
466 #define UART_FIND_CONFIG(node, name, resource) \ argument
469 resource->num = HCS_PROP(node, num); \
470 resource->baudRate = HCS_PROP(node, baudRate); \
471 resource->parity = HCS_PROP(node, parity); \
472 resource->stopBit = HCS_PROP(node, stopBit); \
473 resource->wLen = HCS_PROP(node, data); \
[all …]
Duart_wm.c51 struct UartResource resource; member
256 struct UartResource *resource = NULL; in GetUartDeviceResource() local
261 resource = &device->resource; in GetUartDeviceResource()
262 if (resource == NULL) { in GetUartDeviceResource()
272 if (dri->GetUint32(resourceNode, "num", &resource->num, 0) != HDF_SUCCESS) { in GetUartDeviceResource()
276 if (dri->GetUint32(resourceNode, "baudrate", &resource->baudRate, 0) != HDF_SUCCESS) { in GetUartDeviceResource()
280 if (dri->GetUint32(resourceNode, "parity", &resource->parity, 0) != HDF_SUCCESS) { in GetUartDeviceResource()
284 if (dri->GetUint32(resourceNode, "stopBit", &resource->stopBit, 0) != HDF_SUCCESS) { in GetUartDeviceResource()
289 HDF_LOGI("%d, %d, %d", resource->num, resource->baudRate, resource->parity); in GetUartDeviceResource()
292 device->uartId = resource->num; in GetUartDeviceResource()
[all …]
Duart_bes.h53 struct UartResource resource; member
/drivers/hdf_core/adapter/platform/watchdog/
Dwatchdog_bes.c47 struct WatchdogResource *resource = NULL; in InitWatchdogDevice() local
54 resource = &watchdogDevice->resource; in InitWatchdogDevice()
55 if (resource == NULL) { in InitWatchdogDevice()
60 watchdogId = resource->watchdogId; in InitWatchdogDevice()
68 struct WatchdogResource *resource = NULL; in GetWatchdogDeviceResource() local
75 resource = &device->resource; in GetWatchdogDeviceResource()
76 if (resource == NULL) { in GetWatchdogDeviceResource()
86 if (dri->GetUint32(resourceNode, "watchdogId", &resource->watchdogId, 0) != HDF_SUCCESS) { in GetWatchdogDeviceResource()
116 watchdogCntlr->wdtId = watchdogDevice->resource.watchdogId; in AttachWatchdogDevice()
222 watchdogId = watchdogDevice->resource.watchdogId; in WatchdogDevStart()
[all …]
Dwatchdog_wm.c24 struct WatchdogResource resource; member
101 struct WatchdogResource *resource = NULL; in InitWatchdogDevice() local
107 resource = &watchdogDevice->resource; in InitWatchdogDevice()
108 if (resource == NULL) { in InitWatchdogDevice()
119 struct WatchdogResource *resource = NULL; in GetWatchdogDeviceResource() local
126 resource = &device->resource; in GetWatchdogDeviceResource()
127 if (resource == NULL) { in GetWatchdogDeviceResource()
Dwatchdog_bes.h24 struct WatchdogResource resource; member

12