collab/PineapplePad

git clone https://git.julia.blue/collab/PineapplePad

Joseph RyanFinishing touchesca230b6

master
569 B27 linesraw
1#include "../inc/tm4c123gh6pm.h"
2#include "../inc/IO.h"
3#include <stdint.h>
4
5void PortF_Init(void) {
6    SYSCTL_RCGCGPIO_R |= 0x20;
7    while ((SYSCTL_PRGPIO_R & 0x20) != 0x20) ;
8    GPIO_PORTF_LOCK_R = 0x4C4F434B;
9    GPIO_PORTF_CR_R = 0x1F;
10    GPIO_PORTF_AMSEL_R = 0x00;
11    GPIO_PORTF_DIR_R = 0x0E;
12    GPIO_PORTF_AFSEL_R = 0x00;
13    GPIO_PORTF_PUR_R = 0x11;
14    GPIO_PORTF_DEN_R = 0x1F;
15}
16
17void toggle_red(void){
18    GPIO_PORTF_DATA_R ^= 0x02;
19}
20
21void toggle_blue(void) {
22    GPIO_PORTF_DATA_R ^= 0x04;
23}
24
25void toggle_green(void){
26    GPIO_PORTF_DATA_R ^= 0x08;
27}