diff --git a/sys/pic32/32mxsdram/Config b/sys/pic32/32mxsdram/Config index 82bbafb..d19cc45 100644 --- a/sys/pic32/32mxsdram/Config +++ b/sys/pic32/32mxsdram/Config @@ -24,15 +24,11 @@ options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 #options "NPROC=20" -# LED -options "LED_KERNEL_PORT=TRISA" # for kernel activity LED... -options "LED_KERNEL_PIN=15" # ...use pin RA15 -options "LED_DISK_PORT=TRISC" # for disk activity LED... -options "LED_DISK_PIN=13" # ...use pin RC13 -options "LED_SWAP_PORT=TRISC" # for swap activity LED... -options "LED_SWAP_PIN=14" # ...use pin RC14 -options "LED_TTY_PORT=TRISA" # for serial activity LED... -options "LED_TTY_PIN=14" # ...use pin RA14 +# LEDs +signal "LED_KERNEL" pin RA15 # kernel activity indicator +signal "LED_DISK" pin RC13 # disk activity indicator +signal "LED_SWAP" pin RC14 # swap activity indicator +signal "LED_TTY" pin RA14 # tty activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a @@ -55,8 +51,7 @@ options "SD0_MHZ=10" # speed 10 MHz options "SD0_PORT=4" # at spi4 TODO: delete options "SD0_CS_PORT=TRISF" # for chip select... TODO: delete options "SD0_CS_PIN=3" # ...use pin RF3 TODO: delete -options "SD0_ENA_PORT=TRISB" # for microSD enable... TODO: delete -options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: delete +signal "SD0_ENA" pin RB13 # SD enable signal # ADC driver device adc diff --git a/sys/pic32/32mxsdram/Makefile b/sys/pic32/32mxsdram/Makefile index 24a20e6..e5dc67d 100644 --- a/sys/pic32/32mxsdram/Makefile +++ b/sys/pic32/32mxsdram/Makefile @@ -6,24 +6,19 @@ PARAM += -DSD_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED PARAM += -DSDRAMP_ENABLED +PARAM += -DSD0_ENA_PORT=TRISB -DSD0_ENA_PIN=13 +PARAM += -DLED_TTY_PORT=TRISA -DLED_TTY_PIN=14 +PARAM += -DLED_SWAP_PORT=TRISC -DLED_SWAP_PIN=14 +PARAM += -DLED_DISK_PORT=TRISC -DLED_DISK_PIN=13 +PARAM += -DLED_KERNEL_PORT=TRISA -DLED_KERNEL_PIN=15 PARAM += -DNMOUNT=3 PARAM += -DPARTITION='sdramp0:sa@2048,fs@14000' PARAM += -DKERNEL_EXECUTABLE_RAM -PARAM += -DSD0_ENA_PIN=13 -PARAM += -DSD0_ENA_PORT=TRISB PARAM += -DSD0_CS_PIN=3 PARAM += -DSD0_CS_PORT=TRISF PARAM += -DSD0_PORT=4 PARAM += -DSD0_MHZ=10 PARAM += -DCONSOLE_DEVICE=tty2 -PARAM += -DLED_TTY_PIN=14 -PARAM += -DLED_TTY_PORT=TRISA -PARAM += -DLED_SWAP_PIN=14 -PARAM += -DLED_SWAP_PORT=TRISC -PARAM += -DLED_DISK_PIN=13 -PARAM += -DLED_DISK_PORT=TRISC -PARAM += -DLED_KERNEL_PIN=15 -PARAM += -DLED_KERNEL_PORT=TRISA PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/Config.generic b/sys/pic32/Config.generic index 8710e25..e3a26d0 100644 --- a/sys/pic32/Config.generic +++ b/sys/pic32/Config.generic @@ -40,18 +40,10 @@ options "KERNEL_HIGHLIGHT" # Highlight kernel messages options "PARTITION='%1'" # Partition schema for RAM device # LEDs -options "LED_DISK_PORT=TRISF" # for disk activity LED... -options "LED_DISK_PIN=0" # ...use pin RF0 -options "LED_DISK_INVERT" # invert disk LED -options "LED_SWAP_PORT=TRISF" # for swap activity LED... -options "LED_SWAP_PIN=1" # ...use pin RF1 -options "LED_SWAP_INVERT" # invert swap LED -options "LED_TTY_PORT=TRISA" # for tty LED... -options "LED_TTY_PIN=2" # ...use pin RA2 -options "LED_TTY_INVERT" # invert tty LED -options "LED_KERNEL_PORT=TRISA" # for kernel actibity LED... -options "LED_KERNEL_PIN=3" # ...use pin RA3 -options "LED_KERNEL_INVERT" # invert kernel LED +signal "LED_DISK" pin RF0 invert # disk activity indicator +signal "LED_SWAP" pin RA1 invert # swap activity indicator +signal "LED_TTY" pin RA2 invert # tty activity indicator +signal "LED_KERNEL" pin RA3 invert # kernel activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a @@ -67,8 +59,7 @@ options "UART1_BAUD=115200" # default speed options "UART2_BAUD=115200" # default speed options "UART3_BAUD=115200" # default speed options "UART4_BAUD=115200" # default speed -options "UART4_ENA_PORT=TRISB" # to enable power for uart4... -options "UART4_ENA_PIN=13" # ...use pin RB13 +signal "UART4_ENA" pin RB13 # power enable signal # USB UART ports device uartusb # USB device mode, CDC function @@ -92,8 +83,7 @@ options "SD0_MHZ=10" # speed 10 MHz options "SD0_PORT=2" # at spi2 TODO: delete options "SD0_CS_PORT=TRISC" # for chip select... TODO: delete options "SD0_CS_PIN=14" # ...use pin RC14 TODO: delete -options "SD0_ENA_PORT=TRISA" # to enable SD card... TODO: delete -options "SD0_ENA_PIN=5" # ...use pin RA5 TODO: delete +signal "SD0_ENA" pin RA5 # SD card enable signal TODO: delete # General purpose I/O ports # Flags define a mask of available pins @@ -114,8 +104,7 @@ device gpio4 flags 0x03ff # port E device gpio5 flags 0x313f # port F device gpio6 flags 0xf3cf # port G -options "GPIO_CLEAR_PORT=TRISA" # clear on startup... -options "GPIO_CLEAR_PIN=5" # ...pin RA5 +signal "GPIO_CLEAR" pin RA5 # clear on startup # ADC driver device adc @@ -140,12 +129,9 @@ service log # Power control device power -options "POWER_LED_PORT=TRISA" # for power LED... -options "POWER_LED_PIN=3" # ...use pin RA3 -options "POWER_SWITCH_PORT=TRISA" # for power switch... -options "POWER_SWITCH_PIN=4" # ...use pin RA4 -options "POWER_CONTROL_PORT=TRISA" # for power switch... -options "POWER_CONTROL_PIN=5" # ...use pin RA5 +signal "POWER_LED" pin RA3 +signal "POWER_SWITCH" pin RA4 +signal "POWER_CONTROL" pin RA5 #-------------------------------------------- # Custom RAM disk devices @@ -157,21 +143,16 @@ options "KERNEL_EXECUTABLE_RAM" # allow kernel code in RAM area # sramc - SRAM block device device sramc0 # SRAM via 4-wire CPLD interface -options "SRAMC_DATA_PORT=TRISE" # for DATA signal... -options "SRAMC_DATA_PIN=0" # ...use pin RE0 -options "SRAMC_LDA_PORT=TRISC" # for LDA signal... -options "SRAMC_LDA_PIN=13" # ...use pin RC13 -options "SRAMC_RD_PORT=TRISF" # for RD signal... -options "SRAMC_RD_PIN=1" # ...use pin RF1 -options "SRAMC_WR_PORT=TRISF" # for WR signal... -options "SRAMC_WR_PIN=0" # ...use pin RF0 +signal "SRAMC_DATA" pin RE0 +signal "SRAMC_LDA" pin RC13 +signal "SRAMC_RD" pin RF1 +signal "SRAMC_WR" pin RF0 # picga - SPI block device controller spi1 # RAM disk: picga device picga0 at spi1 options "PICGA_BUS=SPI1CON" # TODO: delete this option -options "PICGA_CS_PORT=TRISA" # for CS... -options "PICGA_CS_PIN=4" # ...use pin RA4 +signal "PICGA_CS" pin RA4 # mrams - SPI block device controller spi1 # RAM disk: mrams @@ -180,30 +161,18 @@ options "MRAMS_PORT=SPI1CON" # TODO: delete this option options "MRAMS_CHIPS=6" # number of chips options "MRAMS_CHIPSIZE=512" # chip size in kbytes options "MRAMS_MHZ=10" # speed 10 MHz -options "MRAMS_CS0_PORT=TRISA" # for CS0... -options "MRAMS_CS0_PIN=4" # ...use pin RA4 -options "MRAMS_CS1_PORT=TRISA" # for CS1... -options "MRAMS_CS1_PIN=2" # ...use pin RA2 -options "MRAMS_CS2_PORT=TRISB" # for CS2... -options "MRAMS_CS2_PIN=14" # ...use pin RB14 -options "MRAMS_CS3_PORT=TRISB" # for CS3... -options "MRAMS_CS3_PIN=12" # ...use pin RB12 -options "MRAMS_CS4_PORT=TRISB" # for CS4... -options "MRAMS_CS4_PIN=10" # ...use pin RB10 -options "MRAMS_CS5_PORT=TRISB" # for CS5... -options "MRAMS_CS5_PIN=11" # ...use pin RB11 -options "MRAMS_LED0_PORT=TRISF" # for LED0... -options "MRAMS_LED0_PIN=0" # ...use pin RF0 -options "MRAMS_LED1_PORT=TRISF" # for LED1... -options "MRAMS_LED1_PIN=1" # ...use pin RF1 -options "MRAMS_LED2_PORT=TRISF" # for LED2... -options "MRAMS_LED2_PIN=2" # ...use pin RF2 -options "MRAMS_LED3_PORT=TRISF" # for LED3... -options "MRAMS_LED3_PIN=3" # ...use pin RF3 -options "MRAMS_LED4_PORT=TRISF" # for LED4... -options "MRAMS_LED4_PIN=4" # ...use pin RF4 -options "MRAMS_LED5_PORT=TRISF" # for LED5... -options "MRAMS_LED5_PIN=5" # ...use pin RF5 +signal "MRAMS_CS0" pin RA4 +signal "MRAMS_CS1" pin RA2 +signal "MRAMS_CS2" pin RB14 +signal "MRAMS_CS3" pin RB12 +signal "MRAMS_CS4" pin RB10 +signal "MRAMS_CS5" pin RB11 +signal "MRAMS_LED0" pin RF0 +signal "MRAMS_LED1" pin RF1 +signal "MRAMS_LED2" pin RF2 +signal "MRAMS_LED3" pin RF3 +signal "MRAMS_LED4" pin RF4 +signal "MRAMS_LED5" pin RF5 # spirams - SPI block device controller spi1 # RAM disk: spirams @@ -212,67 +181,35 @@ options "SPIRAMS_PORT=SPI1CON" # TODO: delete this option options "SPIRAMS_CHIPSIZE=128" # chip size in kbytes options "SPIRAMS_CHIPS=16" # number of chips options "SPIRAMS_MHZ=10" # speed 10 MHz -options "SPIRAMS_CS0_PORT=TRISF" # for CS0... -options "SPIRAMS_CS0_PIN=0" # ...use pin RF0 -options "SPIRAMS_CS1_PORT=TRISF" # for CS1... -options "SPIRAMS_CS1_PIN=1" # ...use pin RF1 -options "SPIRAMS_CS2_PORT=TRISF" # for CS2... -options "SPIRAMS_CS2_PIN=2" # ...use pin RF2 -options "SPIRAMS_CS3_PORT=TRISF" # for CS3... -options "SPIRAMS_CS3_PIN=3" # ...use pin RF3 -options "SPIRAMS_CS4_PORT=TRISF" # for CS4... -options "SPIRAMS_CS4_PIN=4" # ...use pin RF4 -options "SPIRAMS_CS5_PORT=TRISF" # for CS5... -options "SPIRAMS_CS5_PIN=5" # ...use pin RF5 -options "SPIRAMS_CS6_PORT=TRISF" # for CS6... -options "SPIRAMS_CS6_PIN=6" # ...use pin RF6 -options "SPIRAMS_CS7_PORT=TRISF" # for CS7... -options "SPIRAMS_CS7_PIN=7" # ...use pin RF7 -options "SPIRAMS_CS8_PORT=TRISF" # for CS8... -options "SPIRAMS_CS8_PIN=8" # ...use pin RF8 -options "SPIRAMS_CS9_PORT=TRISF" # for CS9... -options "SPIRAMS_CS9_PIN=9" # ...use pin RF9 -options "SPIRAMS_CS10_PORT=TRISF" # for CS10... -options "SPIRAMS_CS10_PIN=10" # ...use pin RF10 -options "SPIRAMS_CS11_PORT=TRISF" # for CS11... -options "SPIRAMS_CS11_PIN=11" # ...use pin RF11 -options "SPIRAMS_CS12_PORT=TRISF" # for CS12... -options "SPIRAMS_CS12_PIN=12" # ...use pin RF12 -options "SPIRAMS_CS13_PORT=TRISF" # for CS13... -options "SPIRAMS_CS13_PIN=13" # ...use pin RF13 -options "SPIRAMS_CS14_PORT=TRISF" # for CS14... -options "SPIRAMS_CS14_PIN=14" # ...use pin RF14 -options "SPIRAMS_CS15_PORT=TRISF" # for CS15... -options "SPIRAMS_CS15_PIN=15" # ...use pin RF15 -options "SPIRAMS_LED0_PORT=TRISG" # for LED0... -options "SPIRAMS_LED0_PIN=0" # ...use pin RG0 -options "SPIRAMS_LED1_PORT=TRISG" # for LED1... -options "SPIRAMS_LED1_PIN=1" # ...use pin RG1 -options "SPIRAMS_LED2_PORT=TRISG" # for LED2... -options "SPIRAMS_LED2_PIN=2" # ...use pin RG2 -options "SPIRAMS_LED3_PORT=TRISG" # for LED3... -options "SPIRAMS_LED3_PIN=3" # ...use pin RG3 -options "SPIRAMS_LED4_PORT=TRISG" # for LED4... -options "SPIRAMS_LED4_PIN=4" # ...use pin RG4 -options "SPIRAMS_LED5_PORT=TRISG" # for LED5... -options "SPIRAMS_LED5_PIN=5" # ...use pin RG5 -options "SPIRAMS_LED6_PORT=TRISG" # for LED6... -options "SPIRAMS_LED6_PIN=6" # ...use pin RG6 -options "SPIRAMS_LED7_PORT=TRISG" # for LED7... -options "SPIRAMS_LED7_PIN=7" # ...use pin RG7 -options "SPIRAMS_LED8_PORT=TRISG" # for LED8... -options "SPIRAMS_LED8_PIN=8" # ...use pin RG8 -options "SPIRAMS_LED9_PORT=TRISG" # for LED9... -options "SPIRAMS_LED9_PIN=9" # ...use pin RG9 -options "SPIRAMS_LED10_PORT=TRISG" # for LED10... -options "SPIRAMS_LED10_PIN=10" # ...use pin RG10 -options "SPIRAMS_LED11_PORT=TRISG" # for LED11... -options "SPIRAMS_LED11_PIN=11" # ...use pin RG11 -options "SPIRAMS_LED12_PORT=TRISG" # for LED12... -options "SPIRAMS_LED12_PIN=12" # ...use pin RG12 -options "SPIRAMS_LED13_PORT=TRISG" # for LED13... -options "SPIRAMS_LED13_PIN=13" # ...use pin RG13 -options "SPIRAMS_LED14_PORT=TRISG" # for LED14... -options "SPIRAMS_LED14_PIN=14" # ...use pin RG14 -options "SPIRAMS_LED15_PORT=TRISG" # for LED15... -options "SPIRAMS_LED15_PIN=15" # ...use pin RG15 +signal "SPIRAMS_CS0" pin RF0 +signal "SPIRAMS_CS1" pin RF1 +signal "SPIRAMS_CS2" pin RF2 +signal "SPIRAMS_CS3" pin RF3 +signal "SPIRAMS_CS4" pin RF4 +signal "SPIRAMS_CS5" pin RF5 +signal "SPIRAMS_CS6" pin RF6 +signal "SPIRAMS_CS7" pin RF7 +signal "SPIRAMS_CS8" pin RF8 +signal "SPIRAMS_CS9" pin RF9 +signal "SPIRAMS_CS10" pin RF10 +signal "SPIRAMS_CS11" pin RF11 +signal "SPIRAMS_CS12" pin RF12 +signal "SPIRAMS_CS13" pin RF13 +signal "SPIRAMS_CS14" pin RF14 +signal "SPIRAMS_CS15" pin RF15 +signal "SPIRAMS_LED0" pin RG0 +signal "SPIRAMS_LED1" pin RG1 +signal "SPIRAMS_LED2" pin RG2 +signal "SPIRAMS_LED3" pin RG3 +signal "SPIRAMS_LED4" pin RG4 +signal "SPIRAMS_LED5" pin RG5 +signal "SPIRAMS_LED6" pin RG6 +signal "SPIRAMS_LED7" pin RG7 +signal "SPIRAMS_LED8" pin RG8 +signal "SPIRAMS_LED9" pin RG9 +signal "SPIRAMS_LED10" pin RG10 +signal "SPIRAMS_LED11" pin RG11 +signal "SPIRAMS_LED12" pin RG12 +signal "SPIRAMS_LED13" pin RG13 +signal "SPIRAMS_LED14" pin RG14 +signal "SPIRAMS_LED15" pin RG15 diff --git a/sys/pic32/baremetal/Config b/sys/pic32/baremetal/Config index 3e2fbc2..b2ae7b8 100644 --- a/sys/pic32/baremetal/Config +++ b/sys/pic32/baremetal/Config @@ -22,13 +22,10 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISD" # for kernel activity LED... -options "LED_KERNEL_PIN=3" # ...use pin RD3 -options "LED_DISK_PORT=TRISD" # for disk activity LED... -options "LED_DISK_PIN=2" # ...use pin RD2 -options "LED_TTY_PORT=TRISD" # for serial activity LED... -options "LED_TTY_PIN=12" # ...use pin RD12 +# LEDs +signal "LED_KERNEL" pin RD3 # kernel activity indicator +signal "LED_DISK" pin RD2 # disk activity indicator +signal "LED_TTY" pin RD12 # tty activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/baremetal/Makefile b/sys/pic32/baremetal/Makefile index 6b708b6..7549d10 100644 --- a/sys/pic32/baremetal/Makefile +++ b/sys/pic32/baremetal/Makefile @@ -3,17 +3,14 @@ PARAM += -DPIC32MX7 PARAM += -DUART1_ENABLED PARAM += -DSPI2_ENABLED PARAM += -DSD_ENABLED +PARAM += -DLED_TTY_PORT=TRISD -DLED_TTY_PIN=12 +PARAM += -DLED_DISK_PORT=TRISD -DLED_DISK_PIN=2 +PARAM += -DLED_KERNEL_PORT=TRISD -DLED_KERNEL_PIN=3 PARAM += -DSD0_CS_PIN=1 PARAM += -DSD0_CS_PORT=TRISD PARAM += -DSD0_PORT=2 PARAM += -DSD0_MHZ=16 PARAM += -DCONSOLE_DEVICE=tty0 -PARAM += -DLED_TTY_PIN=12 -PARAM += -DLED_TTY_PORT=TRISD -PARAM += -DLED_DISK_PIN=2 -PARAM += -DLED_DISK_PORT=TRISD -PARAM += -DLED_KERNEL_PIN=3 -PARAM += -DLED_KERNEL_PORT=TRISD PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/devsw.c b/sys/pic32/devsw.c index 145a7f1..416dfe4 100644 --- a/sys/pic32/devsw.c +++ b/sys/pic32/devsw.c @@ -42,7 +42,7 @@ extern int strcmp(char *s1, char *s2); #ifdef PTY_ENABLED # include #endif -#ifdef HX8357_ENABLED +#ifdef HXTFT_ENABLED # include #endif #ifdef SKEL_ENABLED @@ -263,7 +263,7 @@ const struct cdevsw cdevsw[] = { #endif }, { /* 16 - tft */ -#ifdef HX8357_ENABLED +#ifdef HXTFT_ENABLED hx8357_open, hx8357_close, hx8357_read, hx8357_write, hx8357_ioctl, nulldev, hx8357_ttys, hx8357_select, nostrategy, hx8357_getc, hx8357_putc, hx8357devs diff --git a/sys/pic32/duinomite-emega/Config b/sys/pic32/duinomite-emega/Config index 05f62d3..b60e74b 100644 --- a/sys/pic32/duinomite-emega/Config +++ b/sys/pic32/duinomite-emega/Config @@ -24,11 +24,9 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=40000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISB" # for kernel activity LED... -options "LED_KERNEL_PIN=15" # ...use pin RB15 -options "LED_DISK_PORT=TRISC" # for disk activity LED... -options "LED_DISK_PIN=1" # ...use pin RC1 +# LEDs +signal "LED_KERNEL" pin RB15 # kernel activity indicator +signal "LED_DISK" pin RC1 # disk activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a @@ -51,8 +49,7 @@ device sd0 at spi3 options "SD0_PORT=3" # at spi3 TODO: delete options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete options "SD0_CS_PIN=12" # ...use pin RG12 TODO: delete -options "SD0_ENA_PORT=TRISG" # for SD enable... TODO: delete -options "SD0_ENA_PIN=13" # ...use pin RG13 TODO: delete +signal "SD0_ENA" pin RG13 # SD card enable signal TODO: delete # General purpose I/O ports # Flags define a mask of available pins diff --git a/sys/pic32/duinomite-emega/Config-uart b/sys/pic32/duinomite-emega/Config-uart index ac733ea..5196845 100644 --- a/sys/pic32/duinomite-emega/Config-uart +++ b/sys/pic32/duinomite-emega/Config-uart @@ -24,11 +24,9 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=40000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISB" # for kernel activity LED... -options "LED_KERNEL_PIN=15" # ...use pin RB15 -options "LED_DISK_PORT=TRISC" # for disk activity LED... -options "LED_DISK_PIN=1" # ...use pin RC1 +# LEDs +signal "LED_KERNEL" pin RB15 # kernel activity indicator +signal "LED_DISK" pin RC1 # disk activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a @@ -39,8 +37,7 @@ options "CONSOLE_DEVICE=tty4" # Console on UART5 # Serial UART ports device uart5 pin RB13 # RS-232 port, enable pin -options "UART5_ENA_PORT=TRISB" # for RS-232 enable... TODO: delete -options "UART5_ENA_PIN=13" # ...use pin RB13 TODO: delete +signal "UART5_ENA" pin RB13 # RS-232 enable signal TODO: delete # SPI ports controller spi3 # SD card @@ -51,8 +48,7 @@ device sd0 at spi3 options "SD0_PORT=3" # at spi3 TODO: delete options "SD0_CS_PORT=TRISG" # for chip select... TODO: delete options "SD0_CS_PIN=12" # ...use pin RG12 TODO: delete -options "SD0_ENA_PORT=TRISG" # for SD enable... TODO: delete -options "SD0_ENA_PIN=13" # ...use pin RG13 TODO: delete +signal "SD0_ENA" pin RG13 # SD card enable signal TODO: delete # General purpose I/O ports # Flags define a mask of available pins diff --git a/sys/pic32/duinomite-emega/Makefile b/sys/pic32/duinomite-emega/Makefile index 76ecc7d..8d43d1b 100644 --- a/sys/pic32/duinomite-emega/Makefile +++ b/sys/pic32/duinomite-emega/Makefile @@ -12,18 +12,15 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED -PARAM += -DSD0_ENA_PIN=13 -PARAM += -DSD0_ENA_PORT=TRISG +PARAM += -DSD0_ENA_PORT=TRISG -DSD0_ENA_PIN=13 +PARAM += -DLED_DISK_PORT=TRISC -DLED_DISK_PIN=1 +PARAM += -DLED_KERNEL_PORT=TRISB -DLED_KERNEL_PIN=15 PARAM += -DSD0_CS_PIN=12 PARAM += -DSD0_CS_PORT=TRISG PARAM += -DSD0_PORT=3 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_DISK_PIN=1 -PARAM += -DLED_DISK_PORT=TRISC -PARAM += -DLED_KERNEL_PIN=15 -PARAM += -DLED_KERNEL_PORT=TRISB PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=40000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/duinomite/Config b/sys/pic32/duinomite/Config index ce72040..b651b21 100644 --- a/sys/pic32/duinomite/Config +++ b/sys/pic32/duinomite/Config @@ -23,11 +23,9 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISB" # for kernel activity LED... -options "LED_KERNEL_PIN=15" # ...use pin RB15 -options "LED_DISK_PORT=TRISB" # for disk activity LED... -options "LED_DISK_PIN=12" # ...use pin RB12 +# LEDs +signal "LED_KERNEL" pin RB15 # kernel activity indicator +signal "LED_DISK" pin RB12 # disk activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a @@ -50,8 +48,7 @@ device sd0 at spi3 options "SD0_PORT=3" # at spi3 TODO: delete options "SD0_CS_PORT=TRISD" # for chip select... TODO: delete options "SD0_CS_PIN=5" # ...use pin RD5 TODO: delete -options "SD0_ENA_PORT=TRISB" # for SD enable... TODO: delete -options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: delete +signal "SD0_ENA" pin RB13 # SD card enable signal TODO: delete # General purpose I/O ports # Flags define a mask of available pins diff --git a/sys/pic32/duinomite/Config-uart b/sys/pic32/duinomite/Config-uart index 23d7c92..6ba0942 100644 --- a/sys/pic32/duinomite/Config-uart +++ b/sys/pic32/duinomite/Config-uart @@ -23,11 +23,9 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISB" # for kernel activity LED... -options "LED_KERNEL_PIN=15" # ...use pin RB15 -options "LED_DISK_PORT=TRISB" # for disk activity LED... -options "LED_DISK_PIN=12" # ...use pin RB12 +# LEs +signal "LED_KERNEL" pin RB15 # kernel activity indicator +signal "LED_DISK" pin RB12 # disk activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a @@ -38,8 +36,7 @@ options "CONSOLE_DEVICE=tty4" # Console on UART5 # Serial UART ports device uart5 pin RB13 # RS-232 port, enable pin -options "UART5_ENA_PORT=TRISB" # for RS-232 enable... TODO: delete -options "UART5_ENA_PIN=13" # ...use pin RB13 TODO: delete +signal "UART5_ENA" pin RB13 # RS-232 enable signal TODO: delete # SPI ports controller spi3 # SD card @@ -50,8 +47,7 @@ device sd0 at spi3 options "SD0_PORT=3" # at spi3 TODO: delete options "SD0_CS_PORT=TRISD" # for chip select... TODO: delete options "SD0_CS_PIN=5" # ...use pin RD5 TODO: delete -options "SD0_ENA_PORT=TRISB" # for SD enable... TODO: delete -options "SD0_ENA_PIN=13" # ...use pin RB13 TODO: delete +signal "SD0_ENA" pin RB13 # SD card enable signal TODO: delete # General purpose I/O ports # Flags define a mask of available pins diff --git a/sys/pic32/duinomite/Makefile b/sys/pic32/duinomite/Makefile index 16fd838..3875ee8 100644 --- a/sys/pic32/duinomite/Makefile +++ b/sys/pic32/duinomite/Makefile @@ -11,18 +11,15 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED -PARAM += -DSD0_ENA_PIN=13 -PARAM += -DSD0_ENA_PORT=TRISB +PARAM += -DSD0_ENA_PORT=TRISB -DSD0_ENA_PIN=13 +PARAM += -DLED_DISK_PORT=TRISB -DLED_DISK_PIN=12 +PARAM += -DLED_KERNEL_PORT=TRISB -DLED_KERNEL_PIN=15 PARAM += -DSD0_CS_PIN=5 PARAM += -DSD0_CS_PORT=TRISD PARAM += -DSD0_PORT=3 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_DISK_PIN=12 -PARAM += -DLED_DISK_PORT=TRISB -PARAM += -DLED_KERNEL_PIN=15 -PARAM += -DLED_KERNEL_PORT=TRISB PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/explorer16/Config b/sys/pic32/explorer16/Config index 6c747d7..c290831 100644 --- a/sys/pic32/explorer16/Config +++ b/sys/pic32/explorer16/Config @@ -22,15 +22,11 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_DISK_PORT=TRISA" # for disk activity LED... -options "LED_DISK_PIN=0" # ...use pin RA0 -options "LED_KERNEL_PORT=TRISA" # for kernel activity LED... -options "LED_KERNEL_PIN=1" # ...use pin RA1 -options "LED_TTY_PORT=TRISA" # for serial activity LED... -options "LED_TTY_PIN=2" # ...use pin RA2 -options "LED_SWAP_PORT=TRISA" # for swap activity LED... -options "LED_SWAP_PIN=3" # ...use pin RA3 +# LEDs +signal "LED_DISK" pin RA0 # disk activity indicator +signal "LED_KERNEL" pin RA1 # kernel activity indicator +signal "LED_TTY" pin RA2 # tty activity indicator +signal "LED_SWAP" pin RA3 # swap activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/explorer16/Makefile b/sys/pic32/explorer16/Makefile index 5add0f2..7b88c2c 100644 --- a/sys/pic32/explorer16/Makefile +++ b/sys/pic32/explorer16/Makefile @@ -12,19 +12,15 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED +PARAM += -DLED_SWAP_PORT=TRISA -DLED_SWAP_PIN=3 +PARAM += -DLED_TTY_PORT=TRISA -DLED_TTY_PIN=2 +PARAM += -DLED_KERNEL_PORT=TRISA -DLED_KERNEL_PIN=1 +PARAM += -DLED_DISK_PORT=TRISA -DLED_DISK_PIN=0 PARAM += -DSD0_CS_PIN=1 PARAM += -DSD0_CS_PORT=TRISB PARAM += -DSD0_PORT=1 PARAM += -DSD0_MHZ=10 PARAM += -DCONSOLE_DEVICE=tty1 -PARAM += -DLED_SWAP_PIN=3 -PARAM += -DLED_SWAP_PORT=TRISA -PARAM += -DLED_TTY_PIN=2 -PARAM += -DLED_TTY_PORT=TRISA -PARAM += -DLED_KERNEL_PIN=1 -PARAM += -DLED_KERNEL_PORT=TRISA -PARAM += -DLED_DISK_PIN=0 -PARAM += -DLED_DISK_PORT=TRISA PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/fubarino/Config b/sys/pic32/fubarino/Config index ea7b3ee..d576b85 100644 --- a/sys/pic32/fubarino/Config +++ b/sys/pic32/fubarino/Config @@ -24,8 +24,7 @@ options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 # LED -options "LED_KERNEL_PORT=TRISE" # for kernel activity LED... -options "LED_KERNEL_PIN=5" # ...use pin RE5 +signal "LED_KERNEL" pin RE5 # kernel activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/fubarino/Config-uart-sramc b/sys/pic32/fubarino/Config-uart-sramc index 4ec24cd..2649f74 100644 --- a/sys/pic32/fubarino/Config-uart-sramc +++ b/sys/pic32/fubarino/Config-uart-sramc @@ -29,8 +29,7 @@ options "NMOUNT=3" options "NPROC=25" # LED -options "LED_KERNEL_PORT=TRISE" # for kernel activity LED... -options "LED_KERNEL_PIN=5" # ...use pin RE5 +signal "LED_KERNEL" pin RE5 # kernel activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/fubarino/Makefile b/sys/pic32/fubarino/Makefile index 7985c40..f40d7d4 100644 --- a/sys/pic32/fubarino/Makefile +++ b/sys/pic32/fubarino/Makefile @@ -12,14 +12,13 @@ PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED PARAM += -DGLCD_ENABLED +PARAM += -DLED_KERNEL_PORT=TRISE -DLED_KERNEL_PIN=5 PARAM += -DSD0_CS_PIN=9 PARAM += -DSD0_CS_PORT=TRISG PARAM += -DSD0_PORT=2 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_KERNEL_PIN=5 -PARAM += -DLED_KERNEL_PORT=TRISE PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/max32/Config b/sys/pic32/max32/Config index c8c1663..8f6aa64 100644 --- a/sys/pic32/max32/Config +++ b/sys/pic32/max32/Config @@ -23,8 +23,7 @@ options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 # LED -options "LED_KERNEL_PORT=TRISA" # for kernel activity LED... -options "LED_KERNEL_PIN=3" # ...use pin RA3 +signal "LED_KERNEL" pin RA3 # kernel activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/max32/Makefile b/sys/pic32/max32/Makefile index 689cf6c..dd9f13d 100644 --- a/sys/pic32/max32/Makefile +++ b/sys/pic32/max32/Makefile @@ -14,13 +14,12 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED +PARAM += -DLED_KERNEL_PORT=TRISA -DLED_KERNEL_PIN=3 PARAM += -DSD0_CS_PIN=14 PARAM += -DSD0_CS_PORT=TRISC PARAM += -DSD0_PORT=2 PARAM += -DSD0_MHZ=10 PARAM += -DCONSOLE_DEVICE=tty0 -PARAM += -DLED_KERNEL_PIN=3 -PARAM += -DLED_KERNEL_PORT=TRISA PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/maximite-color/Config b/sys/pic32/maximite-color/Config index c8a2a9f..28269af 100644 --- a/sys/pic32/maximite-color/Config +++ b/sys/pic32/maximite-color/Config @@ -22,12 +22,9 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISE" # for kernel activity LED... -options "LED_KERNEL_PIN=0" # ...use pin RE0... -options "LED_KERNEL_INVERT" # ...inverted -options "LED_DISK_PORT=TRISE" # for disk activity LED... -options "LED_DISK_PIN=1" # ...use pin RE1 +# LEDs +signal "LED_KERNEL" pin RE0 invert # kernel activity indicator +signal "LED_DISK" pin RE1 # disk activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a @@ -51,6 +48,7 @@ options "SD0_CS_PORT=TRISA" # for chip select... TODO: delete options "SD0_CS_PIN=1" # ...use pin RA1 TODO: delete # General purpose I/O ports +# Flags define a mask of available pins # The following pins excluded: # RF4, RF5, RD10, RA1 - spi4, SD card device gpio0 flags 0xc6fd # port A diff --git a/sys/pic32/maximite-color/Makefile b/sys/pic32/maximite-color/Makefile index b6d406f..744f0c2 100644 --- a/sys/pic32/maximite-color/Makefile +++ b/sys/pic32/maximite-color/Makefile @@ -12,17 +12,14 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED +PARAM += -DLED_DISK_PORT=TRISE -DLED_DISK_PIN=1 +PARAM += -DLED_KERNEL_PORT=TRISE -DLED_KERNEL_PIN=0 -DLED_KERNEL_INVERT PARAM += -DSD0_CS_PIN=1 PARAM += -DSD0_CS_PORT=TRISA PARAM += -DSD0_PORT=4 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_DISK_PIN=1 -PARAM += -DLED_DISK_PORT=TRISE -PARAM += -DLED_KERNEL_INVERT -PARAM += -DLED_KERNEL_PIN=0 -PARAM += -DLED_KERNEL_PORT=TRISE PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/maximite/Config b/sys/pic32/maximite/Config index 646e1d6..6155d84 100644 --- a/sys/pic32/maximite/Config +++ b/sys/pic32/maximite/Config @@ -23,12 +23,9 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISF" # for kernel activity LED... -options "LED_KERNEL_PIN=0" # ...use pin RF0... -options "LED_KERNEL_INVERT" # ...inverted -options "LED_DISK_PORT=TRISE" # for disk activity LED... -options "LED_DISK_PIN=1" # ...use pin RE1 +# LEDs +signal "LED_KERNEL" pin RF0 invert # kernel activity indicator +signal "LED_DISK" pin RE1 # disk activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/maximite/Makefile b/sys/pic32/maximite/Makefile index 7fb752a..7d04a34 100644 --- a/sys/pic32/maximite/Makefile +++ b/sys/pic32/maximite/Makefile @@ -12,17 +12,14 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED +PARAM += -DLED_DISK_PORT=TRISE -DLED_DISK_PIN=1 +PARAM += -DLED_KERNEL_PORT=TRISF -DLED_KERNEL_PIN=0 -DLED_KERNEL_INVERT PARAM += -DSD0_CS_PIN=0 PARAM += -DSD0_CS_PORT=TRISE PARAM += -DSD0_PORT=4 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_DISK_PIN=1 -PARAM += -DLED_DISK_PORT=TRISE -PARAM += -DLED_KERNEL_INVERT -PARAM += -DLED_KERNEL_PIN=0 -PARAM += -DLED_KERNEL_PORT=TRISF PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/mmb-mx7/Config b/sys/pic32/mmb-mx7/Config index e08f281..e6a7d62 100644 --- a/sys/pic32/mmb-mx7/Config +++ b/sys/pic32/mmb-mx7/Config @@ -22,16 +22,10 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISA" # for kernel activity LED... -options "LED_KERNEL_PIN=0" # ...use pin RA0... -options "LED_KERNEL_INVERT" # ...inverted -options "LED_SWAP_PORT=TRISD" # for swap activity LED... -options "LED_SWAP_PIN=9" # ...use pin RD9... -options "LED_SWAP_INVERT" # ...inverted -options "LED_TTY_PORT=TRISA" # for console activity LED... -options "LED_TTY_PIN=1" # ...use pin RA1... -options "LED_TTY_INVERT" # ...inverted +# LEDs +signal "LED_KERNEL" pin RA0 invert # kernel activity indicator +signal "LED_SWAP" pin RD9 invert # swap activity indicator +signal "LED_TTY" pin RA1 invert # tty activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a @@ -70,8 +64,7 @@ device gpio3 flags 0xfbfe # port D device gpio4 flags 0x03ff # port E device gpio5 flags 0x303b # port F device gpio6 flags 0xf3cf # port G -options "GPIO_CLEAR_PORT=TRISD" # clear on startup... -options "GPIO_CLEAR_PIN=2" # ...pin RD2 +signal "GPIO_CLEAR" pin RD2 # clear on startup # ADC driver device adc diff --git a/sys/pic32/mmb-mx7/Makefile b/sys/pic32/mmb-mx7/Makefile index 931c9da..8af1e0b 100644 --- a/sys/pic32/mmb-mx7/Makefile +++ b/sys/pic32/mmb-mx7/Makefile @@ -13,8 +13,10 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED -PARAM += -DGPIO_CLEAR_PIN=2 -PARAM += -DGPIO_CLEAR_PORT=TRISD +PARAM += -DGPIO_CLEAR_PORT=TRISD -DGPIO_CLEAR_PIN=2 +PARAM += -DLED_TTY_PORT=TRISA -DLED_TTY_PIN=1 -DLED_TTY_INVERT +PARAM += -DLED_SWAP_PORT=TRISD -DLED_SWAP_PIN=9 -DLED_SWAP_INVERT +PARAM += -DLED_KERNEL_PORT=TRISA -DLED_KERNEL_PIN=0 -DLED_KERNEL_INVERT PARAM += -DSD0_MHZ=8 PARAM += -DSD0_CS_PIN=9 PARAM += -DSD0_CS_PORT=TRISA @@ -22,15 +24,6 @@ PARAM += -DSD0_PORT=1 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_TTY_INVERT -PARAM += -DLED_TTY_PIN=1 -PARAM += -DLED_TTY_PORT=TRISA -PARAM += -DLED_SWAP_INVERT -PARAM += -DLED_SWAP_PIN=9 -PARAM += -DLED_SWAP_PORT=TRISD -PARAM += -DLED_KERNEL_INVERT -PARAM += -DLED_KERNEL_PIN=0 -PARAM += -DLED_KERNEL_PORT=TRISA PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/picadillo/Config-rambo b/sys/pic32/picadillo/Config-rambo index f3abb55..d317d5c 100644 --- a/sys/pic32/picadillo/Config-rambo +++ b/sys/pic32/picadillo/Config-rambo @@ -59,35 +59,19 @@ options "PARTITION='spirams0:sa@2040'" # Partition schema options "SPIRAMS_PORT=SPI4CON" # TODO: delete this option options "SPIRAMS_CHIPSIZE=128" # chip size in kbytes options "SPIRAMS_CHIPS=16" # number of chips -options "SPIRAMS_CS0_PORT=TRISA" # for CS0... -options "SPIRAMS_CS0_PIN=0" # ...use pin RA0 -options "SPIRAMS_CS1_PORT=TRISA" # for CS1... -options "SPIRAMS_CS1_PIN=1" # ...use pin RA1 -options "SPIRAMS_CS2_PORT=TRISA" # for CS2... -options "SPIRAMS_CS2_PIN=4" # ...use pin RA4 -options "SPIRAMS_CS3_PORT=TRISA" # for CS3... -options "SPIRAMS_CS3_PIN=5" # ...use pin RA5 -options "SPIRAMS_CS4_PORT=TRISA" # for CS4... -options "SPIRAMS_CS4_PIN=2" # ...use pin RA2 -options "SPIRAMS_CS5_PORT=TRISD" # for CS5... -options "SPIRAMS_CS5_PIN=1" # ...use pin RD1 -options "SPIRAMS_CS6_PORT=TRISD" # for CS6... -options "SPIRAMS_CS6_PIN=2" # ...use pin RD2 -options "SPIRAMS_CS7_PORT=TRISB" # for CS7... -options "SPIRAMS_CS7_PIN=14" # ...use pin RB14 -options "SPIRAMS_CS8_PORT=TRISD" # for CS8... -options "SPIRAMS_CS8_PIN=14" # ...use pin RFD14 -options "SPIRAMS_CS9_PORT=TRISD" # for CS9... -options "SPIRAMS_CS9_PIN=8" # ...use pin RD8 -options "SPIRAMS_CS10_PORT=TRISA" # for CS10... -options "SPIRAMS_CS10_PIN=6" # ...use pin RA6 -options "SPIRAMS_CS11_PORT=TRISA" # for CS11... -options "SPIRAMS_CS11_PIN=7" # ...use pin RA7 -options "SPIRAMS_CS12_PORT=TRISG" # for CS12... -options "SPIRAMS_CS12_PIN=14" # ...use pin RG14 -options "SPIRAMS_CS13_PORT=TRISG" # for CS13... -options "SPIRAMS_CS13_PIN=12" # ...use pin RG12 -options "SPIRAMS_CS14_PORT=TRISG" # for CS14... -options "SPIRAMS_CS14_PIN=13" # ...use pin RG13 -options "SPIRAMS_CS15_PORT=TRISF" # for CS15... -options "SPIRAMS_CS15_PIN=5" # ...use pin RF5 +signal "SPIRAMS_CS0" pin RA0 +signal "SPIRAMS_CS1" pin RA1 +signal "SPIRAMS_CS2" pin RA4 +signal "SPIRAMS_CS3" pin RA5 +signal "SPIRAMS_CS4" pin RA2 +signal "SPIRAMS_CS5" pin RD1 +signal "SPIRAMS_CS6" pin RD2 +signal "SPIRAMS_CS7" pin RB14 +signal "SPIRAMS_CS8" pin RD14 +signal "SPIRAMS_CS9" pin RD8 +signal "SPIRAMS_CS10" pin RA6 +signal "SPIRAMS_CS11" pin RA7 +signal "SPIRAMS_CS12" pin RG14 +signal "SPIRAMS_CS13" pin RG12 +signal "SPIRAMS_CS14" pin RG13 +signal "SPIRAMS_CS15" pin RF5 diff --git a/sys/pic32/pinguino-micro/Config b/sys/pic32/pinguino-micro/Config index f857ee6..9025931 100644 --- a/sys/pic32/pinguino-micro/Config +++ b/sys/pic32/pinguino-micro/Config @@ -23,9 +23,7 @@ options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 # LED -options "LED_KERNEL_PORT=TRISD" # for kernel activity LED... -options "LED_KERNEL_PIN=1" # ...use pin RD1 -options "LED_KERNEL_INVERT" # ...inverted +signal "LED_KERNEL" pin RD1 invert # kernel activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/pinguino-micro/Makefile b/sys/pic32/pinguino-micro/Makefile index 82f1369..15e82ee 100644 --- a/sys/pic32/pinguino-micro/Makefile +++ b/sys/pic32/pinguino-micro/Makefile @@ -11,15 +11,13 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED +PARAM += -DLED_KERNEL_PORT=TRISD -DLED_KERNEL_PIN=1 -DLED_KERNEL_INVERT PARAM += -DSD0_CS_PIN=13 PARAM += -DSD0_CS_PORT=TRISB PARAM += -DSD0_PORT=2 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_KERNEL_INVERT -PARAM += -DLED_KERNEL_PIN=1 -PARAM += -DLED_KERNEL_PORT=TRISD PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/sdxl/Config b/sys/pic32/sdxl/Config index b888358..baf4256 100644 --- a/sys/pic32/sdxl/Config +++ b/sys/pic32/sdxl/Config @@ -25,8 +25,7 @@ options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 # LED -options "LED_KERNEL_PORT=TRISE" # for kernel activity LED... -options "LED_KERNEL_PIN=7" # ...use pin RE7 +signal "LED_KERNEL" pin RE7 # kernel activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/sdxl/Makefile b/sys/pic32/sdxl/Makefile index adb099d..1fc49ec 100644 --- a/sys/pic32/sdxl/Makefile +++ b/sys/pic32/sdxl/Makefile @@ -12,14 +12,13 @@ PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED PARAM += -DGLCD_ENABLED +PARAM += -DLED_KERNEL_PORT=TRISE -DLED_KERNEL_PIN=7 PARAM += -DSD0_CS_PIN=9 PARAM += -DSD0_CS_PORT=TRISG PARAM += -DSD0_PORT=2 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_KERNEL_PIN=7 -PARAM += -DLED_KERNEL_PORT=TRISE PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/starter-kit/Config b/sys/pic32/starter-kit/Config index 10f3b48..03046f0 100644 --- a/sys/pic32/starter-kit/Config +++ b/sys/pic32/starter-kit/Config @@ -23,11 +23,9 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_DISK_PORT=TRISD" # for disk activity LED... -options "LED_DISK_PIN=1" # ...use pin RD1 -options "LED_KERNEL_PORT=TRISD" # for kernel activity LED... -options "LED_KERNEL_PIN=2" # ...use pin RD2 +# LEDs +signal "LED_DISK" pin RD1 # disk activity indicator +signal "LED_KERNEL" pin RD2 # kernel activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/starter-kit/Makefile b/sys/pic32/starter-kit/Makefile index dc2d866..f6d93c1 100644 --- a/sys/pic32/starter-kit/Makefile +++ b/sys/pic32/starter-kit/Makefile @@ -12,16 +12,14 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED +PARAM += -DLED_KERNEL_PORT=TRISD -DLED_KERNEL_PIN=2 +PARAM += -DLED_DISK_PORT=TRISD -DLED_DISK_PIN=1 PARAM += -DSD0_CS_PIN=1 PARAM += -DSD0_CS_PORT=TRISB PARAM += -DSD0_PORT=1 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_KERNEL_PIN=2 -PARAM += -DLED_KERNEL_PORT=TRISD -PARAM += -DLED_DISK_PIN=1 -PARAM += -DLED_DISK_PORT=TRISD PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/ubw32/Config b/sys/pic32/ubw32/Config index fb41390..76042e8 100644 --- a/sys/pic32/ubw32/Config +++ b/sys/pic32/ubw32/Config @@ -24,19 +24,11 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISE" # for kernel activity LED... -options "LED_KERNEL_PIN=2" # ...use pin RE2 -options "LED_KERNEL_INVERT" -options "LED_DISK_PORT=TRISE" # for disk activity LED... -options "LED_DISK_PIN=1" # ...use pin RE1 -options "LED_DISK_INVERT" -options "LED_SWAP_PORT=TRISE" # for swap activity LED... -options "LED_SWAP_PIN=0" # ...use pin RE0 -options "LED_SWAP_INVERT" -options "LED_TTY_PORT=TRISE" # for console activity LED... -options "LED_TTY_PIN=3" # ...use pin RE3 -options "LED_TTY_INVERT" +# LEDs +signal "LED_KERNEL" pin RE2 invert # kernel activity indicator +signal "LED_DISK" pin RE1 invert # disk activity indicator +signal "LED_SWAP" pin RE0 invert # swap activity indicator +signal "LED_TTY" pin RE3 invert # tty activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/ubw32/Config-uart b/sys/pic32/ubw32/Config-uart index 714cbc3..1acef49 100644 --- a/sys/pic32/ubw32/Config-uart +++ b/sys/pic32/ubw32/Config-uart @@ -23,19 +23,11 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISE" # for kernel activity LED... -options "LED_KERNEL_PIN=2" # ...use pin RE2 -options "LED_KERNEL_INVERT" -options "LED_DISK_PORT=TRISE" # for disk activity LED... -options "LED_DISK_PIN=1" # ...use pin RE1 -options "LED_DISK_INVERT" -options "LED_SWAP_PORT=TRISE" # for swap activity LED... -options "LED_SWAP_PIN=0" # ...use pin RE0 -options "LED_SWAP_INVERT" -options "LED_TTY_PORT=TRISE" # for console activity LED... -options "LED_TTY_PIN=3" # ...use pin RE3 -options "LED_TTY_INVERT" +# LEDs +signal "LED_KERNEL" pin RE2 invert # kernel activity indicator +signal "LED_DISK" pin RE1 invert # disk activity indicator +signal "LED_SWAP" pin RE0 invert # swap activity indicator +signal "LED_TTY" pin RE3 invert # tty activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/ubw32/Makefile b/sys/pic32/ubw32/Makefile index b66b4f0..f5627b0 100644 --- a/sys/pic32/ubw32/Makefile +++ b/sys/pic32/ubw32/Makefile @@ -13,6 +13,10 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED +PARAM += -DLED_TTY_PORT=TRISE -DLED_TTY_PIN=3 -DLED_TTY_INVERT +PARAM += -DLED_SWAP_PORT=TRISE -DLED_SWAP_PIN=0 -DLED_SWAP_INVERT +PARAM += -DLED_DISK_PORT=TRISE -DLED_DISK_PIN=1 -DLED_DISK_INVERT +PARAM += -DLED_KERNEL_PORT=TRISE -DLED_KERNEL_PIN=2 -DLED_KERNEL_INVERT PARAM += -DSD1_CS_PIN=10 PARAM += -DSD1_CS_PORT=TRISA PARAM += -DSD1_PORT=1 @@ -22,18 +26,6 @@ PARAM += -DSD0_PORT=1 PARAM += -DUSB_NUM_STRING_DESCRIPTORS=3 PARAM += -DUSB_MAX_EP_NUMBER=3 PARAM += -DCONSOLE_DEVICE=ttyUSB0 -PARAM += -DLED_TTY_INVERT -PARAM += -DLED_TTY_PIN=3 -PARAM += -DLED_TTY_PORT=TRISE -PARAM += -DLED_SWAP_INVERT -PARAM += -DLED_SWAP_PIN=0 -PARAM += -DLED_SWAP_PORT=TRISE -PARAM += -DLED_DISK_INVERT -PARAM += -DLED_DISK_PIN=1 -PARAM += -DLED_DISK_PORT=TRISE -PARAM += -DLED_KERNEL_INVERT -PARAM += -DLED_KERNEL_PIN=2 -PARAM += -DLED_KERNEL_PORT=TRISE PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/sys/pic32/wf32/Config b/sys/pic32/wf32/Config index d91c389..7db09bc 100644 --- a/sys/pic32/wf32/Config +++ b/sys/pic32/wf32/Config @@ -20,13 +20,10 @@ options "CPU_KHZ=80000" # Oscillator frequency of CPU core options "BUS_KHZ=80000" # Frequency of peripheral bus options "BUS_DIV=1" # Bus clock divisor 1/2/4/8 -# LED -options "LED_KERNEL_PORT=TRISA" # for kernel activity LED... -options "LED_KERNEL_PIN=0" # ...use pin RA3 -options "LED_DISK_PORT=TRISF" # for disk activity LED... -options "LED_DISK_PIN=0" # ...use pin RF0 -options "LED_TTY_PORT=TRISA" # for serial activity LED... -options "LED_TTY_PIN=1" # ...use pin RA1 +# LEDs +signal "LED_KERNEL" pin RA0 # kernel activity indicator +signal "LED_DISK" pin RF0 # disk activity indicator +signal "LED_TTY" pin RA1 # tty activity indicator # Root filesystem at /dev/sd0a, swap at /dev/sd0b config unix root on sd0a diff --git a/sys/pic32/wf32/Makefile b/sys/pic32/wf32/Makefile index 0db6215..b778dc8 100644 --- a/sys/pic32/wf32/Makefile +++ b/sys/pic32/wf32/Makefile @@ -12,17 +12,14 @@ PARAM += -DGPIO5_ENABLED PARAM += -DGPIO6_ENABLED PARAM += -DADC_ENABLED PARAM += -DPWM_ENABLED +PARAM += -DLED_TTY_PORT=TRISA -DLED_TTY_PIN=1 +PARAM += -DLED_DISK_PORT=TRISF -DLED_DISK_PIN=0 +PARAM += -DLED_KERNEL_PORT=TRISA -DLED_KERNEL_PIN=0 PARAM += -DSD0_CS_PIN=4 PARAM += -DSD0_CS_PORT=TRISD PARAM += -DSD0_PORT=2 PARAM += -DSD0_MHZ=10 PARAM += -DCONSOLE_DEVICE=tty0 -PARAM += -DLED_TTY_PIN=1 -PARAM += -DLED_TTY_PORT=TRISA -PARAM += -DLED_DISK_PIN=0 -PARAM += -DLED_DISK_PORT=TRISF -PARAM += -DLED_KERNEL_PIN=0 -PARAM += -DLED_KERNEL_PORT=TRISA PARAM += -DBUS_DIV=1 PARAM += -DBUS_KHZ=80000 PARAM += -DCPU_KHZ=80000 diff --git a/tools/kconfig/config.h b/tools/kconfig/config.h index 23cd942..20f3f3a 100644 --- a/tools/kconfig/config.h +++ b/tools/kconfig/config.h @@ -149,6 +149,16 @@ struct opt { struct opt *op_next; } *opt, *mkopt; +/* + * Mapping of signal names to pins. + */ +struct signal { + char *sig_name; + int sig_pin; + int sig_invert; + struct signal *sig_next; +} *siglist; + char *board; char *ldscript; diff --git a/tools/kconfig/config.y b/tools/kconfig/config.y index 0cd1ad8..e325f4a 100644 --- a/tools/kconfig/config.y +++ b/tools/kconfig/config.y @@ -22,6 +22,7 @@ %token EQUALS %token FLAGS %token HZ +%token INVERT %token LDSCRIPT %token MAJOR %token MAXUSERS @@ -33,6 +34,7 @@ %token PINS %token PRIORITY %token SERVICE +%token SIGNAL %token ROOT %token SEMICOLON %token SEQUENTIAL @@ -53,6 +55,7 @@ %type Id_list %type optional_size %type optional_sflag +%type optional_invert %type device_name %type major_minor %type root_device_spec @@ -167,6 +170,16 @@ Config_spec: LDSCRIPT ID = { ldscript = strdup($2); } | + SIGNAL ID PINS PIN optional_invert + = { + struct signal *s = (struct signal*) malloc(sizeof(struct signal)); + s->sig_name = strdup($2); + s->sig_next = siglist; + s->sig_pin = $4; + s->sig_invert = $5; + siglist = s; + } + | System_spec | TIMEZONE NUMBER @@ -337,6 +350,14 @@ optional_sflag: = { $$ = 0; } ; +optional_invert: + INVERT + = { $$ = 1; } + | + /* empty */ + = { $$ = 0; } + ; + device_name: Save_id = { $$ = $1; } @@ -808,7 +829,7 @@ void checksystemspec(fl) if (minor(dev) & 07) { sprintf(buf, "Warning, swap defaulted to 'b' partition with root on '%c' partition", - (minor(dev) & 07) + 'a'); + (minor(dev) & 07) + 'a' - 1); yyerror(buf); } swap->f_swapdev = diff --git a/tools/kconfig/lang.l b/tools/kconfig/lang.l index 08be554..cc107b2 100644 --- a/tools/kconfig/lang.l +++ b/tools/kconfig/lang.l @@ -52,7 +52,9 @@ struct kt { static struct kt key_words[] = { { "and", AND }, + { "architecture", ARCHITECTURE }, { "at", AT }, + { "board", BOARD }, { "config", CONFIG }, { "controller", CONTROLLER }, { "cpu", CPU }, @@ -62,9 +64,8 @@ static struct kt key_words[] = { { "dst", DST }, { "dumps", DUMPS }, { "flags", FLAGS }, - { "board", BOARD }, + { "invert", INVERT }, { "ldscript", LDSCRIPT }, - { "architecture", ARCHITECTURE }, { "major", MAJOR }, { "makeoptions", MAKEOPTIONS }, { "maxusers", MAXUSERS }, @@ -77,6 +78,7 @@ static struct kt key_words[] = { { "root", ROOT }, { "sequential", SEQUENTIAL }, { "service", SERVICE }, + { "signal", SIGNAL }, { "size", SIZE }, { "swap", SWAP }, { "tape", DEVICE }, diff --git a/tools/kconfig/mkmakefile.c b/tools/kconfig/mkmakefile.c index 1bd46e3..d0a4a0d 100644 --- a/tools/kconfig/mkmakefile.c +++ b/tools/kconfig/mkmakefile.c @@ -409,6 +409,7 @@ void makefile() FILE *ifp, *ofp; char line[BUFSIZ]; struct opt *op; + struct signal *sig; struct cputype *cp; struct device *dp; @@ -442,6 +443,20 @@ void makefile() if (dp->d_type == SERVICE && dp->d_slave > 0) fprintf(ofp, "PARAM += -D%s_NUNITS=%d\n", raise(dp->d_name), dp->d_slave); } + for (sig = siglist; sig; sig = sig->sig_next) { + int bit = sig->sig_pin & 0xff; + int port = sig->sig_pin >> 8; + if (bit > 15 || port < 1 || port > 7) { + printf("%s: invalid pin name R%c%u\n", + sig->sig_name, 'A'+port-1, bit); + exit(1); + } + fprintf(ofp, "PARAM += -D%s_PORT=TRIS%c -D%s_PIN=%d", + sig->sig_name, 'A'+port-1, sig->sig_name, bit); + if (sig->sig_invert) + fprintf(ofp, " -D%s_INVERT", sig->sig_name); + fprintf(ofp, "\n"); + } for (op = opt; op; op = op->op_next) { if (op->op_value) fprintf(ofp, "PARAM += -D%s=\"%s\"\n", op->op_name, op->op_value);