Commit bc24a225 authored by Paul Brook's avatar Paul Brook
Browse files

Follow coding conventions



Remove explicit struct qualifiers and rename structure types.
Signed-off-by: default avatarPaul Brook <paul@codesourcery.com>
parent d4ec5228
......@@ -35,7 +35,7 @@ void kbd_put_keycode(int keycode);
void kbd_mouse_event(int dx, int dy, int dz, int buttons_state);
int kbd_mouse_is_absolute(void);
struct mouse_transform_info_s {
struct MouseTransformInfo {
/* Touchscreen resolution */
int x;
int y;
......
......@@ -11,7 +11,7 @@
#include "devices.h"
#include "console.h"
struct ads7846_state_s {
struct ADS7846State {
qemu_irq interrupt;
int input[8];
......@@ -46,7 +46,7 @@ struct ads7846_state_s {
#define ADS_Z1POS(x, y) 600
#define ADS_Z2POS(x, y) (600 + 6000 / ADS_XPOS(x, y))
static void ads7846_int_update(struct ads7846_state_s *s)
static void ads7846_int_update(ADS7846State *s)
{
if (s->interrupt)
qemu_set_irq(s->interrupt, s->pressure == 0);
......@@ -54,14 +54,14 @@ static void ads7846_int_update(struct ads7846_state_s *s)
uint32_t ads7846_read(void *opaque)
{
struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
ADS7846State *s = (ADS7846State *) opaque;
return s->output;
}
void ads7846_write(void *opaque, uint32_t value)
{
struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
ADS7846State *s = (ADS7846State *) opaque;
switch (s->cycle ++) {
case 0:
......@@ -94,7 +94,7 @@ void ads7846_write(void *opaque, uint32_t value)
static void ads7846_ts_event(void *opaque,
int x, int y, int z, int buttons_state)
{
struct ads7846_state_s *s = opaque;
ADS7846State *s = opaque;
if (buttons_state) {
x = 0x7fff - x;
......@@ -113,7 +113,7 @@ static void ads7846_ts_event(void *opaque,
static void ads7846_save(QEMUFile *f, void *opaque)
{
struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
ADS7846State *s = (ADS7846State *) opaque;
int i;
for (i = 0; i < 8; i ++)
......@@ -125,7 +125,7 @@ static void ads7846_save(QEMUFile *f, void *opaque)
static int ads7846_load(QEMUFile *f, void *opaque, int version_id)
{
struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
ADS7846State *s = (ADS7846State *) opaque;
int i;
for (i = 0; i < 8; i ++)
......@@ -140,12 +140,12 @@ static int ads7846_load(QEMUFile *f, void *opaque, int version_id)
return 0;
}
struct ads7846_state_s *ads7846_init(qemu_irq penirq)
ADS7846State *ads7846_init(qemu_irq penirq)
{
struct ads7846_state_s *s;
s = (struct ads7846_state_s *)
qemu_mallocz(sizeof(struct ads7846_state_s));
memset(s, 0, sizeof(struct ads7846_state_s));
ADS7846State *s;
s = (ADS7846State *)
qemu_mallocz(sizeof(ADS7846State));
memset(s, 0, sizeof(ADS7846State));
s->interrupt = penirq;
......
......@@ -37,7 +37,7 @@
struct nand_state_t
{
struct nand_flash_s *nand;
NANDFlashState *nand;
unsigned int rdy:1;
unsigned int ale:1;
unsigned int cle:1;
......
......@@ -28,7 +28,7 @@
typedef void (*blizzard_fn_t)(uint8_t *, const uint8_t *, unsigned int);
struct blizzard_s {
typedef struct {
uint8_t reg;
uint32_t addr;
int swallow;
......@@ -120,7 +120,7 @@ struct blizzard_s {
int pitch;
blizzard_fn_t line_fn;
} data;
};
} BlizzardState;
/* Bytes(!) per pixel */
static const int blizzard_iformat_bpp[0x10] = {
......@@ -144,7 +144,7 @@ static inline void blizzard_rgb2yuv(int r, int g, int b,
*v = 0x80 + ((0xe0e * r - 0x0bc7 * g - 0x247 * b) >> 13);
}
static void blizzard_window(struct blizzard_s *s)
static void blizzard_window(BlizzardState *s)
{
uint8_t *src, *dst;
int bypp[2];
......@@ -175,7 +175,7 @@ static void blizzard_window(struct blizzard_s *s)
fn(dst, src, bypl[2]);
}
static int blizzard_transfer_setup(struct blizzard_s *s)
static int blizzard_transfer_setup(BlizzardState *s)
{
if (s->source > 3 || !s->bpp ||
s->ix[1] < s->ix[0] || s->iy[1] < s->iy[0])
......@@ -199,7 +199,7 @@ static int blizzard_transfer_setup(struct blizzard_s *s)
return 1;
}
static void blizzard_reset(struct blizzard_s *s)
static void blizzard_reset(BlizzardState *s)
{
s->reg = 0;
s->swallow = 0;
......@@ -280,14 +280,14 @@ static void blizzard_reset(struct blizzard_s *s)
}
static inline void blizzard_invalidate_display(void *opaque) {
struct blizzard_s *s = (struct blizzard_s *) opaque;
BlizzardState *s = (BlizzardState *) opaque;
s->invalidate = 1;
}
static uint16_t blizzard_reg_read(void *opaque, uint8_t reg)
{
struct blizzard_s *s = (struct blizzard_s *) opaque;
BlizzardState *s = (BlizzardState *) opaque;
switch (reg) {
case 0x00: /* Revision Code */
......@@ -490,7 +490,7 @@ static uint16_t blizzard_reg_read(void *opaque, uint8_t reg)
static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value)
{
struct blizzard_s *s = (struct blizzard_s *) opaque;
BlizzardState *s = (BlizzardState *) opaque;
switch (reg) {
case 0x04: /* PLL M-Divider */
......@@ -831,7 +831,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value)
uint16_t s1d13745_read(void *opaque, int dc)
{
struct blizzard_s *s = (struct blizzard_s *) opaque;
BlizzardState *s = (BlizzardState *) opaque;
uint16_t value = blizzard_reg_read(s, s->reg);
if (s->swallow -- > 0)
......@@ -844,7 +844,7 @@ uint16_t s1d13745_read(void *opaque, int dc)
void s1d13745_write(void *opaque, int dc, uint16_t value)
{
struct blizzard_s *s = (struct blizzard_s *) opaque;
BlizzardState *s = (BlizzardState *) opaque;
if (s->swallow -- > 0)
return;
......@@ -860,7 +860,7 @@ void s1d13745_write(void *opaque, int dc, uint16_t value)
void s1d13745_write_block(void *opaque, int dc,
void *buf, size_t len, int pitch)
{
struct blizzard_s *s = (struct blizzard_s *) opaque;
BlizzardState *s = (BlizzardState *) opaque;
while (len > 0) {
if (s->reg == 0x90 && dc &&
......@@ -886,7 +886,7 @@ void s1d13745_write_block(void *opaque, int dc,
static void blizzard_update_display(void *opaque)
{
struct blizzard_s *s = (struct blizzard_s *) opaque;
BlizzardState *s = (BlizzardState *) opaque;
int y, bypp, bypl, bwidth;
uint8_t *src, *dst;
......@@ -935,7 +935,7 @@ static void blizzard_update_display(void *opaque)
}
static void blizzard_screen_dump(void *opaque, const char *filename) {
struct blizzard_s *s = (struct blizzard_s *) opaque;
BlizzardState *s = (BlizzardState *) opaque;
blizzard_update_display(opaque);
if (s && ds_get_data(s->state))
......@@ -955,7 +955,7 @@ static void blizzard_screen_dump(void *opaque, const char *filename) {
void *s1d13745_init(qemu_irq gpio_int)
{
struct blizzard_s *s = (struct blizzard_s *) qemu_mallocz(sizeof(*s));
BlizzardState *s = (BlizzardState *) qemu_mallocz(sizeof(*s));
s->fb = qemu_malloc(0x180000);
......
......@@ -28,9 +28,14 @@
//#define DEBUG
struct cbus_slave_s;
struct cbus_priv_s {
struct cbus_s cbus;
typedef struct {
void *opaque;
void (*io)(void *opaque, int rw, int reg, uint16_t *val);
int addr;
} CBusSlave;
typedef struct {
CBus cbus;
int sel;
int dat;
......@@ -48,16 +53,10 @@ struct cbus_priv_s {
cbus_value,
} cycle;
struct cbus_slave_s *slave[8];
};
struct cbus_slave_s {
void *opaque;
void (*io)(void *opaque, int rw, int reg, uint16_t *val);
int addr;
};
CBusSlave *slave[8];
} CBusPriv;
static void cbus_io(struct cbus_priv_s *s)
static void cbus_io(CBusPriv *s)
{
if (s->slave[s->addr])
s->slave[s->addr]->io(s->slave[s->addr]->opaque,
......@@ -66,7 +65,7 @@ static void cbus_io(struct cbus_priv_s *s)
hw_error("%s: bad slave address %i\n", __FUNCTION__, s->addr);
}
static void cbus_cycle(struct cbus_priv_s *s)
static void cbus_cycle(CBusPriv *s)
{
switch (s->cycle) {
case cbus_address:
......@@ -97,7 +96,7 @@ static void cbus_cycle(struct cbus_priv_s *s)
static void cbus_clk(void *opaque, int line, int level)
{
struct cbus_priv_s *s = (struct cbus_priv_s *) opaque;
CBusPriv *s = (CBusPriv *) opaque;
if (!s->sel && level && !s->clk) {
if (s->dir)
......@@ -114,14 +113,14 @@ static void cbus_clk(void *opaque, int line, int level)
static void cbus_dat(void *opaque, int line, int level)
{
struct cbus_priv_s *s = (struct cbus_priv_s *) opaque;
CBusPriv *s = (CBusPriv *) opaque;
s->dat = level;
}
static void cbus_sel(void *opaque, int line, int level)
{
struct cbus_priv_s *s = (struct cbus_priv_s *) opaque;
CBusPriv *s = (CBusPriv *) opaque;
if (!level) {
s->dir = 1;
......@@ -132,9 +131,9 @@ static void cbus_sel(void *opaque, int line, int level)
s->sel = level;
}
struct cbus_s *cbus_init(qemu_irq dat)
CBus *cbus_init(qemu_irq dat)
{
struct cbus_priv_s *s = (struct cbus_priv_s *) qemu_mallocz(sizeof(*s));
CBusPriv *s = (CBusPriv *) qemu_mallocz(sizeof(*s));
s->dat_out = dat;
s->cbus.clk = qemu_allocate_irqs(cbus_clk, s, 1)[0];
......@@ -148,16 +147,16 @@ struct cbus_s *cbus_init(qemu_irq dat)
return &s->cbus;
}
void cbus_attach(struct cbus_s *bus, void *slave_opaque)
void cbus_attach(CBus *bus, void *slave_opaque)
{
struct cbus_slave_s *slave = (struct cbus_slave_s *) slave_opaque;
struct cbus_priv_s *s = (struct cbus_priv_s *) bus;
CBusSlave *slave = (CBusSlave *) slave_opaque;
CBusPriv *s = (CBusPriv *) bus;
s->slave[slave->addr] = slave;
}
/* Retu/Vilma */
struct cbus_retu_s {
typedef struct {
uint16_t irqst;
uint16_t irqen;
uint16_t cc[2];
......@@ -172,10 +171,10 @@ struct cbus_retu_s {
int is_vilma;
qemu_irq irq;
struct cbus_slave_s cbus;
};
CBusSlave cbus;
} CBusRetu;
static void retu_interrupt_update(struct cbus_retu_s *s)
static void retu_interrupt_update(CBusRetu *s)
{
qemu_set_irq(s->irq, s->irqst & ~s->irqen);
}
......@@ -237,7 +236,7 @@ enum {
retu_adc_self_temp = 13, /* RETU temperature */
};
static inline uint16_t retu_read(struct cbus_retu_s *s, int reg)
static inline uint16_t retu_read(CBusRetu *s, int reg)
{
#ifdef DEBUG
printf("RETU read at %02x\n", reg);
......@@ -304,7 +303,7 @@ static inline uint16_t retu_read(struct cbus_retu_s *s, int reg)
}
}
static inline void retu_write(struct cbus_retu_s *s, int reg, uint16_t val)
static inline void retu_write(CBusRetu *s, int reg, uint16_t val)
{
#ifdef DEBUG
printf("RETU write of %04x at %02x\n", val, reg);
......@@ -379,7 +378,7 @@ static inline void retu_write(struct cbus_retu_s *s, int reg, uint16_t val)
static void retu_io(void *opaque, int rw, int reg, uint16_t *val)
{
struct cbus_retu_s *s = (struct cbus_retu_s *) opaque;
CBusRetu *s = (CBusRetu *) opaque;
if (rw)
*val = retu_read(s, reg);
......@@ -389,7 +388,7 @@ static void retu_io(void *opaque, int rw, int reg, uint16_t *val)
void *retu_init(qemu_irq irq, int vilma)
{
struct cbus_retu_s *s = (struct cbus_retu_s *) qemu_mallocz(sizeof(*s));
CBusRetu *s = (CBusRetu *) qemu_mallocz(sizeof(*s));
s->irq = irq;
s->irqen = 0xffff;
......@@ -419,8 +418,8 @@ void *retu_init(qemu_irq irq, int vilma)
void retu_key_event(void *retu, int state)
{
struct cbus_slave_s *slave = (struct cbus_slave_s *) retu;
struct cbus_retu_s *s = (struct cbus_retu_s *) slave->opaque;
CBusSlave *slave = (CBusSlave *) retu;
CBusRetu *s = (CBusRetu *) slave->opaque;
s->irqst |= 1 << retu_int_pwr;
retu_interrupt_update(s);
......@@ -434,8 +433,8 @@ void retu_key_event(void *retu, int state)
#if 0
static void retu_head_event(void *retu, int state)
{
struct cbus_slave_s *slave = (struct cbus_slave_s *) retu;
struct cbus_retu_s *s = (struct cbus_retu_s *) slave->opaque;
CBusSlave *slave = (CBusSlave *) retu;
CBusRetu *s = (CBusRetu *) slave->opaque;
if ((s->cc[0] & 0x500) == 0x500) { /* TODO: Which bits? */
/* TODO: reissue the interrupt every 100ms or so. */
......@@ -451,8 +450,8 @@ static void retu_head_event(void *retu, int state)
static void retu_hook_event(void *retu, int state)
{
struct cbus_slave_s *slave = (struct cbus_slave_s *) retu;
struct cbus_retu_s *s = (struct cbus_retu_s *) slave->opaque;
CBusSlave *slave = (CBusSlave *) retu;
CBusRetu *s = (CBusRetu *) slave->opaque;
if ((s->cc[0] & 0x500) == 0x500) {
/* TODO: reissue the interrupt every 100ms or so. */
......@@ -468,7 +467,7 @@ static void retu_hook_event(void *retu, int state)
#endif
/* Tahvo/Betty */
struct cbus_tahvo_s {
typedef struct {
uint16_t irqst;
uint16_t irqen;
uint8_t charger;
......@@ -478,10 +477,10 @@ struct cbus_tahvo_s {
int is_betty;
qemu_irq irq;
struct cbus_slave_s cbus;
};
CBusSlave cbus;
} CBusTahvo;
static void tahvo_interrupt_update(struct cbus_tahvo_s *s)
static void tahvo_interrupt_update(CBusTahvo *s)
{
qemu_set_irq(s->irq, s->irqst & ~s->irqen);
}
......@@ -501,7 +500,7 @@ static void tahvo_interrupt_update(struct cbus_tahvo_s *s)
#define TAHVO_REG_NOPR 0x0c /* (RW) Number of periods */
#define TAHVO_REG_FRR 0x0d /* (RO) FR */
static inline uint16_t tahvo_read(struct cbus_tahvo_s *s, int reg)
static inline uint16_t tahvo_read(CBusTahvo *s, int reg)
{
#ifdef DEBUG
printf("TAHVO read at %02x\n", reg);
......@@ -543,7 +542,7 @@ static inline uint16_t tahvo_read(struct cbus_tahvo_s *s, int reg)
}
}
static inline void tahvo_write(struct cbus_tahvo_s *s, int reg, uint16_t val)
static inline void tahvo_write(CBusTahvo *s, int reg, uint16_t val)
{
#ifdef DEBUG
printf("TAHVO write of %04x at %02x\n", val, reg);
......@@ -595,7 +594,7 @@ static inline void tahvo_write(struct cbus_tahvo_s *s, int reg, uint16_t val)
static void tahvo_io(void *opaque, int rw, int reg, uint16_t *val)
{
struct cbus_tahvo_s *s = (struct cbus_tahvo_s *) opaque;
CBusTahvo *s = (CBusTahvo *) opaque;
if (rw)
*val = tahvo_read(s, reg);
......@@ -605,7 +604,7 @@ static void tahvo_io(void *opaque, int rw, int reg, uint16_t *val)
void *tahvo_init(qemu_irq irq, int betty)
{
struct cbus_tahvo_s *s = (struct cbus_tahvo_s *) qemu_mallocz(sizeof(*s));
CBusTahvo *s = (CBusTahvo *) qemu_mallocz(sizeof(*s));
s->irq = irq;
s->irqen = 0xffff;
......
......@@ -11,27 +11,25 @@ int ssd0323_xfer_ssi(void *opaque, int data);
void *ssd0323_init(qemu_irq *cmd_p);
/* ads7846.c */
struct ads7846_state_s;
typedef struct ADS7846State ADS7846State;
uint32_t ads7846_read(void *opaque);
void ads7846_write(void *opaque, uint32_t value);
struct ads7846_state_s *ads7846_init(qemu_irq penirq);
ADS7846State *ads7846_init(qemu_irq penirq);
/* tsc210x.c */
struct uwire_slave_s;
struct mouse_transform_info_s;
struct uwire_slave_s *tsc2102_init(qemu_irq pint, AudioState *audio);
struct uwire_slave_s *tsc2301_init(qemu_irq penirq, qemu_irq kbirq,
uWireSlave *tsc2102_init(qemu_irq pint, AudioState *audio);
uWireSlave *tsc2301_init(qemu_irq penirq, qemu_irq kbirq,
qemu_irq dav, AudioState *audio);
struct i2s_codec_s *tsc210x_codec(struct uwire_slave_s *chip);
I2SCodec *tsc210x_codec(uWireSlave *chip);
uint32_t tsc210x_txrx(void *opaque, uint32_t value, int len);
void tsc210x_set_transform(struct uwire_slave_s *chip,
struct mouse_transform_info_s *info);
void tsc210x_key_event(struct uwire_slave_s *chip, int key, int down);
void tsc210x_set_transform(uWireSlave *chip,
MouseTransformInfo *info);
void tsc210x_key_event(uWireSlave *chip, int key, int down);
/* tsc2005.c */
void *tsc2005_init(qemu_irq pintdav);
uint32_t tsc2005_txrx(void *opaque, uint32_t value, int len);
void tsc2005_set_transform(void *opaque, struct mouse_transform_info_s *info);
void tsc2005_set_transform(void *opaque, MouseTransformInfo *info);
/* stellaris_input.c */
void stellaris_gamepad_init(int n, qemu_irq *irq, const int *keycode);
......@@ -44,13 +42,13 @@ void s1d13745_write_block(void *opaque, int dc,
uint16_t s1d13745_read(void *opaque, int dc);
/* cbus.c */
struct cbus_s {
typedef struct {
qemu_irq clk;
qemu_irq dat;
qemu_irq sel;
};
struct cbus_s *cbus_init(qemu_irq dat_out);
void cbus_attach(struct cbus_s *bus, void *slave_opaque);
} CBus;
CBus *cbus_init(qemu_irq dat_out);
void cbus_attach(CBus *bus, void *slave_opaque);
void *retu_init(qemu_irq irq, int vilma);
void *tahvo_init(qemu_irq irq, int betty);
......@@ -58,20 +56,20 @@ void *tahvo_init(qemu_irq irq, int betty);
void retu_key_event(void *retu, int state);
/* tusb6010.c */
struct tusb_s;
struct tusb_s *tusb6010_init(qemu_irq intr);
int tusb6010_sync_io(struct tusb_s *s);
int tusb6010_async_io(struct tusb_s *s);
void tusb6010_power(struct tusb_s *s, int on);
typedef struct TUSBState TUSBState;
TUSBState *tusb6010_init(qemu_irq intr);
int tusb6010_sync_io(TUSBState *s);
int tusb6010_async_io(TUSBState *s);
void tusb6010_power(TUSBState *s, int on);
/* tc6393xb.c */
struct tc6393xb_s;
typedef struct TC6393xbState TC6393xbState;
#define TC6393XB_RAM 0x110000 /* amount of ram for Video and USB */
struct tc6393xb_s *tc6393xb_init(uint32_t base, qemu_irq irq);
void tc6393xb_gpio_out_set(struct tc6393xb_s *s, int line,
TC6393xbState *tc6393xb_init(uint32_t base, qemu_irq irq);
void tc6393xb_gpio_out_set(TC6393xbState *s, int line,
qemu_irq handler);
qemu_irq *tc6393xb_gpio_in_get(struct tc6393xb_s *s);
qemu_irq tc6393xb_l3v_get(struct tc6393xb_s *s);
qemu_irq *tc6393xb_gpio_in_get(TC6393xbState *s);
qemu_irq tc6393xb_l3v_get(TC6393xbState *s);
/* sm501.c */
void sm501_init(uint32_t base, uint32_t local_mem_bytes, qemu_irq irq,
......
......@@ -50,7 +50,7 @@ static const uint8_t nand_ecc_precalc_table[] = {
};
/* Update ECC parity count. */
uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample)
uint8_t ecc_digest(ECCState *s, uint8_t sample)
{
uint8_t idx = nand_ecc_precalc_table[sample];
......@@ -65,7 +65,7 @@ uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample)
}
/* Reinitialise the counters. */
void ecc_reset(struct ecc_state_s *s)
void ecc_reset(ECCState *s)
{
s->lp[0] = 0x0000;
s->lp[1] = 0x0000;
......@@ -74,7 +74,7 @@ void ecc_reset(struct ecc_state_s *s)
}
/* Save/restore */
void ecc_put(QEMUFile *f, struct ecc_state_s *s)
void ecc_put(QEMUFile *f, ECCState *s)
{
qemu_put_8s(f, &s->cp);
qemu_put_be16s(f, &s->lp[0]);
......@@ -82,7 +82,7 @@ void ecc_put(QEMUFile *f, struct ecc_state_s *s)
qemu_put_be16s(f, &s->count);
}
void ecc_get(QEMUFile *f, struct ecc_state_s *s)
void ecc_get(QEMUFile *f, ECCState *s)
{
qemu_get_8s(f, &s->cp);
qemu_get_be16s(f, &s->lp[0]);
......
......@@ -17,14 +17,14 @@ pflash_t *pflash_cfi02_register(target_phys_addr_t base, ram_addr_t off,
uint16_t unlock_addr0, uint16_t unlock_addr1);
/* nand.c */
struct nand_flash_s;
struct nand_flash_s *nand_init(int manf_id, int chip_id);
void nand_done(struct nand_flash_s *s);
void nand_setpins(struct nand_flash_s *s,
typedef struct NANDFlashState NANDFlashState;
NANDFlashState *nand_init(int manf_id, int chip_id);
void nand_done(NANDFlashState *s);
void nand_setpins(NANDFlashState *s,
int cle, int ale, int ce, int wp, int gnd);
void nand_getpins(struct nand_flash_s *s, int *rb);
void nand_setio(struct nand_flash_s *s, uint8_t value);
uint8_t nand_getio(struct nand_flash_s *s);
void nand_getpins(NANDFlashState *s, int *rb);
void nand_setio(NANDFlashState *s, uint8_t value);
uint8_t nand_getio(NANDFlashState *s);
#define NAND_MFR_TOSHIBA 0x98
#define NAND_MFR_SAMSUNG 0xec
......@@ -42,13 +42,13 @@ void *onenand_init(uint32_t id, int regshift, qemu_irq irq);
void *onenand_raw_otp(void *opaque);
/* ecc.c */
struct ecc_state_s {
typedef struct {
uint8_t cp; /* Column parity */
uint16_t lp[2]; /* Line parity */
uint16_t count;
};
} ECCState;
uint8_t ecc_digest(struct ecc_state_s *s, uint8_t sample);