Choco OS
V.0.16.9.0
Join to the chocolate world
|
The file with interface for the GPIO driver. More...
#include <oc_gpio.h>
#include <oc_gpio_lld.h>
#include <oc_compiler.h>
#include <oc_module.h>
#include <oc_intman.h>
#include <oc_null.h>
#include <string.h>
#include <oc_event.h>
#include <oc_driver.h>
Go to the source code of this file.
Functions | |
oC_ErrorCode_t | oC_GPIO_TurnOn (void) |
turns on the module More... | |
oC_ErrorCode_t | oC_GPIO_TurnOff (void) |
Turns off the GPIO driver. More... | |
bool | oC_GPIO_IsTurnedOn (void) |
checks if the driver is turned on More... | |
oC_ErrorCode_t | oC_GPIO_Configure (const oC_GPIO_Config_t *Config, oC_GPIO_Context_t *outContext) |
configures GPIO pins to work More... | |
oC_ErrorCode_t | oC_GPIO_Unconfigure (const oC_GPIO_Config_t *Config, oC_GPIO_Context_t *outContext) |
Restores default state on pins. More... | |
oC_ErrorCode_t | oC_GPIO_SetSpeed (oC_Pins_t Pins, oC_GPIO_Speed_t Speed) |
configures speed of pin(s) More... | |
oC_ErrorCode_t | oC_GPIO_ReadSpeed (oC_Pins_t Pins, oC_GPIO_Speed_t *outSpeed) |
reads configured speed More... | |
oC_ErrorCode_t | oC_GPIO_SetCurrent (oC_Pins_t Pins, oC_GPIO_Current_t Current) |
configures current of pin(s) More... | |
oC_ErrorCode_t | oC_GPIO_ReadCurrent (oC_Pins_t Pins, oC_GPIO_Current_t *outCurrent) |
reads configured current More... | |
oC_ErrorCode_t | oC_GPIO_SetMode (oC_Pins_t Pins, oC_GPIO_Mode_t Mode) |
configures mode of pin(s) More... | |
oC_ErrorCode_t | oC_GPIO_ReadMode (oC_Pins_t Pins, oC_GPIO_Mode_t *outMode) |
reads mode configuration More... | |
oC_ErrorCode_t | oC_GPIO_SetPull (oC_Pins_t Pins, oC_GPIO_Pull_t Pull) |
configures pull for pin(s) More... | |
oC_ErrorCode_t | oC_GPIO_ReadPull (oC_Pins_t Pins, oC_GPIO_Pull_t *outPull) |
reads pull configuration More... | |
oC_ErrorCode_t | oC_GPIO_SetOutputCircuit (oC_Pins_t Pins, oC_GPIO_OutputCircuit_t OutputCircuit) |
configures output circuit More... | |
oC_ErrorCode_t | oC_GPIO_ReadOutputCircuit (oC_Pins_t Pins, oC_GPIO_OutputCircuit_t *outOutputCircuit) |
reads output circuit configuration More... | |
oC_ErrorCode_t | oC_GPIO_SetInterruptTrigger (oC_Pins_t Pins, oC_GPIO_IntTrigger_t InterruptTrigger) |
configures interrupt for pin(s) More... | |
oC_ErrorCode_t | oC_GPIO_ReadInterruptTrigger (oC_Pins_t Pins, oC_GPIO_IntTrigger_t *outInterruptTrigger) |
reads interrupt trigger More... | |
oC_ErrorCode_t | oC_GPIO_FindPinByName (const char *Name, oC_Pin_t *outPin) |
searching pin by its name More... | |
oC_ErrorCode_t | oC_GPIO_WaitForPins (oC_Pins_t Pins, oC_Time_t Timeout) |
waits for interrupt in the pins | |
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file oc_gpio.c.
oC_ErrorCode_t oC_GPIO_Configure | ( | const oC_GPIO_Config_t * | Config, |
oC_GPIO_Context_t * | outContext | ||
) |
The function is for configuration of the driver. Look at the oC_GPIO_Config_t structure description and fields list to get more info.
Config | Pointer to the configuration structure |
outContext | Destination for the driver context structure |
oC_ErrorCode_t oC_GPIO_FindPinByName | ( | const char * | Name, |
oC_Pin_t * | outPin | ||
) |
The function is for searching a pin definition according to its name
Name | Name of the pin to find (for example "PF4") |
outPin | [out] Destination for a pin |
Example of usage:
bool oC_GPIO_IsTurnedOn | ( | void | ) |
oC_ErrorCode_t oC_GPIO_ReadCurrent | ( | oC_Pins_t | Pins, |
oC_GPIO_Current_t * | outCurrent | ||
) |
The function is for reading configuration of current that is set on the port. This parameter is for output mode, and it defines strong of the current source. If it is set to oC_GPIO_Current_Minimum, it will be in low energy mode.
Pins | variable with single or more pins from the same port |
outCurrent | destination for current variable |
oC_ErrorCode_t oC_GPIO_ReadInterruptTrigger | ( | oC_Pins_t | Pins, |
oC_GPIO_IntTrigger_t * | outInterruptTrigger | ||
) |
The function is for reading configuration of interrupt trigger. The parameter defines trigger source for interrupts in input mode. The trigger can be also set to oC_GPIO_IntTrigger_Off, and in this case it will disable any interrupts on this pin(s).
Pins | variable with single or more pins from the same port |
outInterruptTrigger | destination for the returned value |
oC_ErrorCode_t oC_GPIO_ReadMode | ( | oC_Pins_t | Pins, |
oC_GPIO_Mode_t * | outMode | ||
) |
The function is for reading pin mode. This parameter helps to choose if it is output or input mode.
Pins | variable with single or more pins from the same port |
outMode | destination for the mode variable |
oC_ErrorCode_t oC_GPIO_ReadOutputCircuit | ( | oC_Pins_t | Pins, |
oC_GPIO_OutputCircuit_t * | outOutputCircuit | ||
) |
The function is for reading configuration of the output circuit parameter. This parameter is for output mode, and helps to select between open drain and push-pull mode.
Pins | variable with single or more pins from the same port |
outOutputCircuit | destination for the returned value |
oC_ErrorCode_t oC_GPIO_ReadPull | ( | oC_Pins_t | Pins, |
oC_GPIO_Pull_t * | outPull | ||
) |
The function is for reading pull configuration. This parameter is for input mode, and defines default state for pin(s).
Pins | variable with single or more pins from the same port |
outPull | destination for the pull variable |
oC_ErrorCode_t oC_GPIO_ReadSpeed | ( | oC_Pins_t | Pins, |
oC_GPIO_Speed_t * | outSpeed | ||
) |
The function is for reading current configuration of speed that is set on the port. It is parameter, that defines maximum speed of pin state changing. In most of cases, more speed choice means more current consumption.
Pins | variable with single or more pins from the same port |
outSpeed | destination for the speed variable |
oC_ErrorCode_t oC_GPIO_SetCurrent | ( | oC_Pins_t | Pins, |
oC_GPIO_Current_t | Current | ||
) |
The function is for configuration of the current on selected port and pin(s). This parameter is for output mode, and it defines strong of the current source. If it is set to oC_GPIO_Current_Minimum, it will be in low energy mode.
Pins | variable with single or more pins from the same port |
Current | current limit to configure |
oC_ErrorCode_t oC_GPIO_SetInterruptTrigger | ( | oC_Pins_t | Pins, |
oC_GPIO_IntTrigger_t | InterruptTrigger | ||
) |
The function is for configuration of the interrupt for pins in GPIO input mode. The parameter defines trigger source for interrupts in input mode. The trigger can be also set to oC_GPIO_IntTrigger_Off, and in this case it will disable any interrupts on this pin(s).
Pins | variable with single or more pins from the same port |
InterruptTrigger | value to set |
oC_ErrorCode_t oC_GPIO_SetMode | ( | oC_Pins_t | Pins, |
oC_GPIO_Mode_t | Mode | ||
) |
The function is for configuration of pins mode. This parameter helps to choose if it is output or input mode.
Pins | variable with single or more pins from the same port |
Mode | mode to configure |
oC_ErrorCode_t oC_GPIO_SetOutputCircuit | ( | oC_Pins_t | Pins, |
oC_GPIO_OutputCircuit_t | OutputCircuit | ||
) |
The function if for configuration of output circuit for pin(s). This parameter is for output mode, and helps to select between open drain and push-pull mode.
Pins | variable with single or more pins from the same port |
OutputCircuit | value to set |
oC_ErrorCode_t oC_GPIO_SetPull | ( | oC_Pins_t | Pins, |
oC_GPIO_Pull_t | Pull | ||
) |
The function is for configuration of pull for pins. This parameter is for input mode, and defines default state for pin(s).
Pins | variable with single or more pins from the same port |
Pull | pull to configure |
oC_ErrorCode_t oC_GPIO_SetSpeed | ( | oC_Pins_t | Pins, |
oC_GPIO_Speed_t | Speed | ||
) |
The function is for configuration of pin(s) speed. It is parameter, that defines maximum speed of pin state changing. In most of cases, more speed choice means more current consumption.
Pins | variable with single or more pins from the same port |
Speed | speed to set |
oC_ErrorCode_t oC_GPIO_TurnOff | ( | void | ) |
oC_ErrorCode_t oC_GPIO_TurnOn | ( | void | ) |
oC_ErrorCode_t oC_GPIO_Unconfigure | ( | const oC_GPIO_Config_t * | Config, |
oC_GPIO_Context_t * | outContext | ||
) |