]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/commitdiff
tms570_hydctr: Reconfigure ADC to 24 channels
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 2 Sep 2015 15:57:18 +0000 (17:57 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Thu, 3 Sep 2015 08:22:12 +0000 (10:22 +0200)
rpp/include/drv/_tms570_hydctr/port_def.h
rpp/src/sys/_tms570_hydctr/ti_drv_adc.c

index b264b88fd152c6e55963c6cacd08999dff2471c2..c08554c1441a5d62fdd2def4f94f6ddeffd58253 100644 (file)
@@ -31,7 +31,7 @@ enum port_id {
        _PORT_COUNT,
 };
 
-#define PORT_ADC_CHANNELS 16
+#define PORT_ADC_CHANNELS 24
 
 static double port_adc_lsb2volts(uint16_t lsb)
 {
index 0620182f479de8cef6193124d3630c6964df0938..07cf84ca447bba48ccc1e29cb6b1274af1538a63 100644 (file)
@@ -35,7 +35,7 @@ void adcInit(void)
     adcREG1->CLOCKCR = 100/(1*1000000000/RPP_VCLK1_FREQ);      /* 100 = cycle time in ns */
 
     /** - Setup memory boundaries */
-    adcREG1->BNDCR  =(8U << 16U)|(8U + 8U);
+    adcREG1->BNDCR  =(8U << 16U)|(8U + 12U);
     adcREG1->BNDEND = 2U;
 
     /** - Setup event group conversion mode
@@ -267,7 +267,7 @@ static const uint32_t s_adcSelect[2U][3U] =
 
 
     // ADC1, Group1
-    // AD1IN[0-15] used on the HDK
+    // AD1IN[0-23] used on the HydCtr board
     _BV( 0) |
     _BV( 1) |
     _BV( 2) |
@@ -284,6 +284,14 @@ static const uint32_t s_adcSelect[2U][3U] =
     _BV(13) |
     _BV(14) |
     _BV(15) |
+    _BV(16) |
+    _BV(17) |
+    _BV(18) |
+    _BV(19) |
+    _BV(20) |
+    _BV(21) |
+    _BV(22) |
+    _BV(23) |
          0x0,
 
     // ADC1, Group2
@@ -367,7 +375,7 @@ static const uint32_t s_adcSelect[2U][3U] =
                                       // ADC, Group
 static const uint32_t s_adcFiFoSize[2U][3U] =
 {
-    {0U, 16U, 0U},
+    {0U, 24U, 0U},
     {0U,  0U, 0U}
 };