SimpleFOClibrary  2.1
samd_debug.h
Go to the documentation of this file.
1 
2 
3 
4 #include "../hardware_api.h"
5 #include "wiring_private.h"
6 
7 // Read count
8 //TCC0->CTRLBSET.reg = TCC_CTRLBSET_CMD_READSYNC;
9 //while (TCC0->SYNCBUSY.bit.CTRLB); // or while (TCC0->SYNCBUSY.reg);
10 //int count = TCC0->COUNT.reg;
11 
12 
19  Serial.println();
20  for (uint8_t pin=0;pin<PINS_COUNT;pin++) {
21  const PinDescription& pinDesc = g_APinDescription[pin];
22  wo_association& association = getWOAssociation(pinDesc.ulPort, pinDesc.ulPin);
23  Serial.print("Pin ");
24  if (pin<10) Serial.print("0");
25  Serial.print(pin);
26  switch (pinDesc.ulPort) {
27  case NOT_A_PORT: Serial.print(" "); break;
28  case PORTA: Serial.print(" PA"); break;
29  case PORTB: Serial.print(" PB"); break;
30  case PORTC: Serial.print(" PC"); break;
31  }
32  if (pinDesc.ulPin <10) Serial.print("0");
33  Serial.print(pinDesc.ulPin);
34 
35  Serial.print(" E=");
36  if (association.tccE>=0) {
37  int tcn = GetTCNumber(association.tccE);
38  if (tcn>=TCC_INST_NUM)
39  Serial.print(" TC");
40  else
41  Serial.print(" TCC");
42  Serial.print(tcn);
43  Serial.print("-");
44  Serial.print(GetTCChannelNumber(association.tccE));
45  Serial.print("[");
46  Serial.print(GetTCChannelNumber(association.woE));
47  Serial.print("]");
48  }
49  else
50  Serial.print(" None ");
51 
52  Serial.print(" F=");
53  if (association.tccF>=0) {
54  int tcn = GetTCNumber(association.tccF);
55  if (tcn>=TCC_INST_NUM)
56  Serial.print(" TC");
57  else
58  Serial.print(" TCC");
59  Serial.print(tcn);
60  Serial.print("-");
61  Serial.print(GetTCChannelNumber(association.tccF));
62  Serial.print("[");
63  Serial.print(GetTCChannelNumber(association.woF));
64  Serial.println("]");
65  }
66  else
67  Serial.println(" None ");
68 
69  }
70  Serial.println();
71 
72  // uint32_t attr = pinDesc.ulPinAttribute;
73  //#ifdef PIN_ATTR_PWM //SAMD21
74  // Serial.print(" PWM=");
75  // Serial.print(((attr & PIN_ATTR_PWM) == PIN_ATTR_PWM));
76  //#endif
77  //#ifdef PIN_ATTR_PWM_E //SAMD51
78  // Serial.print(" PWM_E=");
79  // Serial.print(((attr & PIN_ATTR_PWM_E) == PIN_ATTR_PWM_E));
80  // Serial.print(" PWM_F=");
81  // Serial.print(((attr & PIN_ATTR_PWM_F) == PIN_ATTR_PWM_F));
82  // Serial.print(" PWM_G=");
83  // Serial.print(((attr & PIN_ATTR_PWM_G) == PIN_ATTR_PWM_G));
84  //#endif
85  // Serial.print(" TIM=");
86  // Serial.print(((attr & PIN_ATTR_TIMER) == PIN_ATTR_TIMER));
87  // Serial.print(" ALT=");
88  // Serial.print(((attr & PIN_ATTR_TIMER_ALT) == PIN_ATTR_TIMER_ALT));
89 }
90 
91 void printTCCConfiguration(tccConfiguration& info) {
92  Serial.print(info.pin);
93  Serial.print((info.alternate==1)?" alternate TCC":" normal TCC");
94  if (info.tcc.tccn>=0) {
95  Serial.print(info.tcc.tccn);
96  Serial.print("-");
97  Serial.print(info.tcc.chan);
98  Serial.print("[");
99  Serial.print(info.wo);
100  Serial.println("]");
101  }
102  else
103  Serial.println(" None");
104 }
105 
106 
107 
wo_association::pin
uint32_t pin
Definition: samd21_wo_associations.h:5
printAllPinInfos
void printAllPinInfos()
Definition: samd_debug.h:18
wo_association::woE
uint8_t woE
Definition: samd21_wo_associations.h:7
wo_association
Definition: samd21_wo_associations.h:3
printTCCConfiguration
void printTCCConfiguration(tccConfiguration &info)
Definition: samd_debug.h:91
wo_association::tccE
ETCChannel tccE
Definition: samd21_wo_associations.h:6
wo_association::tccF
ETCChannel tccF
Definition: samd21_wo_associations.h:8
wo_association::woF
uint8_t woF
Definition: samd21_wo_associations.h:9