1.1 --- a/pic32.h Wed Oct 17 13:38:01 2018 +0200
1.2 +++ b/pic32.h Wed Oct 17 17:40:05 2018 +0200
1.3 @@ -1,10 +1,10 @@
1.4 #ifndef __PIC32_H__
1.5 #define __PIC32_H__
1.6
1.7 -/* See...
1.8 +/* Peripheral addresses.
1.9 + * See...
1.10 * TABLE 4-1: SFR MEMORYMAP
1.11 * TABLE 11-3: PORTA REGISTER MAP
1.12 - * 11.2 CLR, SET and INV Registers
1.13 * PIC32MX1XX/2XX 28/36/44-pin Family Data Sheet
1.14 */
1.15
1.16 @@ -28,12 +28,6 @@
1.17 #define TMR3 0xBF800A10
1.18 #define PR3 0xBF800A20
1.19
1.20 -#define U1MODE 0xBF806000
1.21 -#define U1STA 0xBF806010
1.22 -#define U1TXREG 0xBF806020
1.23 -#define U1RXREG 0xBF806030
1.24 -#define U1BRG 0xBF806040
1.25 -
1.26 #define PMCON 0xBF807000
1.27 #define PMMODE 0xBF807010
1.28 #define PMADDR 0xBF807020
1.29 @@ -71,8 +65,13 @@
1.30 #define IEC1 0xBF881070
1.31 #define IPC1 0xBF8810A0
1.32 #define IPC2 0xBF8810B0
1.33 +#define IPC3 0xBF8810C0
1.34 +#define IPC4 0xBF8810D0
1.35 +#define IPC5 0xBF8810E0
1.36 +#define IPC6 0xBF8810F0
1.37 #define IPC7 0xBF881100
1.38 #define IPC8 0xBF881110
1.39 +#define IPC9 0xBF881120
1.40 #define IPC10 0xBF881130
1.41
1.42 #define BMXCON 0xBF882000
1.43 @@ -81,32 +80,6 @@
1.44 #define BMXDUPBA 0xBF882030
1.45 #define BMXDRMSZ 0xBF882040
1.46
1.47 -#define DMACON 0xBF883000
1.48 -#define DCH0CON 0xBF883060
1.49 -#define DCH0ECON 0xBF883070
1.50 -#define DCH0INT 0xBF883080
1.51 -#define DCH0SSA 0xBF883090
1.52 -#define DCH0DSA 0xBF8830A0
1.53 -#define DCH0SSIZ 0xBF8830B0
1.54 -#define DCH0DSIZ 0xBF8830C0
1.55 -#define DCH0CSIZ 0xBF8830F0
1.56 -#define DCH1CON 0xBF883120
1.57 -#define DCH1ECON 0xBF883130
1.58 -#define DCH1INT 0xBF883140
1.59 -#define DCH1SSA 0xBF883150
1.60 -#define DCH1DSA 0xBF883160
1.61 -#define DCH1SSIZ 0xBF883170
1.62 -#define DCH1DSIZ 0xBF883180
1.63 -#define DCH1CSIZ 0xBF8831B0
1.64 -#define DCH2CON 0xBF8831E0
1.65 -#define DCH2ECON 0xBF8831F0
1.66 -#define DCH2INT 0xBF883200
1.67 -#define DCH2SSA 0xBF883210
1.68 -#define DCH2DSA 0xBF883220
1.69 -#define DCH2SSIZ 0xBF883230
1.70 -#define DCH2DSIZ 0xBF883240
1.71 -#define DCH2CSIZ 0xBF883270
1.72 -
1.73 #define ANSELA 0xBF886000
1.74 #define TRISA 0xBF886010
1.75 #define PORTA 0xBF886020
1.76 @@ -118,8 +91,77 @@
1.77 #define LATB 0xBF886130
1.78 #define ODCB 0xBF886140
1.79
1.80 -#define CLR 0x4
1.81 -#define SET 0x8
1.82 -#define INV 0xC
1.83 +/* DMA conveniences. */
1.84 +
1.85 +#define DMACON 0xBF883000
1.86 +#define DCH0CON 0xBF883060
1.87 +#define DCH1CON 0xBF883120
1.88 +#define DCH2CON 0xBF8831E0
1.89 +#define DCH3CON 0xBF8832A0
1.90 +
1.91 +#define DCHMIN 0
1.92 +#define DCHMAX 3
1.93 +#define DCHBASE DCH0CON
1.94 +#define DCHSTEP (DCH1CON - DCH0CON)
1.95 +
1.96 +#define DCHxCON 0x00
1.97 +#define DCHxECON 0x10
1.98 +#define DCHxINT 0x20
1.99 +#define DCHxSSA 0x30
1.100 +#define DCHxDSA 0x40
1.101 +#define DCHxSSIZ 0x50
1.102 +#define DCHxDSIZ 0x80
1.103 +#define DCHxCSIZ 0x90
1.104 +
1.105 +#define DMAIEC IEC1
1.106 +#define DMAIFS IFS1
1.107 +#define DMAINTBASE 28
1.108 +#define DMAIPC IPC10
1.109 +#define DCHIPCBASE 0
1.110 +#define DCHIPCSTEP 8
1.111 +
1.112 +/* UART conveniences. */
1.113 +
1.114 +#define U1MODE 0xBF806000
1.115 +#define U2MODE 0xBF806200
1.116 +
1.117 +#define UARTMIN 1
1.118 +#define UARTMAX 2
1.119 +#define UARTBASE U1MODE
1.120 +#define UARTSTEP (U2MODE - U1MODE)
1.121 +
1.122 +#define UxMODE 0x00
1.123 +#define UxSTA 0x10
1.124 +#define UxTXREG 0x20
1.125 +#define UxRXREG 0x30
1.126 +#define UxBRG 0x40
1.127 +
1.128 +#define UARTIEC IEC1
1.129 +#define UARTIFS IFS1
1.130 +#define UARTINTBASE 7
1.131 +#define UARTINTSTEP 14
1.132 +#define UART1IPC IPC8
1.133 +#define UART1IPCBASE 0
1.134 +#define UART2IPC IPC9
1.135 +#define UART2IPCBASE 8
1.136 +
1.137 +/* Interrupt numbers.
1.138 + * See...
1.139 + * TABLE 7-1: INTERRUPT IRQ, VECTOR AND BIT LOCATION
1.140 + * PIC32MX1XX/2XX 28/36/44-pin Family Data Sheet
1.141 + */
1.142 +
1.143 +#define U1RX 40
1.144 +#define U2RX 54
1.145 +
1.146 +/* Address modifiers.
1.147 + * See...
1.148 + * 11.2 CLR, SET and INV Registers
1.149 + * PIC32MX1XX/2XX 28/36/44-pin Family Data Sheet
1.150 + */
1.151 +
1.152 +#define CLR 0x4
1.153 +#define SET 0x8
1.154 +#define INV 0xC
1.155
1.156 #endif /* __PIC32_H__ */