#include <gpio.h> not found - make file edited and library added Topic is solved

If you have a simple question and just want an answer.
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

#include <gpio.h> not found - make file edited and library added

Postby xlordofpainx » Mon Mar 19, 2018 3:47 pm

So I am trying to flash some LEDs on the Xcore2-- audio MC and I am getting fatal error gpio.h not found. I have inported the library into the work space and I have added it in the make file- i have also added assert.h and I am not getting the error for it.
#include <platform.h>
#include <xs1.h>
#include <timer.h>
#include <gpio.h>
#include <assert.h>

port p=X1D14;
port d=X1D16;

void col(unsigned n){
p <: 0;
delay_milliseconds (500) ;
p <: 1;
delay_milliseconds (200) ;
p <: 0;
delay_milliseconds (50000) ;
p <: 1;
delay_milliseconds (200) ;
p <: 0;
delay_milliseconds (50000) ;
p <: 1;
delay_milliseconds (200) ;
}
void row(unsigned n){
d <: 0;
delay_milliseconds (500) ;
d <: 1;
delay_milliseconds (200) ;
d <: 0;
delay_milliseconds (50000) ;
d <: 1;
delay_milliseconds (200) ;
d <: 0;
delay_milliseconds (50000) ;
d <: 1;
delay_milliseconds (200) ;
}

int main () {

par{
row(1);
col(2);
}
return 0;
}
I just chose row 1 column 1 and am trying
View Solution
User avatar
mon2
XCore Legend
Posts: 1255
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Postby mon2 » Mon Mar 19, 2018 5:08 pm

Hi. You are causing more "pain" than required :)

Suggestion:

1) start a fresh workspace
2) goto examples on the left side of the toolchain
3) select AN00155 for the XCORE-200 Explorer Kit
4) Allow for the importing of this example
5) Proceed to compile. During this process, the toolchain will import some dependencies including lib_gpio and others. Then the gpio.h will resolve ok.
6) After a successful compilation -> proceed to kill the source code that is not required and now modify the GPIO pins for your custom code.

Summary: Use the foundation example to correct the raised issue for you and then tweak to suit. Good luck :)
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Postby xlordofpainx » Tue Mar 20, 2018 10:51 am

Thank you sensei, but I am still unable to get the LEds to light up-
I flashed the default N00155 for the XCORE-200 Explorer Kit -> no Leds went on
I changed the target to xk-audio-216-mc - no lights
I changed to default ports to on tile[0] : in port explorer_buttons = XS1_PORT_D14;
on tile[0] : out port explorer_leds = XS1_PORT_D16;
from:
X1D14 4C0 8B0 16A8 32A28 LED_ROW_0
X1D15 4C1 8B1 16A9 32A29 LED_ROW_1
X1D16 4D0 8B2 16A10 LED_COL_0
X1D17 4D1 8B3 16A11 LED_COL_1
X1D18 4D2 8B4 16A12 LED_COL_2
X1D19 4D3 8B5 16A13 LED_COL_3
X1D20 4C2 8B6 16A14 32A30 LED_ROW_2
X1D21 4C3 8B7 16A15 32A31 LED_ROW_3
As they are given in the datasheet, but now i get an error on them - undeclared identifier multiple markers at this line.
User avatar
mon2
XCore Legend
Posts: 1255
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Postby mon2 » Tue Mar 20, 2018 11:03 am

Can you post your code / project?

Review this thread. LEDs are on tile 1.

viewtopic.php?f=3&t=6314&p=31562&hilit=xCORE+200+MC+Audio+PLatform+leds#p31562.
User avatar
xlordofpainx
Experienced Member
Posts: 78
Joined: Thu Mar 08, 2018 2:44 pm

Postby xlordofpainx » Tue Mar 20, 2018 11:18 am

Awesomeee. Thanks! Worked. I am ready for next Christmas!

Who is online

Users browsing this forum: No registered users and 24 guests