Implemented PINOUT.TXT file

This commit is contained in:
2018-01-07 13:04:19 +01:00
parent ad39fc280f
commit 26934a0984
15 changed files with 217 additions and 63 deletions
+5 -5
View File
@@ -208,15 +208,15 @@ char * str_pinmask(uint16_t pins, char *buffer)
} else {
if (on) {
if (!first) {
b += SPRINTF(b, ",");
b += SPRINTF(b, ", ");
}
if (start == (uint32_t)(i+1)) {
b += SPRINTF(b, "%"PRIu32, start);
}
else if (start == (uint32_t)(i+2)) {
// exception for 2-long ranges - don't show as range
b += SPRINTF(b, "%"PRIu32",%"PRIu32, start, i + 1);
}
// else if (start == (uint32_t)(i+2)) {
// // exception for 2-long ranges - don't show as range
// b += SPRINTF(b, "%"PRIu32",%"PRIu32, start, i + 1);
// }
else {
b += SPRINTF(b, "%"PRIu32"-%"PRIu32, start, i + 1);
}
+28
View File
@@ -252,3 +252,31 @@ void plat_usb_reconnect(void)
}
void plat_print_system_pinout(IniWriter *iw)
{
if (iw->count == 0) return;
iw_string(iw, "System pin-out\r\n"
"--------------\r\n");
#if PLAT_LOCK_BTN
iw_sprintf(iw, "Lock button (active="
#if PLAT_LOCK_1CLOSED
"high"
#else
"low"
#endif
"): P%c%d\r\n", LOCK_JUMPER_PORT, LOCK_JUMPER_PIN);
#else
iw_sprintf(iw, "Lock jumper (closed="
#if PLAT_LOCK_1CLOSED
"high"
#else
"low"
#endif
"): P%c%d\r\n", LOCK_JUMPER_PORT, LOCK_JUMPER_PIN);
#endif
iw_sprintf(iw, "Indicator LED (anode): P%c%d\r\n", STATUS_LED_PORT, STATUS_LED_PIN);
iw_sprintf(iw, "System clock speed: %d MHz\r\n", PLAT_AHB_MHZ);
}
+4
View File
@@ -33,6 +33,7 @@
// GEX version string
#include "version.h"
// ---
/**
@@ -56,4 +57,7 @@ void plat_register_units(void);
*/
void plat_usb_reconnect(void);
// provided as extern
//void plat_print_system_pinout(IniWriter *iw);
#endif //GEX_PLATFORM_H