Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PORTB_BASE_ADD ((volatile uint8_t *)0x36)
- typedef uint8_t u8 ;
- typedef struct
- {
- //every port arrangement is AVR 8-bit is as flow : PIN (base) - DDR (dir) - PORT(out)
- u8 port_in ;
- u8 port_dir ;
- u8 port_out ;
- }GPIO_PORT , *GPIO_PORT_PTR;
- #define PORT_B (*(GPIO_PORT_PTR)PORTB_BASE_ADD)
- int main(void)
- {
- PORT_B.port_dir = 0xFF ;
- PORT_B.port_out = 0x50 ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement