summaryrefslogtreecommitdiff
path: root/src/c/hardware/rasberrypi/includes
diff options
context:
space:
mode:
authorsiddhu89902016-07-25 15:59:40 +0530
committersiddhu89902016-07-25 15:59:40 +0530
commit24fbba33153e7758df4a990cb4c21ae8e53e6f3e (patch)
treeb12075cf236142e6e0b9c024a37a2fc4ee5e6761 /src/c/hardware/rasberrypi/includes
parent169db0082ebd07baea82d00213db6ffd4dee7cf6 (diff)
downloadscilab2c-24fbba33153e7758df4a990cb4c21ae8e53e6f3e.tar.gz
scilab2c-24fbba33153e7758df4a990cb4c21ae8e53e6f3e.tar.bz2
scilab2c-24fbba33153e7758df4a990cb4c21ae8e53e6f3e.zip
WiringPi used for RaspberryPi (Gpio, serial, Threads, ISRs)
Diffstat (limited to 'src/c/hardware/rasberrypi/includes')
-rw-r--r--src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h2
-rw-r--r--src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h26
-rw-r--r--src/c/hardware/rasberrypi/includes/RPIPeripheralSerial.h49
-rw-r--r--src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h28
-rw-r--r--src/c/hardware/rasberrypi/includes/RPIPeripheralTiming.h (renamed from src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h)10
5 files changed, 110 insertions, 5 deletions
diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h
index e56366c3..60561cca 100644
--- a/src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h
+++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralDigital.h
@@ -21,7 +21,7 @@ extern "C" {
#include "types.h"
-#include "bcm2835.h"
+#include "wiringPi.h"
extern int phy_pin[];
diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h
new file mode 100644
index 00000000..de05f908
--- /dev/null
+++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralPinISR.h
@@ -0,0 +1,26 @@
+ /* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#ifndef __RPIPERIPHERALPINISR_H__
+#define __RPIPERIPHERALPINISR_H__
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int16 i16RPIPinISRs(uint8 pin, uint8 edgetype, void (*ISRFunction));
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__RPIPERIPHERALPINISR_H__*/
diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralSerial.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralSerial.h
new file mode 100644
index 00000000..199caf9f
--- /dev/null
+++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralSerial.h
@@ -0,0 +1,49 @@
+ /* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#ifndef __RPIPERIPHERALSERIAL_H__
+#define __RPIPERIPHERALSERIAL_H__
+
+#include "types.h"
+#include "wiringSerial.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int u8RPISerialSetups(char* port, int baudrate);
+uint8 u8RPISerialCloses(int fd);
+
+uint8 u8RPISerialSendChars(int fd, uint8 data);
+uint8 u8RPISerialSendDatas(int fd, uint8 data);
+uint8 i8RPISerialSendDatas(int fd, int8 data);
+uint8 u16RPISerialSendDatas(int fd, uint16 data);
+uint8 i16RPISerialSendDatas(int fd, int16 data);
+uint8 sRPISerialSendDatas(int fd, float data);
+uint8 dRPISerialSendDatas(int fd, double data);
+uint8 u8RPISerialSendDataa(int fd, uint8* data, int size);
+uint8 i8RPISerialSendDataa(int fd, int8* data, int size);
+uint8 u16RPISerialSendDataa(int fd, uint16* data, int size);
+uint8 i16RPISerialSendDataa(int fd, int16* data, int size);
+uint8 sRPISerialSendDataa(int fd, float* data, int size);
+uint8 dRPISerialSendDataa(int fd, double* data, int size);
+uint8 gRPISerialSendDatas(int fd, uint8* data, int size);
+
+int16 i16RPISerialDataAvails(int fd);
+int16 i16RPISerialGetChars(int fd);
+
+uint8 u8RPISerialFlushs(int fd);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__RPIPERIPHERALSERIAL_H__*/
diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h
new file mode 100644
index 00000000..4c5d3a55
--- /dev/null
+++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralThreading.h
@@ -0,0 +1,28 @@
+ /* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Siddhesh Wani
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+#ifndef __RPIPERIPHERALTHREADING_H__
+#define __RPIPERIPHERALTHREADING_H__
+
+#include "types.h"
+#include "wiringPi.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+uint16 RPIThreadCreate(void (*threadFunction));
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__RPIPERIPHERALTHREADING_H__*/
diff --git a/src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h b/src/c/hardware/rasberrypi/includes/RPIPeripheralTiming.h
index 0b20ad66..d1ca027e 100644
--- a/src/c/hardware/rasberrypi/includes/RPIPeripheralUtil.h
+++ b/src/c/hardware/rasberrypi/includes/RPIPeripheralTiming.h
@@ -12,21 +12,23 @@
/* This file declares functions and constants related to rasberrypi*/
-#ifndef __RPIPERIPHERALUTIL_H__
-#define __RPIPERIPHERALUTIL_H__
+#ifndef __RPIPERIPHERALTIMING_H__
+#define __RPIPERIPHERALTIMING_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "types.h"
-#include "bcm2835.h"
+#include "wiringPi.h"
uint8 u16RPIDelayMillis(uint16 time);
uint8 u16RPIDelayMicros(uint16 time);
+uint32 u32RPIGetMillis();
+uint32 u32RPIGetMicros();
#ifdef __cplusplus
} /* extern "C" */
#endif
-#endif /*__RPIPERIPHERALUTIL_H__*/
+#endif /*__RPIPERIPHERALTIMING_H__*/