diff --git a/eeprom/Makefile b/eeprom/Makefile deleted file mode 100644 index 1c9f33b..0000000 --- a/eeprom/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -TARGET:=eeprom -#ADDITIONAL_C_FILES:=../ch32v003fun/lib_i2c.c -include ../ch32v003fun/ch32v003fun.mk -clean: - rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \ - $(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss - -.PHONY: clean diff --git a/eeprom/eeprom.c b/eeprom/eeprom.c deleted file mode 100644 index 89b1de2..0000000 --- a/eeprom/eeprom.c +++ /dev/null @@ -1,59 +0,0 @@ -#define CH32V003_I2C_IMPLEMENTATION -#include -#include "ch32v003_i2c.h" -// obtained from i2c_scan(), before shifting by 1 bit -#define EEPROM_ADDR 0x51 - -int main(void) { - SystemInit(); - i2c_init(); - uint8_t found = 0; - i2c_result_e result = i2c_ping(EEPROM_ADDR, &found); - - printf("\nping result: %d\n", result); - printf("found: %d\n", found); - i2c_scan(); - Delay_Ms(1000); - while (1) { - - #define addr_begin 0 - #define addr_end 0x39F - #define reg_size (addr_end - addr_begin + 1) - #define matrix_hori 16 - // write - { - uint8_t data[reg_size] = {0}; - for (uint16_t i = 0; i < reg_size; i++) { - data[i] = i % 0xFF; - } - result = - i2c_write_pages(EEPROM_ADDR, addr_begin, I2C_REGADDR_2B, data, reg_size); - printf("write result: %d\n", result); - printf("Written data as matrix:\n"); - for (uint16_t i = 0; i < reg_size; i++) { - printf("%02X ", data[i]); - if ((i + 1) % matrix_hori == 0) { - printf("\n"); - } - } - printf("\n"); - Delay_Ms(1000); - } - // read - { - uint8_t read_data[reg_size] = {0}; - result = - i2c_read_pages(EEPROM_ADDR, addr_begin, I2C_REGADDR_2B, read_data, reg_size); - printf("read result: %d\n", result); - printf("Read data as matrix:\n"); - for (uint16_t i = 0; i < reg_size; i++) { - printf("%02X ", read_data[i]); - if ((i + 1) % matrix_hori == 0) { - printf("\n"); - } - } - printf("\n"); - Delay_Ms(1000); - } - } -} diff --git a/eeprom/funconfig.h b/eeprom/funconfig.h deleted file mode 100644 index 38e859d..0000000 --- a/eeprom/funconfig.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _FUNCONFIG_H -#define _FUNCONFIG_H - -#define CH32V003 1 -#define FUNCONF_USE_DEBUGPRINTF 0 -#define FUNCONF_USE_UARTPRINTF 1 -#define FUNCONF_UART_PRINTF_BAUD 115200 -//#define FUNCONF_SYSTICK_USE_HCLK 1 -//#define GPIO_ADC_MUX_DELAY 1200 -#define horizontalButtons 8 -#define verticalButtons 8 -#define NUM_LEDS (horizontalButtons * verticalButtons) - -//#define CH32V003J4M6_USE_PD6_AS_UART_TX -//#define INTERNAL_INSPIRE_MATRIX - -#endif diff --git a/menu/Makefile b/menu/Makefile deleted file mode 100644 index 1e629e6..0000000 --- a/menu/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -TARGET:=menu -include ../ch32v003fun/ch32v003fun.mk -clean: - rm -f $(TARGET).elf $(TARGET).hex $(TARGET).bin $(TARGET).map $(TARGET).lst \ - $(TARGET).o $(TARGET).d $(TARGET).srec $(TARGET).sym $(TARGET).lss - $(MAKE) -f Makefile-emulator clean - -emulator: - $(MAKE) -f Makefile-emulator clean - $(MAKE) -f Makefile-emulator diff --git a/menu/funconfig.h b/menu/funconfig.h deleted file mode 100644 index 8385aeb..0000000 --- a/menu/funconfig.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _FUNCONFIG_H -#define _FUNCONFIG_H - -#define CH32V003 1 -#define FUNCONF_USE_DEBUGPRINTF 0 -#define FUNCONF_USE_UARTPRINTF 1 -#define FUNCONF_UART_PRINTF_BAUD 115200 -#define horizontalButtons 8 -#define verticalButtons 8 -#define NUM_LEDS (horizontalButtons * verticalButtons) - -#define FUNCONF_SYSTICK_USE_HCLK 1 - -#endif diff --git a/menu/menu.c b/menu/menu.c deleted file mode 100644 index c5d0937..0000000 --- a/menu/menu.c +++ /dev/null @@ -1,20 +0,0 @@ -#define WS2812BSIMPLE_IMPLEMENTATION -#include "colors.h" -#include "driver.h" -#include "ws2812b_simple.h" -#include - -#define LED_PINS GPIOA, 2 - -void display_paint_icon(void) { - clear(); - const color_t paint_color = {.r = 0, .g = 255, .b = 0}; - set_color(49, paint_color); - set_color(54, paint_color); - WS2812BSimpleSend(LED_PINS, (uint8_t *)led_array, NUM_LEDS * 3); -} - -int main(void) { - SystemInit(); - display_paint_icon(); -}