This library provides Bit Banging API.
View this file on GitHub: mgos_bitbang.h
void mgos_bitbang_write_bits(int gpio, enum mgos_delay_unit delay_unit, int t0h, int t0l, int t1h, int t1l, const uint8_t *data, size_t len);
Bit bang GPIO pin
len bytes from
data are sent to the specified
pin bit by bit. Sending each bit consists of a "high" and "low" phases,
length of which is determined by the specified timing parameters.
| | | | | |_
t0l specify timings if the bit being transmitted is 0,
t1l specify the same for the case where the bit is 1.
If any of these is < 0, the corresponding phase is skipped.
void mgos_bitbang_write_bits_js(int gpio, enum mgos_delay_unit delay_unit, uint32_t t, const uint8_t *data, size_t len);
This function is a wrapper for
It has smaller number of arguments (less than 6) and therefore could be
into a single value
Write bits to a given
delay_unit is one of the:
ptr, len is a bit pattern to write.
t0h, t0l is the time pattern
for zero bit,
t1h, t1l is the time pattern for 1. The time pattern
specifies the number of time units to hold the pin high, and the number
of units to hold the pin low. Return value: none.