46 #include "derivative.h"
55 #define PORT_PCR_MUX_DISABLE 0x000
56 #define PORT_PCR_MUX_GPIO 0x100
57 #define PORT_PCR_MUX_ALT2 0x200
58 #define PORT_PCR_MUX_ALT3 0x300
59 #define PORT_PCR_MUX_ALT4 0x400
60 #define PORT_PCR_MUX_ALT5 0x500
61 #define PORT_PCR_MUX_ALT6 0x600
62 #define PORT_PCR_MUX_ALT7 0x700
70 #define PORT_PCR_IRQC_DISABLE 0x00000
71 #define PORT_PCR_IRQC_DMA_RISING 0x10000
72 #define PORT_PCR_IRQC_DMA_FALLING 0x20000
73 #define PORT_PCR_IRQC_DMA_EDGE 0x30000
74 #define PORT_PCR_IRQC_ZERO 0x80000
75 #define PORT_PCR_IRQC_RISING 0x90000
76 #define PORT_PCR_IRQC_FALLING 0xA0000
77 #define PORT_PCR_IRQC_EDGE 0xB0000
78 #define PORT_PCR_IRQC_ONE 0xC0000
void gpio_init()
initialise the Port interrupt callback function arrays.
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.
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.
bool port_pin_read_isf(PORT_Type *Port, uint8_t Pin)
Return the Interrupt Status of the Pin in port with PORTx_BASE_PTR.
void gpio_set_output(GPIO_Type *Port, uint32_t Pin_Mask)
Set pins with Pin_Mask of port with GPIOn_BASE_PTR to output.
uint32_t gpio_read_pin(GPIO_Type *Port, uint32_t Pin_Mask)
Read pins with Pin_Mask of port with GPIOn_BASE_PTR.
GPIO - Register Layout Typedef.
bool port_read_pin_isf(PORT_Type *Port, uint8_t Pin)
Return the Interrupt Status Flags of Pin in port with PORTx_BASE_PTR.
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.
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.
void port_clr_isf(PORT_Type *Port, uint32_t Pin_Mask)
Clear the Interrupt Status Flag of port with PORTx_BASE_PTR.
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.
void port_register_callback(void *f, PORT_Type *port, uint8_t pin)
Register Port interrupt callback function.
uint32_t port_read_isf(PORT_Type *Port)
Return the Interrupt Status Flags of port with PORTx_BASE_PTR.
void gpio_clr_pin(GPIO_Type *Port, uint32_t Pin_Mask)
Clear pins with Pin_Mask of port with GPIOn_BASE_PTR low.
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.
PORT - Register Layout Typedef.
void gpio_tgl_pin(GPIO_Type *Port, uint32_t Pin_Mask)
Toggle pins with Pin_Mask of port with GPIOn_BASE_PTR low.
void gpio_set_input(GPIO_Type *Port, uint32_t Pin_Mask)
Set pins with Pin_Mask of port with GPIOn_BASE_PTR to input.
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.
void port_pin_clr_isf(PORT_Type *Port, uint8_t Pin)
Clear the Interrupt Status Flag of Pin in port with PORTx_BASE_PTR.
void gpio_set_pin(GPIO_Type *Port, uint32_t Pin_Mask)
Set pins with Pin_Mask of port with GPIOn_BASE_PTR high.
uint32_t port_pin_to_mask(uint8_t pin)
Convert a pin number (0 to 31) to a pin mask.