Skip to content

Commit

Permalink
squash frdm-k64f gpio config
Browse files Browse the repository at this point in the history
  • Loading branch information
Joakim Nohlgård committed Oct 4, 2015
1 parent d6bf162 commit c685617
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 66 deletions.
24 changes: 12 additions & 12 deletions boards/frdm-k64f/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ extern "C"
* @name LED pin definitions
* @{
*/
#define LED_R_PORT_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTB_MASK)) /**< Clock Enable for PORTD*/
#define LED_G_PORT_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTE_MASK)) /**< Clock Enable for PORTD*/
#define LED_B_PORT_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTB_MASK)) /**< Clock Enable for PORTA*/
#define LED_R_PORT_CLKEN() (PORTB_CLOCK_GATE = 1) /**< Clock Enable for PORTD*/
#define LED_G_PORT_CLKEN() (PORTE_CLOCK_GATE = 1) /**< Clock Enable for PORTE*/
#define LED_B_PORT_CLKEN() (PORTB_CLOCK_GATE = 1) /**< Clock Enable for PORTB*/
#define LED_R_PORT PORTB /**< PORT for Red LED*/
#define LED_R_GPIO GPIOB /**< GPIO-Device for Red LED*/
#define LED_G_PORT PORTE /**< PORT for Green LED*/
Expand All @@ -66,15 +66,15 @@ extern "C"
* @name Macros for controlling the on-board LEDs.
* @{
*/
#define LED_B_ON (LED_B_GPIO->PCOR |= (1 << LED_B_PIN))
#define LED_B_OFF (LED_B_GPIO->PSOR |= (1 << LED_B_PIN))
#define LED_B_TOGGLE (LED_B_GPIO->PTOR |= (1 << LED_B_PIN))
#define LED_G_ON (LED_G_GPIO->PCOR |= (1 << LED_G_PIN))
#define LED_G_OFF (LED_G_GPIO->PSOR |= (1 << LED_G_PIN))
#define LED_G_TOGGLE (LED_G_GPIO->PTOR |= (1 << LED_G_PIN))
#define LED_R_ON (LED_R_GPIO->PCOR |= (1 << LED_R_PIN))
#define LED_R_OFF (LED_R_GPIO->PSOR |= (1 << LED_R_PIN))
#define LED_R_TOGGLE (LED_R_GPIO->PTOR |= (1 << LED_R_PIN))
#define LED_B_ON (LED_B_GPIO->PCOR = (1 << LED_B_PIN))
#define LED_B_OFF (LED_B_GPIO->PSOR = (1 << LED_B_PIN))
#define LED_B_TOGGLE (LED_B_GPIO->PTOR = (1 << LED_B_PIN))
#define LED_G_ON (LED_G_GPIO->PCOR = (1 << LED_G_PIN))
#define LED_G_OFF (LED_G_GPIO->PSOR = (1 << LED_G_PIN))
#define LED_G_TOGGLE (LED_G_GPIO->PTOR = (1 << LED_G_PIN))
#define LED_R_ON (LED_R_GPIO->PCOR = (1 << LED_R_PIN))
#define LED_R_OFF (LED_R_GPIO->PSOR = (1 << LED_R_PIN))
#define LED_R_TOGGLE (LED_R_GPIO->PTOR = (1 << LED_R_PIN))

/* for compatability to other boards */
#define LED_GREEN_ON LED_G_ON
Expand Down
55 changes: 1 addition & 54 deletions boards/frdm-k64f/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,60 +258,7 @@ extern "C"
* @name GPIO configuration
* @{
*/
#define GPIO_0_EN 1
#define GPIO_1_EN 1
#define GPIO_2_EN 1
#define GPIO_3_EN 1
#define GPIO_4_EN 1
#define GPIO_5_EN 1
#define GPIO_IRQ_PRIO 1
#define ISR_PORT_A isr_porta
#define ISR_PORT_B isr_portb
#define ISR_PORT_C isr_portc
#define ISR_PORT_D isr_portd

/* GPIO channel 0 config */
#define GPIO_0_DEV GPIOB /* LED_R */
#define GPIO_0_PORT PORTB
#define GPIO_0_PORT_BASE PORTB_BASE
#define GPIO_0_PIN 22
#define GPIO_0_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTB_MASK))
#define GPIO_0_IRQ PORTB_IRQn
/* GPIO channel 1 config */
#define GPIO_1_DEV GPIOE /* LED_G */
#define GPIO_1_PORT PORTE
#define GPIO_1_PORT_BASE PORTE_BASE
#define GPIO_1_PIN 26
#define GPIO_1_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTE_MASK))
#define GPIO_1_IRQ PORTE_IRQn
/* GPIO channel 2 config */
#define GPIO_2_DEV GPIOB /* LED_B */
#define GPIO_2_PORT PORTB
#define GPIO_2_PORT_BASE PORTB_BASE
#define GPIO_2_PIN 21
#define GPIO_2_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTB_MASK))
#define GPIO_2_IRQ PORTB_IRQn
/* GPIO channel 3 config */
#define GPIO_3_DEV GPIOC /* SW2 */
#define GPIO_3_PORT PORTC
#define GPIO_3_PORT_BASE PORTC_BASE
#define GPIO_3_PIN 6
#define GPIO_3_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTC_MASK))
#define GPIO_3_IRQ PORTC_IRQn
/* GPIO channel 4 config */
#define GPIO_4_DEV GPIOB /* A0 (Arduino Headers) */
#define GPIO_4_PORT PORTB
#define GPIO_4_PORT_BASE PORTB_BASE
#define GPIO_4_PIN 2
#define GPIO_4_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTB_MASK))
#define GPIO_4_IRQ PORTB_IRQn
/* GPIO channel 5 config */
#define GPIO_5_DEV GPIOB /* A1 (Arduino Headers) */
#define GPIO_5_PORT PORTB
#define GPIO_5_PORT_BASE PORTB_BASE
#define GPIO_5_PIN 3
#define GPIO_5_CLKEN() (SIM->SCGC5 |= (SIM_SCGC5_PORTB_MASK))
#define GPIO_5_IRQ PORTB_IRQn
#define GPIO_IRQ_PRIO CPU_DEFAULT_IRQ_PRIO
/** @} */

/**
Expand Down

0 comments on commit c685617

Please sign in to comment.