Hello, I'm trying to collect some standard procedures porting arduino(mostly avr, sam is easier) libraries to energia/lm4f.  Maybe all forum members could help together, creating a little howto:   Porting libraries to Energia/Stellaris LM4F Version 2014-05-20   1. First, it is necessary to examine the files to the following:   1.1 #if ARDUINO >= 100 #include <Arduino.h>  #else #include <WProgram.h>  #endif   and change it to: #include <Energia.h>  (or let #include <Arduino.h> as only line)   1.2 change #include <pins_arduino.h> to #include <pins_energia.h>   2. If PROGMEM was used: remove all PROGMEM and replace pgm_read_byte with * and better add a static const   or insert this line on top: (Untested) #define PROGMEM #define pgm_read_byte(addr) (*(const unsigned char *)(addr))   or insert:(Untested) #define pgm_read_word(data) *(data) #define pgm_read_byte(data) *(data) #define PROGMEM   3. __delay_cycles macro 3.1 easy way: use delayMicroseconds(xxx) where xxx is to try&error 3.2 use SysCtlDelay(xxx); -> Thread: http://forum.stellarisiti.com/topic/1980-delay-cycles/   4. Pin related macros/stuff   4.1 insert:(Untested) #define cbi(reg, mask) GPIOPinWrite(reg, mask, 0) #define sbi(reg, mask) GPIOPinWrite(reg, mask, mask) #define pulse_high(reg, bitmask) { sbi(reg, bitmask); cbi(reg, bitmask); } #define pulse_low(reg, bitmask) { cbi(reg, bitmask); sbi(reg, bitmask); }   4.2 Conversation: (now I need your help for converting!) Arduino / AVR: #define digitalPinToPort(P) ( pgm_read_byte( digital_pin_to_port_PGM + (P) ) )
#define digitalPinToBitMask(P) ( pgm_read_byte( digital_pin_to_bit_mask_PGM + (P) ) )
#define digitalPinToTimer(P) ( pgm_read_byte( digital_pin_to_timer_PGM + (P) ) )
#define analogInPinToBit(P) (P)
#define portOutputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_output_PGM + (P))) )
#define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
#define portModeRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_mode_PGM + (P))) )   So your help is desired, I'll update this thread as soon as I get new information. Maybe we can build together a conversation.h file, so we can include it to every library (for testing)   Regards  Matthias