| Wheelchair Control MCU firmware

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Enumerations Groups Pages
MiscInits.h File Reference
Wheelchair control MCU software.
`#include "Defines.h"`

Go to the source code of this file.

## Functions
void | TIMER1_Init (void)
void | TIMER2_Init (void)
void | TIMER0_Init (void)
void | PORTS_Init (void)
void | AC_Disable (void)
void | ADC_Init (void)
void | EXT_INT_Init (void)
void | Init_ISRsSharedstruct (t_ISRsSharedStruct *sharedStruct)

## Detailed Description

Header file of ATMEGA16 peripherals and subsystems initialization library.

Definition in file MiscInits.h.

## Function Documentation

void AC_Disable | ( | void |  | ) |

Disables analog comparator.

Definition at line 91 of file MiscInits.c.

void ADC_Init | ( | void |  | ) |

Initializes A/D converter.

Definition at line 97 of file MiscInits.c.

void EXT_INT_Init | ( | void |  | ) |

Initializes registers of external interrupts

Definition at line 104 of file MiscInits.c.

void Init_ISRsSharedstruct | ( | t_ISRsSharedStruct * | sharedStruct | ) |

Initializes inter-ISRs shared structure.

Parameters

  sharedStruct | t_ISRsSharedStruct to be initialized.

See Also
  t_ISRsSharedStruct

Definition at line 114 of file MiscInits.c.

void PORTS_Init | ( | void |  | ) |

Initializes I/O port A - D (input/output, pull-ups etc.).

Note
  See this function in MiscInits.c file source code to obtain information about ports' configuration.

Definition at line 66 of file MiscInits.c.

void TIMER0_Init | ( | void |  | ) |

Initializes TIMER0 (period 1 ms, used clear UART Rx index every 4ms).

Note
  8-bit timer, interrupt flag is set on everflow.
  Overflow interrupt period: 16 MHz / 64(prescaler) / 256 (8-bit resolution) = 1 ms.

Definition at line 13 of file MiscInits.c.

void TIMER1_Init | ( | void |  | ) |

Initializes TIMER2 (period 2 ms) Measures the range every 50 ms, processes acquired data, PSD motors' regulators are run here.

Note
  16-bit timer, R/C generation on OCR1X and TCNT1 match (non-inverting mode), TCNT1 top = ICR1.
  R/C signal period 20 ms, positive pulse length:
  — 1.5 ms: Stop motor; OCR1X = 375.
  — 1 ms: Full speed backwards; OCR1X = 250.
  — 2 ms: Full speed forward; OCR1X = 500.
  No interrupts enabled for TIMER1.

Definition at line 28 of file MiscInits.c.

void TIMER2_Init | ( | void |  | ) |

Initializes TIMER2 (period 2 ms) Measures the range every 50 ms, processes acquired data, PSD motors' regulators are run here.

Note
  8-bit timer, interrupt flag is set on everflow.
  Overflow interrupt period: 16 MHz / 128(prescaler) / 256 (8-bit resolution) = 2 ms.

Definition at line 49 of file MiscInits.c.