Contiki 3.x
gpio.h File Reference

Header file with function declarations for the MKL25Z GPIO module. More...

#include "derivative.h"
#include <stdint.h>
#include <stdio.h>

Go to the source code of this file.

Macros

GPIO Pin Multiplexer Settings.
#define PORT_PCR_MUX_DISABLE   0x000
 
#define PORT_PCR_MUX_GPIO   0x100
 
#define PORT_PCR_MUX_ALT2   0x200
 
#define PORT_PCR_MUX_ALT3   0x300
 
#define PORT_PCR_MUX_ALT4   0x400
 
#define PORT_PCR_MUX_ALT5   0x500
 
#define PORT_PCR_MUX_ALT6   0x600
 
#define PORT_PCR_MUX_ALT7   0x700
 
GPIO Pin Interrupt Settings.
#define PORT_PCR_IRQC_DISABLE   0x00000
 
#define PORT_PCR_IRQC_DMA_RISING   0x10000
 
#define PORT_PCR_IRQC_DMA_FALLING   0x20000
 
#define PORT_PCR_IRQC_DMA_EDGE   0x30000
 
#define PORT_PCR_IRQC_ZERO   0x80000
 
#define PORT_PCR_IRQC_RISING   0x90000
 
#define PORT_PCR_IRQC_FALLING   0xA0000
 
#define PORT_PCR_IRQC_EDGE   0xB0000
 
#define PORT_PCR_IRQC_ONE   0xC0000
 

Functions

GPIO Manipulation Functions
void gpio_init ()
 initialise the Port interrupt callback function arrays. More...
 
void port_register_callback (void *f, PORT_Type *port, uint8_t pin)
 Register Port interrupt callback function. More...
 
uint32_t port_pin_to_mask (uint8_t pin)
 Convert a pin number (0 to 31) to a pin mask. More...
 
void port_conf_pin (PORT_Type *Port, uint8_t Pin, uint32_t PCR)
 Configure the specified Pin of the port with PORTx_BASE_PTR with PCR. More...
 
void port_conf_pin_int_disable (PORT_Type *Port, uint8_t Pin)
 Disable interrupt on the specified Pin of the port with PORTx_BASE_PTR. More...
 
void port_conf_pin_int_zero (PORT_Type *Port, uint8_t Pin)
 Configure zero-level interrupt on the specified Pin of the port with PORTx_BASE_PTR. More...
 
void port_conf_pin_int_rise (PORT_Type *Port, uint8_t Pin)
 Configure rising-edge interrupt on the specified Pin of the port with PORTx_BASE_PTR. More...
 
void port_conf_pin_int_fall (PORT_Type *Port, uint8_t Pin)
 Configure falling-edge interrupt on the specified Pin of the port with PORTx_BASE_PTR. More...
 
void port_conf_pin_int_edge (PORT_Type *Port, uint8_t Pin)
 Configure either-edge interrupt on the specified Pin of the port with PORTx_BASE_PTR. More...
 
void port_conf_pin_int_one (PORT_Type *Port, uint8_t Pin)
 Configure one-level interrupt on the specified Pin of the port with PORTx_BASE_PTR. More...
 
uint32_t port_read_isf (PORT_Type *Port)
 Return the Interrupt Status Flags of port with PORTx_BASE_PTR. More...
 
bool port_read_pin_isf (PORT_Type *Port, uint8_t Pin)
 Return the Interrupt Status Flags of Pin in port with PORTx_BASE_PTR. More...
 
void port_clr_isf (PORT_Type *Port, uint32_t Pin_Mask)
 Clear the Interrupt Status Flag of port with PORTx_BASE_PTR. More...
 
bool port_pin_read_isf (PORT_Type *Port, uint8_t Pin)
 Return the Interrupt Status of the Pin in port with PORTx_BASE_PTR. More...
 
void port_pin_clr_isf (PORT_Type *Port, uint8_t Pin)
 Clear the Interrupt Status Flag of Pin in port with PORTx_BASE_PTR. More...
 
void gpio_set_input (GPIO_Type *Port, uint32_t Pin_Mask)
 Set pins with Pin_Mask of port with GPIOn_BASE_PTR to input. More...
 
void gpio_set_output (GPIO_Type *Port, uint32_t Pin_Mask)
 Set pins with Pin_Mask of port with GPIOn_BASE_PTR to output. More...
 
void gpio_set_pin (GPIO_Type *Port, uint32_t Pin_Mask)
 Set pins with Pin_Mask of port with GPIOn_BASE_PTR high. More...
 
void gpio_clr_pin (GPIO_Type *Port, uint32_t Pin_Mask)
 Clear pins with Pin_Mask of port with GPIOn_BASE_PTR low. More...
 
void gpio_tgl_pin (GPIO_Type *Port, uint32_t Pin_Mask)
 Toggle pins with Pin_Mask of port with GPIOn_BASE_PTR low. More...
 
uint32_t gpio_read_pin (GPIO_Type *Port, uint32_t Pin_Mask)
 Read pins with Pin_Mask of port with GPIOn_BASE_PTR. More...
 

Detailed Description

Header file with function declarations for the MKL25Z GPIO module.

Definition in file gpio.h.