contrib/firmware/angie: add dev-board power detection

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>
This commit is contained in:
Ahmed BOUDJELIDA
2024-12-12 10:27:14 +01:00
committed by Antonio Borneo
parent ceaa47a2aa
commit 9a150e326a
5 changed files with 44 additions and 30 deletions

View File

@@ -12,6 +12,19 @@
#include "delay.h"
#include "reg_ezusb.h"
bool get_status(void)
{
PIN_SDA_DIR = 1;
OEA = 0xF7;
delay_us(1);
bool sda_state = PIN_SDA;
PIN_T0 = sda_state;
delay_us(1);
OEA = 0xFF;
delay_us(1);
return sda_state;
}
void start_cd(void)
{
PIN_SDA_DIR = 0; // SP6 SDA: OUT