BeRTOS
|
ADC hardware-specific implementation. More...
#include "adc_lm3s.h"
#include <cpu/irq.h>
#include "cfg/cfg_adc.h"
#include "cfg/cfg_proc.h"
#include "cfg/cfg_signal.h"
#include <cfg/macros.h>
#include <cfg/compiler.h>
#include <cfg/debug.h>
#include <cfg/log.h>
#include <drv/adc.h>
#include <drv/timer.h>
#include <drv/clock_lm3s.h>
#include <io/lm3s.h>
Go to the source code of this file.
Functions | |
void | adc_hw_select_ch (uint8_t ch) |
Select mux channel ch. | |
uint16_t | adc_hw_read (void) |
Start an ADC convertion. | |
void | adc_hw_init (void) |
Init ADC hardware. |
ADC hardware-specific implementation.
This ADC module should be use both whit kernel or none. If you are using a kernel, the adc drive does not wait the finish of conversion but use a singal every time a required conversion are ended. This signal wake up a process that return a result of conversion. Otherwise, if you not use a kernl, this module wait whit a loop the finishing of conversion.
Definition in file adc_lm3s.c.
uint16_t adc_hw_read | ( | void | ) |
Start an ADC convertion.
If a kernel is present, preempt until convertion is complete, otherwise a busy wait on ADC_DRDY bit is done.
Definition at line 147 of file adc_lm3s.c.
void adc_hw_select_ch | ( | uint8_t | ch | ) |
Select mux channel ch.
Generally the stm32 cpu family allow us to program the order of adc channel that we want to read. In this driver implementation we put as fist channel to read the select ones.
Definition at line 132 of file adc_lm3s.c.