Lines Matching refs:handle
24 uint8_t spi_write_data(handle_t *handle, uint8_t *buffer, int length) in spi_write_data() argument
26 spi_handle_t *spi_handle = (spi_handle_t *)handle; in spi_write_data()
35 buffer[length] = checksum(handle, buffer, length); in spi_write_data()
43 uint8_t spi_write_cmd(handle_t *handle, uint8_t cmd) in spi_write_cmd() argument
45 spi_handle_t *spi_handle = (spi_handle_t *)handle; in spi_write_cmd()
66 uint8_t spi_read_data(handle_t *handle, uint8_t *data, int length) in spi_read_data() argument
68 spi_handle_t *spi_handle = (spi_handle_t *)handle; in spi_read_data()
94 uint8_t spi_read_ack(handle_t *handle) in spi_read_ack() argument
96 spi_handle_t *spi_handle = (spi_handle_t *)handle; in spi_read_ack()
129 uint8_t spi_sync(handle_t *handle) in spi_sync() argument
131 spi_handle_t *spi_handle = (spi_handle_t *)handle; in spi_sync()
145 return handle->read_ack(handle); in spi_sync()
150 int spi_init(handle_t *handle) in spi_init() argument
152 spi_handle_t *spi_handle = (spi_handle_t *)handle; in spi_init()
156 handle->cmd_erase = CMD_ERASE; in spi_init()
157 handle->cmd_read_memory = CMD_READ_MEMORY; in spi_init()
158 handle->cmd_write_memory = CMD_WRITE_MEMORY; in spi_init()
160 handle->no_extra_sync = 0; in spi_init()
162 handle->write_data = spi_write_data; in spi_init()
163 handle->write_cmd = spi_write_cmd; in spi_init()
164 handle->read_data = spi_read_data; in spi_init()
165 handle->read_ack = spi_read_ack; in spi_init()
185 if (spi_sync(handle) == CMD_ACK) in spi_init()