Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
duo-buildroot-sdk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
duo-buildroot-sdk
Commits
a718e1cb
Commit
a718e1cb
authored
Jun 16, 2023
by
carbon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use wiringX as a GPIO library
parent
3fca6e5a
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
0 deletions
+133
-0
buildroot-2021.05/configs/milkv_duo_musl_riscv64_defconfig
buildroot-2021.05/configs/milkv_duo_musl_riscv64_defconfig
+1
-0
buildroot-2021.05/package/Config.in
buildroot-2021.05/package/Config.in
+1
-0
buildroot-2021.05/package/wiringx/Config.in
buildroot-2021.05/package/wiringx/Config.in
+4
-0
buildroot-2021.05/package/wiringx/src/libwiringx.so
buildroot-2021.05/package/wiringx/src/libwiringx.so
+0
-0
buildroot-2021.05/package/wiringx/src/wiringx.h
buildroot-2021.05/package/wiringx/src/wiringx.h
+110
-0
buildroot-2021.05/package/wiringx/wiringx.mk
buildroot-2021.05/package/wiringx/wiringx.mk
+17
-0
No files found.
buildroot-2021.05/configs/milkv_duo_musl_riscv64_defconfig
View file @
a718e1cb
...
...
@@ -268,6 +268,7 @@ BR2_PACKAGE_BUSYBOX_CONFIG_FRAGMENT_FILES=""
# BR2_PACKAGE_BUSYBOX_SHOW_OTHERS is not set
# BR2_PACKAGE_BUSYBOX_INDIVIDUAL_BINARIES is not set
# BR2_PACKAGE_BUSYBOX_WATCHDOG is not set
BR2_PACKAGE_WIRINGX=y
BR2_PACKAGE_SKELETON=y
BR2_PACKAGE_HAS_SKELETON=y
BR2_PACKAGE_PROVIDES_SKELETON="skeleton-init-sysv"
...
...
buildroot-2021.05/package/Config.in
View file @
a718e1cb
menu "Target packages"
source "package/busybox/Config.in"
source "package/wiringx/Config.in"
source "package/skeleton/Config.in"
source "package/skeleton-custom/Config.in"
source "package/skeleton-init-common/Config.in"
...
...
buildroot-2021.05/package/wiringx/Config.in
0 → 100644
View file @
a718e1cb
config BR2_PACKAGE_WIRINGX
bool "wiringX"
help
wiringX
buildroot-2021.05/package/wiringx/src/libwiringx.so
0 → 100644
View file @
a718e1cb
File added
buildroot-2021.05/package/wiringx/src/wiringx.h
0 → 100644
View file @
a718e1cb
/*
Copyright (c) 2016 CurlyMo <curlymoo1@gmail.com>
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef _WIRING_X_H_
#define _WIRING_X_H_
#ifdef __cplusplus
extern
"C"
{
#endif
#include <errno.h>
#include <syslog.h>
#define wiringXLog(a, b, ...) _wiringXLog(a, __FILE__, __LINE__, b, ##__VA_ARGS__)
extern
void
(
*
_wiringXLog
)(
int
,
char
*
,
int
,
const
char
*
,
...);
#define EXPORT __attribute__((visibility("default")))
#if !defined(PATH_MAX)
#if defined(_POSIX_PATH_MAX)
#define PATH_MAX _POSIX_PATH_MAX
#else
#define PATH_MAX 1024
#endif
#endif
enum
function_t
{
FUNCTION_UNKNOWN
=
0
,
FUNCTION_DIGITAL
=
2
,
FUNCTION_ANALOG
=
4
,
FUNCTION_I2C
=
16
,
FUNCTION_INTERRUPT
=
32
};
enum
pinmode_t
{
PINMODE_NOT_SET
=
0
,
PINMODE_INPUT
=
2
,
PINMODE_OUTPUT
=
4
,
PINMODE_INTERRUPT
=
8
};
enum
isr_mode_t
{
ISR_MODE_UNKNOWN
=
0
,
ISR_MODE_RISING
=
2
,
ISR_MODE_FALLING
=
4
,
ISR_MODE_BOTH
=
8
,
ISR_MODE_NONE
=
16
};
enum
digital_value_t
{
LOW
,
HIGH
};
typedef
struct
wiringXSerial_t
{
unsigned
int
baud
;
unsigned
int
databits
;
unsigned
int
parity
;
unsigned
int
stopbits
;
unsigned
int
flowcontrol
;
}
wiringXSerial_t
;
void
delayMicroseconds
(
unsigned
int
);
int
pinMode
(
int
,
enum
pinmode_t
);
int
wiringXSetup
(
char
*
name
,
void
(
*
func
)(
int
,
char
*
,
int
,
const
char
*
,
...));
int
wiringXGC
(
void
);
// int analogRead(int channel);
int
digitalWrite
(
int
,
enum
digital_value_t
);
int
digitalRead
(
int
);
int
waitForInterrupt
(
int
,
int
);
int
wiringXISR
(
int
,
enum
isr_mode_t
);
int
wiringXI2CRead
(
int
);
int
wiringXI2CReadReg8
(
int
,
int
);
int
wiringXI2CReadReg16
(
int
,
int
);
int
wiringXI2CWrite
(
int
,
int
);
int
wiringXI2CWriteReg8
(
int
,
int
,
int
);
int
wiringXI2CWriteReg16
(
int
,
int
,
int
);
int
wiringXI2CSetup
(
const
char
*
,
int
);
int
wiringXSPIGetFd
(
int
channel
);
int
wiringXSPIDataRW
(
int
channel
,
unsigned
char
*
data
,
int
len
);
int
wiringXSPISetup
(
int
channel
,
int
speed
);
int
wiringXSerialOpen
(
const
char
*
,
struct
wiringXSerial_t
);
void
wiringXSerialFlush
(
int
);
void
wiringXSerialClose
(
int
);
void
wiringXSerialPutChar
(
int
,
unsigned
char
);
void
wiringXSerialPuts
(
int
,
const
char
*
);
void
wiringXSerialPrintf
(
int
,
const
char
*
,
...);
int
wiringXSerialDataAvail
(
int
);
int
wiringXSerialGetChar
(
int
);
char
*
wiringXPlatform
(
void
);
int
wiringXValidGPIO
(
int
);
int
wiringXSelectableFd
(
int
);
int
wiringXSupportedPlatforms
(
char
***
);
#ifdef __cplusplus
}
#endif
#endif
buildroot-2021.05/package/wiringx/wiringx.mk
0 → 100644
View file @
a718e1cb
WIRINGX_SITE
=
$(TOPDIR)
/package/wiringx
WIRINGX_VERSION
=
2023.05.30
WIRINGX_SITE_METHOD
=
local
WIRINGX_INSTALL_STAGING
=
YES
define
WIRINGX_INSTALL_STAGING_CMDS
$(INSTALL)
-D
-m
0644
$(@D)/src/wiringx.h
$(STAGING_DIR)/usr/include/
$(INSTALL)
-D
-m
0644
$(@D)/src/libwiringx.so
$(STAGING_DIR)/usr/lib/
endef
define
WIRINGX_INSTALL_TARGET_CMDS
$(INSTALL)
-D
-m
0644
$(@D)/src/wiringx.h
$(TARGET_DIR)/usr/include/
$(INSTALL)
-D
-m
0644
$(@D)/src/libwiringx.so
$(TARGET_DIR)/usr/lib/
endef
$(eval
$(generic-package))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment