HAL
HAL layer above libopencm3 library.
 All Files Functions Macros Groups Pages

Pin state manipulation. More...

Functions

static bool pin_get (const uint32_t pin)
 Get the actual pin state. More...
 
static void pin_set (const uint32_t pin, bool val)
 Set the pin state. More...
 
static void pin_toggle (const uint32_t pin)
 Toggle the pin level state. More...
 

Detailed Description

Pin state manipulation.

Function Documentation

static bool pin_get ( const uint32_t  pin)
static

Get the actual pin state.

This function returns actual voltage level on the pin.

Note
If the pin was configured as an output, the function can return opposite level, than the one that is used for output, indicating signal collision on that pin. Collisions are not recommended for high-speed settings for the output.
Parameters
[in]pinpin name (pin_name_base)
Returns
true, if pin is held high, false otherwise

Definition at line 75 of file pin_v0.h.

References _pin_pin(), and _pin_port().

static void pin_set ( const uint32_t  pin,
bool  val 
)
static

Set the pin state.

Parameters
[in]pinpin name (pin_name_base)
[in]valvalue to set

Definition at line 80 of file pin_v0.h.

References _pin_pin(), and _pin_port().

Referenced by pin_pull_down(), and pin_pull_up().

static void pin_toggle ( const uint32_t  pin)
static

Toggle the pin level state.

The function creates edge on the specified pin.

Parameters
[in]pinpin name (pin_name_base)

Definition at line 85 of file pin_v0.h.

References _pin_pin(), and _pin_port().