16 #if defined(USE_STDIO_USART)
22 #if !(USE_STDIO_USART < BSP_USART_BUS_COUNT)
23 #error USE_STDIO_USART should be < BSP_USART_BUS_COUNT
48 bus->
var->mutex_ignore = 1;
54 setvbuf(stdout, NULL, _IONBF, 0);
55 setvbuf(stderr, NULL, _IONBF, 0);
56 setvbuf(stdin, NULL, _IONBF, 0);
60 int _write(
int fd,
char *ptr,
int len)
69 for (i = 0 ; i < len ; i++)
91 int _read(
int fd,
char *ptr,
int len)
102 status =
bus_read(bus, 0, ptr, len, &l);
status_e bus_release(const struct heivs_bus_t *bus)
Release exclusive access to the bus.
libheivs configuration file
struct heivs_bus_var_t * var
status_e bus_write(const struct heivs_bus_t *bus, uint32_t address, const void *data, size_t len)
Write data to the bus.
const struct heivs_bus_t bus_usart[BSP_USART_BUS_COUNT]
All USART busses.
status_e(* _read)(const struct heivs_bus_t *, uint32_t address, uint8_t *data, size_t len, size_t *rlen)
#define USE_STDIO_USART
Use this usart number for stdio redirection.
status_e bus_init(const struct heivs_bus_t *bus)
initialize the bus
status_e bus_read(const struct heivs_bus_t *bus, uint32_t address, void *data, size_t len, size_t *rlen)
Resume the bus (from low power mode)
#define USE_STDIO_AUTO_CR_BEFORE_LF
Put a CR ('') before every LF (' ') on stdout (and stderr)
#define USE_STDIO_ECHO
Enable echo for stdio.
status_e bus_get(const struct heivs_bus_t *bus)
Get exclusive access to the bus.
#define USE_STDIO_NOBUF
Disable stdio buffering.