Classes | Defines | Functions | Variables

pwrstep.h File Reference

This graph shows which files directly or indirectly include this file:

Classes

struct  power

Defines

#define PWR_ON   1
#define PWR_OFF   0
#define ADC_DIV   10
#define ADC_CON_CONST   322
#define ADC_OFFSET   2000
#define PWR33   (1<<22)
#define PWR50   (1<<24)
#define PWR80   (1<<23)
#define ADC0   (1<<27)
#define ADC1   (1<<28)
#define ADC2   (1<<29)
#define ADC3   (1<<30)
#define ADCCH0   22
#define ADCCH1   24
#define ADCCH2   26
#define ADCCH3   28
#define ADC_PIN_0   0x1
#define ADC_PIN_1   0x2
#define ADC_PIN_2   0x4
#define ADC_PIN_3   0x8
#define ADC_CR_ADC0   0x1
#define ADC_CR_ADC1   0x2
#define ADC_CR_ADC2   0x4
#define ADC_CR_ADC3   0x8
#define ADC_CR_CLK_DIV_1   (1<<8)
#define ADC_CR_BURST   (1<<16)
#define ADC_CR_CLKS_11   (0<<17)
#define ADC_CR_CLKS_10   (1<<17)
#define ADC_CR_CLKS_9   (2<<17)
#define ADC_CR_CLKS_8   (3<<17)
#define ADC_CR_CLKS_7   (4<<17)
#define ADC_CR_CLKS_6   (5<<17)
#define ADC_CR_CLKS_5   (6<<17)
#define ADC_CR_CLKS_4   (7<<17)
#define ADC_CR_PDN_ON   (1<<21)
#define ADC_CR_START_OFF   (0<<24)
#define ADC_CR_START_NOW   (1<<24)
#define ADC_CR_START_P016   (2<<24)
#define ADC_CR_START_P022   (3<<24)
#define ADC_CR_START_MAT01   (4<<24)
#define ADC_CR_START_MAT03   (5<<24)
#define ADC_CR_START_MAT10   (6<<24)
#define ADC_CR_START_MAT11   (7<<24)
#define ADC_CR_EDGE_RISING   (0<<27)
#define ADC_CR_EDGE_FALLING   (1<<27)
#define BATTERY_CH   adc_val[0]
#define V33_CH   adc_val[1]
#define V50_CH   adc_val[2]
#define V80_CH   adc_val[3]

Functions

void pwr_33 (char mode, struct power *pwr)
 pwr_33 Switch on/off 3,3V power line
void pwr_50 (char mode, struct power *pwr)
 pwr_50 Switch on/off 5,0V power line
void pwr_80 (char mode, struct power *pwr)
 pwr_80 Switch on/off 8,0V power line
void init_pwr (struct power *pwr)
 init_pwr inicializes power lines - default: all lines is off
void init_adc (unsigned rx_isr_vect)
 inicializes ADC lines and starts converion (use ISR)

Variables

volatile unsigned int adc_val [4]

Define Documentation

#define ADC0   (1<<27)
#define ADC1   (1<<28)
#define ADC2   (1<<29)
#define ADC3   (1<<30)
#define ADC_CON_CONST   322
#define ADC_CR_ADC0   0x1
#define ADC_CR_ADC1   0x2
#define ADC_CR_ADC2   0x4
#define ADC_CR_ADC3   0x8
#define ADC_CR_BURST   (1<<16)
#define ADC_CR_CLK_DIV_1   (1<<8)
#define ADC_CR_CLKS_10   (1<<17)
#define ADC_CR_CLKS_11   (0<<17)
#define ADC_CR_CLKS_4   (7<<17)
#define ADC_CR_CLKS_5   (6<<17)
#define ADC_CR_CLKS_6   (5<<17)
#define ADC_CR_CLKS_7   (4<<17)
#define ADC_CR_CLKS_8   (3<<17)
#define ADC_CR_CLKS_9   (2<<17)
#define ADC_CR_EDGE_FALLING   (1<<27)
#define ADC_CR_EDGE_RISING   (0<<27)
#define ADC_CR_PDN_ON   (1<<21)
#define ADC_CR_START_MAT01   (4<<24)
#define ADC_CR_START_MAT03   (5<<24)
#define ADC_CR_START_MAT10   (6<<24)
#define ADC_CR_START_MAT11   (7<<24)
#define ADC_CR_START_NOW   (1<<24)
#define ADC_CR_START_OFF   (0<<24)
#define ADC_CR_START_P016   (2<<24)
#define ADC_CR_START_P022   (3<<24)
#define ADC_DIV   10
#define ADC_OFFSET   2000
#define ADC_PIN_0   0x1
#define ADC_PIN_1   0x2
#define ADC_PIN_2   0x4
#define ADC_PIN_3   0x8
#define ADCCH0   22
#define ADCCH1   24
#define ADCCH2   26
#define ADCCH3   28
#define BATTERY_CH   adc_val[0]
#define PWR33   (1<<22)
#define PWR50   (1<<24)
#define PWR80   (1<<23)
#define PWR_OFF   0
#define PWR_ON   1
#define V33_CH   adc_val[1]
#define V50_CH   adc_val[2]
#define V80_CH   adc_val[3]

Function Documentation

void init_adc ( unsigned  rx_isr_vect  ) 

inicializes ADC lines and starts converion (use ISR)

Parameters:
rx_isr_vect ISR vector

inicializes ADC lines and starts converion (use ISR)

Automaticly starts the conversion of first channel on given conversion frequency.

Parameters:
rx_isr_vect ISR vector

inicializes ADC lines and starts converion (use ISR)

Automaticly starts the conversion of first channel on given conversion frequency.

Here is the call graph for this function:

Here is the caller graph for this function:

void init_pwr ( struct power pwr  ) 

init_pwr inicializes power lines - default: all lines is off

Here is the call graph for this function:

Here is the caller graph for this function:

void pwr_33 ( char  mode,
struct power pwr 
)

pwr_33 Switch on/off 3,3V power line

Parameters:
mode - PWR_ON/PWR_OFF

Here is the caller graph for this function:

void pwr_50 ( char  mode,
struct power pwr 
)

pwr_50 Switch on/off 5,0V power line

Parameters:
mode - PWR_ON/PWR_OFF

Here is the caller graph for this function:

void pwr_80 ( char  mode,
struct power pwr 
)

pwr_80 Switch on/off 8,0V power line

Parameters:
mode - PWR_ON/PWR_OFF

Here is the caller graph for this function:


Variable Documentation

volatile unsigned int adc_val[4]