Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
i2c_abuse_test.c File Reference

Total I2C Abuse: More...

#include "i2c_abuse_test.h"
#include "led.h"
#include "mcu_periph/i2c.h"
+ Include dependency graph for i2c_abuse_test.c:

Go to the source code of this file.

Functions

void init_i2c_abuse_test (void)
 
static void i2c_abuse_send_transaction (uint8_t _init)
 
void event_i2c_abuse_test (void)
 
void periodic_50Hz_i2c_abuse_test (void)
 

Variables

struct i2c_transaction i2c_test1
 
struct i2c_transaction i2c_test2
 
volatile uint8_t i2c_abuse_test_counter = 0
 
volatile uint32_t i2c_abuse_test_bitrate = 1000
 

Detailed Description

Total I2C Abuse:

-all transaction types: T1 T2 T3 T4 R1 R2 R3 R4 T1R1 T2R1 T1R2 T1R3 T1R4 T1R5 T2R5 -all bitrates: 1k (way too slow) to 1M (way to fast) -occasional Short circuit (simulate bus capacitance or EMI errors) -variable bus load: from empty to full stack

-Connect LED to MosFet that pulls-down the SCL and SDA lines

Definition in file i2c_abuse_test.c.

Function Documentation

◆ event_i2c_abuse_test()

◆ i2c_abuse_send_transaction()

static void i2c_abuse_send_transaction ( uint8_t  _init)
static

Definition at line 60 of file i2c_abuse_test.c.

References i2c_transaction::buf, i2c_submit(), i2c_test1, I2CTransRx, I2CTransTx, I2CTransTxRx, i2c_transaction::len_r, i2c_transaction::len_w, i2c_transaction::slave_addr, and i2c_transaction::type.

Referenced by event_i2c_abuse_test().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_i2c_abuse_test()

◆ periodic_50Hz_i2c_abuse_test()

void periodic_50Hz_i2c_abuse_test ( void  )

Definition at line 226 of file i2c_abuse_test.c.

Variable Documentation

◆ i2c_abuse_test_bitrate

volatile uint32_t i2c_abuse_test_bitrate = 1000

Definition at line 43 of file i2c_abuse_test.c.

Referenced by event_i2c_abuse_test(), and init_i2c_abuse_test().

◆ i2c_abuse_test_counter

volatile uint8_t i2c_abuse_test_counter = 0

Definition at line 42 of file i2c_abuse_test.c.

Referenced by event_i2c_abuse_test(), and init_i2c_abuse_test().

◆ i2c_test1

struct i2c_transaction i2c_test1

◆ i2c_test2

struct i2c_transaction i2c_test2

Definition at line 1 of file i2c_abuse_test.c.

Referenced by event_i2c_abuse_test(), and init_i2c_abuse_test().