1 /*!
2  * \file      gpio.c
3  *
4  * \brief     GPIO driver implementation
5  *
6  * \remark: Relies on the specific board GPIO implementation as well as on
7  *          IO expander driver implementation if one is available on the target
8  *          board.
9  *
10  * \copyright Revised BSD License, see section \ref LICENSE.
11  *
12  * \code
13  *                ______                              _
14  *               / _____)             _              | |
15  *              ( (____  _____ ____ _| |_ _____  ____| |__
16  *               \____ \| ___ |    (_   _) ___ |/ ___)  _ \
17  *               _____) ) ____| | | || |_| ____( (___| | | |
18  *              (______/|_____)_|_|_| \__)_____)\____)_| |_|
19  *              (C)2013-2017 Semtech
20  *
21  * \endcode
22  *
23  * \author    Miguel Luis ( Semtech )
24  *
25  * \author    Gregory Cristian ( Semtech )
26  */
27 #include "gpio-board.h"
28 
GpioInit(Gpio_t * obj,PinNames pin,PinModes mode,PinConfigs config,PinTypes type,uint32_t value)29 void GpioInit( Gpio_t *obj, PinNames pin, PinModes mode,  PinConfigs config, PinTypes type, uint32_t value )
30 {
31     GpioMcuInit( obj, pin, mode, config, type, value );
32 }
33 
GpioSetContext(Gpio_t * obj,void * context)34 void GpioSetContext( Gpio_t *obj, void* context )
35 {
36     GpioMcuSetContext( obj, context );
37 }
38 
GpioSetInterrupt(Gpio_t * obj,IrqModes irqMode,IrqPriorities irqPriority,GpioIrqHandler * irqHandler)39 void GpioSetInterrupt( Gpio_t *obj, IrqModes irqMode, IrqPriorities irqPriority, GpioIrqHandler *irqHandler )
40 {
41     GpioMcuSetInterrupt( obj, irqMode, irqPriority, irqHandler );
42 }
43 
GpioRemoveInterrupt(Gpio_t * obj)44 void GpioRemoveInterrupt( Gpio_t *obj )
45 {
46     GpioMcuRemoveInterrupt( obj );
47 }
48 
GpioWrite(Gpio_t * obj,uint32_t value)49 void GpioWrite( Gpio_t *obj, uint32_t value )
50 {
51     GpioMcuWrite( obj, value );
52 }
53 
GpioToggle(Gpio_t * obj)54 void GpioToggle( Gpio_t *obj )
55 {
56     GpioMcuToggle( obj );
57 }
58 
GpioRead(Gpio_t * obj)59 uint32_t GpioRead( Gpio_t *obj )
60 {
61     return GpioMcuRead( obj );
62 }
63