accelR8.c File Reference


Detailed Description

Main accelR8 code

Author:
Jörgen Birkler (birkler@yahoo.com)

Defines

Enumerations

Functions

Variables


Define Documentation

#define TIMER_READ_ADC_TIMEOUT_SHORT
 

Period between LCD bias voltage measurements.

#define TIMER_SWITCH_OFF_ON_TIMEOUT
 

Timeout if on before switch off.

#define TIMER_TIMER2_STABILIZE_TIME
 

Time it takes for the OSC2 TIMER2 oscillator to stabilize. 1s according to spec.

#define uart_printf format,
args...   ) 
 

Wrapper for uart printfs.


Function Documentation

void CPU_Clock_Allocate void   )  [static]
 

Allocate CPU clock Do NOT power save, go to idle, keep clock running

void CPU_Clock_Free void   )  [static]
 

Free the CPU clock so that powersave is possible.

unsigned char CPU_Clock_IsAllocated void   )  [static]
 

Status of CPU clock allocations. !0 if CPU clock is allocated.

int8_t ADC_GetMUX void   )  [static]
 

Get the current MUX setting. 0..7 if ADC coversion is complete. -1 if no conversion is complete.

void uart_sendchar char  data,
void *  not_used
 

Da uart send char used by uart_printf.

int main void   ) 
 

Da main program

Todo:
Keep track of on/off state

User interface

Handle RESET and MODE key presses

__naked__ attribute

void sendchar char  c  ) 
 

External sendchar function, for example UART.


Variable Documentation

volatile Voltage_t LCD_Voltage_Current [static]
 

Current LCD bias voltage in mV.

volatile Voltage_t LCD_Voltage_Set [static]
 

Desired LCD bias voltage in mV.

Milliseconds_t LCD_ChargePumpTimer [static]
 

Current charge pump timer.

Voltage_t voltage [static]
 

Latest voltage read from ADC.

volatile unsigned int ADC_ReadValue [static]
 

Latest value read from ADC.

volatile unsigned char cpu_clock_allocs [static]
 

CPU Clock//////////////////Number of CPU clock allocations.


Copyright 2002 Jörgen Birkler. For accelR8 Accelerometer on Mon Jan 19 21:43:19 2004 by Doxygen 1.3.5.