mesaflash/hostmot2.h
Jeff Epler 934769e0cc Fix problems regarding function prototypes
In C, you can call functions which do not have prototypes
available; however, if the implied prototype doesn't match
the actual prototype, the behavior is undefined.  These changes
make mesaflash compile cleanly even when these prototype-checking
compiler flags are enabled (and enables them by default):
    -Werror=missing-prototypes
    -Werror=strict-prototypes
    -Werror=implicit-function-declaration
2016-11-21 21:09:24 -06:00

97 lines
3 KiB
C

//
// Copyright (C) 2013-2014 Michael Geszkiewicz
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifndef __HOSTMOT2_H
#define __HOSTMOT2_H
#include "types.h"
#include "hostmot2_def.h"
typedef struct {
int index;
char name[64];
} sw_mode_t;
typedef struct {
u32 unit;
u16 sw_revision;
u16 hw_revision;
char name[4];
sw_mode_t sw_modes[256];
int sw_modes_cnt;
} sserial_device_t;
#define HM2_MAX_TAGS 30
#define ANYIO_MAX_IOPORT_CONNECTORS 8
typedef struct llio_struct llio_t;
typedef struct {
llio_t *llio;
char config_name[8];
hm2_idrom_desc_t idrom;
hm2_module_desc_t modules[HM2_MAX_MODULES];
hm2_pin_desc_t pins[HM2_MAX_PINS];
} hostmot2_t;
struct llio_struct {
int (*read)(llio_t *self, u32 addr, void *buffer, int size);
int (*write)(llio_t *self, u32 addr, void *buffer, int size);
int (*write_flash)(llio_t *self, char *bitfile_name, u32 start_address, int fix_boot_flag);
int (*verify_flash)(llio_t *self, char *bitfile_name, u32 start_address);
int (*program_fpga)(llio_t *self, char *bitfile_name);
int (*reset)(llio_t *self);
int (*reload)(llio_t *self, int fallback_flag);
int num_ioport_connectors;
int pins_per_connector;
const char *ioport_connector_name[ANYIO_MAX_IOPORT_CONNECTORS];
int num_leds;
const char *fpga_part_number;
char board_name[16];
void *board;
hostmot2_t hm2;
sserial_interface_t ss_interface[HM2_SSERIAL_MAX_INTEFACES];
sserial_device_t ss_device[HM2_SSERIAL_MAX_CHANNELS];
int verbose;
};
typedef struct {
u8 tag;
char *name[10];
} pin_name_t;
typedef struct {
char *name;
u8 tag;
} mod_name_t;
int hm2_check_cookie(llio_t *llio);
void hm2_read_idrom(hostmot2_t *hm2);
hm2_module_desc_t *hm2_find_module(hostmot2_t *hm2, u8 gtag);
void hm2_print_idrom(hostmot2_t *hm2);
void hm2_print_modules(hostmot2_t *hm2);
void hm2_print_pins(hostmot2_t *hm2);
void hm2_print_pin_file(llio_t *llio, int xml_flag);
void hm2_set_pin_source(hostmot2_t *hm2, int pin_number, u8 source);
void hm2_set_pin_direction(hostmot2_t *hm2, int pin_number, u8 direction);
void sserial_module_init(llio_t *llio);
void hm2_set_pin_source(hostmot2_t *hm2, int pin_number, u8 source);
void hm2_set_pin_direction(hostmot2_t *hm2, int pin_number, u8 direction);
#endif