swieeprom
2.0.0.7
|
API for SWI master driver. More...
#include "stdint.h"
Go to the source code of this file.
Enumerations | |
enum | swi_return_value_t { SWI_RET_VAL_OK = 0, SWI_RET_VAL_ERROR = -1 } |
SWI driver return values data. More... | |
enum | swi_acknowledgement_t { SWI_ACK = 0, SWI_NACK = 1 } |
SWI driver acknowledgement values. More... | |
enum | swi_logic_lvl_t { SWI_LOGIC_0 = 0, SWI_LOGIC_1 = 1 } |
SWI driver logic values. More... | |
Functions | |
int8_t | swi_init (void) |
Initializes SWI communication. More... | |
int8_t | swi_reset (void) |
Resets device and checks devices response. More... | |
void | swi_start (void) |
Send start SWI signal. More... | |
void | swi_stop (void) |
Send stop SWI signal. More... | |
void | swi_logic_write (swi_logic_lvl_t logic_level) |
Send logic signal to device. More... | |
uint8_t | swi_logic_read (void) |
Receive logic signal from device. More... | |
uint8_t | swi_send_byte (uint8_t byte_to_send) |
Send byte to device. More... | |
void | swi_receive_byte (uint8_t *byte_to_receive, swi_acknowledgement_t ack_nack) |
Receive byte from device. More... | |
API for SWI master driver.
enum swi_logic_lvl_t |
enum swi_return_value_t |
int8_t swi_init | ( | void | ) |
Initializes SWI communication.
Initializes GPIO for data and SWI driver, restarts device, discovers device.
0
- Success, -1
- Error. uint8_t swi_logic_read | ( | void | ) |
Receive logic signal from device.
Sends signal for response and returns logic level.
0
- SWI_LOGIC_0, 1
- SWI_LOGIC_1. void swi_logic_write | ( | swi_logic_lvl_t | logic_level | ) |
Send logic signal to device.
Sends logic 0 or 1 relative to parameter logic_level.
[in] | logic_level | :
|
void swi_receive_byte | ( | uint8_t * | byte_to_receive, |
swi_acknowledgement_t | ack_nack | ||
) |
Receive byte from device.
Sample byte receive from device.
[out] | byte_to_receive | : Byte that received data will be stored in. |
[in] | ack_nack | :
|
int8_t swi_reset | ( | void | ) |
Resets device and checks devices response.
Resets device and sends discovery signal.
0
- Device found, -1
- No device. uint8_t swi_send_byte | ( | uint8_t | byte_to_send | ) |
Send byte to device.
Sends desired byte to device and check response.
[in] | byte_to_send | : Byte that will be sent. |
0
- SWI_ACK, 1
- SWI_NACK. void swi_start | ( | void | ) |
Send start SWI signal.
Sends to device signal for starting communication.
void swi_stop | ( | void | ) |
Send stop SWI signal.
Sends to device signal for stoping communication.