Lines Matching refs:obj

35 void GpioMcuInit( Gpio_t *obj, PinNames pin, PinModes mode, PinConfigs config, PinTypes type, uint3…  in GpioMcuInit()  argument
41 obj->pin = pin; in GpioMcuInit()
48 obj->pinIndex = ( 0x01 << ( obj->pin & 0x0F ) ); in GpioMcuInit()
50 if( ( obj->pin & 0xF0 ) == 0x00 ) in GpioMcuInit()
52 obj->port = GPIOA; in GpioMcuInit()
55 else if( ( obj->pin & 0xF0 ) == 0x10 ) in GpioMcuInit()
57 obj->port = GPIOB; in GpioMcuInit()
60 else if( ( obj->pin & 0xF0 ) == 0x20 ) in GpioMcuInit()
62 obj->port = GPIOC; in GpioMcuInit()
65 else if( ( obj->pin & 0xF0 ) == 0x30 ) in GpioMcuInit()
67 obj->port = GPIOD; in GpioMcuInit()
72 obj->port = GPIOH; in GpioMcuInit()
76 GPIO_InitStructure.Pin = obj->pinIndex ; in GpioMcuInit()
77 GPIO_InitStructure.Pull = obj->pull = type; in GpioMcuInit()
115 GpioMcuWrite( obj, value ); in GpioMcuInit()
118 HAL_GPIO_Init( obj->port, &GPIO_InitStructure ); in GpioMcuInit()
124 GpioIoeInit( obj, pin, mode, config, type, value ); in GpioMcuInit()
129 void GpioMcuSetContext( Gpio_t *obj, void* context ) in GpioMcuSetContext() argument
131 obj->Context = context; in GpioMcuSetContext()
134 void GpioMcuSetInterrupt( Gpio_t *obj, IrqModes irqMode, IrqPriorities irqPriority, GpioIrqHandler … in GpioMcuSetInterrupt() argument
136 if( obj->pin < IOE_0 ) in GpioMcuSetInterrupt()
148 obj->IrqHandler = irqHandler; in GpioMcuSetInterrupt()
150 GPIO_InitStructure.Pin = obj->pinIndex; in GpioMcuSetInterrupt()
165 GPIO_InitStructure.Pull = obj->pull; in GpioMcuSetInterrupt()
168 HAL_GPIO_Init( obj->port, &GPIO_InitStructure ); in GpioMcuSetInterrupt()
188 switch( obj->pinIndex ) in GpioMcuSetInterrupt()
224 GpioIrq[( obj->pin ) & 0x0F] = obj; in GpioMcuSetInterrupt()
233 GpioIoeSetInterrupt( obj, irqMode, irqPriority, irqHandler ); in GpioMcuSetInterrupt()
238 void GpioMcuRemoveInterrupt( Gpio_t *obj ) in GpioMcuRemoveInterrupt() argument
240 if( obj->pin < IOE_0 ) in GpioMcuRemoveInterrupt()
243 GpioIrq[( obj->pin ) & 0x0F] = NULL; in GpioMcuRemoveInterrupt()
247 GPIO_InitStructure.Pin = obj->pinIndex ; in GpioMcuRemoveInterrupt()
249 HAL_GPIO_Init( obj->port, &GPIO_InitStructure ); in GpioMcuRemoveInterrupt()
255 GpioIoeRemoveInterrupt( obj ); in GpioMcuRemoveInterrupt()
260 void GpioMcuWrite( Gpio_t *obj, uint32_t value ) in GpioMcuWrite() argument
262 if( obj->pin < IOE_0 ) in GpioMcuWrite()
264 if( obj == NULL ) in GpioMcuWrite()
269 if( obj->pin == NC ) in GpioMcuWrite()
273 HAL_GPIO_WritePin( obj->port, obj->pinIndex , ( GPIO_PinState )value ); in GpioMcuWrite()
279 GpioIoeWrite( obj, value ); in GpioMcuWrite()
284 void GpioMcuToggle( Gpio_t *obj ) in GpioMcuToggle() argument
286 if( obj->pin < IOE_0 ) in GpioMcuToggle()
288 if( obj == NULL ) in GpioMcuToggle()
294 if( obj->pin == NC ) in GpioMcuToggle()
298 HAL_GPIO_TogglePin( obj->port, obj->pinIndex ); in GpioMcuToggle()
304 GpioIoeToggle( obj ); in GpioMcuToggle()
309 uint32_t GpioMcuRead( Gpio_t *obj ) in GpioMcuRead() argument
311 if( obj->pin < IOE_0 ) in GpioMcuRead()
313 if( obj == NULL ) in GpioMcuRead()
318 if( obj->pin == NC ) in GpioMcuRead()
322 return HAL_GPIO_ReadPin( obj->port, obj->pinIndex ); in GpioMcuRead()
328 return GpioIoeRead( obj ); in GpioMcuRead()