Go to the documentation of this file.
18 #ifndef HAND_BRIDGE_GPIO_H_
19 #define HAND_BRIDGE_GPIO_H_
26 bool call(
int (*func)(uint32_t), uint32_t mask, uint32_t pins){
27 return initialized && (pins & mask) == pins && (pins == 0 || func(pins) == 0);
53 if(pin < 32 && ((1<<pin) &
out_mask0) != (1<<pin))
return false;
55 return gpioWrite(pin, level ? 1 : 0) == 0;
57 bool pwmPin(uint32_t pin,
float level) {
59 if(pin >= 32 || ((1<<pin) &
out_mask0) != (1<<pin))
return false;
64 if(level < 0 || level > 1.0)
return false;
66 return gpioPWM(pin, level* range) == 0;
72 #endif // HAND_BRIDGE_GPIO_H_
bool isInitialized() const
int gpioWrite(unsigned gpio, unsigned level)
bool clearPins(uint32_t pins)
int gpioPWM(unsigned gpio, unsigned val)
int gpioWrite_Bits_0_31_Clear(uint32_t bits)
int gpioGetPWMrange(unsigned gpio)
bool setPins(uint32_t pins)
uint32_t gpioRead_Bits_0_31(void)
int gpioWrite_Bits_0_31_Set(uint32_t bits)
int gpioSetMode(unsigned gpio, unsigned mode)
bool writePin(uint32_t pin, uint32_t level)
bool call(int(*func)(uint32_t), uint32_t mask, uint32_t pins)
bool setOutput(uint32_t pin)
bool setInput(uint32_t pin)
bool pwmPin(uint32_t pin, float level)
cob_hand_bridge
Author(s): Mathias Lüdtke
autogenerated on Fri Aug 2 2024 09:40:56