|
@ -45,9 +45,11 @@ class ZGPIO { |
|
|
GPIOMode_t mode; |
|
|
GPIOMode_t mode; |
|
|
bool mirror; |
|
|
bool mirror; |
|
|
bool initLevel; |
|
|
bool initLevel; |
|
|
|
|
|
bool log_when_setstate; |
|
|
} OutputGpioCfg_t; |
|
|
} OutputGpioCfg_t; |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
|
|
|
Pin_t m_pin; |
|
|
GPIO_TypeDef *m_gpio; |
|
|
GPIO_TypeDef *m_gpio; |
|
|
uint16_t m_pinoff; |
|
|
uint16_t m_pinoff; |
|
|
GPIOType_t m_gpiotype; |
|
|
GPIOType_t m_gpiotype; |
|
@ -55,6 +57,7 @@ class ZGPIO { |
|
|
GPIOIrqType_t m_irqtype; |
|
|
GPIOIrqType_t m_irqtype; |
|
|
bool m_mirror; |
|
|
bool m_mirror; |
|
|
bool lastLevel; |
|
|
bool lastLevel; |
|
|
|
|
|
bool m_log_when_setstate = false; |
|
|
|
|
|
|
|
|
onirq_t m_onirq; |
|
|
onirq_t m_onirq; |
|
|
bool m_initflag; |
|
|
bool m_initflag; |
|
@ -64,7 +67,10 @@ class ZGPIO { |
|
|
|
|
|
|
|
|
void initAsInput(Pin_t pin, GPIOMode_t mode, GPIOIrqType_t irqtype, bool mirror); |
|
|
void initAsInput(Pin_t pin, GPIOMode_t mode, GPIOIrqType_t irqtype, bool mirror); |
|
|
void initAsOutput(Pin_t pin, GPIOMode_t mode, bool mirror, bool initLevel); |
|
|
void initAsOutput(Pin_t pin, GPIOMode_t mode, bool mirror, bool initLevel); |
|
|
void initAsOutput(OutputGpioCfg_t *outputcfg) { initAsOutput(outputcfg->pin, outputcfg->mode, outputcfg->mirror, outputcfg->initLevel); } |
|
|
|
|
|
|
|
|
void initAsOutput(OutputGpioCfg_t *outputcfg) { |
|
|
|
|
|
m_log_when_setstate = outputcfg->log_when_setstate; |
|
|
|
|
|
initAsOutput(outputcfg->pin, outputcfg->mode, outputcfg->mirror, outputcfg->initLevel); |
|
|
|
|
|
} |
|
|
void initAsInput(InputGpioCfg_t *inputcfg) { initAsInput(inputcfg->pin, inputcfg->mode, inputcfg->irqtype, inputcfg->mirror); } |
|
|
void initAsInput(InputGpioCfg_t *inputcfg) { initAsInput(inputcfg->pin, inputcfg->mode, inputcfg->irqtype, inputcfg->mirror); } |
|
|
|
|
|
|
|
|
void regListener(onirq_t listener); |
|
|
void regListener(onirq_t listener); |
|
|