Skip to content

Instantly share code, notes, and snippets.

View Embedded-linux's full-sized avatar
💭
I may be slow to respond.

G Satish Kumar Embedded-linux

💭
I may be slow to respond.
  • Cavium Networks
  • Bangalore
View GitHub Profile
@Embedded-linux
Embedded-linux / IAP for LPC2148
Created September 4, 2013 14:21
IAP[In Application Programming] for LPC 2148
/*Programming on chip flash driver -- copy data from RAM to Flash/Erasing Sector address, Erasing complete chip and programming the chip with IAP [In Application Program] commands*/
/* Reference Manual for Flash memory and IAP commands :http://www.nxp.com/documents/user_manual/UM10139.pdf */
#include ''../FlashOs.H"
// Memory Mapping Control
#define MEMMAP (*((volatile unsigned char *) 0x E01FC040))
@Embedded-linux
Embedded-linux / LED Blink for LPC 2148
Created September 4, 2013 14:23
LED Blink for LPC 2148
@Embedded-linux
Embedded-linux / LED Switch 2148-Exp2
Last active December 22, 2015 12:39
LED Switch Programing-Exp2
#include <LPC214x.H> /* LPC21xx definitions */
#define IOPIN1 (*((volatile unsigned long *) 0xE0028010))
#define IOSET0 (*((volatile unsigned long *) 0xE0028004))
#define IOCLR0 (*((volatile unsigned long *) 0xE002800C))
#define IODIR0 (*((volatile unsigned long *) 0xE0028008))
#define IODIR1 (*((volatile unsigned long *) 0xE0028018))
#define LED_IO_DIR IODIR0
@Embedded-linux
Embedded-linux / EINT for LPC2148
Last active December 22, 2015 15:58
External INT for LPC 2148
/************Main Function*****************/
#include <lpc214x.h>
#include "ext_int.h"
int main(void) {
keypad_init(); //// initialize the keypad in interrup mode
while(1)
{
@Embedded-linux
Embedded-linux / Stack in 'C'
Last active December 22, 2015 19:29
Stack program in C with array
/***Main Program **********/
#include <stdio.h>
#define MAX 5
int status,top;
int push(int stack[],int item)
{
if (top == MAX-1)
{
printf("Stack overflow \n");
@Embedded-linux
Embedded-linux / postfix in C
Created September 11, 2013 07:11
Postfix implementation in C using Stack
#include <stdio.h>
#incluyde <ctype.h>
#define SIZE 50
char s[SIZE];
int top =-1;
push(char elem)
{
s[++top] = elem;
@Embedded-linux
Embedded-linux / Queue in C
Last active December 22, 2015 21:39
Queue Program Using Array in C
This Program is for queue implementation using arrays in C.
#include <stdio.h>
#define N 6
int queue[N] = {0};
int rear = 0,front = 0;
void insert(void);
void delete(void);
void display(void);
@Embedded-linux
Embedded-linux / Bubble sort in C
Created September 12, 2013 10:02
Bubble sort In C
#include <stdio.h>
int main()
{
int s,temp,i,j,a[20];
printf("Enter total no. of elements:");
scanf("%d",&s);
printf("Enter %d elements:",s);
for(i=0;i<s;i++)
@Embedded-linux
Embedded-linux / String Match in C
Last active December 22, 2015 23:59
String Match In C
Program is to find the "String matching pattern from source string".
#include <stdio.h>
#include <string.h>
int match(char[],char[]);
int main()
{
@Embedded-linux
Embedded-linux / Sequential Search in C
Last active December 22, 2015 23:59
Sequential Search in C
This program is for sequential search
#include <stdio.h>
int main()
{
int key[20],i,s;
int key1;
printf("Enter the no. of elements:\n");
scanf("%d",&s);