117117_ADC_INPUT_2_PIN = const (0x04 )
118118_ADC_INPUT_3_PIN = const (0x05 )
119119
120- _ADC_INPUT_0_PIN_CRCKIT = const (2 )
121- _ADC_INPUT_1_PIN_CRCKIT = const (3 )
122- _ADC_INPUT_2_PIN_CRCKIT = const (40 )
123- _ADC_INPUT_3_PIN_CRCKIT = const (41 )
124- _ADC_INPUT_4_PIN_CRCKIT = const (11 )
125- _ADC_INPUT_5_PIN_CRCKIT = const (10 )
126- _ADC_INPUT_6_PIN_CRCKIT = const (9 )
127- _ADC_INPUT_7_PIN_CRCKIT = const (8 )
120+ _ADC_INPUT_0_PIN_CRICKIT = const (2 )
121+ _ADC_INPUT_1_PIN_CRICKIT = const (3 )
122+ _ADC_INPUT_2_PIN_CRICKIT = const (40 )
123+ _ADC_INPUT_3_PIN_CRICKIT = const (41 )
124+ _ADC_INPUT_4_PIN_CRICKIT = const (11 )
125+ _ADC_INPUT_5_PIN_CRICKIT = const (10 )
126+ _ADC_INPUT_6_PIN_CRICKIT = const (9 )
127+ _ADC_INPUT_7_PIN_CRICKIT = const (8 )
128128
129129_PWM_0_PIN = const (0x04 )
130130_PWM_1_PIN = const (0x05 )
131131_PWM_2_PIN = const (0x06 )
132132_PWM_3_PIN = const (0x07 )
133133
134- _CRCKIT_S4 = const (14 )
135- _CRCKIT_S3 = const (15 )
136- _CRCKIT_S2 = const (16 )
137- _CRCKIT_S1 = const (17 )
138-
139- _CRCKIT_M1_A1 = const (18 )
140- _CRCKIT_M1_A2 = const (19 )
141- _CRCKIT_M1_B1 = const (22 )
142- _CRCKIT_M1_B2 = const (23 )
143- _CRCKIT_DRIVE1 = const (42 )
144- _CRCKIT_DRIVE2 = const (43 )
145- _CRCKIT_DRIVE3 = const (12 )
146- _CRCKIT_DRIVE4 = const (13 )
147-
148- _CRCKIT_CT1 = const (0 )
149- _CRCKIT_CT2 = const (1 )
150- _CRCKIT_CT3 = const (2 )
151- _CRCKIT_CT4 = const (3 )
134+ _CRICKIT_S4 = const (14 )
135+ _CRICKIT_S3 = const (15 )
136+ _CRICKIT_S2 = const (16 )
137+ _CRICKIT_S1 = const (17 )
138+
139+ _CRICKIT_M1_A1 = const (18 )
140+ _CRICKIT_M1_A2 = const (19 )
141+ _CRICKIT_M1_B1 = const (22 )
142+ _CRICKIT_M1_B2 = const (23 )
143+ _CRICKIT_DRIVE1 = const (42 )
144+ _CRICKIT_DRIVE2 = const (43 )
145+ _CRICKIT_DRIVE3 = const (12 )
146+ _CRICKIT_DRIVE4 = const (13 )
147+
148+ _CRICKIT_CT1 = const (0 )
149+ _CRICKIT_CT2 = const (1 )
150+ _CRICKIT_CT3 = const (2 )
151+ _CRICKIT_CT4 = const (3 )
152152
153153_HW_ID_CODE = const (0x55 )
154154_EEPROM_I2C_ADDR = const (0x3F )
155155
156156SEESAW_SAMD09 = const (0x00 )
157- SEESAW_CRCKIT = const (0x01 )
157+ SEESAW_CRICKIT = const (0x01 )
158158
159159#TODO: update when we get real PID
160- _CRCKIT_PID = const (9999 )
160+ _CRICKIT_PID = const (9999 )
161161
162162class DigitalIO :
163163 def __init__ (self , seesaw , pin ):
@@ -368,8 +368,8 @@ def sw_reset(self):
368368 .format (chip_id , _HW_ID_CODE ))
369369
370370 pid = self .get_version () >> 16
371- if pid == _CRCKIT_PID :
372- self .variant = SEESAW_CRCKIT
371+ if pid == _CRICKIT_PID :
372+ self .variant = SEESAW_CRICKIT
373373 else :
374374 self .variant = SEESAW_SAMD09
375375
@@ -436,11 +436,11 @@ def get_analog_in(self, pin):
436436
437437 def analog_read (self , pin ):
438438 buf = bytearray (2 )
439- if self .variant == SEESAW_CRCKIT :
440- pin_mapping = [_ADC_INPUT_0_PIN_CRCKIT , _ADC_INPUT_1_PIN_CRCKIT ,
441- _ADC_INPUT_2_PIN_CRCKIT , _ADC_INPUT_3_PIN_CRCKIT ,
442- _ADC_INPUT_4_PIN_CRCKIT , _ADC_INPUT_5_PIN_CRCKIT ,
443- _ADC_INPUT_6_PIN_CRCKIT , _ADC_INPUT_7_PIN_CRCKIT ]
439+ if self .variant == SEESAW_CRICKIT :
440+ pin_mapping = [_ADC_INPUT_0_PIN_CRICKIT , _ADC_INPUT_1_PIN_CRICKIT ,
441+ _ADC_INPUT_2_PIN_CRICKIT , _ADC_INPUT_3_PIN_CRICKIT ,
442+ _ADC_INPUT_4_PIN_CRICKIT , _ADC_INPUT_5_PIN_CRICKIT ,
443+ _ADC_INPUT_6_PIN_CRICKIT , _ADC_INPUT_7_PIN_CRICKIT ]
444444 else :
445445 pin_mapping = [_ADC_INPUT_0_PIN , _ADC_INPUT_1_PIN ,
446446 _ADC_INPUT_2_PIN , _ADC_INPUT_3_PIN ]
@@ -456,7 +456,7 @@ def analog_read(self, pin):
456456 def touch_read (self , pin ):
457457 buf = bytearray (2 )
458458
459- pin_mapping = [_CRCKIT_CT1 , _CRCKIT_CT2 , _CRCKIT_CT3 , _CRCKIT_CT4 ]
459+ pin_mapping = [_CRICKIT_CT1 , _CRICKIT_CT2 , _CRICKIT_CT3 , _CRICKIT_CT4 ]
460460
461461 if pin not in pin_mapping :
462462 raise ValueError ("Invalid touch pin" )
@@ -510,11 +510,11 @@ def get_pwm(self, pin):
510510 return PWMChannel (self , pin )
511511
512512 def analog_write (self , pin , value ):
513- if self .variant == SEESAW_CRCKIT :
514- pin_mapping = [_CRCKIT_S4 , _CRCKIT_S3 , _CRCKIT_S2 , _CRCKIT_S1 ,
515- _CRCKIT_M1_A1 , _CRCKIT_M1_A2 , _CRCKIT_M1_B1 ,
516- _CRCKIT_M1_B2 , _CRCKIT_DRIVE1 , _CRCKIT_DRIVE2 ,
517- _CRCKIT_DRIVE3 , _CRCKIT_DRIVE4 ]
513+ if self .variant == SEESAW_CRICKIT :
514+ pin_mapping = [_CRICKIT_S4 , _CRICKIT_S3 , _CRICKIT_S2 , _CRICKIT_S1 ,
515+ _CRICKIT_M1_A1 , _CRICKIT_M1_A2 , _CRICKIT_M1_B1 ,
516+ _CRICKIT_M1_B2 , _CRICKIT_DRIVE1 , _CRICKIT_DRIVE2 ,
517+ _CRICKIT_DRIVE3 , _CRICKIT_DRIVE4 ]
518518 if pin in pin_mapping :
519519 cmd = bytearray ([pin_mapping .index (pin ), (value >> 8 ), value ])
520520 self .write (_TIMER_BASE , _TIMER_PWM , cmd )
@@ -525,11 +525,11 @@ def analog_write(self, pin, value):
525525 self .write (_TIMER_BASE , _TIMER_PWM , cmd )
526526
527527 def set_pwm_freq (self , pin , freq ):
528- if self .variant == SEESAW_CRCKIT :
529- pin_mapping = [_CRCKIT_S4 , _CRCKIT_S3 , _CRCKIT_S2 , _CRCKIT_S1 ,
530- _CRCKIT_M1_A1 , _CRCKIT_M1_A2 , _CRCKIT_M1_B1 ,
531- _CRCKIT_M1_B2 , _CRCKIT_DRIVE1 , _CRCKIT_DRIVE2 ,
532- _CRCKIT_DRIVE3 , _CRCKIT_DRIVE4 ]
528+ if self .variant == SEESAW_CRICKIT :
529+ pin_mapping = [_CRICKIT_S4 , _CRICKIT_S3 , _CRICKIT_S2 , _CRICKIT_S1 ,
530+ _CRICKIT_M1_A1 , _CRICKIT_M1_A2 , _CRICKIT_M1_B1 ,
531+ _CRICKIT_M1_B2 , _CRICKIT_DRIVE1 , _CRICKIT_DRIVE2 ,
532+ _CRICKIT_DRIVE3 , _CRICKIT_DRIVE4 ]
533533 else :
534534 pin_mapping = [_PWM_0_PIN , _PWM_1_PIN , _PWM_2_PIN , _PWM_3_PIN ]
535535
0 commit comments