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