Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
196337f7df |
4 changed files with 18 additions and 1 deletions
1
Makefile
1
Makefile
|
|
@ -32,6 +32,7 @@ INCLUDES += -I./asf/sam0/drivers/system/interrupt -I./asf/sam0/drivers/system/in
|
|||
INCLUDES += -I./boards/$(BOARD)
|
||||
|
||||
COMMON_SRC = \
|
||||
src/neopixel.c \
|
||||
src/flash.c \
|
||||
src/init.c \
|
||||
src/startup_samd21.c \
|
||||
|
|
|
|||
|
|
@ -7,14 +7,18 @@
|
|||
#define VENDOR_NAME "Adafruit Industries"
|
||||
#define PRODUCT_NAME "Circuit Playground Express"
|
||||
#define VOLUME_LABEL "CPLAYBOOT"
|
||||
#define INDEX_URL "https://adafru.it/cplayxpress"
|
||||
|
||||
#define BOARD_ID "SAMD21G18A-CPlay-v0"
|
||||
|
||||
#define USB_VID 0x239A
|
||||
#define USB_PID 0x8019
|
||||
#define USB_PID 0x0019
|
||||
|
||||
#define LED_PIN PIN_PA17
|
||||
//#define LED_TX_PIN PIN_PA27
|
||||
//#define LED_RX_PIN PIN_PB03
|
||||
|
||||
#define BOARD_RGBLED_NEOPIX_PORT (1) // PB
|
||||
#define BOARD_RGBLED_NEOPIX_PIN (23) // 23
|
||||
#define NUM_NEOPIXELS 1
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -208,6 +208,7 @@ void led_tick(void);
|
|||
void led_signal(void);
|
||||
void led_init(void);
|
||||
void RGBLED_set_color(uint8_t red, uint8_t green, uint8_t blue);
|
||||
void NeoPixel_show(uint8_t);
|
||||
|
||||
#define LED_MSC_OFF() PINOP(LED_PIN, OUTCLR)
|
||||
#define LED_MSC_ON() PINOP(LED_PIN, OUTSET)
|
||||
|
|
|
|||
11
src/utils.c
11
src/utils.c
|
|
@ -139,6 +139,9 @@ void led_init() {
|
|||
// using APA102, set pins to outputs
|
||||
PORT->Group[BOARD_RGBLED_CLOCK_PORT].DIRSET.reg = (1<<BOARD_RGBLED_CLOCK_PIN);
|
||||
PORT->Group[BOARD_RGBLED_DATA_PORT].DIRSET.reg = (1<<BOARD_RGBLED_DATA_PIN);
|
||||
#endif
|
||||
#if defined(BOARD_RGBLED_NEOPIX_PORT)
|
||||
PORT->Group[BOARD_RGBLED_NEOPIX_PORT].DIRSET.reg = (1<<BOARD_RGBLED_NEOPIX_PIN);
|
||||
#endif
|
||||
// and clock 0x00000 out!
|
||||
RGBLED_set_color(0,0,0);
|
||||
|
|
@ -186,4 +189,12 @@ void RGBLED_set_color(uint8_t red, uint8_t green, uint8_t blue) {
|
|||
// set clock port low for 100ms
|
||||
delay(100);
|
||||
#endif
|
||||
|
||||
#if defined(BOARD_RGBLED_NEOPIX_PORT)
|
||||
NeoPixel_show(88);
|
||||
|
||||
// set clock port low for 100ms
|
||||
delay(100);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue