Main Site Documentation

Working on Interops


#1

I’ve successfully ported TinyCLR 0.7.0 to my good old STM32 Mikromedia Board from Mikroelektronika and it works fine.
Now, the board is rich of peripherals and specifically it has LCD Display attached.
The display is SSD1963 chip driven. The guys at Mikroe doesn’t use FSMC bus and so it needs specific driver. I have the old c++ code I wrote in the MF 4.2 era as Interop.
Now I’m playing with TinyCLR Interops and Native API to see what to do.

The question: the native .c/.h code generated by VS2017 has an #include <TinyCLR_Interop.h> that I can’t find on github repo. I’m missing something? I remember that include file in the porting kit of MF 4.x …


#2

Have you checked both the “Generate native stubs for internal methods” and the “Generate bare native stubs” checkboxes?


#3

Thank you John … It seems I haven’t checked both checkbox!! Now I have “bare” native code.
I will start experimenting…


#4

My managed code and native code.


Enjoy!


#5

Thank you @matsujirushi, that’s very useful starting point.


#6

No videos no pictures? :slight_smile:


#7

@Gus_Issa It’s short video. :sunglasses:

I announced that how to porting in .NET geek meeting.

And I have meeting next weekend. creating slides now.:blush:


#8

Thanks to some sample code from @matsujirushi I’ve mostly done porting TinyCLR 0.7.0 to Mikromedia Board for STM32F4. I’m working on LCD Display and the base drawing functions are implemented and working … News soon…


#9

Very cool. Which board are we taking about?


#10

The board is Mikromedia Plus for STM32 (STM32F407ZG)
https://www.mikroe.com/mikromedia-4-stm32f4?search_query=stm32&results=33


#11

Beautiful board!


#12

It’s very good board, but very expansive …
I’ve ported code to 0.8.0. Still work in progress…

static void Main()
 {
            Mikroe_MMB_LCD myLcd = new Mikroe_MMB_LCD();
            myLcd.Init();
            Debug.WriteLine("Testing...");
            myLcd.ClearScreen(Color.Black);
            myLcd.DrawRect(1, 1, 479, 271, Color.Green);
            myLcd.DrawLine(2, 150, 479, 150, Color.White);
            var s = "Hello World!";
            myLcd.DrawText(s, (ushort) s.Length, 80, 40, Color.Red);
            s = "From TinyCLR!";
            myLcd.DrawText(s, (ushort) s.Length, 80, 50, Color.Red);
            myLcd.DrawRect(75, 38, 120, 30, Color.Blue);
            //DrawGauge(myLcd, 25, 25, 100, Color.Red, 50.0F, 0.0F, 100.0F);
}