microHAL
An abstraction layer for your future F4xx projects
Loading...
Searching...
No Matches
gpio.c File Reference

Function defines for the GPIO driver. More...

#include "gpio.h"

Functions

void gp_set_direction (const gp_bank_t bank, const uint8_t pin, const gp_dir_t dir)
 Sets the GPIO pin to the desired mode.
 
void gp_set_output_type (const gp_bank_t bank, const uint8_t pin, const gp_otype_t type)
 Sets the GPIO output pin to the desired type.
 
void gp_set_speed (const gp_bank_t bank, const uint8_t pin, const gp_speed_t speed)
 Sets the GPIO output pin to the desired speed.
 
void gp_set_pupd (const gp_bank_t bank, const uint8_t pin, const gp_pupd_t poopdr)
 Sets the GPIO input pin to the desired state.
 
void gp_set_val (const gp_bank_t bank, const uint8_t pin, const _Bool value)
 Sets the GPIO output pin to the desired value.
 
uint8_t gp_read_val (const gp_bank_t bank, const uint8_t pin)
 Reads the GPIO input pin value.
 
void gp_set_af (const gp_bank_t bank, const uint8_t pin, const uint8_t af)
 Sets the alternate function of the GPIO pin.
 

Detailed Description

Function defines for the GPIO driver.

This file contains all of the function definitions declared in gpio.h.

Author
Vasileios Ch. (BillisC)
Bug
None, yet.

Function Documentation

◆ gp_read_val()

uint8_t gp_read_val ( const gp_bank_t bank,
const uint8_t pin )

Reads the GPIO input pin value.

Parameters
bankThe GPIO bank
pinThe GPIO pin
Returns
The current state of the pin

◆ gp_set_af()

void gp_set_af ( const gp_bank_t bank,
const uint8_t pin,
const uint8_t af )

Sets the alternate function of the GPIO pin.

Parameters
bankThe GPIO bank
pinThe GPIO pin
Thealternate function number
Returns
None

◆ gp_set_direction()

void gp_set_direction ( const gp_bank_t bank,
const uint8_t pin,
const gp_dir_t dir )

Sets the GPIO pin to the desired mode.

The available directions for the GPIO pins are specified in the gp_dir_t enum. Any other value will be ignored.

Parameters
bankThe GPIO bank
pinThe GPIO pin
dirThe pin mode
Returns
None

◆ gp_set_output_type()

void gp_set_output_type ( const gp_bank_t bank,
const uint8_t pin,
const gp_otype_t type )

Sets the GPIO output pin to the desired type.

The available output types for the GPIO pins are specified in the gp_otype_t enum. Any other value will be ignored.

Parameters
bankThe GPIO bank
pinThe GPIO pin
typeThe pin type
Returns
None

◆ gp_set_pupd()

void gp_set_pupd ( const gp_bank_t bank,
const uint8_t pin,
const gp_pupd_t poopdr )

Sets the GPIO input pin to the desired state.

The available pull-up/pull-down states for the GPIO pins are specified in the gp_pupdr_t enum. Any other value will be ignored.

Parameters
bankThe GPIO bank
pinThe GPIO pin
poopdrThe pin state
Returns
None

◆ gp_set_speed()

void gp_set_speed ( const gp_bank_t bank,
const uint8_t pin,
const gp_speed_t speed )

Sets the GPIO output pin to the desired speed.

The available speeds for the GPIO output pins are specified in the gp_speed_t enum. Any other value will be ignored.

Parameters
bankThe GPIO bank
pinThe GPIO pin
speedThe pin speed
Returns
None

◆ gp_set_val()

void gp_set_val ( const gp_bank_t bank,
const uint8_t pin,
const _Bool value )

Sets the GPIO output pin to the desired value.

Allowed values are either TRUE(1) or FALSE(0). Any other value will be ignored.

Parameters
bankThe GPIO bank
pinThe GPIO pin
valueThe pin value
Returns
None