Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 75 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. #define PORTB_BASE_ADD ((volatile uint8_t *)0x36)
  2.  
  3. typedef uint8_t u8 ;
  4. typedef struct  
  5. {
  6.   //every port arrangement is AVR 8-bit is as flow :  PIN (base) - DDR (dir) - PORT(out)
  7.  
  8.     u8 port_in ;
  9.     u8 port_dir ;
  10.     u8 port_out ;
  11. }GPIO_PORT , *GPIO_PORT_PTR;
  12.  
  13. #define PORT_B (*(GPIO_PORT_PTR)PORTB_BASE_ADD)
  14.  
  15. int main(void)
  16. {
  17.     PORT_B.port_dir = 0xFF ;
  18.     PORT_B.port_out = 0x50 ;
  19.  
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top