├── Arduino └── KCORES_Link_V1 │ ├── .gitignore │ ├── Readme.md │ ├── ch32_upload_settings.png │ ├── include │ ├── ArialNarrow7pt7b.h │ ├── KCORES_CSPS.h │ └── README │ ├── lib │ └── README │ ├── platformio.ini │ ├── src │ ├── KCORES_CSPS.cpp │ └── main.cpp │ └── test │ └── README ├── Readme.md ├── Rhino ├── csps-atx-mount.3dm └── csps-atx-mount.scad ├── STL ├── clip.stl ├── clip2.stl ├── csps-atx-mount.stl ├── reinforcement1.stl └── reinforcement2.stl ├── photo1.jpg ├── photo2.jpg └── photo3.jpg /Arduino/KCORES_Link_V1/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/Readme.md: -------------------------------------------------------------------------------- 1 | # 适用于STM32F103C8T6的arduino程序,提供oled显示和串口输出 2 | 3 | 引脚连接: 4 | 5 | * PB8 -> CSPS SCL 6 | * PB9 -> CSPS SDA 7 | * G -> CSPS GND 8 | * PB10 -> 12832 SCL 9 | * PB11 -> 12832 SDA 10 | * V3 -> 12832 VCC 11 | * G -> 12832 GND 12 | 13 | 使用VSCode + PlatformIO编译, 编译命令:`platformio run -e bluepill_f103c8` 14 | 15 | 如果你给STM32F103C8T6安装了hid bootloader, 你可以直接运行`platformio run -e bluepill_f103c8 -t upload`编译并上传 16 | 17 | 2021/5/24:使用PlatformIO后可以成功兼容CH32F103C8T6。编译完成后需要手动使用WCHISPTool上传,参数如下: 18 | 19 | ![ch32_upload_settings](ch32_upload_settings.png) 20 | 21 | 通过usb连接电脑时需要接正面的microusb/typec口(有跳线帽的一侧) -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/ch32_upload_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/Arduino/KCORES_Link_V1/ch32_upload_settings.png -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/include/ArialNarrow7pt7b.h: -------------------------------------------------------------------------------- 1 | const uint8_t ArialNarrow7pt7bBitmaps[] PROGMEM = { 2 | 0x00, 0xFF, 0x40, 0xB6, 0xD0, 0x12, 0x24, 0x97, 0xF2, 0x44, 0xBF, 0xA4, 3 | 0x48, 0x90, 0x23, 0xAB, 0x4A, 0x38, 0xA5, 0xAD, 0x5C, 0x40, 0x61, 0x24, 4 | 0x89, 0x22, 0x50, 0x64, 0x02, 0x60, 0xA4, 0x49, 0x12, 0x48, 0x60, 0x30, 5 | 0x91, 0x22, 0x86, 0x1A, 0xA5, 0x44, 0x8C, 0xEC, 0xF0, 0x29, 0x49, 0x24, 6 | 0x91, 0x22, 0x89, 0x12, 0x49, 0x25, 0x28, 0x5D, 0x50, 0x10, 0x23, 0xF8, 7 | 0x81, 0x00, 0x58, 0xE0, 0x80, 0x22, 0x22, 0x44, 0x44, 0x88, 0x22, 0xA3, 8 | 0x18, 0xC6, 0x31, 0x51, 0x00, 0x25, 0xD2, 0x49, 0x24, 0x64, 0xA2, 0x10, 9 | 0x88, 0x88, 0x87, 0xC0, 0x64, 0x82, 0x22, 0x08, 0x31, 0x93, 0x00, 0x08, 10 | 0x61, 0x8A, 0x29, 0x28, 0xBF, 0x08, 0x20, 0x7A, 0x21, 0xC9, 0x04, 0x31, 11 | 0x93, 0x00, 0x32, 0x61, 0x0A, 0x6A, 0x31, 0x51, 0x00, 0xF8, 0x44, 0x22, 12 | 0x10, 0x88, 0x42, 0x00, 0x22, 0xA2, 0xA2, 0x2A, 0x31, 0x51, 0x00, 0x22, 13 | 0xA3, 0x15, 0x94, 0x21, 0x93, 0x00, 0x82, 0x40, 0x05, 0x80, 0x04, 0x66, 14 | 0x20, 0x60, 0x60, 0x40, 0xFC, 0x00, 0x3F, 0x81, 0x81, 0x81, 0x19, 0x88, 15 | 0x00, 0x74, 0x62, 0x10, 0x88, 0x84, 0x01, 0x00, 0x1E, 0x08, 0x44, 0x0A, 16 | 0x75, 0xA3, 0x68, 0x9A, 0x26, 0x89, 0xA6, 0x66, 0xE4, 0x04, 0x82, 0x1F, 17 | 0x00, 0x10, 0x50, 0xA1, 0x42, 0x88, 0x9F, 0x22, 0x83, 0x04, 0xFA, 0x18, 18 | 0x61, 0xFA, 0x18, 0x61, 0x87, 0xE0, 0x39, 0x18, 0x60, 0x82, 0x08, 0x61, 19 | 0x48, 0xC0, 0xF2, 0x28, 0x61, 0x86, 0x18, 0x61, 0x8B, 0xC0, 0xFE, 0x08, 20 | 0x20, 0xFE, 0x08, 0x20, 0x83, 0xF0, 0xFE, 0x08, 0x20, 0xFA, 0x08, 0x20, 21 | 0x82, 0x00, 0x3C, 0x86, 0x0C, 0x08, 0x11, 0xE0, 0xC1, 0x42, 0x78, 0x86, 22 | 0x18, 0x61, 0xFE, 0x18, 0x61, 0x86, 0x10, 0xFF, 0xC0, 0x11, 0x11, 0x11, 23 | 0x19, 0x96, 0x86, 0x29, 0x28, 0xA3, 0x49, 0x22, 0x8A, 0x10, 0x84, 0x21, 24 | 0x08, 0x42, 0x10, 0x87, 0xC0, 0xC1, 0xE0, 0xE8, 0xB4, 0x5A, 0x2D, 0xA6, 25 | 0x53, 0x29, 0x94, 0xC4, 0x40, 0x87, 0x1C, 0x69, 0xA6, 0x59, 0x63, 0x8E, 26 | 0x10, 0x38, 0x8A, 0x0C, 0x18, 0x30, 0x60, 0xC1, 0x44, 0x70, 0xFA, 0x18, 27 | 0x61, 0x87, 0xE8, 0x20, 0x82, 0x00, 0x38, 0x8A, 0x0C, 0x18, 0x30, 0x60, 28 | 0xC5, 0x4C, 0x74, 0x08, 0xF9, 0x0A, 0x14, 0x28, 0x5F, 0x22, 0x42, 0x85, 29 | 0x04, 0x7A, 0x18, 0x60, 0x60, 0x68, 0x61, 0x85, 0xE0, 0xFE, 0x20, 0x40, 30 | 0x81, 0x02, 0x04, 0x08, 0x10, 0x20, 0x86, 0x18, 0x61, 0x86, 0x18, 0x61, 31 | 0x48, 0xC0, 0x83, 0x05, 0x12, 0x24, 0x45, 0x0A, 0x14, 0x28, 0x20, 0x84, 32 | 0x31, 0x46, 0x28, 0xA5, 0x24, 0xA4, 0xA2, 0x94, 0x52, 0x8A, 0x51, 0x44, 33 | 0x10, 0x81, 0x42, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x42, 0x81, 0x82, 34 | 0x89, 0x11, 0x42, 0x82, 0x04, 0x08, 0x10, 0x20, 0xFC, 0x10, 0x84, 0x10, 35 | 0x82, 0x10, 0x83, 0xF0, 0xEA, 0xAA, 0xAA, 0xC0, 0x92, 0x24, 0x92, 0x24, 36 | 0xD5, 0x55, 0x55, 0xC0, 0x22, 0x94, 0xA8, 0x80, 0xFC, 0x90, 0x74, 0x42, 37 | 0xF8, 0xC5, 0xE0, 0x84, 0x21, 0x6C, 0xC6, 0x31, 0xCD, 0x80, 0x74, 0x61, 38 | 0x08, 0xC5, 0xC0, 0x08, 0x42, 0xD9, 0xC6, 0x31, 0x9B, 0x40, 0x74, 0x63, 39 | 0xF8, 0x45, 0xC0, 0x69, 0x74, 0x92, 0x48, 0x6C, 0xE3, 0x18, 0xCD, 0xA1, 40 | 0x8B, 0x80, 0x84, 0x21, 0x6C, 0xC6, 0x31, 0x8C, 0x40, 0x9F, 0xC0, 0x41, 41 | 0x55, 0x55, 0xC0, 0x84, 0x21, 0x2A, 0x62, 0x94, 0x94, 0x80, 0xFF, 0xC0, 42 | 0xB7, 0x64, 0x62, 0x31, 0x18, 0x8C, 0x46, 0x22, 0xB6, 0x63, 0x18, 0xC6, 43 | 0x20, 0x74, 0x63, 0x18, 0xC5, 0xC0, 0xB6, 0x63, 0x18, 0xE6, 0xD0, 0x84, 44 | 0x00, 0x6C, 0xE3, 0x18, 0xCD, 0xA1, 0x08, 0x40, 0xBA, 0x49, 0x20, 0x74, 45 | 0x60, 0xE0, 0xC5, 0xC0, 0x49, 0x74, 0x92, 0x4C, 0x8C, 0x63, 0x18, 0xCD, 46 | 0xA0, 0x8C, 0x54, 0xA5, 0x28, 0x80, 0x93, 0x26, 0xAD, 0x5A, 0xB5, 0x51, 47 | 0x00, 0x8A, 0x94, 0x45, 0x2A, 0x20, 0x8C, 0x54, 0xA5, 0x10, 0x84, 0x26, 48 | 0x00, 0xF8, 0x44, 0x44, 0x43, 0xE0, 0x29, 0x24, 0xA2, 0x49, 0x22, 0xFF, 49 | 0xF8, 0x89, 0x24, 0x8A, 0x49, 0x28, 0x03, 0x99, 0x80 }; 50 | 51 | const GFXglyph ArialNarrow7pt7bGlyphs[] PROGMEM = { 52 | { 0, 1, 1, 3, 0, 0 }, // 0x20 ' ' 53 | { 1, 1, 10, 3, 1, -9 }, // 0x21 '!' 54 | { 3, 3, 4, 4, 0, -9 }, // 0x22 '"' 55 | { 5, 7, 10, 7, 0, -9 }, // 0x23 '#' 56 | { 14, 5, 12, 6, 0, -10 }, // 0x24 '$' 57 | { 22, 10, 10, 11, 0, -9 }, // 0x25 '%' 58 | { 35, 7, 10, 8, 1, -9 }, // 0x26 '&' 59 | { 44, 1, 4, 2, 0, -9 }, // 0x27 ''' 60 | { 45, 3, 13, 4, 1, -9 }, // 0x28 '(' 61 | { 50, 3, 13, 4, 0, -9 }, // 0x29 ')' 62 | { 55, 3, 4, 4, 0, -9 }, // 0x2A '*' 63 | { 57, 7, 5, 7, 1, -6 }, // 0x2B '+' 64 | { 62, 2, 3, 3, 0, 0 }, // 0x2C ',' 65 | { 63, 3, 1, 4, 0, -3 }, // 0x2D '-' 66 | { 64, 1, 1, 3, 1, 0 }, // 0x2E '.' 67 | { 65, 4, 10, 3, 0, -9 }, // 0x2F '/' 68 | { 70, 5, 10, 6, 0, -9 }, // 0x30 '0' 69 | { 77, 3, 10, 6, 1, -9 }, // 0x31 '1' 70 | { 81, 5, 10, 6, 0, -9 }, // 0x32 '2' 71 | { 88, 5, 10, 6, 0, -9 }, // 0x33 '3' 72 | { 95, 6, 10, 6, 0, -9 }, // 0x34 '4' 73 | { 103, 5, 10, 6, 0, -9 }, // 0x35 '5' 74 | { 110, 5, 10, 6, 0, -9 }, // 0x36 '6' 75 | { 117, 5, 10, 6, 0, -9 }, // 0x37 '7' 76 | { 124, 5, 10, 6, 0, -9 }, // 0x38 '8' 77 | { 131, 5, 10, 6, 0, -9 }, // 0x39 '9' 78 | { 138, 1, 7, 3, 1, -6 }, // 0x3A ':' 79 | { 139, 2, 9, 3, 0, -6 }, // 0x3B ';' 80 | { 142, 6, 7, 7, 0, -8 }, // 0x3C '<' 81 | { 148, 6, 4, 7, 0, -6 }, // 0x3D '=' 82 | { 151, 6, 7, 7, 0, -8 }, // 0x3E '>' 83 | { 157, 5, 10, 6, 0, -9 }, // 0x3F '?' 84 | { 164, 10, 13, 12, 1, -9 }, // 0x40 '@' 85 | { 181, 7, 10, 8, 0, -9 }, // 0x41 'A' 86 | { 190, 6, 10, 8, 1, -9 }, // 0x42 'B' 87 | { 198, 6, 10, 8, 1, -9 }, // 0x43 'C' 88 | { 206, 6, 10, 8, 1, -9 }, // 0x44 'D' 89 | { 214, 6, 10, 8, 1, -9 }, // 0x45 'E' 90 | { 222, 6, 10, 7, 1, -9 }, // 0x46 'F' 91 | { 230, 7, 10, 9, 1, -9 }, // 0x47 'G' 92 | { 239, 6, 10, 8, 1, -9 }, // 0x48 'H' 93 | { 247, 1, 10, 3, 1, -9 }, // 0x49 'I' 94 | { 249, 4, 10, 6, 1, -9 }, // 0x4A 'J' 95 | { 254, 6, 10, 8, 1, -9 }, // 0x4B 'K' 96 | { 262, 5, 10, 6, 1, -9 }, // 0x4C 'L' 97 | { 269, 9, 10, 11, 1, -9 }, // 0x4D 'M' 98 | { 281, 6, 10, 8, 1, -9 }, // 0x4E 'N' 99 | { 289, 7, 10, 9, 1, -9 }, // 0x4F 'O' 100 | { 298, 6, 10, 8, 1, -9 }, // 0x50 'P' 101 | { 306, 7, 11, 9, 1, -9 }, // 0x51 'Q' 102 | { 316, 7, 10, 8, 1, -9 }, // 0x52 'R' 103 | { 325, 6, 10, 8, 1, -9 }, // 0x53 'S' 104 | { 333, 7, 10, 7, 0, -9 }, // 0x54 'T' 105 | { 342, 6, 10, 8, 1, -9 }, // 0x55 'U' 106 | { 350, 7, 10, 7, 0, -9 }, // 0x56 'V' 107 | { 359, 11, 10, 11, 0, -9 }, // 0x57 'W' 108 | { 373, 8, 10, 8, 0, -9 }, // 0x58 'X' 109 | { 383, 7, 10, 8, 0, -9 }, // 0x59 'Y' 110 | { 392, 6, 10, 6, 0, -9 }, // 0x5A 'Z' 111 | { 400, 2, 13, 3, 1, -9 }, // 0x5B '[' 112 | { 404, 3, 10, 3, 0, -9 }, // 0x5C '\' 113 | { 408, 2, 13, 3, 0, -9 }, // 0x5D ']' 114 | { 412, 5, 5, 5, 0, -9 }, // 0x5E '^' 115 | { 416, 6, 1, 6, 0, 2 }, // 0x5F '_' 116 | { 417, 2, 2, 4, 1, -9 }, // 0x60 '`' 117 | { 418, 5, 7, 6, 0, -6 }, // 0x61 'a' 118 | { 423, 5, 10, 6, 0, -9 }, // 0x62 'b' 119 | { 430, 5, 7, 6, 0, -6 }, // 0x63 'c' 120 | { 435, 5, 10, 6, 0, -9 }, // 0x64 'd' 121 | { 442, 5, 7, 6, 0, -6 }, // 0x65 'e' 122 | { 447, 3, 10, 2, -1, -9 }, // 0x66 'f' 123 | { 451, 5, 10, 6, 0, -6 }, // 0x67 'g' 124 | { 458, 5, 10, 6, 0, -9 }, // 0x68 'h' 125 | { 465, 1, 10, 2, 0, -9 }, // 0x69 'i' 126 | { 467, 2, 13, 2, -1, -9 }, // 0x6A 'j' 127 | { 471, 5, 10, 6, 1, -9 }, // 0x6B 'k' 128 | { 478, 1, 10, 2, 0, -9 }, // 0x6C 'l' 129 | { 480, 9, 7, 10, 0, -6 }, // 0x6D 'm' 130 | { 488, 5, 7, 6, 0, -6 }, // 0x6E 'n' 131 | { 493, 5, 7, 6, 0, -6 }, // 0x6F 'o' 132 | { 498, 5, 10, 6, 0, -6 }, // 0x70 'p' 133 | { 505, 5, 10, 6, 0, -6 }, // 0x71 'q' 134 | { 512, 3, 7, 4, 0, -6 }, // 0x72 'r' 135 | { 515, 5, 7, 6, 0, -6 }, // 0x73 's' 136 | { 520, 3, 10, 2, -1, -9 }, // 0x74 't' 137 | { 524, 5, 7, 6, 0, -6 }, // 0x75 'u' 138 | { 529, 5, 7, 6, 0, -6 }, // 0x76 'v' 139 | { 534, 7, 7, 8, 0, -6 }, // 0x77 'w' 140 | { 541, 5, 7, 6, 0, -6 }, // 0x78 'x' 141 | { 546, 5, 10, 6, 0, -6 }, // 0x79 'y' 142 | { 553, 5, 7, 6, 0, -6 }, // 0x7A 'z' 143 | { 558, 3, 13, 4, 0, -9 }, // 0x7B '{' 144 | { 563, 1, 13, 3, 1, -9 }, // 0x7C '|' 145 | { 565, 3, 13, 4, 0, -9 }, // 0x7D '}' 146 | { 570, 6, 4, 7, 0, -6 } }; // 0x7E '~' 147 | 148 | const GFXfont ArialNarrow7pt7b PROGMEM = { 149 | (uint8_t *)ArialNarrow7pt7bBitmaps, 150 | (GFXglyph *)ArialNarrow7pt7bGlyphs, 151 | 0x20, 0x7E, 16 }; 152 | 153 | // Approx. 1245 bytes 154 | -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/include/KCORES_CSPS.h: -------------------------------------------------------------------------------- 1 | /*! 2 | * @file KCORES_CSPS.h 3 | * 4 | * This is a library for the CSPS PMBUS 5 | * Written by AlphaArea 6 | * 7 | * GPL license, all text here must be included in any redistribution. 8 | * 9 | */ 10 | 11 | #ifndef KCORES_CSPS_H 12 | #define KCORES_CSPS_H 13 | 14 | #include 15 | #include 16 | 17 | class CSPS 18 | { 19 | public: 20 | CSPS(byte CSPS_addr, uint8_t sda, uint8_t scl); 21 | CSPS(byte CSPS_addr, byte ROM_addr, uint8_t sda, uint8_t scl); 22 | 23 | String getROM(byte addr, byte len); 24 | 25 | //Spare Part No 26 | String getSPN() 27 | { 28 | return getROM(0x12, 0x0A); 29 | }; 30 | 31 | //Manufacture Date 32 | String getMFG() 33 | { 34 | return getROM(0x1D, 0x08); 35 | }; 36 | 37 | //Manufacturer 38 | String getMFR() 39 | { 40 | return getROM(0x2C, 0x05); 41 | }; 42 | 43 | //Power Name 44 | String getName() 45 | { 46 | return getROM(0x32, 0x1A); 47 | }; 48 | 49 | //Option Kit No 50 | String getOKN() 51 | { 52 | return getROM(0x4D, 0x0A); 53 | }; 54 | 55 | //CT Date Codes 56 | String getCT() 57 | { 58 | return getROM(0x5B, 0x0E); 59 | }; 60 | 61 | float getInputVoltage() 62 | { 63 | return (float)readCSPSword(0x08) / 32; 64 | }; 65 | 66 | float getInputCurrent() 67 | { 68 | return (float)readCSPSword(0x0A) / 64; 69 | }; 70 | 71 | float getInputPower() 72 | { 73 | return (float)readCSPSword(0x0C); 74 | }; 75 | 76 | float getOutputVoltage() 77 | { 78 | return (float)readCSPSword(0x0E) / 256; 79 | }; 80 | 81 | float getOutputCurrent() 82 | { 83 | return (float)readCSPSword(0x10) / 64; 84 | }; 85 | 86 | float getOutputPower() 87 | { 88 | return (float)readCSPSword(0x12); 89 | }; 90 | 91 | float getTemp1() 92 | { 93 | return (float)readCSPSword(0x1A) / 64; 94 | }; 95 | 96 | float getTemp2() 97 | { 98 | return (float)readCSPSword(0x1C) / 64; 99 | }; 100 | 101 | uint16_t getFanRPM() 102 | { 103 | return readCSPSword(0x1E); 104 | }; 105 | 106 | uint32_t getRunTime() 107 | { 108 | return readCSPSword(0x30); 109 | }; 110 | 111 | void setFanRPM(uint16_t rpm) 112 | { 113 | writeCSPSword(0x40, rpm); 114 | }; 115 | 116 | private: 117 | byte _CSPS_addr; 118 | byte _ROM_addr; 119 | byte readROM(byte dataAddr); 120 | 121 | uint32_t readCSPSword(byte dataAddr); 122 | void writeCSPSword(byte dataAddr, unsigned int data); 123 | }; 124 | 125 | #endif 126 | -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/include/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project header files. 3 | 4 | A header file is a file containing C declarations and macro definitions 5 | to be shared between several project source files. You request the use of a 6 | header file in your project source file (C, C++, etc) located in `src` folder 7 | by including it, with the C preprocessing directive `#include'. 8 | 9 | ```src/main.c 10 | 11 | #include "header.h" 12 | 13 | int main (void) 14 | { 15 | ... 16 | } 17 | ``` 18 | 19 | Including a header file produces the same results as copying the header file 20 | into each source file that needs it. Such copying would be time-consuming 21 | and error-prone. With a header file, the related declarations appear 22 | in only one place. If they need to be changed, they can be changed in one 23 | place, and programs that include the header file will automatically use the 24 | new version when next recompiled. The header file eliminates the labor of 25 | finding and changing all the copies as well as the risk that a failure to 26 | find one copy will result in inconsistencies within a program. 27 | 28 | In C, the usual convention is to give header files names that end with `.h'. 29 | It is most portable to use only letters, digits, dashes, and underscores in 30 | header file names, and at most one dot. 31 | 32 | Read more about using header files in official GCC documentation: 33 | 34 | * Include Syntax 35 | * Include Operation 36 | * Once-Only Headers 37 | * Computed Includes 38 | 39 | https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html 40 | -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/lib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link into executable file. 4 | 5 | The source code of each library should be placed in a an own separate directory 6 | ("lib/your_library_name/[here are source files]"). 7 | 8 | For example, see a structure of the following two libraries `Foo` and `Bar`: 9 | 10 | |--lib 11 | | | 12 | | |--Bar 13 | | | |--docs 14 | | | |--examples 15 | | | |--src 16 | | | |- Bar.c 17 | | | |- Bar.h 18 | | | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html 19 | | | 20 | | |--Foo 21 | | | |- Foo.c 22 | | | |- Foo.h 23 | | | 24 | | |- README --> THIS FILE 25 | | 26 | |- platformio.ini 27 | |--src 28 | |- main.c 29 | 30 | and a contents of `src/main.c`: 31 | ``` 32 | #include 33 | #include 34 | 35 | int main (void) 36 | { 37 | ... 38 | } 39 | 40 | ``` 41 | 42 | PlatformIO Library Dependency Finder will find automatically dependent 43 | libraries scanning project source files. 44 | 45 | More information about PlatformIO Library Dependency Finder 46 | - https://docs.platformio.org/page/librarymanager/ldf.html 47 | -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; https://docs.platformio.org/page/projectconf.html 10 | 11 | [env:bluepill_f103c8] 12 | platform = ststm32 13 | board = bluepill_f103c8 14 | ;https://hackaday.com/2020/10/22/stm32-clones-the-good-the-bad-and-the-ugly/ 15 | ;board_build.mcu = STM32F103C6T6 16 | ;upload_flags = -c set CPUTAPID 0x2ba01477 17 | upload_protocol = hid 18 | upload_port = COM8 19 | framework = arduino 20 | lib_deps = 21 | adafruit/Adafruit SSD1306@^2.4.3 22 | adafruit/Adafruit GFX Library @ ^1.10.4 23 | adafruit/Adafruit BusIO @ ^1.7.2 24 | build_flags = 25 | -w 26 | -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC 27 | -D USBCON 28 | -D USBD_VID=0x0483 29 | -D USBD_PID=0x5740 30 | -D USB_MANUFACTURER="Kcores" 31 | -D USB_PRODUCT="\"Kcores_Link\"" 32 | ; QUIRK: without setting this, no 33 | ; data will be received on the serial USB port 34 | ; https://github.com/stm32duino/Arduino_Core_STM32/issues/1193 35 | monitor_dtr = 1 36 | ; optional: set COM port to monitor here if there are multiple 37 | ;monitor_port= COM27 -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/src/KCORES_CSPS.cpp: -------------------------------------------------------------------------------- 1 | /*! 2 | * @file KCORES_CSPS.cpp 3 | * 4 | * This is a library for the CSPS PMBUS 5 | * Written by AlphaArea 6 | * 7 | * GPL license, all text here must be included in any redistribution. 8 | * 9 | */ 10 | 11 | #include "KCORES_CSPS.h" 12 | 13 | // avoid PB7 PB6 14 | // SDA SCL 15 | //TwoWire Wire2(PB11,PB10); 16 | 17 | #define WIRE Wire 18 | 19 | CSPS::CSPS(byte CSPS_addr, uint8_t sda, uint8_t scl) 20 | { 21 | _CSPS_addr = CSPS_addr; 22 | _ROM_addr = CSPS_addr - 8; 23 | WIRE.setSDA(sda); 24 | WIRE.setSCL(scl); 25 | WIRE.begin(); 26 | } 27 | 28 | CSPS::CSPS(byte CSPS_addr, byte ROM_addr, uint8_t sda, uint8_t scl) 29 | { 30 | _CSPS_addr = CSPS_addr; 31 | _ROM_addr = ROM_addr; 32 | WIRE.setSDA(sda); 33 | WIRE.setSCL(scl); 34 | WIRE.begin(); 35 | } 36 | 37 | String CSPS::getROM(byte addr, byte len) 38 | { 39 | String rec; 40 | for (byte n = 0; n < len; n++) 41 | rec.concat((char)readROM(addr + n)); 42 | return rec; 43 | } 44 | 45 | byte CSPS::readROM(byte dataAddr) 46 | { 47 | byte rec = 0x00; 48 | WIRE.beginTransmission(_ROM_addr); 49 | WIRE.write(dataAddr); 50 | WIRE.endTransmission(); 51 | WIRE.requestFrom(_ROM_addr, 1); 52 | if (WIRE.available()) 53 | rec = WIRE.read(); 54 | return rec; 55 | } 56 | 57 | 58 | uint32_t CSPS::readCSPSword(byte dataAddr) 59 | { 60 | byte regCS = ((0xFF - (dataAddr + (_CSPS_addr << 1))) + 1) & 0xFF; 61 | uint32_t rec = 0xFFFF; 62 | WIRE.beginTransmission(_CSPS_addr); 63 | WIRE.write(dataAddr); 64 | WIRE.write(regCS); 65 | WIRE.endTransmission(); 66 | WIRE.requestFrom(_CSPS_addr, 3); 67 | if (WIRE.available()) 68 | { 69 | rec = WIRE.read(); 70 | rec |= WIRE.read() << 8; 71 | //rec |= WIRE.read() << 16; 72 | return rec; 73 | } 74 | else 75 | return 0; 76 | } 77 | 78 | void CSPS::writeCSPSword(byte dataAddr, unsigned int data) 79 | { 80 | byte valLSB = lowByte(data), 81 | valMSB = highByte(data); 82 | uint8_t cs = (_CSPS_addr << 1) + dataAddr + valLSB + valMSB; 83 | uint8_t regCS = ((0xFF - cs) + 1) & 0xff; 84 | //the checksum is the 'secret sauce' 85 | //writeInts = [reg, valLSB, valMSB, regCS]; //write these 4 bytes to i2c 86 | WIRE.beginTransmission(_CSPS_addr); 87 | WIRE.write(dataAddr); 88 | WIRE.write(valLSB); 89 | WIRE.write(valMSB); 90 | WIRE.write(regCS); 91 | WIRE.endTransmission(); 92 | } 93 | -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "Arduino.h" 2 | /*! 3 | * Work with KCORES Link V0.0.1 https://github.com/KCORES/kcores-link 4 | * 5 | * Written by AlphaArea 6 | * 7 | * GPL license, all text here must be included in any redistribution. 8 | * 9 | */ 10 | 11 | /* Modified by maz-1 for stm32f103c8t6 and 0.91 inch 12832 oled display 12 | * Should be compiled with stm32duino : https://github.com/stm32duino/BoardManagerFiles/raw/master/package_stmicroelectronics_index.json 13 | * Watch this video about how to install hid bootloader : https://www.youtube.com/watch?v=Myon8H111PQ 14 | * stm32f103c8t6 should be powered by onboard usb, it will also provide a virtual serial port that can be used by KCORES Link 15 | * Pin connections: 16 | * PB8 -> CSPS SCL 17 | * PB9 -> CSPS SDA 18 | * G -> CSPS GND 19 | * PB10 -> 12832 SCL 20 | * PB11 -> 12832 SDA 21 | * V3 -> 12832 VCC 22 | * G -> 12832 GND 23 | */ 24 | 25 | 26 | #include "KCORES_CSPS.h" 27 | 28 | 29 | #include 30 | #include 31 | #include "ArialNarrow7pt7b.h" 32 | #define SCREEN_WIDTH 128 // OLED display width, in pixels 33 | #define SCREEN_HEIGHT 32 // OLED display height, in pixels 34 | // SDA SCL 35 | TwoWire WireOLED(PB11, PB10); 36 | #define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin) 37 | #define SCREEN_ADDRESS 0x3C ///< See datasheet for Address; 0x3D for 128x64, 0x3C for 128x32 38 | Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &WireOLED, OLED_RESET); 39 | String OutputOLEDString; 40 | //float efficiency; 41 | 42 | CSPS PowerSupply_1(0x5F, 0x57, PB9, PB8); 43 | 44 | float VoltIn, VoltOut, 45 | CurrentIn, CurrentOut, 46 | PowerIn, PowerOut, 47 | Temp1, 48 | Temp2, 49 | FanSpeed; 50 | 51 | String OutputString; 52 | uint8_t OutputLen = 0; 53 | 54 | bool displayInitialized; 55 | 56 | void setup() 57 | { 58 | Serial.begin(115200); 59 | Wire.setClock(100000); 60 | 61 | displayInitialized = false; 62 | display.setFont(&ArialNarrow7pt7b); 63 | // SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally 64 | if(display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) { 65 | displayInitialized = true; 66 | } else { 67 | //Serial.println(F("SSD1306 allocation failed")); 68 | } 69 | 70 | if (displayInitialized) 71 | { 72 | display.setTextSize(1); // pixel scale 73 | display.setTextColor(SSD1306_WHITE); // Draw white text 74 | display.cp437(true); // Use full 256 char 'Code Page 437' font 75 | display.setRotation(2); // rotate screen 76 | } 77 | 78 | } 79 | 80 | void loop() 81 | { 82 | VoltIn = PowerSupply_1.getInputVoltage(); 83 | VoltOut = PowerSupply_1.getOutputVoltage(); 84 | CurrentIn = PowerSupply_1.getInputCurrent(); 85 | CurrentOut = PowerSupply_1.getOutputCurrent(); 86 | PowerIn = PowerSupply_1.getInputPower(); 87 | PowerOut = PowerSupply_1.getOutputPower(); 88 | Temp1 = PowerSupply_1.getTemp1(); 89 | Temp2 = PowerSupply_1.getTemp2(); 90 | FanSpeed = PowerSupply_1.getFanRPM(); 91 | 92 | Serial.print(" "); 93 | OutputLen = 0; 94 | OutputString = String(VoltIn, 1) + ',' + String(CurrentIn, 2) + ',' + String(PowerIn, 1) + ','; 95 | OutputLen += OutputString.length(); 96 | Serial.print(OutputString); 97 | 98 | OutputString = String(VoltOut, 2) + ',' + String(CurrentOut, 2) + ',' + String(PowerOut, 1) + ','; 99 | OutputLen += OutputString.length(); 100 | Serial.print(OutputString); 101 | 102 | OutputString = String(Temp1, 1) + ',' + String(Temp2, 1) + ',' + String(FanSpeed, 0) + ','; 103 | OutputLen += OutputString.length(); 104 | Serial.print(OutputString); 105 | Serial.print(",,"); 106 | 107 | OutputLen = 59 - OutputLen; 108 | 109 | for (; OutputLen > 0; OutputLen--) 110 | Serial.print(" "); 111 | 112 | Serial.print("\n"); 113 | 114 | 115 | if (displayInitialized) 116 | { 117 | display.clearDisplay(); 118 | display.setCursor(0, 12); // Start at top-left corner 119 | //display.println("I: 226V 268W 80%\nO: 12.23V 214.1W"); 120 | //efficiency = PowerOut * 100 / PowerIn; 121 | OutputOLEDString = " I : " + String(VoltIn, 0) + "V " + String(CurrentIn, 2) + "A " + String(PowerIn, 0) + "W\nO: " + String(VoltOut, 1) + "V " + String(CurrentOut, 1) + "A " + String(PowerOut, 0) + "W"; 122 | display.println(OutputOLEDString); 123 | display.display(); 124 | } 125 | 126 | 127 | delay(500); 128 | } 129 | 130 | void serialEvent() 131 | { 132 | PowerSupply_1.setFanRPM(Serial.readStringUntil('\n').toInt()); 133 | } 134 | -------------------------------------------------------------------------------- /Arduino/KCORES_Link_V1/test/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for PlatformIO Unit Testing and project tests. 3 | 4 | Unit Testing is a software testing method by which individual units of 5 | source code, sets of one or more MCU program modules together with associated 6 | control data, usage procedures, and operating procedures, are tested to 7 | determine whether they are fit for use. Unit testing finds problems early 8 | in the development cycle. 9 | 10 | More information about PlatformIO Unit Testing: 11 | - https://docs.platformio.org/page/plus/unit-testing.html 12 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # 一个CSPS转ATX电源位的背板,相关项目: [KCORES-CSPS-to-ATX-Converter](https://github.com/KCORES/KCORES-CSPS-to-ATX-Converter) 2 | 3 | ![CSPS to ATX Backplate mounted](photo1.jpg) 4 | ![CSPS to ATX Backplate detail1](photo2.jpg) 5 | ![CSPS to ATX Backplate detail2](photo3.jpg) 6 | 7 | 需要打印的部分 (有条件的用abs/尼龙,petg也可,最好别用pla): 8 | - 9 | - STL/csps-atx-mount.stl (背板) 10 | - STL/reinforcement1.stl (固定件一) 11 | - STL/reinforcement2.stl (固定件二) 12 | 13 | 使用方法: 14 | - 15 | - 卸掉电源把手上的螺丝,把把手拿掉,螺丝备用 16 | - 按住拨片把电源插入,左侧风扇位置金属外壳和背板平行,右侧和限位块接触 17 | - 把固定件一和固定件二放到对应位置,用万能胶固定 18 | - 胶干了以后把把手螺丝拧到固定件螺丝孔位 19 | 20 | 显示屏为ssd1306驱动的0.91寸128x32分辨率oled屏,用热熔胶固定到对应位置,单片机为stm32f103c8t6。程序及引脚接法见 [KCORES_Link_V1](Arduino/KCORES_Link_V1) -------------------------------------------------------------------------------- /Rhino/csps-atx-mount.3dm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/Rhino/csps-atx-mount.3dm -------------------------------------------------------------------------------- /Rhino/csps-atx-mount.scad: -------------------------------------------------------------------------------- 1 | // move & rotate 2 | translate_x=-52; 3 | translate_y=-5; 4 | rotate_z=0; 5 | // space for motherboard 6 | space_for_motherboard=true; 7 | 8 | rotate(a=[180,0,0]) 9 | union() 10 | { 11 | difference() 12 | { 13 | rotate(a=[0,0,rotate_z]) 14 | translate([translate_x,translate_y,0]) 15 | // plate with screw holes 16 | difference() 17 | { 18 | translate([-5,-5,0]) 19 | cube([148,84,5],center=false); 20 | union() 21 | { 22 | if (space_for_motherboard) 23 | { 24 | translate([-6,17,-3]) 25 | cube([4,63,7],center=false); 26 | } 27 | // atx psu screw holes 28 | cylinder(h=12, r=1.5, $fn=12, center=true); 29 | translate([114,0,0]) 30 | cylinder(h=12, r=1.5, $fn=12, center=true); 31 | translate([138,0,0]) 32 | cylinder(h=12, r=1.5, $fn=12, center=true); 33 | translate([0,10,0]) 34 | cylinder(h=12, r=1.5, $fn=12, center=true); 35 | translate([138,64,0]) 36 | cylinder(h=12, r=1.5, $fn=12, center=true); 37 | translate([0,74,0]) 38 | cylinder(h=12, r=1.5, $fn=12, center=true); 39 | translate([24,74,0]) 40 | cylinder(h=12, r=1.5, $fn=12, center=true); 41 | translate([138,74,0]) 42 | cylinder(h=12, r=1.5, $fn=12, center=true); 43 | } 44 | } 45 | 46 | translate([0,0,-1]) 47 | difference() 48 | { 49 | union() 50 | { 51 | translate([3,0,0]) 52 | cube([43,41,7],center=false); 53 | cube([87,39.2,7],center=false); 54 | } 55 | /* 56 | union() 57 | { 58 | translate([82,0,0]) 59 | cube([5,5,7],center=false); 60 | translate([82,35,0]) 61 | cube([5,5,7],center=false); 62 | } 63 | */ 64 | } 65 | } 66 | 67 | union() 68 | { 69 | translate([82,0,-1.5]) 70 | cube([5,5,6.5],center=false); 71 | translate([82,35,-1.5]) 72 | cube([5,5,6.5],center=false); 73 | } 74 | 75 | translate([-2,-2,-31]) 76 | difference() 77 | { 78 | cube([90.5,45,36],center=false); 79 | union() 80 | { 81 | translate([5,2,-1]) 82 | cube([43,41,38],center=false); 83 | translate([2,2,-1]) 84 | cube([87,39.2,38],center=false); 85 | translate([51,42.8,-1]) 86 | cube([41,4,38],center=false); 87 | // slots 88 | translate([88.5,13,13]) 89 | cube([6,2,10],center=false); 90 | translate([87.5,27.5,13]) 91 | cube([6,2,10],center=false); 92 | } 93 | } 94 | } -------------------------------------------------------------------------------- /STL/clip.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/STL/clip.stl -------------------------------------------------------------------------------- /STL/clip2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/STL/clip2.stl -------------------------------------------------------------------------------- /STL/csps-atx-mount.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/STL/csps-atx-mount.stl -------------------------------------------------------------------------------- /STL/reinforcement1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/STL/reinforcement1.stl -------------------------------------------------------------------------------- /STL/reinforcement2.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/STL/reinforcement2.stl -------------------------------------------------------------------------------- /photo1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/photo1.jpg -------------------------------------------------------------------------------- /photo2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/photo2.jpg -------------------------------------------------------------------------------- /photo3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maz-1/CSPS_ATX_Backplate/215f07070c225aa1cb5b2b28ccdff68fe123aa02/photo3.jpg --------------------------------------------------------------------------------