Trying to understand MikroSDK

General discussion on mikroC PRO for PIC32.
Post Reply
Author
Message
Stuartk
Posts: 54
Joined: 12 Jan 2013 04:17

Trying to understand MikroSDK

#1 Post by Stuartk » 27 Jan 2019 00:02

Compiler: MikroC Pro for Pic32
Board: Easy Pic Fusion v7
Micro: Pic32MX795
Current Click:Altitude2

Hello,

I'm trying to understand how MikroSDK is structured: The purpose is to be able to switch to different pins on the microprocessor if required at a later time in a complex project.

For instance is:

Code: Select all

 mikrobus_i2cInit( _MIKROBUS1, &_ALTITUDE2_I2C_CFG[0] );
Roughly equivalent to:

Code: Select all

I2C2_Init(100000); 
And is:

Code: Select all

mikrobus_gpioInit( _MIKROBUS1, _MIKROBUS_CS_PIN, _GPIO_OUTPUT );
Is this equivalent to:

Code: Select all

TRISC2_bit = 0;              // Set PORTC.C2 as output
?

It would be very helpful that in the MikroSDK help file that the equivalent plain code in C is placed in the help file for the mikrobus functions.

Thanks for your help.

Stuart

User avatar
petar.suknjaja
mikroElektronika team
Posts: 683
Joined: 05 Mar 2018 09:44
Location: Belgrade

Re: Trying to understand MikroSDK

#2 Post by petar.suknjaja » 28 Jan 2019 22:53

Hi Stuart,

mikroSDK allows you to use mikroBUS with ease, aims at platform compability, time efficiency and code portability, among the rest.

The mikroSDK manual is available from this link:
https://download.mikroe.com/documents/m ... l-v100.pdf

Generally, what you wrote is what it does in the code.

I recommend you to take a look of the mikroSDK help file located in the \Packages\mikroBUS Board Definition API\Help folder.
You can see what options are available and what pointers are used.
Also, you could open various def files and see what pins are used and for what function.

The suggestion about equivalent C code is on the place, I'll forward it to our developers.

Kind regards,
Petar

Post Reply

Return to “mikroC PRO for PIC32 General”