CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Header file for built-in function

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jackhab



Joined: 03 Apr 2019
Posts: 6

View user's profile Send private message

Header file for built-in function
PostPosted: Wed Apr 03, 2019 11:27 am     Reply with quote

I just started using CCS with MPLAB X.

Is there a header with all built-in functions and defines so that I can get rid of unresolved identifiers in the IDE?

If not, is there some kind of a list of this built-in API? What kind of a reference you usually use?

Thanks.
PrinceNai



Joined: 31 Oct 2016
Posts: 463
Location: Montenegro

View user's profile Send private message

PostPosted: Wed Apr 03, 2019 11:47 am     Reply with quote

CCS C manual :-). It is there if you press the question mark in top right corner inside IDE. Or here: http://www.ccsinfo.com/content.php?page=syntax-functions
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Wed Apr 03, 2019 11:52 am     Reply with quote

If you are in windows, in the PICC start menu folder, the help file is the manual.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

Re: Header file for built-in function
PostPosted: Wed Apr 03, 2019 12:18 pm     Reply with quote

jackhab wrote:

Is there a header with all built-in functions and defines so that I can get rid of unresolved identifiers in the IDE?

The .h file for your PIC lists all the built-in functions.
For example, the 18F46K22.h file starts with:
Code:
// Discrete I/O Prototypes:
_bif void set_tris_a(int8 value); 
_bif void set_tris_b(int8 value); 
_bif void set_tris_c(int8 value); 
_bif void set_tris_d(int8 value); 
_bif void set_tris_e(int8 value); 

"bif" stands for "built-in function".
Ttelmah



Joined: 11 Mar 2010
Posts: 19372

View user's profile Send private message

PostPosted: Thu Apr 04, 2019 1:28 am     Reply with quote

and, since you should be including that file at the start of each project,
MPLAB should not be giving you unresolved identifiers....


A CCS program should always start with:
Code:

#include "processor.h" //where processor is the PIC you are using
//Then fuses
//clock settings
//select peripherals if your chip use this
//then #uses for USART, I2C etc.
//Then include library functions required
//Then the actual code.


Including the processor file as the first line of your program then tells
everything following what features are supported (and tells MPLAB about
the CCS functions). Then the fuses and clock should be setup before
anything else.
Doing things in this order (or very slight variants - in some cases a fuse
setting may be needed after the clock), makes sure that things are
correctly sequenced.
Very Happy
jackhab



Joined: 03 Apr 2019
Posts: 6

View user's profile Send private message

Re: Header file for built-in function
PostPosted: Thu Apr 04, 2019 1:57 am     Reply with quote

PCM programmer wrote:
jackhab wrote:

Is there a header with all built-in functions and defines so that I can get rid of unresolved identifiers in the IDE?

The .h file for your PIC lists all the built-in functions.
For example, the 18F46K22.h file starts with:
Code:
// Discrete I/O Prototypes:
_bif void set_tris_a(int8 value); 
_bif void set_tris_b(int8 value); 
_bif void set_tris_c(int8 value); 
_bif void set_tris_d(int8 value); 
_bif void set_tris_e(int8 value); 

"bif" stands for "built-in function".


This is interesting because PIC headers in my PICC directory does not have any _bif functions in them at all, including of course 18F45K22.h I'm building the project with.

In general this is the first time I encounter C API without a header file declaring all its functions.
Ttelmah



Joined: 11 Mar 2010
Posts: 19372

View user's profile Send private message

PostPosted: Thu Apr 04, 2019 3:18 am     Reply with quote

That means you have a very old compiler. The bif definitions were introduced
with the V5 compiler, in about 2013.
There was a list of at least some prototypes for MPLAB published here
before that. Problem is going to be working out what the thread was
called that had these.
jackhab



Joined: 03 Apr 2019
Posts: 6

View user's profile Send private message

PostPosted: Sat Apr 06, 2019 10:11 am     Reply with quote

Ttelmah wrote:
That means you have a very old compiler. The bif definitions were introduced
with the V5 compiler, in about 2013.
There was a list of at least some prototypes for MPLAB published here
before that. Problem is going to be working out what the thread was
called that had these.


That's right - I have version 4. I'll check if I can get the headers from evaluation version of version 5.

Thanks.
jeremiah



Joined: 20 Jul 2010
Posts: 1329

View user's profile Send private message

PostPosted: Sat Apr 06, 2019 2:42 pm     Reply with quote

jackhab wrote:
Ttelmah wrote:
That means you have a very old compiler. The bif definitions were introduced
with the V5 compiler, in about 2013.
There was a list of at least some prototypes for MPLAB published here
before that. Problem is going to be working out what the thread was
called that had these.


That's right - I have version 4. I'll check if I can get the headers from evaluation version of version 5.

Thanks.


There might be some incompatibilities for some chips as CCS did a set of sweeping changes to various names for some chips in v5. If things don't work out, you can always manually add those _bif lines to your header file manually using the format that PCM Programmer's post shows.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group