Skip to content

Commit

Permalink
updated #7
Browse files Browse the repository at this point in the history
  • Loading branch information
Esraa1moshsen committed May 3, 2019
1 parent a87123f commit ed6e3c6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
17 changes: 17 additions & 0 deletions Tivac2/pushButton_Init.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "lcd.h"

void pushButtons_Init (void)
{
void Port_Init (PF);
void Port_SetPinDirection (PF, PF_pins_mask, PORT_PIN_IN);
void Port_AnalogOrDigital (PF,PF_pins_mask, 1);
void Port_AlternateFunction (PF, PF_pins_mask, 0, PCTL_pins_mask);
void Port_SetPinPullUp (PF, PF_pins_mask, 1);
GPIO_PORTF_IS_R &= ~GPIO_PF4_0_M;
GPIO_PORTF_IBE_R &= ~GPIO_PF4_0_M;
GPIO_PORTF_IEV_R &= ~GPIO_PF4_0_M;
GPIO_PORTF_ICR_R |= GPIO_PF4_0_M;
GPIO_PORTF_IM_R |= GPIO_PF4_0_M;
NVIC_PRI7_R = (NVIC_PRI7_R & 0xFF00FFFF) | (GPIO_PF4_0_PRI << 21); // PRI7 bits 23:21
NVIC_EN0_R |= (1 << 30); // EN0 bit 30
}
12 changes: 0 additions & 12 deletions Tivac2/push_buttons.c

This file was deleted.

10 changes: 7 additions & 3 deletions Tivac2/push_buttons.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
#define PushB_H_

#include "tm4c123gh6pm.h"
#include "std_types.h"
#include <std_types.h>
#include "lcd.h"

void pushButtons_Init (void);
#define PF_pins_mask 0x11
#define PCTL_pins_mask 0x00
#define GPIO_PF4_0_M 0x11
#define GPIO_PF4_0_PRI 2
void pushButtons_Init (void);
#endif

0 comments on commit ed6e3c6

Please sign in to comment.