Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

James Allen's Content

There have been 1 items by James Allen (Search limited from 09-July 23)


By content type

See this member's

Sort by                Order  

#9596 How do I start with converting C++ lib

Posted by James Allen on 15 February 2011 - 09:21 PM in Netduino 2 (and Netduino 1)

Hi

This is my first post in the forums and whilst being a C# dev for nearly 8 years, I've not done much with C or C++. I have recently purchased the DFRobots LCD 48x84 shield (http://goo.gl/BFlhd) and was trying to work out where to start converting the C to C#? I got a bit stumped with things like:

  TCCR2A &= ~((1<<WGM21) | (1<<WGM20));
  TCCR2B &= ~(1<<WGM22);
  TCCR2B = (1<<CS22)|(1<<CS21);      
   
  ASSR |=(0<<AS2);
 
   // Use normal mode  
   TCCR2A =0;    
   //Timer2 Overflow Interrupt Enable  
   TIMSK2 |= (0<<OCIE2A);
   TCNT2=0x6;  // counting starts from 6;  
   TIMSK2 = (1<<TOIE2);    
  
  SREG|=1<<SREG_I;
And even more like that...
   // LCD_RST = 0;
   DDRD |= (1<<SPI_CS)|(1<<LCD_DC)|(1<<LCD_RST)|(1<<SPI_MOSI)|(1<<SPI_SCK)|(1<<LCD_BL);
  
   PORTD &= ~(1<<LCD_RST);
   delayMicroseconds(1);
   PORTD |= (1<<LCD_RST);  

   PORTD &= ~(1<<SPI_CS);
   delayMicroseconds(1);
   PORTD |= (1<<SPI_CS);  
   delayMicroseconds(1);

I searched to see if someone has already converted this (no sense reinventing the wheel) but couldn't find anything.

Does anyone have any pointers?

Thanks




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.