Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
9637baec75 | ||
|
2d77c962a8 | ||
|
d4bb108e3b | ||
|
8d4384814a | ||
|
1719a14cf0 | ||
|
c8eee68fa0 | ||
|
251c0f5507 | ||
|
67d2e888c3 | ||
|
6001b64a8a | ||
|
8e14522b99 |
3
conf.py
3
conf.py
@ -350,3 +350,6 @@ texinfo_documents = [
|
|||||||
intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None),
|
intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None),
|
||||||
"bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),
|
"bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),
|
||||||
"register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)}
|
"register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)}
|
||||||
|
|
||||||
|
def setup(app):
|
||||||
|
app.add_stylesheet("customstyle.css")
|
||||||
|
13
docs/static/customstyle.css
vendored
13
docs/static/customstyle.css
vendored
@ -10,6 +10,19 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* custom CSS to sticky the ' viewing outdated version'
|
||||||
|
warning
|
||||||
|
*/
|
||||||
|
.document > .admonition {
|
||||||
|
position: sticky;
|
||||||
|
top: 0px;
|
||||||
|
background-color: salmon;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
overflow-x: unset!important;
|
||||||
|
}
|
||||||
|
|
||||||
/* override table width restrictions */
|
/* override table width restrictions */
|
||||||
@media screen and (min-width: 767px) {
|
@media screen and (min-width: 767px) {
|
||||||
|
@ -233,6 +233,9 @@ void common_hal_pulseio_pwmout_deinit(pulseio_pwmout_obj_t* self) {
|
|||||||
// Disconnect pin from channel.
|
// Disconnect pin from channel.
|
||||||
pwm->PSEL.OUT[self->channel] = 0xFFFFFFFF;
|
pwm->PSEL.OUT[self->channel] = 0xFFFFFFFF;
|
||||||
|
|
||||||
|
reset_pin_number(self->pin_number);
|
||||||
|
self->pin_number = NO_PIN;
|
||||||
|
|
||||||
for(int i=0; i < CHANNELS_PER_PWM; i++) {
|
for(int i=0; i < CHANNELS_PER_PWM; i++) {
|
||||||
if (self->pwm->PSEL.OUT[i] != 0xFFFFFFFF) {
|
if (self->pwm->PSEL.OUT[i] != 0xFFFFFFFF) {
|
||||||
// Some channel is still being used, so don't disable.
|
// Some channel is still being used, so don't disable.
|
||||||
|
@ -39,7 +39,10 @@ static digitalio_digitalinout_obj_t status_neopixel;
|
|||||||
|
|
||||||
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
|
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
|
||||||
uint8_t rgb_status_brightness = 255;
|
uint8_t rgb_status_brightness = 255;
|
||||||
static uint8_t status_apa102_color[12] = {0, 0, 0, 0, 0xff, 0, 0, 0};
|
|
||||||
|
#define APA102_BUFFER_LENGTH 12
|
||||||
|
static uint8_t status_apa102_color[APA102_BUFFER_LENGTH] = {0, 0, 0, 0, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0xff};
|
||||||
|
|
||||||
#ifdef CIRCUITPY_BITBANG_APA102
|
#ifdef CIRCUITPY_BITBANG_APA102
|
||||||
#include "shared-bindings/bitbangio/SPI.h"
|
#include "shared-bindings/bitbangio/SPI.h"
|
||||||
#include "shared-module/bitbangio/types.h"
|
#include "shared-module/bitbangio/types.h"
|
||||||
@ -104,10 +107,12 @@ void rgb_led_status_init() {
|
|||||||
apa102_sck_in_use = false;
|
apa102_sck_in_use = false;
|
||||||
#ifdef CIRCUITPY_BITBANG_APA102
|
#ifdef CIRCUITPY_BITBANG_APA102
|
||||||
shared_module_bitbangio_spi_try_lock(&status_apa102);
|
shared_module_bitbangio_spi_try_lock(&status_apa102);
|
||||||
shared_module_bitbangio_spi_configure(&status_apa102, 100000, 0, 1, 8);
|
// Use 1MHz for clock rate. Some APA102's are spec'd 800kHz-1200kHz,
|
||||||
|
// though many can run much faster. bitbang will probably run slower.
|
||||||
|
shared_module_bitbangio_spi_configure(&status_apa102, 1000000, 0, 0, 8);
|
||||||
#else
|
#else
|
||||||
common_hal_busio_spi_try_lock(&status_apa102);
|
common_hal_busio_spi_try_lock(&status_apa102);
|
||||||
common_hal_busio_spi_configure(&status_apa102, 100000, 0, 1, 8);
|
common_hal_busio_spi_configure(&status_apa102, 1000000, 0, 0, 8);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -120,7 +125,7 @@ void rgb_led_status_init() {
|
|||||||
common_hal_pulseio_pwmout_never_reset(&rgb_status_r);
|
common_hal_pulseio_pwmout_never_reset(&rgb_status_r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (common_hal_mcu_pin_is_free(CP_RGB_STATUS_G)) {
|
if (common_hal_mcu_pin_is_free(CP_RGB_STATUS_G)) {
|
||||||
pwmout_result_t green_result = common_hal_pulseio_pwmout_construct(&rgb_status_g, CP_RGB_STATUS_G, 0, 50000, false);
|
pwmout_result_t green_result = common_hal_pulseio_pwmout_construct(&rgb_status_g, CP_RGB_STATUS_G, 0, 50000, false);
|
||||||
|
|
||||||
@ -186,9 +191,9 @@ void new_status_color(uint32_t rgb) {
|
|||||||
status_apa102_color[7] = (rgb_adjusted >> 16) & 0xff;
|
status_apa102_color[7] = (rgb_adjusted >> 16) & 0xff;
|
||||||
|
|
||||||
#ifdef CIRCUITPY_BITBANG_APA102
|
#ifdef CIRCUITPY_BITBANG_APA102
|
||||||
shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, 8);
|
shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, APA102_BUFFER_LENGTH);
|
||||||
#else
|
#else
|
||||||
common_hal_busio_spi_write(&status_apa102, status_apa102_color, 8);
|
common_hal_busio_spi_write(&status_apa102, status_apa102_color, APA102_BUFFER_LENGTH);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -229,20 +234,20 @@ void temp_status_color(uint32_t rgb) {
|
|||||||
if (apa102_mosi_in_use || apa102_sck_in_use) {
|
if (apa102_mosi_in_use || apa102_sck_in_use) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uint8_t colors[12] = {0, 0, 0, 0, 0xff, rgb_adjusted & 0xff, (rgb_adjusted >> 8) & 0xff, (rgb_adjusted >> 16) & 0xff, 0x0, 0x0, 0x0, 0x0};
|
uint8_t colors[APA102_BUFFER_LENGTH] = {0, 0, 0, 0, 0xff, rgb_adjusted & 0xff, (rgb_adjusted >> 8) & 0xff, (rgb_adjusted >> 16) & 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||||
#ifdef CIRCUITPY_BITBANG_APA102
|
#ifdef CIRCUITPY_BITBANG_APA102
|
||||||
shared_module_bitbangio_spi_write(&status_apa102, colors, 12);
|
shared_module_bitbangio_spi_write(&status_apa102, colors, APA102_BUFFER_LENGTH);
|
||||||
#else
|
#else
|
||||||
common_hal_busio_spi_write(&status_apa102, colors, 12);
|
common_hal_busio_spi_write(&status_apa102, colors, APA102_BUFFER_LENGTH);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if defined(CP_RGB_STATUS_LED)
|
#if defined(CP_RGB_STATUS_LED)
|
||||||
uint8_t red_u8 = (rgb_adjusted >> 16) & 0xFF;
|
uint8_t red_u8 = (rgb_adjusted >> 16) & 0xFF;
|
||||||
uint8_t green_u8 = (rgb_adjusted >> 8) & 0xFF;
|
uint8_t green_u8 = (rgb_adjusted >> 8) & 0xFF;
|
||||||
uint8_t blue_u8 = rgb_adjusted & 0xFF;
|
uint8_t blue_u8 = rgb_adjusted & 0xFF;
|
||||||
|
|
||||||
uint16_t temp_status_color_rgb[3] = {0};
|
uint16_t temp_status_color_rgb[3] = {0};
|
||||||
|
|
||||||
#if defined(CP_RGB_STATUS_INVERTED_PWM)
|
#if defined(CP_RGB_STATUS_INVERTED_PWM)
|
||||||
temp_status_color_rgb[0] = (1 << 16) - 1 - ((uint16_t) (red_u8 << 8) + red_u8);
|
temp_status_color_rgb[0] = (1 << 16) - 1 - ((uint16_t) (red_u8 << 8) + red_u8);
|
||||||
temp_status_color_rgb[1] = (1 << 16) - 1 - ((uint16_t) (green_u8 << 8) + green_u8);
|
temp_status_color_rgb[1] = (1 << 16) - 1 - ((uint16_t) (green_u8 << 8) + green_u8);
|
||||||
@ -265,9 +270,9 @@ void clear_temp_status() {
|
|||||||
#endif
|
#endif
|
||||||
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
|
#if defined(MICROPY_HW_APA102_MOSI) && defined(MICROPY_HW_APA102_SCK)
|
||||||
#ifdef CIRCUITPY_BITBANG_APA102
|
#ifdef CIRCUITPY_BITBANG_APA102
|
||||||
shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, 8);
|
shared_module_bitbangio_spi_write(&status_apa102, status_apa102_color, APA102_BUFFER_LENGTH);
|
||||||
#else
|
#else
|
||||||
common_hal_busio_spi_write(&status_apa102, status_apa102_color, 8);
|
common_hal_busio_spi_write(&status_apa102, status_apa102_color, APA102_BUFFER_LENGTH);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#if defined(CP_RGB_STATUS_LED)
|
#if defined(CP_RGB_STATUS_LED)
|
||||||
|
@ -34,6 +34,7 @@ def copy_and_process(in_dir, out_dir):
|
|||||||
|
|
||||||
# Skip library examples directories.
|
# Skip library examples directories.
|
||||||
if Path(root).name in ['examples', 'docs', 'tests']:
|
if Path(root).name in ['examples', 'docs', 'tests']:
|
||||||
|
del subdirs[:]
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for file in files:
|
for file in files:
|
||||||
|
Loading…
Reference in New Issue
Block a user