Microchip® Advanced Software Framework

sam0/ioport.h File Reference

SAM architecture specific IOPORT service implementation header file.

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

#include <compiler.h>

Macros

#define IOPORT_CREATE_PIN(port, pin)   ((port) * 32 + (pin))
 Create IOPORT pin number. More...
 
IOPORT Mode bit definitions
#define IOPORT_MODE_MUX_MASK   (0xF << 0)
 
#define IOPORT_MODE_MUX_BIT0   (1 << 0)
 
#define IOPORT_MODE_MUX_BIT1   (1 << 1)
 
#define IOPORT_MODE_MUX_BIT2   (1 << 2)
 
#define IOPORT_MODE_MUX_BIT3   (1 << 3)
 
#define IOPORT_MODE_MUX_A   (0 << 0)
 
#define IOPORT_MODE_MUX_B   (1 << 0)
 
#define IOPORT_MODE_MUX_C   (2 << 0)
 
#define IOPORT_MODE_MUX_D   (3 << 0)
 
#define IOPORT_MODE_MUX_E   (4 << 0)
 
#define IOPORT_MODE_MUX_F   (5 << 0)
 
#define IOPORT_MODE_MUX_G   (6 << 0)
 
#define IOPORT_MODE_MUX_H   (7 << 0)
 
#define IOPORT_MODE_PULLUP   (1 << 4)
 
#define IOPORT_MODE_PULLDOWN   (1 << 5)
 
#define IOPORT_MODE_OPEN_DRAIN   (1 << 6)
 
#define IOPORT_MODE_DRIVE_STRENGTH   (1 << 7)
 

Typedefs

typedef uint32_t ioport_mode_t
 
typedef uint32_t ioport_pin_t
 
typedef uint32_t ioport_port_mask_t
 
typedef uint32_t ioport_port_t
 

Functions

static void arch_ioport_disable_pin (ioport_pin_t pin)
 
static void arch_ioport_disable_port (ioport_port_t port, ioport_port_mask_t mask)
 
static void arch_ioport_enable_pin (ioport_pin_t pin)
 
static void arch_ioport_enable_port (ioport_port_t port, ioport_port_mask_t mask)
 
static bool arch_ioport_get_pin_level (ioport_pin_t pin)
 
static ioport_port_mask_t arch_ioport_get_port_level (ioport_port_t port, ioport_port_mask_t mask)
 
static void arch_ioport_init (void)
 
static PortGroup * arch_ioport_pin_to_base (ioport_pin_t pin)
 
static ioport_port_mask_t arch_ioport_pin_to_mask (ioport_pin_t pin)
 
static ioport_port_t arch_ioport_pin_to_port_id (ioport_pin_t pin)
 
static PortGroup * arch_ioport_port_to_base (ioport_port_t port)
 
static void arch_ioport_set_pin_dir (ioport_pin_t pin, enum ioport_direction dir)
 
static void arch_ioport_set_pin_level (ioport_pin_t pin, bool level)
 
static void arch_ioport_set_pin_mode (ioport_pin_t pin, ioport_mode_t mode)
 
static void arch_ioport_set_pin_sense_mode (ioport_pin_t pin, enum ioport_sense pin_sense)
 
static void arch_ioport_set_port_dir (ioport_port_t port, ioport_port_mask_t mask, unsigned char dir)
 
static void arch_ioport_set_port_level (ioport_port_t port, ioport_port_mask_t mask, enum ioport_value level)
 
static void arch_ioport_set_port_mode (ioport_port_t port, ioport_port_mask_t mask, ioport_mode_t mode)
 
static void arch_ioport_set_port_sense_mode (ioport_port_t port, ioport_port_mask_t mask, enum ioport_sense pin_sense)
 
static void arch_ioport_toggle_pin_level (ioport_pin_t pin)
 
static void arch_ioport_toggle_port_level (ioport_port_t port, ioport_port_mask_t mask)
 

typedef uint32_t ioport_mode_t
typedef uint32_t ioport_pin_t
typedef uint32_t ioport_port_mask_t
typedef uint32_t ioport_port_t

static void arch_ioport_disable_pin ( ioport_pin_t  pin)
inlinestatic
static void arch_ioport_disable_port ( ioport_port_t  port,
ioport_port_mask_t  mask 
)
inlinestatic
static void arch_ioport_enable_pin ( ioport_pin_t  pin)
inlinestatic
static void arch_ioport_enable_port ( ioport_port_t  port,
ioport_port_mask_t  mask 
)
inlinestatic
static bool arch_ioport_get_pin_level ( ioport_pin_t  pin)
inlinestatic
static ioport_port_mask_t arch_ioport_get_port_level ( ioport_port_t  port,
ioport_port_mask_t  mask 
)
inlinestatic
static void arch_ioport_init ( void  )
inlinestatic

Referenced by ioport_init().

static void arch_ioport_set_pin_dir ( ioport_pin_t  pin,
enum ioport_direction  dir 
)
inlinestatic
static void arch_ioport_set_pin_level ( ioport_pin_t  pin,
bool  level 
)
inlinestatic
static void arch_ioport_set_pin_mode ( ioport_pin_t  pin,
ioport_mode_t  mode 
)
inlinestatic
static void arch_ioport_set_pin_sense_mode ( ioport_pin_t  pin,
enum ioport_sense  pin_sense 
)
inlinestatic
static void arch_ioport_set_port_dir ( ioport_port_t  port,
ioport_port_mask_t  mask,
unsigned char  dir 
)
inlinestatic
static void arch_ioport_set_port_level ( ioport_port_t  port,
ioport_port_mask_t  mask,
enum ioport_value  level 
)
inlinestatic
static void arch_ioport_set_port_sense_mode ( ioport_port_t  port,
ioport_port_mask_t  mask,
enum ioport_sense  pin_sense 
)
inlinestatic
static void arch_ioport_toggle_pin_level ( ioport_pin_t  pin)
inlinestatic
static void arch_ioport_toggle_port_level ( ioport_port_t  port,
ioport_port_mask_t  mask 
)
inlinestatic