Skip to content

Instantly share code, notes, and snippets.

View Xhendos's full-sized avatar

Youri Klaassens Xhendos

View GitHub Profile
/*
*A header with all includes.
*/
#include "program.h"
int main()
{
struct sockaddr_in socketaddress_in;
struct icmphdr *icmp_header;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Created by : Youri Klaassens ;
; Date : 4 October, 2017 ;
; Description : Rotate all 4 LEDS ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#include <p16f1829.inc>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; Created by : Youri Klaassens ;
; Date : 07 October, 2017 ;
; Description : Set LED while button pressed ;
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#include <p16f1829.inc>
#include <stdio.h>
#include <stdbool.h>
/* Contains floor() which will round */
#include <math.h>
/* Prototyping */
bool calculate_instructions(int delay1, int delay2);
bool float_mod(double instructions);
@Xhendos
Xhendos / TM4C1294NCPDT_Interrupt.c
Last active September 2, 2018 10:51
This is the hello world program for the interrupt availability in the TM4C1294NCPDT microcontroller
#define GPIO_PORT_CGC_R (*((volatile unsigned long *) 0x400FE608))
#define GPIO_PORTA_DIR_R (*((volatile unsigned long *) 0x40058400))
#define GPIO_PORTA_IS_R (*((volatile unsigned long *) 0x40058404)) /* Interrupt sense */
#define GPIO_PORTA_IBE_R (*((volatile unsigned long *) 0x40058408)) /* Interrupt both edges */
#define GPIO_PORTA_IEV_R (*((volatile unsigned long *) 0x4005840C)) /* Interrupt event */
#define GPIO_PORTA_IM_R (*((volatile unsigned long *) 0x40058410)) /* Interrupt mask */
#define GPIO_PORTA_RIS_R (*((volatile unsigned long *) 0x40058414)) /* Raw interrupt status */
#define GPIO_PORTA_MIS_R (*((volatile unsigned long *) 0x40058418)) /* Masked interrupt status */
#define GPIO_PORTA_IC_R (*((volatile unsigned long *) 0x4005841C)) /* Interrupt clear */