avr/base/include/base.h

20 lines
291 B
C
Raw Normal View History

2022-04-17 04:43:50 +00:00
#ifndef __BASE_H__
#define __BASE_H__
typedef struct IO_PIN {
volatile uint8_t *port;
uint8_t pin;
} io_pin_t;
inline void set_pin(io_pin_t *pin) {
*(pin->port) |= 1 << pin->pin;
}
inline void clear_pin(io_pin_t *pin) {
*(pin->port) &= 0xff ^ (1 << pin->pin);
}
#endif