Skip to content

Commit eb956c1

Browse files
author
Thomas Preston
committed
Working on pwm
1 parent 88d22ea commit eb956c1

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

codebug_tether/core.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@
4040
CHANNEL_INDEX_UART_TX_LENGTH,
4141
CHANNEL_INDEX_UART_CONTROL,
4242
CHANNEL_INDEX_COLOURTAIL_LENGTH,
43-
CHANNEL_INDEX_COLOURTAIL_CONTROL) = range(5, 25)
43+
CHANNEL_INDEX_COLOURTAIL_CONTROL,
44+
CHANNEL_INDEX_PWM_CONF_0,
45+
CHANNEL_INDEX_PWM_CONF_1,
46+
CHANNEL_INDEX_PWM_CONF_2) = range(5, 31)
4447

4548
EXTENSION_CONF_IO = 0x01
4649
EXTENSION_CONF_SPI = 0x02
@@ -161,6 +164,20 @@ def set_leg_io(self, leg_index, direction):
161164
self.and_mask(CHANNEL_INDEX_IO_DIRECTION_EXT, clear_mask)
162165
self.or_mask(CHANNEL_INDEX_IO_DIRECTION_EXT, direction_mask)
163166

167+
def pwm_on(self, t2_prescale, full_period, on_period):
168+
"""Turns on the PWM generator with the given settings."""
169+
# self.set
170+
pass
171+
172+
def pwm_freq(self, frequency):
173+
"""Turns on the PWM generator with the given frequency."""
174+
# calculate pwm settings
175+
# self.pwm_on(settings)
176+
pass
177+
178+
def pwm_off(self):
179+
pass
180+
164181
def clear(self):
165182
"""Clears the pixels on CodeBug.
166183

0 commit comments

Comments
 (0)