Lines Matching defs:handle
54 /* STM32CubeProgrammer over UART handle */
63 } handle;
65 /* Trace and handle unrecoverable UART protocol error */
69 if (handle.phase != PHASE_RESET) { \
70 snprintf((char *)&handle.error, sizeof(handle.error), __VA_ARGS__); \
71 handle.phase = PHASE_RESET; \
72 handle.addr = (uint8_t *)UNDEFINED_DOWN_ADDR; \
73 handle.len = 0U; \
74 handle.packet = 0U; \
81 if (stm32_uart_putc(&handle.uart, *addr) != 0) {
93 return stm32_uart_putc(&handle.uart, byte);
107 ret = stm32_uart_getc(&handle.uart);
128 ret = stm32_uart_getc(&handle.uart);
230 if (handle.phase == PHASE_RESET) {
231 error_size = strnlen((char *)&handle.error, sizeof(handle.error));
239 ret = uart_write_8(handle.phase);
257 ret = uart_write(handle.error, error_size);
292 if (packet_number != handle.packet) {
294 packet_number, handle.packet);
320 if (handle.len < packet_size) {
321 STM32PROG_ERROR("Download overflow at %p\n", handle.addr + packet_size);
331 *(handle.addr + i) = byte;
347 handle.packet++;
348 handle.addr += packet_size;
349 handle.len -= packet_size;
387 start_address, handle.phase);
393 buffer, handle.phase);
407 handle.phase = id;
408 handle.packet = 0U;
409 handle.addr = (uint8_t *)buffer;
410 handle.len = length;
450 if ((ret == 0) && (handle.phase == PHASE_RESET)) {
462 if ((ret == 0) && (handle.phase == id)) {
463 INFO("UART: Start phase %u\n", handle.phase);
484 stm32_uart_flush(&handle.uart);
504 if (stm32_uart_init(&handle.uart, instance, &init) != 0) {