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()
75 GPIO_InitStructure.Pin = obj->pinIndex ; in GpioMcuInit()
76 GPIO_InitStructure.Pull = obj->pull = type; in GpioMcuInit()
114 GpioMcuWrite( obj, value ); in GpioMcuInit()
117 HAL_GPIO_Init( obj->port, &GPIO_InitStructure ); in GpioMcuInit()
123 GpioIoeInit( obj, pin, mode, config, type, value ); in GpioMcuInit()
128 void GpioMcuSetContext( Gpio_t *obj, void* context ) in GpioMcuSetContext() argument
130 obj->Context = context; in GpioMcuSetContext()
133 void GpioMcuSetInterrupt( Gpio_t *obj, IrqModes irqMode, IrqPriorities irqPriority, GpioIrqHandler … in GpioMcuSetInterrupt() argument
135 if( obj->pin < IOE_0 ) in GpioMcuSetInterrupt()
147 obj->IrqHandler = irqHandler; in GpioMcuSetInterrupt()
149 GPIO_InitStructure.Pin = obj->pinIndex; in GpioMcuSetInterrupt()
164 GPIO_InitStructure.Pull = obj->pull; in GpioMcuSetInterrupt()
167 HAL_GPIO_Init( obj->port, &GPIO_InitStructure ); in GpioMcuSetInterrupt()
187 switch( obj->pinIndex ) in GpioMcuSetInterrupt()
215 GpioIrq[( obj->pin ) & 0x0F] = obj; in GpioMcuSetInterrupt()
224 GpioIoeSetInterrupt( obj, irqMode, irqPriority, irqHandler ); in GpioMcuSetInterrupt()
229 void GpioMcuRemoveInterrupt( Gpio_t *obj ) in GpioMcuRemoveInterrupt() argument
231 if( obj->pin < IOE_0 ) in GpioMcuRemoveInterrupt()
234 GpioIrq[( obj->pin ) & 0x0F] = NULL; in GpioMcuRemoveInterrupt()
238 GPIO_InitStructure.Pin = obj->pinIndex ; in GpioMcuRemoveInterrupt()
240 HAL_GPIO_Init( obj->port, &GPIO_InitStructure ); in GpioMcuRemoveInterrupt()
246 GpioIoeRemoveInterrupt( obj ); in GpioMcuRemoveInterrupt()
251 void GpioMcuWrite( Gpio_t *obj, uint32_t value ) in GpioMcuWrite() argument
253 if( obj->pin < IOE_0 ) in GpioMcuWrite()
255 if( obj == NULL ) in GpioMcuWrite()
260 if( obj->pin == NC ) in GpioMcuWrite()
264 HAL_GPIO_WritePin( obj->port, obj->pinIndex , ( GPIO_PinState )value ); in GpioMcuWrite()
270 GpioIoeWrite( obj, value ); in GpioMcuWrite()
275 void GpioMcuToggle( Gpio_t *obj ) in GpioMcuToggle() argument
277 if( obj->pin < IOE_0 ) in GpioMcuToggle()
279 if( obj == NULL ) in GpioMcuToggle()
285 if( obj->pin == NC ) in GpioMcuToggle()
289 HAL_GPIO_TogglePin( obj->port, obj->pinIndex ); in GpioMcuToggle()
295 GpioIoeToggle( obj ); in GpioMcuToggle()
300 uint32_t GpioMcuRead( Gpio_t *obj ) in GpioMcuRead() argument
302 if( obj->pin < IOE_0 ) in GpioMcuRead()
304 if( obj == NULL ) in GpioMcuRead()
309 if( obj->pin == NC ) in GpioMcuRead()
313 return HAL_GPIO_ReadPin( obj->port, obj->pinIndex ); in GpioMcuRead()
319 return GpioIoeRead( obj ); in GpioMcuRead()