TTK4155 Ping-pong project
adc_driver.c File Reference
#include "general_header.h"
#include "adc_driver.h"
Include dependency graph for adc_driver.c:

Functions

int adc_init (void)
 Function to initialize adc. More...
 
uint8_t adc_read (int ch)
 Read adc value. More...
 
 ISR (INT1_vect)
 

Variables

volatile uint8_t adc_conversion_running
 Flag to check if conversion is running. More...
 

Detailed Description

Implementation of adc driver.

Function Documentation

◆ adc_init()

int adc_init ( void  )

Function to initialize adc.

brief Function to initialize adc.

<

Todo:
Need to init ADC before SRAM in main. They should not be dependent

<

Todo:
Change to bolean with <stdbool.h>
Here is the caller graph for this function:

◆ adc_read()

uint8_t adc_read ( int  ch)

Read adc value.

Parameters
chADC channel.

< Start address for the ADC

< Wait for ADC conversion to complete

Here is the caller graph for this function:

◆ ISR()

ISR ( INT1_vect  )

Variable Documentation

◆ adc_conversion_running

volatile uint8_t adc_conversion_running

Flag to check if conversion is running.