periph_cpu_common.h
Go to the documentation of this file.
1 /*
2  * Copyright(C) 2017, Imagination Technologies Limited and/or its
3  * affiliated group companies.
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  *
9  */
10 
22 #ifndef PERIPH_CPU_COMMON_H
23 #define PERIPH_CPU_COMMON_H
24 
25 #include "cpu.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 #define FLASH_XIP (1)
35 
40 #define PROVIDES_PM_SET_LOWEST
41 
46 #define CPUID_LEN (4U)
47 
48 #ifndef DOXYGEN
49 
53 #define HAVE_GPIO_T
54 typedef uint32_t gpio_t;
56 #endif
57 
61 #define GPIO_PIN(x, y) (((_PORTB_BASE_ADDRESS & 0xFFFFF000) + (x << 8)) | y)
62 
66 enum {
67  PORT_A = 0,
68  PORT_B = 1,
69  PORT_C = 2,
70  PORT_D = 3,
71  PORT_E = 4,
72  PORT_F = 5,
73  PORT_G = 6,
74 };
75 
79 #define PERIPH_TIMER_PROVIDES_SET
80 
81 
85 typedef enum {
86  GPIO_AF0 = 0,
102 } gpio_af_t;
103 
107 typedef struct {
108  volatile unsigned int * base;
109  uint32_t clock;
110  gpio_t rx_pin;
111  gpio_t tx_pin;
112  volatile unsigned int *rx_mux_reg;
113  volatile unsigned int *tx_mux_reg;
114  gpio_af_t rx_af;
115  gpio_af_t tx_af;
116  uint32_t vector;
117 #ifdef CPU_FAM_PIC32MX
118  uint32_t irq;
119 #endif
120 } uart_conf_t;
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif /* PERIPH_CPU_COMMON_H */
127 
volatile unsigned int * tx_mux_reg
Address of TX mux register.
volatile unsigned int * rx_mux_reg
Address of RX mux register.
use alternate function 9
gpio_af_t
Available MUX values for configuring a pin&#39;s alternate function.
use alternate function 13
port E
gpio_af_t tx_af
alternate function for TX pin
use alternate function 11
use alternate function 8
port G
volatile unsigned int * base
UART device base register address.
use alternate function 1
port A
use alternate function 10
port B
use alternate function 5
use alternate function 2
unsigned int gpio_t
GPIO type identifier.
Definition: gpio.h:86
uint32_t vector
vector number
port C
use alternate function 6
use alternate function 12
use alternate function 4
uint32_t clock
Peripheral clock frequency.
port D
use alternate function 0
UART device configuration.
Definition: periph_cpu.h:166
gpio_af_t rx_af
alternate function for RX pin
port F
use alternate function 14
use alternate function 15
use alternate function 3
use alternate function 7