Compare commits
1 Commits
371b4c0e80
...
2e01aa6877
Author | SHA1 | Date | |
---|---|---|---|
|
2e01aa6877 |
2
Makefile
2
Makefile
@ -71,7 +71,7 @@ distclean:
|
|||||||
|
|
||||||
.PHONY:
|
.PHONY:
|
||||||
check: $(C_SRCS)
|
check: $(C_SRCS)
|
||||||
$(CHECK) $(CHECK_FLAGS) --check-config $(CC_SRCS)
|
$(CHECK) $(CHECK_FLAGS) $(CC_SRCS)
|
||||||
|
|
||||||
$(TARGET): $(OBJS) $(THIS_MAKEFILE)
|
$(TARGET): $(OBJS) $(THIS_MAKEFILE)
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
|
@ -38,6 +38,11 @@ void Gpio::set_direction(direction dir)
|
|||||||
GPIO_REGS->PIN_CNF[pin_number] = direct | input | pull | drive | sense;
|
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 Gpio::get()
|
||||||
{
|
{
|
||||||
uint32_t res = (GPIO_REGS->IN >> pin_number) & 1UL;
|
uint32_t res = (GPIO_REGS->IN >> pin_number) & 1UL;
|
||||||
|
@ -10,6 +10,7 @@ class Gpio : public interfaces::GpioInterface
|
|||||||
public:
|
public:
|
||||||
inline Gpio() {}
|
inline Gpio() {}
|
||||||
Gpio(uint32_t);
|
Gpio(uint32_t);
|
||||||
|
void set_pin_number(uint32_t);
|
||||||
void set_direction(direction) override;
|
void set_direction(direction) override;
|
||||||
uint32_t get() override;
|
uint32_t get() override;
|
||||||
void set() override;
|
void set() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user