MEAM.Design - MAEVARM - Custom Header File
The custom m_general.h file provides some useful features specific to the M2 (and older M1) microcontroller board. This is a work in progress, and you are highly encouraged to add/modify/update this file and post changes here (just add a new line with your version and notes about what has been added - as time goes by changes will be rolled into official releases).
Official Releases:
version: 2.1
uploaded: September 29, 2011
link: m_general.h (right-click, select download)
defines the following useful constants:
TRUE (1)
OFF (0)
ON (1)
TOGGLE (2)
provides the following macro functions:
set(register,n)
- sets the n-th bit of register
clear(register,n)
- clears the n-th bit of register
toggle(register,n)
- toggles the n-th bit of register
check(register,n)
- returns the state of the n-th bit of register
m_disableJTAG()
- turn off JTAG port and allow access to F4-F7 as GPIO
m_clockdivide(N)
- reduces the system clock speed by 2^N (N=0..8)
m_wait(ms)
- delay the microcontroller for an integer number of milliseconds (assumes a 16 MHz system clock)
m_green(state)
- set the state of the green on-board LED to OFF, ON, or TOGGLE
m_red(state)
- set the state of the red on-board LED to OFF, ON, or TOGGLE
Archived Versions
2.0 - m_general_2_0.h
0.4.0 - maevarm_h_040.zip
0.3.1 - maevarm-031.h
0.2.0 - maevarm-020.h
0.1.0 - maevarm_h_v010.zip