more change
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 1 Oct 2012 08:54:29 +0000 (17:54 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 1 Oct 2012 08:54:29 +0000 (17:54 +0900)
ChangeLog
README
boards/STM8S_DISCOVERY/board.h
src/random.c

index 25f7d2c..4249a70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
 2012-10-01  Niibe Yutaka  <gniibe@fsij.org>
 
-       * src/random.c (adcgrpcfg): ADC1 and ADC2 two channels, each.
-       (adc2_start): Add SCAN for ADC2.
+       * src/random.c (adc2_start): Add SCAN for ADC2.
+       (adcgrpcfg, NEUG_ADC_SETTING1_SMPR1, NEUG_ADC_SETTING2_SMPR1):
+       ADC1 three channels and ADC2 two channels, one same channel.
 
        * boards/FST_01/board.h: Use default ADC settings.
        * boards/OLIMEX_STM32_H103/board.h (NEUG_ADC_SETTING2_SMPR1)
diff --git a/README b/README
index d6f5281..ecc0919 100644 (file)
--- a/README
+++ b/README
@@ -162,7 +162,11 @@ Then, you can use output of /dev/ttyACM0.
 
 When you want to get raw output (not conditioned), you can configure:
 
-  $ stty -F /dev/ttyACM0 parenb
+  $ stty -F /dev/ttyACM0 parenb parodd
+
+for raw data of LSBs.  For raw data of samples, configure:
+
+  $ stty -F /dev/ttyACM0 parenb -parodd
 
 And you can get conditioned output by configuring:
 
index 958a917..fa5f225 100644 (file)
@@ -35,6 +35,8 @@
 #define GPIO_LED       GPIOA_LED
 #define IOPORT_LED     GPIOA
 
+/* NeuG settings for ADC2 is default.  */
+
 /*
  * Board identifier.
  */
@@ -84,6 +86,8 @@
 
 /*
  * Port A setup.
+ * PA0  - Digital input with PullUp.  AN0
+ * PA1  - Digital input with PullUp.  AN1
  * PA11 - input with pull-up (USBDM)
  * PA12 - input with pull-up (USBDP)
  * Everything input with pull-up except:
index ee0a73d..34ba91a 100644 (file)
@@ -35,12 +35,15 @@ static Thread *rng_thread;
 /* Depth of the conversion buffer.  */
 #define ADC_GRP1_BUF_DEPTH      256
 
+#if !defined(NEUG_ADC_SETTING1_SMPR1)
 #define NEUG_ADC_SETTING1_SMPR1 ADC_SMPR1_SMP_SENSOR(ADC_SAMPLE_1P5) \
                               | ADC_SMPR1_SMP_VREF(ADC_SAMPLE_1P5)
-#define NEUG_ADC_SETTING1_SMPR2 0
-#define NEUG_ADC_SETTING1_SQR3  ADC_SQR3_SQ2_N(ADC_CHANNEL_SENSOR)   \
-                              | ADC_SQR3_SQ1_N(ADC_CHANNEL_VREFINT)
-#define NEUG_ADC_SETTING1_NUM_CHANNELS 2
+#define NEUG_ADC_SETTING1_SMPR2 ADC_SMPR2_SMP_AN0(ADC_SAMPLE_1P5)
+#define NEUG_ADC_SETTING1_SQR3  ADC_SQR3_SQ1_N(ADC_CHANNEL_SENSOR)   \
+                              | ADC_SQR3_SQ2_N(ADC_CHANNEL_VREFINT)  \
+                              | ADC_SQR3_SQ3_N(ADC_CHANNEL_IN0)
+#define NEUG_ADC_SETTING1_NUM_CHANNELS 3
+#endif
 
 #if !defined(NEUG_ADC_SETTING2_SMPR1)
 #define NEUG_ADC_SETTING2_SMPR1 0