fc10ef2e10
GD32F470ZGT6 based project with full peripheral support: - SDRAM (W9825G6KH) via EXMC - LCD NT35510 (480x800) via EXMC NOR/PSRAM - Flash (W25Q64) via SPI - UART (USART0) debug console - LED indicators - CMSIS-DAP debug interface - CMake + ARM GCC toolchain build system
37 lines
473 B
C++
37 lines
473 B
C++
#ifndef __BUS_CORE_H__
|
|
#define __BUS_CORE_H__
|
|
|
|
#include <cstdint>
|
|
#include "common_types.h"
|
|
|
|
enum class BusType : uint8_t {
|
|
SPI = 0,
|
|
I2C,
|
|
UART,
|
|
BUS_EXMC,
|
|
TIMER,
|
|
ADC,
|
|
GPIO,
|
|
};
|
|
|
|
struct Bus {
|
|
BusType type;
|
|
uint8_t port;
|
|
void *priv;
|
|
};
|
|
|
|
struct BusDevice {
|
|
Bus *bus;
|
|
uint16_t addr;
|
|
void *priv;
|
|
};
|
|
|
|
struct BusTransfer {
|
|
const uint8_t *tx_data;
|
|
uint8_t *rx_data;
|
|
uint32_t length;
|
|
uint32_t timeout_ms;
|
|
};
|
|
|
|
#endif
|