Merge pull request #22 from vsfteam/master

add vsf port
This commit is contained in:
Lyon 2021-12-22 01:23:01 +08:00 committed by GitHub
commit 76e1e25ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 1 deletions

View File

@ -128,7 +128,7 @@ CH340 is deployed to support USB to serial with Type-C USB, support download pyt
|OS|port|GPIO|TIME| |OS|port|GPIO|TIME|
|---|---|---|---| |---|---|---|---|
|rt-thread|√|√|√| |rt-thread|√|√|√|
|vsfOS| |√|√| |vsf|√|√| |
|OS|port|Google Test|Banch Mark| |OS|port|Google Test|Banch Mark|
|---|---|---|---| |---|---|---|---|

View File

@ -7,7 +7,32 @@
#if __PIKA_VSF_GPIO == ENABLED #if __PIKA_VSF_GPIO == ENABLED
static int __vsf_gpio_pin_get(char *pin) { static int __vsf_gpio_pin_get(char *pin) {
char ch_port, ch_pin;
int hw_port = 0, hw_pin = 0; int hw_port = 0, hw_pin = 0;
ch_port = *pin++;
VSF_ASSERT(ch_port == 'P');
ch_port = *pin++;
if ((ch_port >= 'A') && (ch_port <= 'Z')) {
hw_port = ch_port - 'A';
} else if ((ch_port >= '0') && (ch_port <= '9')) {
hw_port = ch_port - '0';
} else {
VSF_ASSERT(false);
}
if (*pin == '.') {
pin++;
}
while ((ch_pin = *pin++) != NULL) {
if (!((ch_pin >= '0') && (ch_pin <= '9'))) {
break;
}
hw_pin *= 10;
hw_pin += ch_pin - '0';
}
return vsf_hw_io_mapper_pin(hw_port, hw_pin); return vsf_hw_io_mapper_pin(hw_port, hw_pin);
} }
#endif #endif

4
port/vsf/main.py Normal file
View File

@ -0,0 +1,4 @@
import PikaStdLib
import PikaVSF
print('python startup...')

4
port/vsf/requestment.txt Normal file
View File

@ -0,0 +1,4 @@
pikascript-core==latest
PikaStdLib==latest
PikaStdDevice==latest
PikaVSF==latest