#ifndef __LPC_H__
#define __LPC_H__

#include <serial.h>
#include <sprog.h>

struct lpc_device {
  struct serial_device *port;
  const struct lpc_part *part;
};

struct lpc_device *lpc_setup(struct serial_device *port);
void lpc_init(struct lpc_device *dev);
void lpc_exec(struct lpc_device *dev, const struct sprog_data *d);
void lpc_close(struct lpc_device *dev);


struct lpc_part {
  const char *name;
  unsigned int part_id;
  int ram;
  int flash;
};

extern const struct lpc_part lpc_parts[];
extern const struct sprog_family lpc_family;

#endif