Raspberry
Functions
Has Gpio
Checks if the system has GPIO capabilities.
Return Type: Boolean
Signatures:
bool has_gpio()
public static bool SplashKit.HasGpio();
def has_gpio():
function HasGpio(): Boolean
Raspi Cleanup {</>}
This function should be called when you are finished using the GPIO library. It sets all pin modes to INPUT and values to LOW.
Signatures:
void raspi_cleanup()
public static void SplashKit.RaspiCleanup();
def raspi_cleanup():
procedure RaspiCleanup()
Usage: {</>}
Raspi Get Mode
This function retrieves the mode of the specified pin.
Parameters:
Name | Type | Description |
---|---|---|
pin | Gpio Pin | The pin to get the mode for. |
Return Type: Gpio Pin Mode
Signatures:
gpio_pin_mode raspi_get_mode(gpio_pin pin)
public static GpioPinMode SplashKit.RaspiGetMode(GpioPin pin);
def raspi_get_mode(pin):
function RaspiGetMode(pin: GpioPin): GpioPinMode
Raspi Init {</>}
This function initializes the GPIO library for use. It should be called before any other GPIO functions.
Signatures:
void raspi_init()
public static void SplashKit.RaspiInit();
def raspi_init():
procedure RaspiInit()
Usage: {</>}
Raspi Read {</>}
This function reads the value from the specified pin.
Parameters:
Name | Type | Description |
---|---|---|
pin | Gpio Pin | The pin to read the value from. |
Return Type: Gpio Pin Value
Signatures:
gpio_pin_value raspi_read(gpio_pin pin)
public static GpioPinValue SplashKit.RaspiRead(GpioPin pin);
def raspi_read(pin):
function RaspiRead(pin: GpioPin): GpioPinValue
Usage: {</>}
Raspi Set Mode {</>}
This function sets the mode of the specified pin to the specified mode.
Parameters:
Name | Type | Description |
---|---|---|
pin | Gpio Pin | The pin to set the mode for. |
mode | Gpio Pin Mode | The mode to set for the pin. |
Signatures:
void raspi_set_mode(gpio_pin pin, gpio_pin_mode mode)
public static void SplashKit.RaspiSetMode(GpioPin pin, GpioPinMode mode);
def raspi_set_mode(pin, mode):
procedure RaspiSetMode(pin: GpioPin; mode: GpioPinMode)
Usage: {</>}
Raspi Set Pull Up Down {</>}
This function sets the pull-up/down mode for the specified pin.
Parameters:
Name | Type | Description |
---|---|---|
pin | Gpio Pin | The pin to set the pull up/down mode for. |
pud | Pull Up Down | The pull up/down mode to set for the pin. |
Signatures:
void raspi_set_pull_up_down(gpio_pin pin, pull_up_down pud)
public static void SplashKit.RaspiSetPullUpDown(GpioPin pin, PullUpDown pud);
def raspi_set_pull_up_down(pin, pud):
procedure RaspiSetPullUpDown(pin: GpioPin; pud: PullUpDown)
Usage: {</>}
Raspi Set Pwm Dutycycle {</>}
This function sets the PWM duty cycle for the specified pin.
Parameters:
Name | Type | Description |
---|---|---|
pin | Gpio Pin | The pin to set the PWM duty cycle for. |
dutycycle | Integer | The PWM duty cycle to set for the pin. |
Signatures:
void raspi_set_pwm_dutycycle(gpio_pin pin, int dutycycle)
public static void SplashKit.RaspiSetPwmDutycycle(GpioPin pin, int dutycycle);
def raspi_set_pwm_dutycycle(pin, dutycycle):
procedure RaspiSetPwmDutycycle(pin: GpioPin; dutycycle: Integer)
Usage: {</>}
Raspi Set Pwm Frequency {</>}
This function sets the PWM frequency for the specified pin.
Parameters:
Name | Type | Description |
---|---|---|
pin | Gpio Pin | The pin to set the PWM frequency for. |
frequency | Integer | The PWM frequency to set for the pin. |
Signatures:
void raspi_set_pwm_frequency(gpio_pin pin, int frequency)
public static void SplashKit.RaspiSetPwmFrequency(GpioPin pin, int frequency);
def raspi_set_pwm_frequency(pin, frequency):
procedure RaspiSetPwmFrequency(pin: GpioPin; frequency: Integer)
Usage: {</>}
Raspi Set Pwm Range {</>}
This function sets the PWM range for the specified pin. Valid values for the range are 25 - 40000
Parameters:
Name | Type | Description |
---|---|---|
pin | Gpio Pin | The pin to set the PWM range for. |
range | Integer | The PWM range to set for the pin. |
Signatures:
void raspi_set_pwm_range(gpio_pin pin, int range)
public static void SplashKit.RaspiSetPwmRange(GpioPin pin, int range);
def raspi_set_pwm_range(pin, range):
procedure RaspiSetPwmRange(pin: GpioPin; range: Integer)
Usage: {</>}
Raspi Spi Close
This function closes SPI communication on a particular channel.
Parameters:
Name | Type | Description |
---|---|---|
handle | Integer | A reference to the specific SPI connection to close. |
Return Type: Integer
Signatures:
int raspi_spi_close(int handle)
public static int SplashKit.RaspiSpiClose(int handle);
def raspi_spi_close(handle):
function RaspiSpiClose(handle: Integer): Integer
Raspi Spi Open
This function opens SPI communication on a particular channel. It will return -1 if not using Raspberry Pi.
Parameters:
Name | Type | Description |
---|---|---|
channel | Integer | The SPI channel to use. |
speed | Integer | The speed of data transfer (in baud). |
spi_flags | Integer | Optional flags for the SPI modes and settings. |
Return Type: Integer
Signatures:
int raspi_spi_open(int channel, int speed, int spi_flags)
public static int SplashKit.RaspiSpiOpen(int channel, int speed, int spiFlags);
def raspi_spi_open(channel, speed, spi_flags):
function RaspiSpiOpen(channel: Integer; speed: Integer; spiFlags: Integer): Integer
Raspi Spi Transfer
This function transfers data through SPI, it sends data from sendBuf and receives it into recvBuf.
Parameters:
Name | Type | Description |
---|---|---|
handle | Integer | The reference for a specific SPI connection. |
send | String | The data to send. |
count | Integer | The number of bytes to be transferred. |
bytes_transfered | Integer | The number of bytes transferred (output) |
Return Type: String
Signatures:
string raspi_spi_transfer(int handle, const string &send, int count, int &bytes_transfered)
public static string SplashKit.RaspiSpiTransfer(int handle, string send, int count, ref int bytesTransfered);
def raspi_spi_transfer(handle, send, count, bytes_transfered):
function RaspiSpiTransfer(handle: Integer; const send: String; count: Integer; var bytesTransfered: Integer): String
Raspi Write {</>}
This function writes the specified value to the specified pin.
Parameters:
Name | Type | Description |
---|---|---|
pin | Gpio Pin | The pin to write the value to. |
value | Gpio Pin Value | The value to write to the pin. |
Signatures:
void raspi_write(gpio_pin pin, gpio_pin_value value)
public static void SplashKit.RaspiWrite(GpioPin pin, GpioPinValue value);
def raspi_write(pin, value):
procedure RaspiWrite(pin: GpioPin; value: GpioPinValue)
Usage: {</>}
Remote Raspi Cleanup
This function closes the connection to the remote Raspberry Pi and releases any resources associated with it.
Parameters:
Name | Type | Description |
---|---|---|
pi | Connection | The connection object to the remote Raspberry Pi. |
Return Type: Boolean
Signatures:
bool remote_raspi_cleanup(connection pi)
public static bool SplashKit.RemoteRaspiCleanup(Connection pi);
def remote_raspi_cleanup(pi):
function RemoteRaspiCleanup(pi: Connection): Boolean
Remote Raspi Get Mode
This function retrieves the mode of a specific pin on a remote Raspberry Pi.
Parameters:
Name | Type | Description |
---|---|---|
pi | Connection | The connection object to the remote Raspberry Pi. |
pin | Gpio Pin | The pin to get the mode for. |
Return Type: Gpio Pin Mode
Signatures:
gpio_pin_mode remote_raspi_get_mode(connection pi, gpio_pin pin)
public static GpioPinMode SplashKit.RemoteRaspiGetMode(Connection pi, GpioPin pin);
def remote_raspi_get_mode(pi, pin):
function RemoteRaspiGetMode(pi: Connection; pin: GpioPin): GpioPinMode
Remote Raspi Init
This function initialises a connection to a remote Raspberry Pi using the specified name, host, and port.
Parameters:
Name | Type | Description |
---|---|---|
name | String | The name of the connection. |
host | String | The host address of the Raspberry Pi. |
port | unsigned short | The port to use for the connection. |
Return Type: Connection
Signatures:
connection remote_raspi_init(const string &name, const string &host, unsigned short port)
public static Connection SplashKit.RemoteRaspiInit(string name, string host, ushort port);
def remote_raspi_init(name, host, port):
function RemoteRaspiInit(const name: String; const host: String; port: Word): Connection
Remote Raspi Read
This function reads the value from a specific pin on a remote Raspberry Pi.
Parameters:
Name | Type | Description |
---|---|---|
pi | Connection | The connection object to the remote Raspberry Pi. |
pin | Gpio Pin | The pin to read the value from. |
Return Type: Gpio Pin Value
Signatures:
gpio_pin_value remote_raspi_read(connection pi, gpio_pin pin)
public static GpioPinValue SplashKit.RemoteRaspiRead(Connection pi, GpioPin pin);
def remote_raspi_read(pi, pin):
function RemoteRaspiRead(pi: Connection; pin: GpioPin): GpioPinValue
Remote Raspi Set Mode
This function sets the mode of a specific pin on a remote Raspberry Pi.
Parameters:
Name | Type | Description |
---|---|---|
pi | Connection | The connection object to the remote Raspberry Pi. |
pin | Gpio Pin | The pin to set the mode for. |
mode | Gpio Pin Mode | The mode to set for the pin. |
Signatures:
void remote_raspi_set_mode(connection pi, gpio_pin pin, gpio_pin_mode mode)
public static void SplashKit.RemoteRaspiSetMode(Connection pi, GpioPin pin, GpioPinMode mode);
def remote_raspi_set_mode(pi, pin, mode):
procedure RemoteRaspiSetMode(pi: Connection; pin: GpioPin; mode: GpioPinMode)
Remote Raspi Set Pull Up Down
This function sets the pull-up/down mode of a specific pin on a remote Raspberry Pi.
Parameters:
Name | Type | Description |
---|---|---|
pi | Connection | The connection object to the remote Raspberry Pi. |
pin | Gpio Pin | The pin to set the pull up/down mode for. |
pud | Pull Up Down | The pull up/down mode to set for the pin. |
Signatures:
void remote_raspi_set_pull_up_down(connection pi, gpio_pin pin, pull_up_down pud)
public static void SplashKit.RemoteRaspiSetPullUpDown(Connection pi, GpioPin pin, PullUpDown pud);
def remote_raspi_set_pull_up_down(pi, pin, pud):
procedure RemoteRaspiSetPullUpDown(pi: Connection; pin: GpioPin; pud: PullUpDown)
Remote Raspi Set Pwm Dutycycle
This function sets the PWM duty cycle for a specific pin on a remote Raspberry Pi.
Parameters:
Name | Type | Description |
---|---|---|
pi | Connection | The connection object to the remote Raspberry Pi. |
pin | Gpio Pin | The pin to set the PWM duty cycle for. |
dutycycle | Integer | The PWM duty cycle to set for the pin. |
Signatures:
void remote_raspi_set_pwm_dutycycle(connection pi, gpio_pin pin, int dutycycle)
public static void SplashKit.RemoteRaspiSetPwmDutycycle(Connection pi, GpioPin pin, int dutycycle);
def remote_raspi_set_pwm_dutycycle(pi, pin, dutycycle):
procedure RemoteRaspiSetPwmDutycycle(pi: Connection; pin: GpioPin; dutycycle: Integer)
Remote Raspi Set Pwm Frequency
This function sets the PWM frequency for a specific pin on a remote Raspberry Pi.
Parameters:
Name | Type | Description |
---|---|---|
pi | Connection | The connection object to the remote Raspberry Pi. |
pin | Gpio Pin | The pin to set the PWM frequency for. |
frequency | Integer | The PWM frequency to set for the pin. |
Signatures:
void remote_raspi_set_pwm_frequency(connection pi, gpio_pin pin, int frequency)
public static void SplashKit.RemoteRaspiSetPwmFrequency(Connection pi, GpioPin pin, int frequency);
def remote_raspi_set_pwm_frequency(pi, pin, frequency):
procedure RemoteRaspiSetPwmFrequency(pi: Connection; pin: GpioPin; frequency: Integer)
Remote Raspi Set Pwm Range
This function sets the PWM range for a specific pin on a remote Raspberry Pi. Valid values for the range are 25 - 40000
Parameters:
Name | Type | Description |
---|---|---|
pi | Connection | The connection object to the remote Raspberry Pi. |
pin | Gpio Pin | The pin to set the PWM range for. |
range | Integer | The PWM range to set for the pin. |
Signatures:
void remote_raspi_set_pwm_range(connection pi, gpio_pin pin, int range)
public static void SplashKit.RemoteRaspiSetPwmRange(Connection pi, GpioPin pin, int range);
def remote_raspi_set_pwm_range(pi, pin, range):
procedure RemoteRaspiSetPwmRange(pi: Connection; pin: GpioPin; range: Integer)
Remote Raspi Write
This function writes a specified value to a specific pin on a remote Raspberry Pi.
Parameters:
Name | Type | Description |
---|---|---|
pi | Connection | The connection object to the remote Raspberry Pi. |
pin | Gpio Pin | The pin to write the value to. |
value | Gpio Pin Value | The value to write to the pin. |
Signatures:
void remote_raspi_write(connection pi, gpio_pin pin, gpio_pin_value value)
public static void SplashKit.RemoteRaspiWrite(Connection pi, GpioPin pin, GpioPinValue value);
def remote_raspi_write(pi, pin, value):
procedure RemoteRaspiWrite(pi: Connection; pin: GpioPin; value: GpioPinValue)