Sming Framework API
Sming - Open Source framework for high efficiency WiFi SoC ESP8266 native development with C++ language.
NexGpio Class Reference

#include <NexGpio.h>

Public Member Functions

bool pin_mode (uint32_t port, uint32_t mode, uint32_t control_id)
 
bool digital_write (uint32_t port, uint32_t value)
 
uint32_t digital_read (uint32_t port)
 
bool analog_write (uint32_t port, uint32_t value)
 
bool set_pwmfreq (uint32_t value)
 
uint32_t get_pwmfreq (uint32_t *number)
 

Detailed Description

NexGpio component.

Member Function Documentation

bool NexGpio::analog_write ( uint32_t  port,
uint32_t  value 
)

writes an analog value (PWM wave) to a pin

Parameters
port- the gpio port number
value- the duty cycle: between 0 (always off) and 100 (always on).
Returns
true if success, false for failure
uint32_t NexGpio::digital_read ( uint32_t  port)

read a HIGH or a LOW value to a digital pin

Parameters
port- the gpio port number
Returns
the value from a specified digital pin, either high or low
bool NexGpio::digital_write ( uint32_t  port,
uint32_t  value 
)

write a HIGH or a LOW value to a digital pin

Parameters
port- the gpio port number
value- HIGH or LOW
Returns
true if success, false for failure
uint32_t NexGpio::get_pwmfreq ( uint32_t *  number)

read pwm output frequency

Parameters
number- the frequency
Returns
true if success, false for failure
bool NexGpio::pin_mode ( uint32_t  port,
uint32_t  mode,
uint32_t  control_id 
)

Set gpio mode

Parameters
port- the gpio port number
mode- set gpio port mode(0–Pull on the input 1–the control input binding 2–Push-pull output 3–pwm output 4–open mode leakage)
control_id- nextion controls id ,when the modeel is 1 to be valid
Returns
true if success, false for failure
bool NexGpio::set_pwmfreq ( uint32_t  value)

writes pwm output frequency

Parameters
value- the frequency: between 1 and 65535
Returns
true if success, false for failure