mirror of
https://github.com/pine64/blisp.git
synced 2026-09-18 03:51:31 +00:00
WIP
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#ifndef _LIBBLISP_H
|
||||
#define _LIBBLISP_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "blisp_chip.h"
|
||||
|
||||
struct blisp_device {
|
||||
struct blisp_chip* chip;
|
||||
void* serial_port;
|
||||
bool is_usb;
|
||||
uint32_t current_baud_rate;
|
||||
uint8_t rx_buffer[5000]; // TODO:
|
||||
uint8_t tx_buffer[5000];
|
||||
uint16_t error_code;
|
||||
};
|
||||
|
||||
struct blisp_boot_info {
|
||||
uint8_t boot_rom_version[4];
|
||||
uint8_t chip_id[8]; // TODO: BL60X only 6 bytes
|
||||
};
|
||||
|
||||
int32_t blisp_device_init(struct blisp_device* device, struct blisp_chip* chip);
|
||||
int32_t blisp_device_open(struct blisp_device* device, const char* port_name);
|
||||
int32_t blisp_device_handshake(struct blisp_device* device);
|
||||
int32_t blisp_device_get_boot_info(struct blisp_device* device, struct blisp_boot_info* boot_info);
|
||||
void blisp_device_close(struct blisp_device* device);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
#ifndef _BLISP_CHIP_H
|
||||
#define _BLISP_CHIP_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
enum blisp_chip_type {
|
||||
BLISP_CHIP_BL70X
|
||||
};
|
||||
|
||||
struct blisp_chip { // TODO: Move elsewhere?
|
||||
enum blisp_chip_type type;
|
||||
bool usb_isp_available;
|
||||
};
|
||||
|
||||
extern struct blisp_chip blisp_chip_bl70x;
|
||||
|
||||
#endif
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef _LIBBLISP_EASY_H
|
||||
#define _LIBBLISP_EASY_H
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user