All Projects → jawher → Xavr

jawher / Xavr

Licence: mit
An AVR C project template for XCode

Labels

Projects that are alternatives of or similar to Xavr

Counter Strike Docker
Docker image for Counter-Strike 1.6 server
Stars: ✭ 63 (-10%)
Mutual labels:  makefile
Telephony
The telephony packages feed
Stars: ✭ 66 (-5.71%)
Mutual labels:  makefile
Sweet
Official repository for Semantic Web for Earth and Environmental Terminology (SWEET) Ontologies
Stars: ✭ 69 (-1.43%)
Mutual labels:  makefile
Makebakery
A static website generator built on GNU Make.
Stars: ✭ 64 (-8.57%)
Mutual labels:  makefile
Openwrt Packages Yun
Stars: ✭ 65 (-7.14%)
Mutual labels:  makefile
Cpython Emscripten
Python in the browser - CPython compiled with emscripten
Stars: ✭ 68 (-2.86%)
Mutual labels:  makefile
Reactnative Jwts
Authenticating a React Native app with JSON Web Tokens
Stars: ✭ 62 (-11.43%)
Mutual labels:  makefile
Adafruit icufflinks
Adafruit iCufflinks
Stars: ✭ 69 (-1.43%)
Mutual labels:  makefile
Ngrok K8s
Using ngrok to expose k8s services
Stars: ✭ 66 (-5.71%)
Mutual labels:  makefile
Swift Playground Templates
🏫 A collection of helpful Xcode playground templates.
Stars: ✭ 69 (-1.43%)
Mutual labels:  makefile
Clourmusic flutter
flutter 仿网易云音乐app
Stars: ✭ 65 (-7.14%)
Mutual labels:  makefile
Example Project
Example Python DS project
Stars: ✭ 65 (-7.14%)
Mutual labels:  makefile
Imagefilters
Image Filter is an Android Libary that lets you to Filtering any image
Stars: ✭ 68 (-2.86%)
Mutual labels:  makefile
Openvoiceos
OpenVoiceOS is a minimalistic linux OS bringing the open source voice assistant Mycroft A.I. to embbeded, low-spec headless and/or small (touch)screen devices.
Stars: ✭ 64 (-8.57%)
Mutual labels:  makefile
Translation
translation work flow
Stars: ✭ 69 (-1.43%)
Mutual labels:  makefile
Python Docs Zh Tw
Stars: ✭ 63 (-10%)
Mutual labels:  makefile
Ocaml Makefile
Easy to use Makefile for small to medium-sized OCaml-projects
Stars: ✭ 67 (-4.29%)
Mutual labels:  makefile
Aws Lambda Swift Sprinter
AWS Lambda Custom Runtime for Swift with swift-nio 2.0 support
Stars: ✭ 70 (+0%)
Mutual labels:  makefile
Injectdemo
Stars: ✭ 69 (-1.43%)
Mutual labels:  makefile
Hellogopher
Hellogopher: "just clone and make" your conventional Go project
Stars: ✭ 1,159 (+1555.71%)
Mutual labels:  makefile

X-AVR

X-AVR is an XCode template for generating AVR C projects.

Now the meta version: X-AVR is a python script which uses the installed avr-gcc and avrdude to generate and install an XCode TemplateInfo.plist file. This template can be used to create AVR C XCode projects with a Makefile to build and upload the program to an AVR chip.

Notice: This template does not generate projects in the arduino language. The generated project uses the C language and the avr-libc library.

For example, activating pin 13 on an arduino looks like this:

DDRB |= _BV(PB5)
PORTB |= _BV(PB5)

and not:

pinMode(13, OUTPUT)
digitalWrite(13, HIGH)

Motivation

There are literally dozens of articles and blog posts showing a very basic setup to use XCode for AVR C programming: a C project with an external build system based on a Makefile.

The problem is that with such a basic setup you might as well use a simple text editor instead of XCode. Indeed, you don't get much besides a rudimentary syntax coloring (no autocomplete for example).

To fix this, the X-AVR project template setus up a fake build target (called index) which uses clang to enable XCode to parse and index your project code. X-AVR also cnfigures the following variables for your build:

  • HEADER_SEARCH_PATHS: So that XCode can index the avr-libc headers and include their definitions (port and register names, functions, etc.) in the autocomplete suggestions
  • GCC_PREPROCESSOR_DEFINITIONS: The selected MCU macro is set (e.g. __AVR_ATmega328__) to get accurate autocomplete over the port and register names. F_CPU macro is also set (otherwise the indexing would encouter errors)

Also, X-AVR, and unlike many other Makefiles and templates, automatically picks up all the .c and .h files in your project.

Usage

Clone this repository or download the source zip somewhere in your mac and run python setup.py to generate and install the XCode project template.

The previous step need only be run once (or whenever you install a new avr-gcc version).

Once the template is installed, you should see an xavr entry in the new project wizard in XCode.

The wizard page lets you select the target MCU, its frequency and the programmer to be used to upload the program.

After the wizard is done, hit Cmd+B to build the project.

The project is created with the following targets:

  • All: performs a clean build and uploads the generated hex to the target MCU
  • Build: performs a clean build
  • Upload: uploads the generated hex to the target MCU
  • Clean: deletes the build artifcats
  • Index: a trick target to get XCode autocompletion to work. You're not supposed to interact with this target

Also check Using XCode for AVR C developement for more detailed instructions and screenshots.

Prequisites

  • avr-gcc must be installed and in the PATH variable (detectable via a which avr-gcc)
  • avrdude must be installed and in the PATH variable (detectable via a which avrdude)

Simply install AVR Crosspack to satisfy these prequisites.

Another option is to use homebrew:

brew install avrdude
brew tap larsimmisch/avr
brew install avr-libc

Credits

Icon

The template icon was created using GIMP and includes a mictochip icon designed by Lutz Schubert from the Noun Project and published under the Creative Commons – Attribution (CC BY 3.0) license.

Makefile

The template's Makefile is based on the one written by Eric B. Weddington, Jörg Wunsch, et al.

Template

This template was inspired by the embedXcode XCode template.

License

See LICENSE for details (hint: it's MIT).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].