aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libmaple/adc.h7
-rw-r--r--libmaple/dma.c4
-rw-r--r--libmaple/dma.h5
3 files changed, 8 insertions, 8 deletions
diff --git a/libmaple/adc.h b/libmaple/adc.h
index f41044f..776768e 100644
--- a/libmaple/adc.h
+++ b/libmaple/adc.h
@@ -65,15 +65,16 @@ extern "C"{
#define CR2_ADON_BIT *(volatile uint32*)(BITBAND_PERI(ADC1_BASE+0x8, 0))
#define CR2_CAL_BIT *(volatile uint32*)(BITBAND_PERI(ADC1_BASE+0x8, 2))
#define CR2_RSTCAL_BIT *(volatile uint32*)(BITBAND_PERI(ADC1_BASE+0x8, 3))
-#define CR2_SWSTART_BIT *(volatile uint32*)(BITBAND_PERI(ADC1_BASE+0x8 + 2, 6))
+#define CR2_SWSTART_BIT *(volatile uint32*)(BITBAND_PERI(ADC1_BASE+0x8, 22))
#define SR_EOC_BIT *(volatile uint32*)(BITBAND_PERI(ADC1_BASE+0, 1))
/* (NR_ANALOG_PINS is board specific) */
-/* Initialize ADC1 to do one-shot conversions */
+/** Initialize ADC1 to do one-shot conversions */
void adc_init(void);
void adc_disable(void);
-/* Perform a single conversion on ADC[0-16],
+/**
+ * Perform a single conversion on ADC[0-16],
* PRECONDITIONS:
* adc initialized */
static inline int adc_read(int channel) {
diff --git a/libmaple/dma.c b/libmaple/dma.c
index a6c6ccd..70507b9 100644
--- a/libmaple/dma.c
+++ b/libmaple/dma.c
@@ -107,7 +107,7 @@ void DMAChannel7_IRQHandler(void) {
void dma_init(uint8 channel, volatile void *paddr,
dma_transfer_size psize, dma_transfer_size msize,
- dma_mode_flags mode) {
+ int mode) {
volatile dma_regs *regs = dma_get_regs(channel);
if (regs != NULL) {
@@ -131,7 +131,7 @@ void dma_start(uint8 channel, volatile void *buffer, uint16 count) {
regs->CMAR = (uint32)buffer;
regs->CNDTR = count;
- regs->CCR |= DMA_EN; /* Start the transfer */
+ regs->CCR |= DMA_EN;
}
}
diff --git a/libmaple/dma.h b/libmaple/dma.h
index 7072a1a..aabbfb8 100644
--- a/libmaple/dma.h
+++ b/libmaple/dma.h
@@ -88,11 +88,10 @@ typedef enum dma_transfer_size {
* @see dma_start() */
void dma_init(uint8 channel, volatile void *paddr,
dma_transfer_size psize, dma_transfer_size msize,
- dma_mode_flags mode);
+ int mode);
/**
- * Begin a DMA transfer initialized with dma_init(). You may call
- * this function repeatedly after a single call to dma_init().
+ * Begin a DMA transfer initialized with dma_init().
*
* @param channel Channel transfer to start.
* @param buffer Buffer to write to (unless DMA_FROM_MEM was set in