Microchip® Advanced Software Framework

pio.c File Reference

Parallel Input/Output (PIO) Controller driver for SAM.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "pio.h"

Macros

#define FREQ_SLOW_CLOCK_EXT   32768
 
#define PIO_WPMR_WPKEY_PASSWD   PIO_WPMR_WPKEY(0x50494Fu)
 

Functions

void pio_clear (Pio *p_pio, const uint32_t ul_mask)
 Set a low output level on all the PIOs defined in ul_mask. More...
 
uint32_t pio_configure (Pio *p_pio, const pio_type_t ul_type, const uint32_t ul_mask, const uint32_t ul_attribute)
 Perform complete pin(s) configuration; general attributes and PIO init if necessary. More...
 
void pio_configure_interrupt (Pio *p_pio, const uint32_t ul_mask, const uint32_t ul_attr)
 Configure the given interrupt source. More...
 
uint32_t pio_configure_pin (uint32_t ul_pin, const uint32_t ul_flags)
 Perform complete pin(s) configuration; general attributes and PIO init if necessary. More...
 
uint32_t pio_configure_pin_group (Pio *p_pio, uint32_t ul_mask, const uint32_t ul_flags)
 Perform complete pin(s) configuration; general attributes and PIO init if necessary. More...
 
void pio_disable_interrupt (Pio *p_pio, const uint32_t ul_mask)
 Disable a given interrupt source, with no added side effects. More...
 
void pio_disable_output_write (Pio *p_pio, const uint32_t ul_mask)
 Disable PIO output write. More...
 
void pio_disable_pin_interrupt (uint32_t ul_pin)
 Disable interrupt for a GPIO pin. More...
 
void pio_enable_interrupt (Pio *p_pio, const uint32_t ul_mask)
 Enable the given interrupt source. More...
 
void pio_enable_output_write (Pio *p_pio, const uint32_t ul_mask)
 Enable PIO output write for synchronous data output. More...
 
void pio_enable_pin_interrupt (uint32_t ul_pin)
 Enable interrupt for a GPIO pin. More...
 
uint32_t pio_get (Pio *p_pio, const pio_type_t ul_type, const uint32_t ul_mask)
 Return 1 if one or more PIOs of the given Pin instance currently have a high level; otherwise returns 0. More...
 
uint32_t pio_get_interrupt_mask (const Pio *p_pio)
 Read PIO interrupt mask. More...
 
uint32_t pio_get_interrupt_status (const Pio *p_pio)
 Read and clear PIO interrupt status. More...
 
uint32_t pio_get_multi_driver_status (const Pio *p_pio)
 Get multi-driver status. More...
 
uint32_t pio_get_output_data_status (const Pio *p_pio, const uint32_t ul_mask)
 Return 1 if one or more PIOs of the given Pin are configured to output a high level (even if they are not output). More...
 
uint32_t pio_get_output_write_status (const Pio *p_pio)
 Read PIO output write status. More...
 
Pio * pio_get_pin_group (uint32_t ul_pin)
 Return GPIO port for a GPIO pin. More...
 
uint32_t pio_get_pin_group_id (uint32_t ul_pin)
 Return GPIO port peripheral ID for a GPIO pin. More...
 
uint32_t pio_get_pin_group_mask (uint32_t ul_pin)
 Return GPIO port pin mask for a GPIO pin. More...
 
uint32_t pio_get_pin_value (uint32_t ul_pin)
 Return the value of a pin. More...
 
uint32_t pio_get_schmitt_trigger (const Pio *p_pio)
 Get PIO pin schmitt trigger status. More...
 
uint32_t pio_get_writeprotect_status (const Pio *p_pio)
 Read write protect status. More...
 
void pio_pull_down (Pio *p_pio, const uint32_t ul_mask, const uint32_t ul_pull_down_enable)
 Configure PIO pin internal pull-down. More...
 
void pio_pull_up (Pio *p_pio, const uint32_t ul_mask, const uint32_t ul_pull_up_enable)
 Configure PIO internal pull-up. More...
 
void pio_set (Pio *p_pio, const uint32_t ul_mask)
 Set a high output level on all the PIOs defined in ul_mask. More...
 
void pio_set_additional_interrupt_mode (Pio *p_pio, const uint32_t ul_mask, const uint32_t ul_attribute)
 Set additional interrupt mode. More...
 
void pio_set_debounce_filter (Pio *p_pio, const uint32_t ul_mask, const uint32_t ul_cut_off)
 Configure Glitch or Debouncing filter for the specified input(s). More...
 
void pio_set_input (Pio *p_pio, const uint32_t ul_mask, const uint32_t ul_attribute)
 Configure one or more pin(s) or a PIO controller as inputs. More...
 
void pio_set_multi_driver (Pio *p_pio, const uint32_t ul_mask, const uint32_t ul_multi_driver_enable)
 Configure PIO pin multi-driver. More...
 
void pio_set_output (Pio *p_pio, const uint32_t ul_mask, const uint32_t ul_default_level, const uint32_t ul_multidrive_enable, const uint32_t ul_pull_up_enable)
 Configure one or more pin(s) of a PIO controller as outputs, with the given default value. More...
 
void pio_set_peripheral (Pio *p_pio, const pio_type_t ul_type, const uint32_t ul_mask)
 Configure IO of a PIO controller as being controlled by a specific peripheral. More...
 
void pio_set_pin_group_high (Pio *p_pio, uint32_t ul_mask)
 Drive a GPIO port to 1. More...
 
void pio_set_pin_group_low (Pio *p_pio, uint32_t ul_mask)
 Drive a GPIO port to 0. More...
 
void pio_set_pin_high (uint32_t ul_pin)
 Drive a GPIO pin to 1. More...
 
void pio_set_pin_low (uint32_t ul_pin)
 Drive a GPIO pin to 0. More...
 
void pio_set_schmitt_trigger (Pio *p_pio, const uint32_t ul_mask)
 Configure PIO pin schmitt trigger. More...
 
void pio_set_writeprotect (Pio *p_pio, const uint32_t ul_enable)
 Enable or disable write protect of PIO registers. More...
 
void pio_sync_output_write (Pio *p_pio, const uint32_t ul_mask)
 Synchronously write on output pins. More...
 
void pio_toggle_pin (uint32_t ul_pin)
 Toggle a GPIO pin. More...
 
void pio_toggle_pin_group (Pio *p_pio, uint32_t ul_mask)
 Toggle a GPIO group. More...
 

#define PIO_WPMR_WPKEY_PASSWD   PIO_WPMR_WPKEY(0x50494Fu)

Referenced by pio_set_writeprotect().