diff --git a/coresdk/src/backend/gpio_driver.cpp b/coresdk/src/backend/gpio_driver.cpp index 67196390..b53d7d75 100644 --- a/coresdk/src/backend/gpio_driver.cpp +++ b/coresdk/src/backend/gpio_driver.cpp @@ -1,6 +1,6 @@ /*********************************************** * XQuestCode || Aditya Parmar - * 🚀 © 2024 Aditya Parmar. All Rights Reserved. + * © 2024 Aditya Parmar. All Rights Reserved. * This file is part of the SplashKit Core Library. * Use https://abyz.me.uk/rpi/pigpio/pdif2.html for reference ***********************************************/ diff --git a/coresdk/src/backend/gpio_driver.h b/coresdk/src/backend/gpio_driver.h index 3e265979..8bd317c4 100644 --- a/coresdk/src/backend/gpio_driver.h +++ b/coresdk/src/backend/gpio_driver.h @@ -1,6 +1,6 @@ /*********************************************** * XQuestCode || Aditya Parmar - * 🚀 © 2024 Aditya Parmar. All Rights Reserved. + * © 2024 Aditya Parmar. All Rights Reserved. * This file is part of the SplashKit Core Library. * Use https://abyz.me.uk/rpi/pigpio/pdif2.html for reference ***********************************************/ @@ -21,4 +21,4 @@ namespace splashkit_lib void sk_set_pwm_dutycycle(int pin, int dutycycle); void sk_gpio_cleanup(); } -#endif // SPLASHKIT_sk_gpio_H \ No newline at end of file +#endif /* defined(gpio_driver) */ \ No newline at end of file diff --git a/coresdk/src/coresdk/raspi_gpio.cpp b/coresdk/src/coresdk/raspi_gpio.cpp index 58927354..215221c7 100644 --- a/coresdk/src/coresdk/raspi_gpio.cpp +++ b/coresdk/src/coresdk/raspi_gpio.cpp @@ -1,19 +1,15 @@ -// raspi_gpio.c -/*********************************************** - * XQuestCode || Aditya Parmar - * 🚀 © 2024 Aditya Parmar. All Rights Reserved. - * This file is part of the SplashKit Core Library. - * Use https://abyz.me.uk/rpi/pigpio/pdif2.html for reference - ***********************************************/ - +// raspi_gpio.cpp +// splashkit +// Created by Aditya Parmar on 20/01/2024. +// Copyright © 2024 XQuestCode. All rights reserved. #include "raspi_gpio.h" #include "gpio_driver.h" #include using namespace std; -// Each index points to PIN_1, PIN_2, PIN_3, etc. namespace splashkit_lib { + // Each index points to PIN_1, PIN_2, PIN_3, etc. int BCMpinData[] = { -1, -1, 2, -1, 3, -2, 4, 14, -2, 15, 17, 18, 27, -2, 22, 23, -1, 24, 10, -2, 9, 25, 11, 8, -2, 7, 0, 1, 5, -2, -6, 12, 13, -2, 19, 16, 26, 20, -2, 21}; diff --git a/coresdk/src/coresdk/raspi_gpio.h b/coresdk/src/coresdk/raspi_gpio.h index cb327d9a..b4277c87 100644 --- a/coresdk/src/coresdk/raspi_gpio.h +++ b/coresdk/src/coresdk/raspi_gpio.h @@ -1,16 +1,15 @@ /** - * @header raspberry - * @author Aditya Parmar - * @brief Splashkit allows you to read and write to the GPIO pins on the Raspberry Pi. - * - * @attribute group raspberry + * @header raspi_gpio + * @brief Splashkit allows you to read and write to the GPIO pins on the Raspberry Pi. + * @author Aditya Parmar + * @attribute group raspberry * @attribute static raspberry */ -#ifndef raspi_gpio_h -#define raspi_gpio_h +#ifndef raspi_gpio_hpp +#define raspi_gpio_hpp -#include // Include the appropriate header file for stdint.h +#include #include "gpio_driver.h" #include "types.h" @@ -18,12 +17,16 @@ namespace splashkit_lib { /** * @brief Initializes the GPIO library. + * + * This function initializes the GPIO library for use. It should be called before any other GPIO functions. */ void raspi_init(); /** * @brief Sets the mode of the specified pin. * + * This function sets the mode of the specified pin to the specified mode. + * * @param pin The pin to set the mode for. * @param mode The mode to set for the pin. */ @@ -32,6 +35,8 @@ namespace splashkit_lib /** * @brief Gets the mode of the specified pin. * + * This function retrieves the mode of the specified pin. + * * @param pin The pin to get the mode for. * @returns The mode of the pin. */ @@ -40,6 +45,8 @@ namespace splashkit_lib /** * @brief Writes a value to the specified pin. * + * This function writes the specified value to the specified pin. + * * @param pin The pin to write the value to. * @param value The value to write to the pin. */ @@ -48,13 +55,17 @@ namespace splashkit_lib /** * @brief Sets the pull up/down mode for the specified pin. * + * This function sets the pull-up/down mode for the specified pin. + * * @param pin The pin to set the pull up/down mode for. * @param pud The pull up/down mode to set for the pin. */ void raspi_set_pull_up_down(pins pin, pull_up_down pud); /** - * Sets the PWM range for the specified pin. + * @brief Sets the PWM range for the specified pin. + * + * This function sets the PWM range for the specified pin. * * @param pin The pin to set the PWM range for. * @param range The PWM range to set for the pin. @@ -62,7 +73,9 @@ namespace splashkit_lib void raspi_set_pwm_range(pins pin, int range); /** - * Sets the PWM frequency for the specified pin. + * @brief Sets the PWM frequency for the specified pin. + * + * This function sets the PWM frequency for the specified pin. * * @param pin The pin to set the PWM frequency for. * @param frequency The PWM frequency to set for the pin. @@ -70,7 +83,9 @@ namespace splashkit_lib void raspi_set_pwm_frequency(pins pin, int frequency); /** - * Sets the PWM duty cycle for the specified pin. + * @brief Sets the PWM duty cycle for the specified pin. + * + * This function sets the PWM duty cycle for the specified pin. * * @param pin The pin to set the PWM duty cycle for. * @param dutycycle The PWM duty cycle to set for the pin. @@ -78,18 +93,20 @@ namespace splashkit_lib void raspi_set_pwm_dutycycle(pins pin, int dutycycle); /** - * Reads the value from the specified pin. + * @brief Reads the value from the specified pin. + * + * This function reads the value from the specified pin. * * @param pin The pin to read the value from. * @returns The value read from the pin. */ pin_values raspi_read(pins pin); - - /** - * Cleans up and releases any resources used by the GPIO library ( sets all pin modes to INPUT and values to LOW ). This should be called when you are finished using the GPIO library. + * @brief Cleans up and releases any resources used by the GPIO library. + * + * This function should be called when you are finished using the GPIO library. It sets all pin modes to INPUT and values to LOW. */ void raspi_cleanup(); } -#endif // RASPI_GPIO_H \ No newline at end of file +#endif /* raspi_gpio_hpp */ diff --git a/coresdk/src/coresdk/types.h b/coresdk/src/coresdk/types.h index 16119fd5..c6b3faa7 100644 --- a/coresdk/src/coresdk/types.h +++ b/coresdk/src/coresdk/types.h @@ -319,46 +319,46 @@ namespace splashkit_lib /** * Raspberry Pi GPIO Board Pin Descriptions: * - * @constant PIN_1 - 3.3V Power Supply - * @constant PIN_2 - 5V Power Supply - * @constant PIN_3 - GPIO2 / SDA (I2C) - * @constant PIN_4 - 5V Power Supply - * @constant PIN_5 - GPIO3 / SCL (I2C) - * @constant PIN_6 - Ground - * @constant PIN_7 - GPIO4 - * @constant PIN_8 - GPIO14 / TXD (UART) - * @constant PIN_9 - Ground - * @constant PIN_10 - GPIO15 / RXD (UART) - * @constant PIN_11 - GPIO17 - * @constant PIN_12 - GPIO18 / PCM_CLK - * @constant PIN_13 - GPIO27 - * @constant PIN_14 - Ground - * @constant PIN_15 - GPIO22 - * @constant PIN_16 - GPIO23 - * @constant PIN_17 - 3.3V Power Supply - * @constant PIN_18 - GPIO24 - * @constant PIN_19 - GPIO10 / MOSI (SPI) - * @constant PIN_20 - Ground - * @constant PIN_21 - GPIO9 / MISO (SPI) - * @constant PIN_22 - GPIO25 - * @constant PIN_23 - GPIO11 / SCLK (SPI) - * @constant PIN_24 - GPIO8 / CE0 (SPI) - * @constant PIN_25 - Ground - * @constant PIN_26 - GPIO7 / CE1 (SPI) - * @constant PIN_27 - ID_SD (I2C ID EEPROM) - * @constant PIN_28 - ID_SC (I2C ID EEPROM) - * @constant PIN_29 - GPIO5 - * @constant PIN_30 - Ground - * @constant PIN_31 - GPIO6 - * @constant PIN_32 - GPIO12 - * @constant PIN_33 - GPIO13 - * @constant PIN_34 - Ground - * @constant PIN_35 - GPIO19 / MISO (PCM) - * @constant PIN_36 - GPIO16 / CE0 (PCM) - * @constant PIN_37 - GPIO26 - * @constant PIN_38 - GPIO20 / MOSI (PCM) - * @constant PIN_39 - Ground - * @constant PIN_40 - GPIO21 / SCLK (PCM) + * @constant PIN_1 3.3V Power Supply + * @constant PIN_2 5V Power Supply + * @constant PIN_3 GPIO2 / SDA (I2C) + * @constant PIN_4 5V Power Supply + * @constant PIN_5 GPIO3 / SCL (I2C) + * @constant PIN_6 Ground + * @constant PIN_7 GPIO4 + * @constant PIN_8 GPIO14 / TXD (UART) + * @constant PIN_9 Ground + * @constant PIN_10 GPIO15 / RXD (UART) + * @constant PIN_11 GPIO17 + * @constant PIN_12 GPIO18 / PCM_CLK + * @constant PIN_13 GPIO27 + * @constant PIN_14 Ground + * @constant PIN_15 GPIO22 + * @constant PIN_16 GPIO23 + * @constant PIN_17 3.3V Power Supply + * @constant PIN_18 GPIO24 + * @constant PIN_19 GPIO10 / MOSI (SPI) + * @constant PIN_20 Ground + * @constant PIN_21 GPIO9 / MISO (SPI) + * @constant PIN_22 GPIO25 + * @constant PIN_23 GPIO11 / SCLK (SPI) + * @constant PIN_24 GPIO8 / CE0 (SPI) + * @constant PIN_25 Ground + * @constant PIN_26 GPIO7 / CE1 (SPI) + * @constant PIN_27 ID_SD (I2C ID EEPROM) + * @constant PIN_28 ID_SC (I2C ID EEPROM) + * @constant PIN_29 GPIO5 + * @constant PIN_30 Ground + * @constant PIN_31 GPIO6 + * @constant PIN_32 GPIO12 + * @constant PIN_33 GPIO13 + * @constant PIN_34 Ground + * @constant PIN_35 GPIO19 / MISO (PCM) + * @constant PIN_36 GPIO16 / CE0 (PCM) + * @constant PIN_37 GPIO26 + * @constant PIN_38 GPIO20 / MOSI (PCM) + * @constant PIN_39 Ground + * @constant PIN_40 GPIO21 / SCLK (PCM) */ enum pins { @@ -408,14 +408,14 @@ enum pins /** * GPIO Pin Modes: * - * @constant GPIO_INPUT - Input mode. - * @constant GPIO_OUTPUT - Output mode. - * @constant GPIO_ALT0 - Alternate function mode 0. - * @constant GPIO_ALT1 - Alternate function mode 1. - * @constant GPIO_ALT2 - Alternate function mode 2. - * @constant GPIO_ALT3 - Alternate function mode 3. - * @constant GPIO_ALT4 - Alternate function mode 4. - * @constant GPIO_ALT5 - Alternate function mode 5. + * @constant GPIO_INPUT Input mode. + * @constant GPIO_OUTPUT Output mode. + * @constant GPIO_ALT0 Alternate function mode 0. + * @constant GPIO_ALT1 Alternate function mode 1. + * @constant GPIO_ALT2 Alternate function mode 2. + * @constant GPIO_ALT3 Alternate function mode 3. + * @constant GPIO_ALT4 Alternate function mode 4. + * @constant GPIO_ALT5 Alternate function mode 5. */ enum pin_modes { @@ -432,8 +432,8 @@ enum pin_modes /** * GPIO Pin Values: * - * @constant GPIO_LOW - Logic low (0). - * @constant GPIO_HIGH - Logic high (1). + * @constant GPIO_LOW Logic low (0). + * @constant GPIO_HIGH Logic high (1). */ enum pin_values { @@ -443,9 +443,9 @@ enum pin_values /** * GPIO Pull-up/Pull-down Configurations: * - * @constant PUD_OFF - No pull-up or pull-down resistor. - * @constant PUD_DOWN - Enable pull-down resistor. - * @constant PUD_UP - Enable pull-up resistor. + * @constant PUD_OFF No pull-up or pull-down resistor. + * @constant PUD_DOWN Enable pull-down resistor. + * @constant PUD_UP Enable pull-up resistor. */ enum pull_up_down { diff --git a/generated/clib/lib_type_mapper.h b/generated/clib/lib_type_mapper.h index 7698cd10..25063f4b 100644 --- a/generated/clib/lib_type_mapper.h +++ b/generated/clib/lib_type_mapper.h @@ -41,6 +41,7 @@ #include "point_geometry.h" #include "quad_geometry.h" #include "random.h" +#include "raspi_gpio.h" #include "rectangle_drawing.h" #include "rectangle_geometry.h" #include "resources.h" diff --git a/generated/clib/sk_clib.cpp b/generated/clib/sk_clib.cpp index 3421af56..d177aa18 100644 --- a/generated/clib/sk_clib.cpp +++ b/generated/clib/sk_clib.cpp @@ -3723,6 +3723,52 @@ int __sklib__rnd__int(int ubound) { int __skreturn = rnd(__skparam__ubound); return __sklib__to_int(__skreturn); } +void __sklib__raspi_cleanup() { + raspi_cleanup(); +} +int __sklib__raspi_get_mode__pins(int pin) { + pins __skparam__pin = __sklib__to_pins(pin); + pin_modes __skreturn = raspi_get_mode(__skparam__pin); + return __sklib__to_int(__skreturn); +} +void __sklib__raspi_init() { + raspi_init(); +} +int __sklib__raspi_read__pins(int pin) { + pins __skparam__pin = __sklib__to_pins(pin); + pin_values __skreturn = raspi_read(__skparam__pin); + return __sklib__to_int(__skreturn); +} +void __sklib__raspi_set_mode__pins__pin_modes(int pin, int mode) { + pins __skparam__pin = __sklib__to_pins(pin); + pin_modes __skparam__mode = __sklib__to_pin_modes(mode); + raspi_set_mode(__skparam__pin, __skparam__mode); +} +void __sklib__raspi_set_pull_up_down__pins__pull_up_down(int pin, int pud) { + pins __skparam__pin = __sklib__to_pins(pin); + pull_up_down __skparam__pud = __sklib__to_pull_up_down(pud); + raspi_set_pull_up_down(__skparam__pin, __skparam__pud); +} +void __sklib__raspi_set_pwm_dutycycle__pins__int(int pin, int dutycycle) { + pins __skparam__pin = __sklib__to_pins(pin); + int __skparam__dutycycle = __sklib__to_int(dutycycle); + raspi_set_pwm_dutycycle(__skparam__pin, __skparam__dutycycle); +} +void __sklib__raspi_set_pwm_frequency__pins__int(int pin, int frequency) { + pins __skparam__pin = __sklib__to_pins(pin); + int __skparam__frequency = __sklib__to_int(frequency); + raspi_set_pwm_frequency(__skparam__pin, __skparam__frequency); +} +void __sklib__raspi_set_pwm_range__pins__int(int pin, int range) { + pins __skparam__pin = __sklib__to_pins(pin); + int __skparam__range = __sklib__to_int(range); + raspi_set_pwm_range(__skparam__pin, __skparam__range); +} +void __sklib__raspi_write__pins__pin_values(int pin, int value) { + pins __skparam__pin = __sklib__to_pins(pin); + pin_values __skparam__value = __sklib__to_pin_values(value); + raspi_write(__skparam__pin, __skparam__value); +} void __sklib__draw_quad__color__quad_ref(__sklib_color clr, const __sklib_quad q) { color __skparam__clr = __sklib__to_color(clr); quad __skparam__q = __sklib__to_quad(q); diff --git a/generated/clib/sk_clib.h b/generated/clib/sk_clib.h index f9a91f88..8f223cc0 100644 --- a/generated/clib/sk_clib.h +++ b/generated/clib/sk_clib.h @@ -868,6 +868,16 @@ __sklib_vector_triangle __sklib__triangles_from__quad_ref(const __sklib_quad q); int __sklib__rnd__int__int(int min, int max); float __sklib__rnd(); int __sklib__rnd__int(int ubound); +void __sklib__raspi_cleanup(); +int __sklib__raspi_get_mode__pins(int pin); +void __sklib__raspi_init(); +int __sklib__raspi_read__pins(int pin); +void __sklib__raspi_set_mode__pins__pin_modes(int pin, int mode); +void __sklib__raspi_set_pull_up_down__pins__pull_up_down(int pin, int pud); +void __sklib__raspi_set_pwm_dutycycle__pins__int(int pin, int dutycycle); +void __sklib__raspi_set_pwm_frequency__pins__int(int pin, int frequency); +void __sklib__raspi_set_pwm_range__pins__int(int pin, int range); +void __sklib__raspi_write__pins__pin_values(int pin, int value); void __sklib__draw_quad__color__quad_ref(__sklib_color clr, const __sklib_quad q); void __sklib__draw_quad__color__quad_ref__drawing_options_ref(__sklib_color clr, const __sklib_quad q, const __sklib_drawing_options opts); void __sklib__draw_quad_on_bitmap__bitmap__color__quad_ref(__sklib_bitmap destination, __sklib_color clr, const __sklib_quad q); diff --git a/generated/cpp/raspi_gpio.h b/generated/cpp/raspi_gpio.h new file mode 100644 index 00000000..460743ee --- /dev/null +++ b/generated/cpp/raspi_gpio.h @@ -0,0 +1,27 @@ +// +// SplashKit Generated Raspi Gpio C++ Code +// DO NOT MODIFY +// + +#ifndef __raspi_gpio_h +#define __raspi_gpio_h + +#include "types.h" +#include +#include +#include +using std::string; +using std::vector; + +void raspi_cleanup(); +pin_modes raspi_get_mode(pins pin); +void raspi_init(); +pin_values raspi_read(pins pin); +void raspi_set_mode(pins pin, pin_modes mode); +void raspi_set_pull_up_down(pins pin, pull_up_down pud); +void raspi_set_pwm_dutycycle(pins pin, int dutycycle); +void raspi_set_pwm_frequency(pins pin, int frequency); +void raspi_set_pwm_range(pins pin, int range); +void raspi_write(pins pin, pin_values value); + +#endif /* __raspi_gpio_h */ diff --git a/generated/cpp/splashkit.cpp b/generated/cpp/splashkit.cpp index e2ff3fea..fd75b11c 100644 --- a/generated/cpp/splashkit.cpp +++ b/generated/cpp/splashkit.cpp @@ -3854,6 +3854,52 @@ int rnd(int ubound) { int __skreturn = __sklib__rnd__int(__skparam__ubound); return __skadapter__to_int(__skreturn); } +void raspi_cleanup() { + __sklib__raspi_cleanup(); +} +pin_modes raspi_get_mode(pins pin) { + int __skparam__pin = __skadapter__to_int(pin); + int __skreturn = __sklib__raspi_get_mode__pins(__skparam__pin); + return __skadapter__to_pin_modes(__skreturn); +} +void raspi_init() { + __sklib__raspi_init(); +} +pin_values raspi_read(pins pin) { + int __skparam__pin = __skadapter__to_int(pin); + int __skreturn = __sklib__raspi_read__pins(__skparam__pin); + return __skadapter__to_pin_values(__skreturn); +} +void raspi_set_mode(pins pin, pin_modes mode) { + int __skparam__pin = __skadapter__to_int(pin); + int __skparam__mode = __skadapter__to_int(mode); + __sklib__raspi_set_mode__pins__pin_modes(__skparam__pin, __skparam__mode); +} +void raspi_set_pull_up_down(pins pin, pull_up_down pud) { + int __skparam__pin = __skadapter__to_int(pin); + int __skparam__pud = __skadapter__to_int(pud); + __sklib__raspi_set_pull_up_down__pins__pull_up_down(__skparam__pin, __skparam__pud); +} +void raspi_set_pwm_dutycycle(pins pin, int dutycycle) { + int __skparam__pin = __skadapter__to_int(pin); + int __skparam__dutycycle = __skadapter__to_int(dutycycle); + __sklib__raspi_set_pwm_dutycycle__pins__int(__skparam__pin, __skparam__dutycycle); +} +void raspi_set_pwm_frequency(pins pin, int frequency) { + int __skparam__pin = __skadapter__to_int(pin); + int __skparam__frequency = __skadapter__to_int(frequency); + __sklib__raspi_set_pwm_frequency__pins__int(__skparam__pin, __skparam__frequency); +} +void raspi_set_pwm_range(pins pin, int range) { + int __skparam__pin = __skadapter__to_int(pin); + int __skparam__range = __skadapter__to_int(range); + __sklib__raspi_set_pwm_range__pins__int(__skparam__pin, __skparam__range); +} +void raspi_write(pins pin, pin_values value) { + int __skparam__pin = __skadapter__to_int(pin); + int __skparam__value = __skadapter__to_int(value); + __sklib__raspi_write__pins__pin_values(__skparam__pin, __skparam__value); +} void draw_quad(color clr, const quad &q) { __sklib_color __skparam__clr = __skadapter__to_sklib_color(clr); const __sklib_quad __skparam__q = __skadapter__to_sklib_quad(q); diff --git a/generated/cpp/splashkit.h b/generated/cpp/splashkit.h index c907249f..ce78318f 100644 --- a/generated/cpp/splashkit.h +++ b/generated/cpp/splashkit.h @@ -33,6 +33,7 @@ #include "point_geometry.h" #include "quad_geometry.h" #include "random.h" +#include "raspi_gpio.h" #include "rectangle_drawing.h" #include "rectangle_geometry.h" #include "resources.h" diff --git a/generated/csharp/SplashKit.cs b/generated/csharp/SplashKit.cs index bd71bf4e..3b5039b0 100644 --- a/generated/csharp/SplashKit.cs +++ b/generated/csharp/SplashKit.cs @@ -3121,6 +3121,36 @@ private static void __skadapter__update_from_vector_bool(ref __sklib_vector_bool [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__rnd__int", CharSet=CharSet.Ansi)] private static extern int __sklib__rnd__int(int ubound); + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_cleanup", CharSet=CharSet.Ansi)] + private static extern void __sklib__raspi_cleanup(); + + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_get_mode__pins", CharSet=CharSet.Ansi)] + private static extern int __sklib__raspi_get_mode__pins(int pin); + + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_init", CharSet=CharSet.Ansi)] + private static extern void __sklib__raspi_init(); + + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_read__pins", CharSet=CharSet.Ansi)] + private static extern int __sklib__raspi_read__pins(int pin); + + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_set_mode__pins__pin_modes", CharSet=CharSet.Ansi)] + private static extern void __sklib__raspi_set_mode__pins__pin_modes(int pin, int mode); + + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_set_pull_up_down__pins__pull_up_down", CharSet=CharSet.Ansi)] + private static extern void __sklib__raspi_set_pull_up_down__pins__pull_up_down(int pin, int pud); + + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_set_pwm_dutycycle__pins__int", CharSet=CharSet.Ansi)] + private static extern void __sklib__raspi_set_pwm_dutycycle__pins__int(int pin, int dutycycle); + + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_set_pwm_frequency__pins__int", CharSet=CharSet.Ansi)] + private static extern void __sklib__raspi_set_pwm_frequency__pins__int(int pin, int frequency); + + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_set_pwm_range__pins__int", CharSet=CharSet.Ansi)] + private static extern void __sklib__raspi_set_pwm_range__pins__int(int pin, int range); + + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__raspi_write__pins__pin_values", CharSet=CharSet.Ansi)] + private static extern void __sklib__raspi_write__pins__pin_values(int pin, int value); + [DllImport("splashkit.dll", CallingConvention=CallingConvention.Cdecl, EntryPoint="__sklib__draw_quad__color__quad_ref", CharSet=CharSet.Ansi)] private static extern void __sklib__draw_quad__color__quad_ref(__sklib_color clr, __sklib_quad q); @@ -10640,6 +10670,78 @@ public static int Rnd(int ubound) __skreturn = __sklib__rnd__int(__skparam__ubound); return __skadapter__to_int(__skreturn); } + public static void RaspiCleanup() + { + __sklib__raspi_cleanup(); + } + public static PinModes RaspiGetMode(Pins pin) + { + int __skparam__pin; + int __skreturn; + __skparam__pin = __skadapter__to_sklib_pins(pin); + __skreturn = __sklib__raspi_get_mode__pins(__skparam__pin); + return __skadapter__to_pin_modes(__skreturn); + } + public static void RaspiInit() + { + __sklib__raspi_init(); + } + public static PinValues RaspiRead(Pins pin) + { + int __skparam__pin; + int __skreturn; + __skparam__pin = __skadapter__to_sklib_pins(pin); + __skreturn = __sklib__raspi_read__pins(__skparam__pin); + return __skadapter__to_pin_values(__skreturn); + } + public static void RaspiSetMode(Pins pin, PinModes mode) + { + int __skparam__pin; + int __skparam__mode; + __skparam__pin = __skadapter__to_sklib_pins(pin); + __skparam__mode = __skadapter__to_sklib_pin_modes(mode); + __sklib__raspi_set_mode__pins__pin_modes(__skparam__pin, __skparam__mode); + } + public static void RaspiSetPullUpDown(Pins pin, PullUpDown pud) + { + int __skparam__pin; + int __skparam__pud; + __skparam__pin = __skadapter__to_sklib_pins(pin); + __skparam__pud = __skadapter__to_sklib_pull_up_down(pud); + __sklib__raspi_set_pull_up_down__pins__pull_up_down(__skparam__pin, __skparam__pud); + } + public static void RaspiSetPwmDutycycle(Pins pin, int dutycycle) + { + int __skparam__pin; + int __skparam__dutycycle; + __skparam__pin = __skadapter__to_sklib_pins(pin); + __skparam__dutycycle = __skadapter__to_sklib_int(dutycycle); + __sklib__raspi_set_pwm_dutycycle__pins__int(__skparam__pin, __skparam__dutycycle); + } + public static void RaspiSetPwmFrequency(Pins pin, int frequency) + { + int __skparam__pin; + int __skparam__frequency; + __skparam__pin = __skadapter__to_sklib_pins(pin); + __skparam__frequency = __skadapter__to_sklib_int(frequency); + __sklib__raspi_set_pwm_frequency__pins__int(__skparam__pin, __skparam__frequency); + } + public static void RaspiSetPwmRange(Pins pin, int range) + { + int __skparam__pin; + int __skparam__range; + __skparam__pin = __skadapter__to_sklib_pins(pin); + __skparam__range = __skadapter__to_sklib_int(range); + __sklib__raspi_set_pwm_range__pins__int(__skparam__pin, __skparam__range); + } + public static void RaspiWrite(Pins pin, PinValues value) + { + int __skparam__pin; + int __skparam__value; + __skparam__pin = __skadapter__to_sklib_pins(pin); + __skparam__value = __skadapter__to_sklib_pin_values(value); + __sklib__raspi_write__pins__pin_values(__skparam__pin, __skparam__value); + } public static void DrawQuad(Color clr, Quad q) { __sklib_color __skparam__clr; diff --git a/generated/docs/api.json b/generated/docs/api.json index 3f16960b..d50cdfc6 100644 --- a/generated/docs/api.json +++ b/generated/docs/api.json @@ -61432,6 +61432,596 @@ ] }, + "raspberry": { + "brief": "Splashkit allows you to read and write to the GPIO pins on the Raspberry Pi.", + "description": "", + "functions": [ + { + "signature": "void raspi_cleanup();", + "name": "raspi_cleanup", + "method_name": null, + "unique_global_name": "raspi_cleanup", + "unique_method_name": null, + "suffix_name": null, + "description": "This function should be called when you are finished using the GPIO library. It sets all pin modes to INPUT and values to LOW.", + "brief": "Cleans up and releases any resources used by the GPIO library.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_cleanup():" + ], + "pascal": [ + "procedure RaspiCleanup()" + ], + "csharp": [ + "public static void Raspberry.RaspiCleanup();", + "public static void SplashKit.RaspiCleanup();" + ], + "cpp": [ + "void raspi_cleanup()" + ] + } + }, + { + "signature": "pin_modes raspi_get_mode(pins pin);", + "name": "raspi_get_mode", + "method_name": null, + "unique_global_name": "raspi_get_mode", + "unique_method_name": null, + "suffix_name": null, + "description": "This function retrieves the mode of the specified pin.", + "brief": "Gets the mode of the specified pin.", + "return": { + "type": "pin_modes", + "description": "The mode of the pin.", + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to get the mode for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_get_mode(pin):" + ], + "pascal": [ + "function RaspiGetMode(pin: Pins): PinModes" + ], + "csharp": [ + "public static PinModes Raspberry.RaspiGetMode(Pins pin);", + "public static PinModes SplashKit.RaspiGetMode(Pins pin);" + ], + "cpp": [ + "pin_modes raspi_get_mode(pins pin)" + ] + } + }, + { + "signature": "void raspi_init();", + "name": "raspi_init", + "method_name": null, + "unique_global_name": "raspi_init", + "unique_method_name": null, + "suffix_name": null, + "description": "This function initializes the GPIO library for use. It should be called before any other GPIO functions.", + "brief": "Initializes the GPIO library.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_init():" + ], + "pascal": [ + "procedure RaspiInit()" + ], + "csharp": [ + "public static void Raspberry.RaspiInit();", + "public static void SplashKit.RaspiInit();" + ], + "cpp": [ + "void raspi_init()" + ] + } + }, + { + "signature": "pin_values raspi_read(pins pin);", + "name": "raspi_read", + "method_name": null, + "unique_global_name": "raspi_read", + "unique_method_name": null, + "suffix_name": null, + "description": "This function reads the value from the specified pin.", + "brief": "Reads the value from the specified pin.", + "return": { + "type": "pin_values", + "description": "The value read from the pin.", + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to read the value from.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_read(pin):" + ], + "pascal": [ + "function RaspiRead(pin: Pins): PinValues" + ], + "csharp": [ + "public static PinValues Raspberry.RaspiRead(Pins pin);", + "public static PinValues SplashKit.RaspiRead(Pins pin);" + ], + "cpp": [ + "pin_values raspi_read(pins pin)" + ] + } + }, + { + "signature": "void raspi_set_mode(pins pin,pin_modes mode);", + "name": "raspi_set_mode", + "method_name": null, + "unique_global_name": "raspi_set_mode", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the mode of the specified pin to the specified mode.", + "brief": "Sets the mode of the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the mode for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "mode": { + "type": "pin_modes", + "description": "The mode to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_set_mode(pin, mode):" + ], + "pascal": [ + "procedure RaspiSetMode(pin: Pins; mode: PinModes)" + ], + "csharp": [ + "public static void Raspberry.RaspiSetMode(Pins pin, PinModes mode);", + "public static void SplashKit.RaspiSetMode(Pins pin, PinModes mode);" + ], + "cpp": [ + "void raspi_set_mode(pins pin, pin_modes mode)" + ] + } + }, + { + "signature": "void raspi_set_pull_up_down(pins pin,pull_up_down pud);", + "name": "raspi_set_pull_up_down", + "method_name": null, + "unique_global_name": "raspi_set_pull_up_down", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the pull-up/down mode for the specified pin.", + "brief": "Sets the pull up/down mode for the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the pull up/down mode for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "pud": { + "type": "pull_up_down", + "description": "The pull up/down mode to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_set_pull_up_down(pin, pud):" + ], + "pascal": [ + "procedure RaspiSetPullUpDown(pin: Pins; pud: PullUpDown)" + ], + "csharp": [ + "public static void Raspberry.RaspiSetPullUpDown(Pins pin, PullUpDown pud);", + "public static void SplashKit.RaspiSetPullUpDown(Pins pin, PullUpDown pud);" + ], + "cpp": [ + "void raspi_set_pull_up_down(pins pin, pull_up_down pud)" + ] + } + }, + { + "signature": "void raspi_set_pwm_dutycycle(pins pin,int dutycycle);", + "name": "raspi_set_pwm_dutycycle", + "method_name": null, + "unique_global_name": "raspi_set_pwm_dutycycle", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the PWM duty cycle for the specified pin.", + "brief": "Sets the PWM duty cycle for the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the PWM duty cycle for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "dutycycle": { + "type": "int", + "description": "The PWM duty cycle to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_set_pwm_dutycycle(pin, dutycycle):" + ], + "pascal": [ + "procedure RaspiSetPwmDutycycle(pin: Pins; dutycycle: Integer)" + ], + "csharp": [ + "public static void Raspberry.RaspiSetPwmDutycycle(Pins pin, int dutycycle);", + "public static void SplashKit.RaspiSetPwmDutycycle(Pins pin, int dutycycle);" + ], + "cpp": [ + "void raspi_set_pwm_dutycycle(pins pin, int dutycycle)" + ] + } + }, + { + "signature": "void raspi_set_pwm_frequency(pins pin,int frequency);", + "name": "raspi_set_pwm_frequency", + "method_name": null, + "unique_global_name": "raspi_set_pwm_frequency", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the PWM frequency for the specified pin.", + "brief": "Sets the PWM frequency for the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the PWM frequency for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "frequency": { + "type": "int", + "description": "The PWM frequency to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_set_pwm_frequency(pin, frequency):" + ], + "pascal": [ + "procedure RaspiSetPwmFrequency(pin: Pins; frequency: Integer)" + ], + "csharp": [ + "public static void Raspberry.RaspiSetPwmFrequency(Pins pin, int frequency);", + "public static void SplashKit.RaspiSetPwmFrequency(Pins pin, int frequency);" + ], + "cpp": [ + "void raspi_set_pwm_frequency(pins pin, int frequency)" + ] + } + }, + { + "signature": "void raspi_set_pwm_range(pins pin,int range);", + "name": "raspi_set_pwm_range", + "method_name": null, + "unique_global_name": "raspi_set_pwm_range", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the PWM range for the specified pin.", + "brief": "Sets the PWM range for the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the PWM range for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "range": { + "type": "int", + "description": "The PWM range to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_set_pwm_range(pin, range):" + ], + "pascal": [ + "procedure RaspiSetPwmRange(pin: Pins; range: Integer)" + ], + "csharp": [ + "public static void Raspberry.RaspiSetPwmRange(Pins pin, int range);", + "public static void SplashKit.RaspiSetPwmRange(Pins pin, int range);" + ], + "cpp": [ + "void raspi_set_pwm_range(pins pin, int range)" + ] + } + }, + { + "signature": "void raspi_write(pins pin,pin_values value);", + "name": "raspi_write", + "method_name": null, + "unique_global_name": "raspi_write", + "unique_method_name": null, + "suffix_name": null, + "description": "This function writes the specified value to the specified pin.", + "brief": "Writes a value to the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to write the value to.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "value": { + "type": "pin_values", + "description": "The value to write to the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + }, + "signatures": { + "python": [ + "def raspi_write(pin, value):" + ], + "pascal": [ + "procedure RaspiWrite(pin: Pins; value: PinValues)" + ], + "csharp": [ + "public static void Raspberry.RaspiWrite(Pins pin, PinValues value);", + "public static void SplashKit.RaspiWrite(Pins pin, PinValues value);" + ], + "cpp": [ + "void raspi_write(pins pin, pin_values value)" + ] + } + } + ], + "typedefs": [ + + ], + "structs": [ + + ], + "enums": [ + + ], + "defines": [ + + ] + }, "resource_bundles": { "brief": "SplashKit resource bundles allow you to quickly and easily load a\nnumber of resources in the `Resources` folder.", "description": "Supports the loading and freeing of game resource bundles. Resource types\ninclude images, sounds, music and animation files to name a few. Resource\nfiles must be saved in specific locations of a `Resources` folder for\nyour game.", @@ -80585,35 +81175,35 @@ "brief": null, "constants": { "GPIO_INPUT": { - "description": "- Input mode.", + "description": "Input mode.", "number": 0 }, "GPIO_OUTPUT": { - "description": "- Output mode.", + "description": "Output mode.", "number": 1 }, "GPIO_ALT0": { - "description": "- Alternate function mode 0.", + "description": "Alternate function mode 0.", "number": 4 }, "GPIO_ALT1": { - "description": "- Alternate function mode 1.", + "description": "Alternate function mode 1.", "number": 5 }, "GPIO_ALT2": { - "description": "- Alternate function mode 2.", + "description": "Alternate function mode 2.", "number": 6 }, "GPIO_ALT3": { - "description": "- Alternate function mode 3.", + "description": "Alternate function mode 3.", "number": 7 }, "GPIO_ALT4": { - "description": "- Alternate function mode 4.", + "description": "Alternate function mode 4.", "number": 3 }, "GPIO_ALT5": { - "description": "- Alternate function mode 5.", + "description": "Alternate function mode 5.", "number": 2 } }, @@ -80628,11 +81218,11 @@ "brief": null, "constants": { "GPIO_LOW": { - "description": "- Logic low (0).", + "description": "Logic low (0).", "number": 0 }, "GPIO_HIGH": { - "description": "- Logic high (1).", + "description": "Logic high (1).", "number": 1 } }, @@ -80647,163 +81237,163 @@ "brief": null, "constants": { "PIN_1": { - "description": "- 3.3V Power Supply", + "description": "3.3V Power Supply", "number": 1 }, "PIN_2": { - "description": "- 5V Power Supply", + "description": "5V Power Supply", "number": 2 }, "PIN_3": { - "description": "- GPIO2 / SDA (I2C)", + "description": "GPIO2 / SDA (I2C)", "number": 3 }, "PIN_4": { - "description": "- 5V Power Supply", + "description": "5V Power Supply", "number": 4 }, "PIN_5": { - "description": "- GPIO3 / SCL (I2C)", + "description": "GPIO3 / SCL (I2C)", "number": 5 }, "PIN_6": { - "description": "- Ground", + "description": "Ground", "number": 6 }, "PIN_7": { - "description": "- GPIO4", + "description": "GPIO4", "number": 7 }, "PIN_8": { - "description": "- GPIO14 / TXD (UART)", + "description": "GPIO14 / TXD (UART)", "number": 8 }, "PIN_9": { - "description": "- Ground", + "description": "Ground", "number": 9 }, "PIN_10": { - "description": "- GPIO15 / RXD (UART)", + "description": "GPIO15 / RXD (UART)", "number": 10 }, "PIN_11": { - "description": "- GPIO17", + "description": "GPIO17", "number": 11 }, "PIN_12": { - "description": "- GPIO18 / PCM_CLK", + "description": "GPIO18 / PCM_CLK", "number": 12 }, "PIN_13": { - "description": "- GPIO27", + "description": "GPIO27", "number": 13 }, "PIN_14": { - "description": "- Ground", + "description": "Ground", "number": 14 }, "PIN_15": { - "description": "- GPIO22", + "description": "GPIO22", "number": 15 }, "PIN_16": { - "description": "- GPIO23", + "description": "GPIO23", "number": 16 }, "PIN_17": { - "description": "- 3.3V Power Supply", + "description": "3.3V Power Supply", "number": 17 }, "PIN_18": { - "description": "- GPIO24", + "description": "GPIO24", "number": 18 }, "PIN_19": { - "description": "- GPIO10 / MOSI (SPI)", + "description": "GPIO10 / MOSI (SPI)", "number": 19 }, "PIN_20": { - "description": "- Ground", + "description": "Ground", "number": 20 }, "PIN_21": { - "description": "- GPIO9 / MISO (SPI)", + "description": "GPIO9 / MISO (SPI)", "number": 21 }, "PIN_22": { - "description": "- GPIO25", + "description": "GPIO25", "number": 22 }, "PIN_23": { - "description": "- GPIO11 / SCLK (SPI)", + "description": "GPIO11 / SCLK (SPI)", "number": 23 }, "PIN_24": { - "description": "- GPIO8 / CE0 (SPI)", + "description": "GPIO8 / CE0 (SPI)", "number": 24 }, "PIN_25": { - "description": "- Ground", + "description": "Ground", "number": 25 }, "PIN_26": { - "description": "- GPIO7 / CE1 (SPI)", + "description": "GPIO7 / CE1 (SPI)", "number": 26 }, "PIN_27": { - "description": "- ID_SD (I2C ID EEPROM)", + "description": "ID_SD (I2C ID EEPROM)", "number": 27 }, "PIN_28": { - "description": "- ID_SC (I2C ID EEPROM)", + "description": "ID_SC (I2C ID EEPROM)", "number": 28 }, "PIN_29": { - "description": "- GPIO5", + "description": "GPIO5", "number": 29 }, "PIN_30": { - "description": "- Ground", + "description": "Ground", "number": 30 }, "PIN_31": { - "description": "- GPIO6", + "description": "GPIO6", "number": 31 }, "PIN_32": { - "description": "- GPIO12", + "description": "GPIO12", "number": 32 }, "PIN_33": { - "description": "- GPIO13", + "description": "GPIO13", "number": 33 }, "PIN_34": { - "description": "- Ground", + "description": "Ground", "number": 34 }, "PIN_35": { - "description": "- GPIO19 / MISO (PCM)", + "description": "GPIO19 / MISO (PCM)", "number": 35 }, "PIN_36": { - "description": "- GPIO16 / CE0 (PCM)", + "description": "GPIO16 / CE0 (PCM)", "number": 36 }, "PIN_37": { - "description": "- GPIO26", + "description": "GPIO26", "number": 37 }, "PIN_38": { - "description": "- GPIO20 / MOSI (PCM)", + "description": "GPIO20 / MOSI (PCM)", "number": 38 }, "PIN_39": { - "description": "- Ground", + "description": "Ground", "number": 39 }, "PIN_40": { - "description": "- GPIO21 / SCLK (PCM)", + "description": "GPIO21 / SCLK (PCM)", "number": 40 } }, @@ -80818,15 +81408,15 @@ "brief": null, "constants": { "PUD_OFF": { - "description": "- No pull-up or pull-down resistor.", + "description": "No pull-up or pull-down resistor.", "number": 0 }, "PUD_DOWN": { - "description": "- Enable pull-down resistor.", + "description": "Enable pull-down resistor.", "number": 1 }, "PUD_UP": { - "description": "- Enable pull-up resistor.", + "description": "Enable pull-up resistor.", "number": 2 } }, diff --git a/generated/pascal/splashkit.pas b/generated/pascal/splashkit.pas index ab306274..6a835f13 100644 --- a/generated/pascal/splashkit.pas +++ b/generated/pascal/splashkit.pas @@ -1078,6 +1078,16 @@ function TrianglesFrom(const q: Quad): ArrayOfTriangle; function Rnd(min: Integer; max: Integer): Integer; function Rnd(): Single; function Rnd(ubound: Integer): Integer; +procedure RaspiCleanup(); +function RaspiGetMode(pin: Pins): PinModes; +procedure RaspiInit(); +function RaspiRead(pin: Pins): PinValues; +procedure RaspiSetMode(pin: Pins; mode: PinModes); +procedure RaspiSetPullUpDown(pin: Pins; pud: PullUpDown); +procedure RaspiSetPwmDutycycle(pin: Pins; dutycycle: Integer); +procedure RaspiSetPwmFrequency(pin: Pins; frequency: Integer); +procedure RaspiSetPwmRange(pin: Pins; range: Integer); +procedure RaspiWrite(pin: Pins; value: PinValues); procedure DrawQuad(clr: Color; const q: Quad); procedure DrawQuad(clr: Color; const q: Quad; const opts: DrawingOptions); procedure DrawQuadOnBitmap(destination: Bitmap; clr: Color; const q: Quad); @@ -3184,6 +3194,16 @@ function __sklib__triangles_from__quad_ref(const q: __sklib_quad): __sklib_vecto function __sklib__rnd__int__int(min: Integer; max: Integer): Integer; cdecl; external; function __sklib__rnd(): Single; cdecl; external; function __sklib__rnd__int(ubound: Integer): Integer; cdecl; external; +procedure __sklib__raspi_cleanup(); cdecl; external; +function __sklib__raspi_get_mode__pins(pin: LongInt): LongInt; cdecl; external; +procedure __sklib__raspi_init(); cdecl; external; +function __sklib__raspi_read__pins(pin: LongInt): LongInt; cdecl; external; +procedure __sklib__raspi_set_mode__pins__pin_modes(pin: LongInt; mode: LongInt); cdecl; external; +procedure __sklib__raspi_set_pull_up_down__pins__pull_up_down(pin: LongInt; pud: LongInt); cdecl; external; +procedure __sklib__raspi_set_pwm_dutycycle__pins__int(pin: LongInt; dutycycle: Integer); cdecl; external; +procedure __sklib__raspi_set_pwm_frequency__pins__int(pin: LongInt; frequency: Integer); cdecl; external; +procedure __sklib__raspi_set_pwm_range__pins__int(pin: LongInt; range: Integer); cdecl; external; +procedure __sklib__raspi_write__pins__pin_values(pin: LongInt; value: LongInt); cdecl; external; procedure __sklib__draw_quad__color__quad_ref(clr: __sklib_color; const q: __sklib_quad); cdecl; external; procedure __sklib__draw_quad__color__quad_ref__drawing_options_ref(clr: __sklib_color; const q: __sklib_quad; const opts: __sklib_drawing_options); cdecl; external; procedure __sklib__draw_quad_on_bitmap__bitmap__color__quad_ref(destination: __sklib_ptr; clr: __sklib_color; const q: __sklib_quad); cdecl; external; @@ -10339,6 +10359,86 @@ function Rnd(ubound: Integer): Integer; __skreturn := __sklib__rnd__int(__skparam__ubound); result := __skadapter__to_int(__skreturn); end; +procedure RaspiCleanup(); +begin + __sklib__raspi_cleanup(); +end; +function RaspiGetMode(pin: Pins): PinModes; +var + __skparam__pin: LongInt; + __skreturn: LongInt; +begin + __skparam__pin := __skadapter__to_sklib_pins(pin); + __skreturn := __sklib__raspi_get_mode__pins(__skparam__pin); + result := __skadapter__to_pin_modes(__skreturn); +end; +procedure RaspiInit(); +begin + __sklib__raspi_init(); +end; +function RaspiRead(pin: Pins): PinValues; +var + __skparam__pin: LongInt; + __skreturn: LongInt; +begin + __skparam__pin := __skadapter__to_sklib_pins(pin); + __skreturn := __sklib__raspi_read__pins(__skparam__pin); + result := __skadapter__to_pin_values(__skreturn); +end; +procedure RaspiSetMode(pin: Pins; mode: PinModes); +var + __skparam__pin: LongInt; + __skparam__mode: LongInt; +begin + __skparam__pin := __skadapter__to_sklib_pins(pin); + __skparam__mode := __skadapter__to_sklib_pin_modes(mode); + __sklib__raspi_set_mode__pins__pin_modes(__skparam__pin, __skparam__mode); +end; +procedure RaspiSetPullUpDown(pin: Pins; pud: PullUpDown); +var + __skparam__pin: LongInt; + __skparam__pud: LongInt; +begin + __skparam__pin := __skadapter__to_sklib_pins(pin); + __skparam__pud := __skadapter__to_sklib_pull_up_down(pud); + __sklib__raspi_set_pull_up_down__pins__pull_up_down(__skparam__pin, __skparam__pud); +end; +procedure RaspiSetPwmDutycycle(pin: Pins; dutycycle: Integer); +var + __skparam__pin: LongInt; + __skparam__dutycycle: Integer; +begin + __skparam__pin := __skadapter__to_sklib_pins(pin); + __skparam__dutycycle := __skadapter__to_sklib_int(dutycycle); + __sklib__raspi_set_pwm_dutycycle__pins__int(__skparam__pin, __skparam__dutycycle); +end; +procedure RaspiSetPwmFrequency(pin: Pins; frequency: Integer); +var + __skparam__pin: LongInt; + __skparam__frequency: Integer; +begin + __skparam__pin := __skadapter__to_sklib_pins(pin); + __skparam__frequency := __skadapter__to_sklib_int(frequency); + __sklib__raspi_set_pwm_frequency__pins__int(__skparam__pin, __skparam__frequency); +end; +procedure RaspiSetPwmRange(pin: Pins; range: Integer); +var + __skparam__pin: LongInt; + __skparam__range: Integer; +begin + __skparam__pin := __skadapter__to_sklib_pins(pin); + __skparam__range := __skadapter__to_sklib_int(range); + __sklib__raspi_set_pwm_range__pins__int(__skparam__pin, __skparam__range); +end; +procedure RaspiWrite(pin: Pins; value: PinValues); +var + __skparam__pin: LongInt; + __skparam__value: LongInt; +begin + __skparam__pin := __skadapter__to_sklib_pins(pin); + __skparam__value := __skadapter__to_sklib_pin_values(value); + __sklib__raspi_write__pins__pin_values(__skparam__pin, __skparam__value); +end; procedure DrawQuad(clr: Color; const q: Quad); var __skparam__clr: __sklib_color; diff --git a/generated/python/splashkit.py b/generated/python/splashkit.py index b4ea5e71..6feb1776 100644 --- a/generated/python/splashkit.py +++ b/generated/python/splashkit.py @@ -2763,6 +2763,26 @@ def __skadapter__to_sklib_window(v): sklib.__sklib__rnd.restype = c_float sklib.__sklib__rnd__int.argtypes = [ c_int ] sklib.__sklib__rnd__int.restype = c_int +sklib.__sklib__raspi_cleanup.argtypes = [ ] +sklib.__sklib__raspi_cleanup.restype = None +sklib.__sklib__raspi_get_mode__pins.argtypes = [ c_int ] +sklib.__sklib__raspi_get_mode__pins.restype = c_int +sklib.__sklib__raspi_init.argtypes = [ ] +sklib.__sklib__raspi_init.restype = None +sklib.__sklib__raspi_read__pins.argtypes = [ c_int ] +sklib.__sklib__raspi_read__pins.restype = c_int +sklib.__sklib__raspi_set_mode__pins__pin_modes.argtypes = [ c_int, c_int ] +sklib.__sklib__raspi_set_mode__pins__pin_modes.restype = None +sklib.__sklib__raspi_set_pull_up_down__pins__pull_up_down.argtypes = [ c_int, c_int ] +sklib.__sklib__raspi_set_pull_up_down__pins__pull_up_down.restype = None +sklib.__sklib__raspi_set_pwm_dutycycle__pins__int.argtypes = [ c_int, c_int ] +sklib.__sklib__raspi_set_pwm_dutycycle__pins__int.restype = None +sklib.__sklib__raspi_set_pwm_frequency__pins__int.argtypes = [ c_int, c_int ] +sklib.__sklib__raspi_set_pwm_frequency__pins__int.restype = None +sklib.__sklib__raspi_set_pwm_range__pins__int.argtypes = [ c_int, c_int ] +sklib.__sklib__raspi_set_pwm_range__pins__int.restype = None +sklib.__sklib__raspi_write__pins__pin_values.argtypes = [ c_int, c_int ] +sklib.__sklib__raspi_write__pins__pin_values.restype = None sklib.__sklib__draw_quad__color__quad_ref.argtypes = [ _sklib_color, _sklib_quad ] sklib.__sklib__draw_quad__color__quad_ref.restype = None sklib.__sklib__draw_quad__color__quad_ref__drawing_options_ref.argtypes = [ _sklib_color, _sklib_quad, _sklib_drawing_options ] @@ -6693,6 +6713,42 @@ def rnd_int ( ubound ): __skparam__ubound = __skadapter__to_sklib_int(ubound) __skreturn = sklib.__sklib__rnd__int(__skparam__ubound) return __skadapter__to_int(__skreturn) +def raspi_cleanup ( ): + sklib.__sklib__raspi_cleanup() +def raspi_get_mode ( pin ): + __skparam__pin = __skadapter__to_sklib_pins(pin) + __skreturn = sklib.__sklib__raspi_get_mode__pins(__skparam__pin) + return __skadapter__to_pin_modes(__skreturn) +def raspi_init ( ): + sklib.__sklib__raspi_init() +def raspi_read ( pin ): + __skparam__pin = __skadapter__to_sklib_pins(pin) + __skreturn = sklib.__sklib__raspi_read__pins(__skparam__pin) + return __skadapter__to_pin_values(__skreturn) +def raspi_set_mode ( pin, mode ): + __skparam__pin = __skadapter__to_sklib_pins(pin) + __skparam__mode = __skadapter__to_sklib_pin_modes(mode) + sklib.__sklib__raspi_set_mode__pins__pin_modes(__skparam__pin, __skparam__mode) +def raspi_set_pull_up_down ( pin, pud ): + __skparam__pin = __skadapter__to_sklib_pins(pin) + __skparam__pud = __skadapter__to_sklib_pull_up_down(pud) + sklib.__sklib__raspi_set_pull_up_down__pins__pull_up_down(__skparam__pin, __skparam__pud) +def raspi_set_pwm_dutycycle ( pin, dutycycle ): + __skparam__pin = __skadapter__to_sklib_pins(pin) + __skparam__dutycycle = __skadapter__to_sklib_int(dutycycle) + sklib.__sklib__raspi_set_pwm_dutycycle__pins__int(__skparam__pin, __skparam__dutycycle) +def raspi_set_pwm_frequency ( pin, frequency ): + __skparam__pin = __skadapter__to_sklib_pins(pin) + __skparam__frequency = __skadapter__to_sklib_int(frequency) + sklib.__sklib__raspi_set_pwm_frequency__pins__int(__skparam__pin, __skparam__frequency) +def raspi_set_pwm_range ( pin, range ): + __skparam__pin = __skadapter__to_sklib_pins(pin) + __skparam__range = __skadapter__to_sklib_int(range) + sklib.__sklib__raspi_set_pwm_range__pins__int(__skparam__pin, __skparam__range) +def raspi_write ( pin, value ): + __skparam__pin = __skadapter__to_sklib_pins(pin) + __skparam__value = __skadapter__to_sklib_pin_values(value) + sklib.__sklib__raspi_write__pins__pin_values(__skparam__pin, __skparam__value) def draw_quad ( clr, q ): __skparam__clr = __skadapter__to_sklib_color(clr) __skparam__q = __skadapter__to_sklib_quad(q) diff --git a/generated/translator_cache.json b/generated/translator_cache.json index 325a1cb7..b96f6138 100644 --- a/generated/translator_cache.json +++ b/generated/translator_cache.json @@ -3,7 +3,7 @@ "group": "animations", "brief": "Animations in SplashKit can be used to move between cells in\nbitmaps and sprites. Each animation generates a number sequence\nthat can then be used when drawing bitmaps.", "description": null, - "parsed_at": 1705981404, + "parsed_at": 1706062545, "path": "coresdk/src/coresdk/animations.h", "functions": [ { @@ -1951,7 +1951,7 @@ "group": "audio", "brief": "SplashKit Audio allows you to load and play music and sound effects.", "description": "SplashKit's audio library allows you to easily load and play music and\nsound effects within your programs. To get started with audio the first\nthing you need to do is load a sound effect or music file. You can do this\nby calling the `load_sound_effect(string name)` function to the\n`load_music(string name)` function.", - "parsed_at": 1705981405, + "parsed_at": 1706062546, "path": "coresdk/src/coresdk/audio.h", "functions": [ { @@ -2045,7 +2045,7 @@ "group": "utilities", "brief": "SplashKit provides some basic data manipulation functions to\nhelp make it easy to get some basic tasks performed.", "description": null, - "parsed_at": 1705981405, + "parsed_at": 1706062546, "path": "coresdk/src/coresdk/basics.h", "functions": [ { @@ -2362,7 +2362,7 @@ "group": "resource_bundles", "brief": "SplashKit resource bundles allow you to quickly and easily load a\nnumber of resources in the `Resources` folder.", "description": "Supports the loading and freeing of game resource bundles. Resource types\ninclude images, sounds, music and animation files to name a few. Resource\nfiles must be saved in specific locations of a `Resources` folder for\nyour game.", - "parsed_at": 1705981405, + "parsed_at": 1706062546, "path": "coresdk/src/coresdk/bundles.h", "functions": [ { @@ -2507,7 +2507,7 @@ "group": "camera", "brief": "SplashKit camera functionality allows you to move a virtual camera\naround in your world.", "description": "Splashkit camera functionality allows you to move a virtual camera around in\nyour world. This camera projects to the users window, allowing you to\ndraw things to the screen in your world coordinates.", - "parsed_at": 1705981406, + "parsed_at": 1706062547, "path": "coresdk/src/coresdk/camera.h", "functions": [ { @@ -3574,7 +3574,7 @@ "group": "graphics", "brief": null, "description": null, - "parsed_at": 1705981407, + "parsed_at": 1706062548, "path": "coresdk/src/coresdk/circle_drawing.h", "functions": [ { @@ -4945,7 +4945,7 @@ "group": "geometry", "brief": null, "description": null, - "parsed_at": 1705981408, + "parsed_at": 1706062549, "path": "coresdk/src/coresdk/circle_geometry.h", "functions": [ { @@ -5872,7 +5872,7 @@ "group": "graphics", "brief": null, "description": null, - "parsed_at": 1705981408, + "parsed_at": 1706062549, "path": "coresdk/src/coresdk/clipping.h", "functions": [ { @@ -6456,7 +6456,7 @@ "group": "physics", "brief": "SplashKit Collisions library allow you to perform tests between\nbitmaps, sprites and shapes to determin if a collision has occured.", "description": null, - "parsed_at": 1705981410, + "parsed_at": 1706062551, "path": "coresdk/src/coresdk/collisions.h", "functions": [ { @@ -8707,7 +8707,7 @@ "group": "color", "brief": "SplashKit simplifies color manipulation in graphical applications for developers, ensuring ease of use and efficiency.", "description": null, - "parsed_at": 1705981414, + "parsed_at": 1706062556, "path": "coresdk/src/coresdk/color.h", "functions": [ { @@ -13907,7 +13907,7 @@ "group": "graphics", "brief": null, "description": null, - "parsed_at": 1705981416, + "parsed_at": 1706062557, "path": "coresdk/src/coresdk/drawing_options.h", "functions": [ { @@ -15271,7 +15271,7 @@ "group": "graphics", "brief": null, "description": null, - "parsed_at": 1705981417, + "parsed_at": 1706062558, "path": "coresdk/src/coresdk/ellipse_drawing.h", "functions": [ { @@ -17366,7 +17366,7 @@ "group": "geometry", "brief": "SplashKit's geometry functions assist with geometry-related computations.", "description": null, - "parsed_at": 1705981417, + "parsed_at": 1706062558, "path": "coresdk/src/coresdk/geometry.h", "functions": [ { @@ -17498,7 +17498,7 @@ "group": "graphics", "brief": null, "description": null, - "parsed_at": 1705981418, + "parsed_at": 1706062559, "path": "coresdk/src/coresdk/graphics.h", "functions": [ { @@ -18074,7 +18074,7 @@ "group": "graphics", "brief": "SplashKit Images allow drawing of bitmaps and sprites to graphic windows.", "description": null, - "parsed_at": 1705981419, + "parsed_at": 1706062560, "path": "coresdk/src/coresdk/images.h", "functions": [ { @@ -20562,7 +20562,7 @@ "group": "input", "brief": "Input handles user interaction and events such as keypresses.", "description": null, - "parsed_at": 1705981419, + "parsed_at": 1706062561, "path": "coresdk/src/coresdk/input.h", "functions": [ { @@ -20655,7 +20655,7 @@ "group": "json", "brief": "SplashKit Json allows you to create and read JSON objects.", "description": "Splashkit's JSON library allows you to easily create or read JSON objects and\nmanipulate them to/from a JSON string or from a file containing a JSON\nstring. Create a new JSON object with a call to `create_json()` and\nread or write data to it by calling methods like\n`json_add_string(json j, string key, string value)` and\n`json_read_string(json j, string key)`.", - "parsed_at": 1705981421, + "parsed_at": 1706062562, "path": "coresdk/src/coresdk/json.h", "functions": [ { @@ -22407,7 +22407,7 @@ "group": "input", "brief": null, "description": null, - "parsed_at": 1705981422, + "parsed_at": 1706062564, "path": "coresdk/src/coresdk/keyboard_input.h", "functions": [ { @@ -23405,7 +23405,7 @@ "group": "graphics", "brief": null, "description": null, - "parsed_at": 1705981423, + "parsed_at": 1706062565, "path": "coresdk/src/coresdk/line_drawing.h", "functions": [ { @@ -24944,7 +24944,7 @@ "group": "geometry", "brief": null, "description": null, - "parsed_at": 1705981424, + "parsed_at": 1706062565, "path": "coresdk/src/coresdk/line_geometry.h", "functions": [ { @@ -25818,7 +25818,7 @@ "group": "logging", "brief": "SplashKit Logging facilitates streamlined logging with customizable severity levels and modes.", "description": "SplashKit Logging module, allows users to initialize a custom logger with specified log levels and modes (console, file, or both). \nThe module provides functions to log messages at different severity levels (INFO, DEBUG, WARNING, ERROR, FATAL) with timestamped entries. \nUsers can close the logging process as needed, and the module handles customization for console and file output.", - "parsed_at": 1705981425, + "parsed_at": 1706062566, "path": "coresdk/src/coresdk/logging.h", "functions": [ { @@ -26067,7 +26067,7 @@ "group": "physics", "brief": "Provides matrix functions to work on 2d coordinates.", "description": null, - "parsed_at": 1705981425, + "parsed_at": 1706062566, "path": "coresdk/src/coresdk/matrix_2d.h", "functions": [ { @@ -26805,7 +26805,7 @@ "group": "input", "brief": null, "description": null, - "parsed_at": 1705981426, + "parsed_at": 1706062567, "path": "coresdk/src/coresdk/mouse_input.h", "functions": [ { @@ -27292,7 +27292,7 @@ "group": "audio", "brief": null, "description": null, - "parsed_at": 1705981427, + "parsed_at": 1706062568, "path": "coresdk/src/coresdk/music.h", "functions": [ { @@ -28285,7 +28285,7 @@ "group": "networking", "brief": "SplashKit's network-related functions allow you to communicate data\nacross networks.", "description": null, - "parsed_at": 1705981430, + "parsed_at": 1706062570, "path": "coresdk/src/coresdk/networking.h", "functions": [ { @@ -31429,7 +31429,7 @@ "group": "physics", "brief": null, "description": null, - "parsed_at": 1705981430, + "parsed_at": 1706062570, "path": "coresdk/src/coresdk/physics.h", "functions": [ @@ -31451,7 +31451,7 @@ "group": "graphics", "brief": null, "description": null, - "parsed_at": 1705981431, + "parsed_at": 1706062571, "path": "coresdk/src/coresdk/point_drawing.h", "functions": [ { @@ -32771,7 +32771,7 @@ "group": "geometry", "brief": null, "description": null, - "parsed_at": 1705981432, + "parsed_at": 1706062572, "path": "coresdk/src/coresdk/point_geometry.h", "functions": [ { @@ -33795,7 +33795,7 @@ "group": "geometry", "brief": null, "description": null, - "parsed_at": 1705981433, + "parsed_at": 1706062572, "path": "coresdk/src/coresdk/quad_geometry.h", "functions": [ { @@ -34260,7 +34260,7 @@ "group": "utilities", "brief": "SplashKit random provides a simple implementation of random.", "description": "The SplashKit`s random library provides two rnd methods, a `rnd()` which generates\na random number between 0 and 1, and `rnd(int ubound)` which\ngenerates a random number between 0 and the value scpeficied in `ubound`.", - "parsed_at": 1705981434, + "parsed_at": 1706062572, "path": "coresdk/src/coresdk/random.h", "functions": [ { @@ -34390,11 +34390,454 @@ ] }, + "raspi_gpio": { + "group": "raspberry", + "brief": "Splashkit allows you to read and write to the GPIO pins on the Raspberry Pi.", + "description": null, + "parsed_at": 1706062573, + "path": "coresdk/src/coresdk/raspi_gpio.h", + "functions": [ + { + "signature": "void raspi_cleanup();", + "name": "raspi_cleanup", + "method_name": null, + "unique_global_name": "raspi_cleanup", + "unique_method_name": null, + "suffix_name": null, + "description": "This function should be called when you are finished using the GPIO library. It sets all pin modes to INPUT and values to LOW.", + "brief": "Cleans up and releases any resources used by the GPIO library.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + }, + { + "signature": "pin_modes raspi_get_mode(pins pin);", + "name": "raspi_get_mode", + "method_name": null, + "unique_global_name": "raspi_get_mode", + "unique_method_name": null, + "suffix_name": null, + "description": "This function retrieves the mode of the specified pin.", + "brief": "Gets the mode of the specified pin.", + "return": { + "type": "pin_modes", + "description": "The mode of the pin.", + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to get the mode for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + }, + { + "signature": "void raspi_init();", + "name": "raspi_init", + "method_name": null, + "unique_global_name": "raspi_init", + "unique_method_name": null, + "suffix_name": null, + "description": "This function initializes the GPIO library for use. It should be called before any other GPIO functions.", + "brief": "Initializes the GPIO library.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + }, + { + "signature": "pin_values raspi_read(pins pin);", + "name": "raspi_read", + "method_name": null, + "unique_global_name": "raspi_read", + "unique_method_name": null, + "suffix_name": null, + "description": "This function reads the value from the specified pin.", + "brief": "Reads the value from the specified pin.", + "return": { + "type": "pin_values", + "description": "The value read from the pin.", + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to read the value from.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + }, + { + "signature": "void raspi_set_mode(pins pin,pin_modes mode);", + "name": "raspi_set_mode", + "method_name": null, + "unique_global_name": "raspi_set_mode", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the mode of the specified pin to the specified mode.", + "brief": "Sets the mode of the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the mode for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "mode": { + "type": "pin_modes", + "description": "The mode to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + }, + { + "signature": "void raspi_set_pull_up_down(pins pin,pull_up_down pud);", + "name": "raspi_set_pull_up_down", + "method_name": null, + "unique_global_name": "raspi_set_pull_up_down", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the pull-up/down mode for the specified pin.", + "brief": "Sets the pull up/down mode for the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the pull up/down mode for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "pud": { + "type": "pull_up_down", + "description": "The pull up/down mode to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + }, + { + "signature": "void raspi_set_pwm_dutycycle(pins pin,int dutycycle);", + "name": "raspi_set_pwm_dutycycle", + "method_name": null, + "unique_global_name": "raspi_set_pwm_dutycycle", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the PWM duty cycle for the specified pin.", + "brief": "Sets the PWM duty cycle for the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the PWM duty cycle for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "dutycycle": { + "type": "int", + "description": "The PWM duty cycle to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + }, + { + "signature": "void raspi_set_pwm_frequency(pins pin,int frequency);", + "name": "raspi_set_pwm_frequency", + "method_name": null, + "unique_global_name": "raspi_set_pwm_frequency", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the PWM frequency for the specified pin.", + "brief": "Sets the PWM frequency for the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the PWM frequency for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "frequency": { + "type": "int", + "description": "The PWM frequency to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + }, + { + "signature": "void raspi_set_pwm_range(pins pin,int range);", + "name": "raspi_set_pwm_range", + "method_name": null, + "unique_global_name": "raspi_set_pwm_range", + "unique_method_name": null, + "suffix_name": null, + "description": "This function sets the PWM range for the specified pin.", + "brief": "Sets the PWM range for the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to set the PWM range for.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "range": { + "type": "int", + "description": "The PWM range to set for the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + }, + { + "signature": "void raspi_write(pins pin,pin_values value);", + "name": "raspi_write", + "method_name": null, + "unique_global_name": "raspi_write", + "unique_method_name": null, + "suffix_name": null, + "description": "This function writes the specified value to the specified pin.", + "brief": "Writes a value to the specified pin.", + "return": { + "type": "void", + "description": null, + "is_pointer": false, + "is_reference": false, + "is_vector": false, + "type_parameter": null + }, + "parameters": { + "pin": { + "type": "pins", + "description": "The pin to write the value to.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + }, + "value": { + "type": "pin_values", + "description": "The value to write to the pin.", + "is_pointer": false, + "is_const": false, + "is_reference": false, + "is_array": false, + "array_dimension_sizes": [ + + ], + "is_vector": false, + "type_parameter": null + } + }, + "attributes": { + "group": "raspberry", + "static": "raspberry" + } + } + ], + "typedefs": [ + + ], + "structs": [ + + ], + "enums": [ + + ], + "defines": [ + + ] + }, "rectangle_drawing": { "group": "graphics", "brief": null, "description": null, - "parsed_at": 1705981436, + "parsed_at": 1706062575, "path": "coresdk/src/coresdk/rectangle_drawing.h", "functions": [ { @@ -37287,7 +37730,7 @@ "group": "geometry", "brief": null, "description": null, - "parsed_at": 1705981437, + "parsed_at": 1706062576, "path": "coresdk/src/coresdk/rectangle_geometry.h", "functions": [ { @@ -38073,7 +38516,7 @@ "group": "resources", "brief": "SplashKit resource functions allow you to locate resources in a\nproject's `Resources` folder.", "description": null, - "parsed_at": 1705981438, + "parsed_at": 1706062576, "path": "coresdk/src/coresdk/resources.h", "functions": [ { @@ -38391,7 +38834,7 @@ "group": "audio", "brief": null, "description": null, - "parsed_at": 1705981440, + "parsed_at": 1706062577, "path": "coresdk/src/coresdk/sound.h", "functions": [ { @@ -39363,7 +39806,7 @@ "group": "sprites", "brief": "SplashKit Sprites allows you to create images you can easily\nmove and animate.", "description": "SplashKit sprites are game elements that can be moved, and animated. Sprites\nare located at a position in the game, have a velocity, and an animation.\nThe sprite can also have arbitary data associated with it for game specific\npurposes.", - "parsed_at": 1705981445, + "parsed_at": 1706062581, "path": "coresdk/src/coresdk/sprites.h", "functions": [ { @@ -46239,7 +46682,7 @@ "group": "terminal", "brief": "SplashKit Terminal allows you to read and write values to the\nterminal in a consistent manner.", "description": null, - "parsed_at": 1705981446, + "parsed_at": 1706062581, "path": "coresdk/src/coresdk/terminal.h", "functions": [ { @@ -46635,7 +47078,7 @@ "group": "graphics", "brief": "SplashKit Text allows for drawing text in a variety of ways to\ngraphic windows.", "description": null, - "parsed_at": 1705981448, + "parsed_at": 1706062583, "path": "coresdk/src/coresdk/text.h", "functions": [ { @@ -49538,7 +49981,7 @@ "group": "input", "brief": null, "description": null, - "parsed_at": 1705981449, + "parsed_at": 1706062584, "path": "coresdk/src/coresdk/text_input.h", "functions": [ { @@ -50073,7 +50516,7 @@ "group": "timers", "brief": "Timers in SplashKit can be used to track the passing of time.", "description": null, - "parsed_at": 1705981450, + "parsed_at": 1706062584, "path": "coresdk/src/coresdk/timers.h", "functions": [ { @@ -50911,7 +51354,7 @@ "group": "graphics", "brief": null, "description": null, - "parsed_at": 1705981452, + "parsed_at": 1706062586, "path": "coresdk/src/coresdk/triangle_drawing.h", "functions": [ { @@ -53318,7 +53761,7 @@ "group": "geometry", "brief": null, "description": null, - "parsed_at": 1705981453, + "parsed_at": 1706062586, "path": "coresdk/src/coresdk/triangle_geometry.h", "functions": [ { @@ -53679,7 +54122,7 @@ "group": "types", "brief": "SplashKit Types simplifies data type creation and management for streamlined programming.", "description": null, - "parsed_at": 1705981455, + "parsed_at": 1706062588, "path": "coresdk/src/coresdk/types.h", "functions": [ @@ -54409,35 +54852,35 @@ "brief": null, "constants": { "GPIO_INPUT": { - "description": "- Input mode.", + "description": "Input mode.", "number": 0 }, "GPIO_OUTPUT": { - "description": "- Output mode.", + "description": "Output mode.", "number": 1 }, "GPIO_ALT0": { - "description": "- Alternate function mode 0.", + "description": "Alternate function mode 0.", "number": 4 }, "GPIO_ALT1": { - "description": "- Alternate function mode 1.", + "description": "Alternate function mode 1.", "number": 5 }, "GPIO_ALT2": { - "description": "- Alternate function mode 2.", + "description": "Alternate function mode 2.", "number": 6 }, "GPIO_ALT3": { - "description": "- Alternate function mode 3.", + "description": "Alternate function mode 3.", "number": 7 }, "GPIO_ALT4": { - "description": "- Alternate function mode 4.", + "description": "Alternate function mode 4.", "number": 3 }, "GPIO_ALT5": { - "description": "- Alternate function mode 5.", + "description": "Alternate function mode 5.", "number": 2 } }, @@ -54452,11 +54895,11 @@ "brief": null, "constants": { "GPIO_LOW": { - "description": "- Logic low (0).", + "description": "Logic low (0).", "number": 0 }, "GPIO_HIGH": { - "description": "- Logic high (1).", + "description": "Logic high (1).", "number": 1 } }, @@ -54471,163 +54914,163 @@ "brief": null, "constants": { "PIN_1": { - "description": "- 3.3V Power Supply", + "description": "3.3V Power Supply", "number": 1 }, "PIN_2": { - "description": "- 5V Power Supply", + "description": "5V Power Supply", "number": 2 }, "PIN_3": { - "description": "- GPIO2 / SDA (I2C)", + "description": "GPIO2 / SDA (I2C)", "number": 3 }, "PIN_4": { - "description": "- 5V Power Supply", + "description": "5V Power Supply", "number": 4 }, "PIN_5": { - "description": "- GPIO3 / SCL (I2C)", + "description": "GPIO3 / SCL (I2C)", "number": 5 }, "PIN_6": { - "description": "- Ground", + "description": "Ground", "number": 6 }, "PIN_7": { - "description": "- GPIO4", + "description": "GPIO4", "number": 7 }, "PIN_8": { - "description": "- GPIO14 / TXD (UART)", + "description": "GPIO14 / TXD (UART)", "number": 8 }, "PIN_9": { - "description": "- Ground", + "description": "Ground", "number": 9 }, "PIN_10": { - "description": "- GPIO15 / RXD (UART)", + "description": "GPIO15 / RXD (UART)", "number": 10 }, "PIN_11": { - "description": "- GPIO17", + "description": "GPIO17", "number": 11 }, "PIN_12": { - "description": "- GPIO18 / PCM_CLK", + "description": "GPIO18 / PCM_CLK", "number": 12 }, "PIN_13": { - "description": "- GPIO27", + "description": "GPIO27", "number": 13 }, "PIN_14": { - "description": "- Ground", + "description": "Ground", "number": 14 }, "PIN_15": { - "description": "- GPIO22", + "description": "GPIO22", "number": 15 }, "PIN_16": { - "description": "- GPIO23", + "description": "GPIO23", "number": 16 }, "PIN_17": { - "description": "- 3.3V Power Supply", + "description": "3.3V Power Supply", "number": 17 }, "PIN_18": { - "description": "- GPIO24", + "description": "GPIO24", "number": 18 }, "PIN_19": { - "description": "- GPIO10 / MOSI (SPI)", + "description": "GPIO10 / MOSI (SPI)", "number": 19 }, "PIN_20": { - "description": "- Ground", + "description": "Ground", "number": 20 }, "PIN_21": { - "description": "- GPIO9 / MISO (SPI)", + "description": "GPIO9 / MISO (SPI)", "number": 21 }, "PIN_22": { - "description": "- GPIO25", + "description": "GPIO25", "number": 22 }, "PIN_23": { - "description": "- GPIO11 / SCLK (SPI)", + "description": "GPIO11 / SCLK (SPI)", "number": 23 }, "PIN_24": { - "description": "- GPIO8 / CE0 (SPI)", + "description": "GPIO8 / CE0 (SPI)", "number": 24 }, "PIN_25": { - "description": "- Ground", + "description": "Ground", "number": 25 }, "PIN_26": { - "description": "- GPIO7 / CE1 (SPI)", + "description": "GPIO7 / CE1 (SPI)", "number": 26 }, "PIN_27": { - "description": "- ID_SD (I2C ID EEPROM)", + "description": "ID_SD (I2C ID EEPROM)", "number": 27 }, "PIN_28": { - "description": "- ID_SC (I2C ID EEPROM)", + "description": "ID_SC (I2C ID EEPROM)", "number": 28 }, "PIN_29": { - "description": "- GPIO5", + "description": "GPIO5", "number": 29 }, "PIN_30": { - "description": "- Ground", + "description": "Ground", "number": 30 }, "PIN_31": { - "description": "- GPIO6", + "description": "GPIO6", "number": 31 }, "PIN_32": { - "description": "- GPIO12", + "description": "GPIO12", "number": 32 }, "PIN_33": { - "description": "- GPIO13", + "description": "GPIO13", "number": 33 }, "PIN_34": { - "description": "- Ground", + "description": "Ground", "number": 34 }, "PIN_35": { - "description": "- GPIO19 / MISO (PCM)", + "description": "GPIO19 / MISO (PCM)", "number": 35 }, "PIN_36": { - "description": "- GPIO16 / CE0 (PCM)", + "description": "GPIO16 / CE0 (PCM)", "number": 36 }, "PIN_37": { - "description": "- GPIO26", + "description": "GPIO26", "number": 37 }, "PIN_38": { - "description": "- GPIO20 / MOSI (PCM)", + "description": "GPIO20 / MOSI (PCM)", "number": 38 }, "PIN_39": { - "description": "- Ground", + "description": "Ground", "number": 39 }, "PIN_40": { - "description": "- GPIO21 / SCLK (PCM)", + "description": "GPIO21 / SCLK (PCM)", "number": 40 } }, @@ -54642,15 +55085,15 @@ "brief": null, "constants": { "PUD_OFF": { - "description": "- No pull-up or pull-down resistor.", + "description": "No pull-up or pull-down resistor.", "number": 0 }, "PUD_DOWN": { - "description": "- Enable pull-down resistor.", + "description": "Enable pull-down resistor.", "number": 1 }, "PUD_UP": { - "description": "- Enable pull-up resistor.", + "description": "Enable pull-up resistor.", "number": 2 } }, @@ -54667,7 +55110,7 @@ "group": "utilities", "brief": "SplashKit provides miscellaneous utilities for unclassified functionality.", "description": null, - "parsed_at": 1705981455, + "parsed_at": 1706062588, "path": "coresdk/src/coresdk/utils.h", "functions": [ { @@ -54875,7 +55318,7 @@ "group": "physics", "brief": "Provides vector functions to work on vectors.", "description": null, - "parsed_at": 1705981456, + "parsed_at": 1706062589, "path": "coresdk/src/coresdk/vector_2d.h", "functions": [ { @@ -56308,7 +56751,7 @@ "group": "networking", "brief": null, "description": null, - "parsed_at": 1705981457, + "parsed_at": 1706062590, "path": "coresdk/src/coresdk/web_client.h", "functions": [ { @@ -56903,7 +57346,7 @@ "group": "networking", "brief": null, "description": null, - "parsed_at": 1705981458, + "parsed_at": 1706062591, "path": "coresdk/src/coresdk/web_server.h", "functions": [ { @@ -58622,7 +59065,7 @@ "group": "windows", "brief": "Window Manager in SplashKit can be used create, and manipulate\ngraphics windows", "description": null, - "parsed_at": 1705981460, + "parsed_at": 1706062593, "path": "coresdk/src/coresdk/window_manager.h", "functions": [ {