27#ifndef LIBRISHKA_GPIO_H
28#define LIBRISHKA_GPIO_H
180 static void tone(
u32 frequency,
u64 duration);
Class for handling GPIO operations in Rishka applications.
Definition: gpio.h:67
static u64 pulse_in_long(u8 pin, u8 state, u64 timeout)
Measure the duration of a long pulse on a GPIO pin.
Definition: librishka_gpio.cpp:45
static u8 shift_in(u8 data, u8 clock, u8 bit_order)
Shift in data from a digital input pin.
Definition: librishka_gpio.cpp:49
static void shift_out(u8 data, u8 clock, u8 bit_order, u8 value)
Shift out data to a digital output pin.
Definition: librishka_gpio.cpp:53
static u64 pulse_in(u8 pin, u8 state, u64 timeout)
Measure the duration of a pulse on a GPIO pin.
Definition: librishka_gpio.cpp:41
static gpio_mode_t digital_read(u8 pin)
Read the digital value of a GPIO pin.
Definition: librishka_gpio.cpp:25
static void digital_write(u8 pin, gpio_mode_t mode)
Write a digital value to a GPIO pin.
Definition: librishka_gpio.cpp:29
static u16 analog_read(u8 pin)
Read the analog value of a GPIO pin.
Definition: librishka_gpio.cpp:33
static void tone(u32 frequency, u64 duration)
Generate a tone of the specified frequency and duration on GPIO25.
Definition: librishka_gpio.cpp:57
static void pin_mode(u8 pin, gpio_pin_mode_t mode)
Set the mode of a GPIO pin.
Definition: librishka_gpio.cpp:21
static void no_tone()
Stop generating a tone on GPIO25.
Definition: librishka_gpio.cpp:61
static void analog_write(u8 pin, u16 value)
Write an analog value to a GPIO pin.
Definition: librishka_gpio.cpp:37
gpio_mode_t
Enum representing the digital modes for GPIO pins.
Definition: gpio.h:53
@ GPIO_HIGH
Definition: gpio.h:55
@ GPIO_LOW
Definition: gpio.h:54
gpio_pin_mode_t
Enum representing the pin modes for GPIO pins.
Definition: gpio.h:40
@ GPIO_INPUT
Definition: gpio.h:41
@ GPIO_OUTPUT
Definition: gpio.h:42
@ GPIO_INPUT_PULLUP
Definition: gpio.h:43
Header file for common data types used in Rishka applications.
unsigned int u32
Alias for the unsigned 32-bit integer type.
Definition: types.h:82
unsigned short int u16
Alias for the unsigned 16-bit integer type.
Definition: types.h:76
unsigned char u8
Alias for the unsigned 8-bit integer type.
Definition: types.h:70
unsigned long int u64
Alias for the unsigned 64-bit integer type.
Definition: types.h:88