aboutsummaryrefslogtreecommitdiff
ModeNameSize
-rw-r--r--.gitignore69logplainblame
-rw-r--r--Makefile7194logplainblame
-rw-r--r--README.md6307logplainblame
d---------bin137logplain
d---------libraries164logplain
-rw-r--r--memfunc.c2287logplainblame
d---------projects177logplain
-rw-r--r--spiflash_n25q128.c11051logplainblame
-rw-r--r--spiflash_n25q128.h3854logplainblame
-rw-r--r--stm-flash.c4747logplainblame
-rw-r--r--stm-flash.h2030logplainblame
-rw-r--r--stm-fmc.c5840logplainblame
-rw-r--r--stm-fmc.h4124logplainblame
-rw-r--r--stm-fpgacfg.c4795logplainblame
-rw-r--r--stm-fpgacfg.h4177logplainblame
-rw-r--r--stm-init.c4200logplainblame
-rw-r--r--stm-init.h2743logplainblame
-rw-r--r--stm-keystore.c3490logplainblame
-rw-r--r--stm-keystore.h3007logplainblame
-rw-r--r--stm-led.h2393logplainblame
-rw-r--r--stm-rtc.c3573logplainblame
-rw-r--r--stm-rtc.h2587logplainblame
-rw-r--r--stm-sdram.c7825logplainblame
-rw-r--r--stm-sdram.h1969logplainblame
-rw-r--r--stm-uart.c6705logplainblame
-rw-r--r--stm-uart.h4061logplainblame
-rw-r--r--syscalls.c5263logplainblame
-rw-r--r--task.c10854logplainblame
-rw-r--r--task.h2937logplainblame
span> == STM_UART_MGMT) { return HAL_UART_Transmit(&huart1, &ch, 1, 0x1); } return HAL_ERROR; } /* receive a single character */ HAL_StatusTypeDef uart_recv_char(uint8_t *cp) { return HAL_UART_Receive(&huart2, cp, 1, HAL_MAX_DELAY); } /* receive a single character */ HAL_StatusTypeDef uart_recv_char2(enum stm_uart_port port, uint8_t *cp, uint32_t timeout) { if (port == STM_UART_USER) { return HAL_UART_Receive(&huart2, cp, 1, timeout); } else if (port == STM_UART_MGMT) { return HAL_UART_Receive(&huart1, cp, 1, timeout); } return HAL_ERROR; } /* send a string */ HAL_StatusTypeDef uart_send_string(char *s) { return HAL_UART_Transmit(&huart2, (uint8_t *) s, strlen(s), 0x1); } /* Generalized routine to send binary, decimal, and hex integers. * This code is adapted from Chris Giese's printf.c */ HAL_StatusTypeDef uart_send_number(uint32_t num, uint8_t digits, uint8_t radix) { #define BUFSIZE 32 char buf[BUFSIZE]; char *where = buf + BUFSIZE; /* initialize buf so we can add leading 0 by adjusting the pointer */ memset(buf, '0', BUFSIZE); /* build the string backwards, starting with the least significant digit */ do { uint32_t temp; temp = num % radix; where--; if (temp < 10) *where = temp + '0'; else *where = temp - 10 + 'A'; num = num / radix; } while (num != 0); if (where > buf + BUFSIZE - digits) /* pad with leading 0 */ where = buf + BUFSIZE - digits; else /* number is larger than the specified number of digits */ digits = buf + BUFSIZE - where; return HAL_UART_Transmit(&huart2, (uint8_t *) where, digits, 0x1); }