sd.h (0034ebe6ee3151e5c54fd13c6f441429bd2cdadf) sd.h (da34692234a03b6ffabd0b5b7864b423ac8eca56)
1/*
2 * SD Memory Card emulation. Mostly correct for MMC too.
3 *
4 * Copyright (c) 2006 Andrzej Zaborowski <balrog@zabor.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 89 unchanged lines hidden (view full) ---

98 DeviceClass parent_class;
99 /*< public >*/
100
101 int (*do_command)(SDState *sd, SDRequest *req, uint8_t *response);
102 void (*write_data)(SDState *sd, uint8_t value);
103 uint8_t (*read_data)(SDState *sd);
104 bool (*data_ready)(SDState *sd);
105 void (*set_voltage)(SDState *sd, uint16_t millivolts);
1/*
2 * SD Memory Card emulation. Mostly correct for MMC too.
3 *
4 * Copyright (c) 2006 Andrzej Zaborowski <balrog@zabor.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 89 unchanged lines hidden (view full) ---

98 DeviceClass parent_class;
99 /*< public >*/
100
101 int (*do_command)(SDState *sd, SDRequest *req, uint8_t *response);
102 void (*write_data)(SDState *sd, uint8_t value);
103 uint8_t (*read_data)(SDState *sd);
104 bool (*data_ready)(SDState *sd);
105 void (*set_voltage)(SDState *sd, uint16_t millivolts);
106 uint8_t (*get_dat_lines)(SDState *sd);
107 bool (*get_cmd_line)(SDState *sd);
106 void (*enable)(SDState *sd, bool enable);
107 bool (*get_inserted)(SDState *sd);
108 bool (*get_readonly)(SDState *sd);
109} SDCardClass;
110
111#define TYPE_SD_BUS "sd-bus"
112#define SD_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_SD_BUS)
113#define SD_BUS_CLASS(klass) OBJECT_CLASS_CHECK(SDBusClass, (klass), TYPE_SD_BUS)

--- 31 unchanged lines hidden (view full) ---

145 * second slot is always empty).
146 */
147void sd_enable(SDState *sd, bool enable);
148
149/* Functions to be used by qdevified callers (working via
150 * an SDBus rather than directly with SDState)
151 */
152void sdbus_set_voltage(SDBus *sdbus, uint16_t millivolts);
108 void (*enable)(SDState *sd, bool enable);
109 bool (*get_inserted)(SDState *sd);
110 bool (*get_readonly)(SDState *sd);
111} SDCardClass;
112
113#define TYPE_SD_BUS "sd-bus"
114#define SD_BUS(obj) OBJECT_CHECK(SDBus, (obj), TYPE_SD_BUS)
115#define SD_BUS_CLASS(klass) OBJECT_CLASS_CHECK(SDBusClass, (klass), TYPE_SD_BUS)

--- 31 unchanged lines hidden (view full) ---

147 * second slot is always empty).
148 */
149void sd_enable(SDState *sd, bool enable);
150
151/* Functions to be used by qdevified callers (working via
152 * an SDBus rather than directly with SDState)
153 */
154void sdbus_set_voltage(SDBus *sdbus, uint16_t millivolts);
155uint8_t sdbus_get_dat_lines(SDBus *sdbus);
156bool sdbus_get_cmd_line(SDBus *sdbus);
153int sdbus_do_command(SDBus *sd, SDRequest *req, uint8_t *response);
154void sdbus_write_data(SDBus *sd, uint8_t value);
155uint8_t sdbus_read_data(SDBus *sd);
156bool sdbus_data_ready(SDBus *sd);
157bool sdbus_get_inserted(SDBus *sd);
158bool sdbus_get_readonly(SDBus *sd);
159/**
160 * sdbus_reparent_card: Reparent an SD card from one controller to another

--- 15 unchanged lines hidden ---
157int sdbus_do_command(SDBus *sd, SDRequest *req, uint8_t *response);
158void sdbus_write_data(SDBus *sd, uint8_t value);
159uint8_t sdbus_read_data(SDBus *sd);
160bool sdbus_data_ready(SDBus *sd);
161bool sdbus_get_inserted(SDBus *sd);
162bool sdbus_get_readonly(SDBus *sd);
163/**
164 * sdbus_reparent_card: Reparent an SD card from one controller to another

--- 15 unchanged lines hidden ---