lgeorge123
Full Member level 2
Can someone give me exactly the code of bit banding using LPC4357 set pin 9_5 GPIO5[18] high ?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Bit banging I2C and SPI Codes are same for any microcontroller. They bit banging code from saeedsolution.blogspot.com Modify the codes to LPCxxxx code else post LPCxxxx code I will try to add the bit banging code for it.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 /* foo.c */ typedef struct { int i : 1; int j : 2; int k : 3; } BB; BB value __attribute__((at(0x20000040))); // Placed object void update_value(void) { value.i = 1; value.j = 0; } /* end of foo.c */
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 /* foo.c */ typedef struct { int rts : 1; int cts : 1; unsigned int data; } uart; #define com2 (*((volatile uart *)0x20002000)) void put_com2(int n) { com2.rts = 1; com2.data = n; } /* end of foo.c */
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 /* foo.c */ typedef struct { int i : 1; int j : 2; int k : 3; } BB __attribute__((bitband)); BB value; // Unplaced object void update_value(void) { value.i = 1; value.j = 0; } /* end of foo.c */
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 /* foo.c */ typedef struct { int i : 1; int j : 2; int k : 3; } BB __attribute((bitband)); BB value __attribute__((at(0x20000040))); // Placed object void update_value(void) { value.i = 1; value.j = 0; } /* end of foo.c */