Compare commits

..

1 Commits

Author SHA1 Message Date
Thomas Klaehn
2e01aa6877 Re-organize build system 2020-03-30 14:17:42 +02:00
3 changed files with 7 additions and 1 deletions

View File

@ -71,7 +71,7 @@ distclean:
.PHONY:
check: $(C_SRCS)
$(CHECK) $(CHECK_FLAGS) --check-config $(CC_SRCS)
$(CHECK) $(CHECK_FLAGS) $(CC_SRCS)
$(TARGET): $(OBJS) $(THIS_MAKEFILE)
@mkdir -p $(dir $@)

View File

@ -38,6 +38,11 @@ void Gpio::set_direction(direction dir)
GPIO_REGS->PIN_CNF[pin_number] = direct | input | pull | drive | sense;
}
void Gpio::set_pin_number(uint32_t pin)
{
this->pin_number = pin;
}
uint32_t Gpio::get()
{
uint32_t res = (GPIO_REGS->IN >> pin_number) & 1UL;

View File

@ -10,6 +10,7 @@ class Gpio : public interfaces::GpioInterface
public:
inline Gpio() {}
Gpio(uint32_t);
void set_pin_number(uint32_t);
void set_direction(direction) override;
uint32_t get() override;
void set() override;