30 #if !defined(__HOST_HARDWARE_H__) 31 #define __HOST_HARDWARE_H__ 33 #include "bootloader_common.h" 34 #include "microseconds/microseconds.h" 35 #include "dspi/fsl_dspi.h" 41 #define UART_INSTANCE 4 42 #define SPI_INSTANCE 2 43 #define I2C_INSTANCE 0 44 #define FLEXCAN_INSTANCE 0 49 kUART_MIN_BAUD = 19200,
50 kUART_MAX_BAUD = 230400,
51 kUART_DEFAULT_BAUD = 57600
55 enum _flexcan_freq_value
61 kFLEXCAN_1000K = 1000,
67 #if defined(__cplusplus) 72 void hardware_init(
void);
75 bool wait_uart_char(uint8_t *data);
76 uint8_t wait_uart_char_blocking(
void);
79 void configure_spi_speed(uint32_t speedkhz);
82 status_t receive_spi_data(uint8_t *dest, uint32_t readLength);
85 status_t send_spi_data(uint8_t *src, uint32_t writeLength);
88 void configure_i2c_speed(uint32_t speedkhz);
91 status_t send_i2c_data(uint8_t *src, uint32_t writeLength);
94 status_t receive_i2c_data(uint8_t *dest, uint32_t readLength);
97 void configure_uart_speed(uint32_t baud);
100 status_t send_uart_data(uint8_t *src, uint32_t writeLength);
103 status_t receive_uart_data(uint8_t *dest, uint32_t readLength);
106 void configure_can_speed(uint32_t speed);
109 status_t send_can_data(uint8_t *src, uint32_t writeLength);
112 status_t receive_can_data(uint8_t *dest, uint32_t readLength);
114 #if defined(__cplusplus) int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:121