forked from auracaster/openocd
Add a check if i2c SDA pin state is HIGH. if its HIGH, the dev-board is ON, we receive number of Ack. in its LOW, the board is OFF, we send this information back to driver. Change-Id: Ia40d3910675cc10e0208d8bc0060a19c12b1409d Signed-off-by: Ahmed BOUDJELIDA <aboudjelida@nanoxplore.com> Reviewed-on: https://review.openocd.org/c/openocd/+/8716 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
31 lines
934 B
C
31 lines
934 B
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/****************************************************************************
|
|
File : i2c.h *
|
|
Contents : i2c bit-bang library *
|
|
Copyright 2023, Ahmed Errached BOUDJELIDA, NanoXplore SAS. *
|
|
<aboudjelida@nanoxplore.com> *
|
|
<ahmederrachedbjld@gmail.com> *
|
|
*****************************************************************************/
|
|
|
|
#ifndef __I2C_H
|
|
#define __I2C_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
|
|
bool get_status(void);
|
|
void start_cd(void);
|
|
void repeated_start(void);
|
|
void stop_cd(void);
|
|
void clock_cd(void);
|
|
void send_ack(void);
|
|
void send_nack(void);
|
|
bool get_ack(void);
|
|
|
|
uint8_t get_address(uint8_t adr, uint8_t rdwr);
|
|
|
|
void send_byte(uint8_t input);
|
|
uint8_t receive_byte(void);
|
|
#endif
|