Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "mcu_periph/i2c.h"
#include <BOARD_CONFIG>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/cm3/nvic.h>
#include <libopencm3/cm3/scb.h>
#include "mcu_periph/gpio.h"
#include "mcu_periph/sys_time.h"
Go to the source code of this file.
Macros | |
#define | I2C_SR1_ERR_MASK |
#define | BIT_X_IS_SET_IN_REG(X, REG) (((REG) & (X)) == (X)) |
#define | __I2C_REG_CRITICAL_ZONE_START __disable_irq(); |
#define | __I2C_REG_CRITICAL_ZONE_STOP __enable_irq(); |
#define | NVIC_I2C1_IRQ_PRIO 0 |
#define | NVIC_I2C2_IRQ_PRIO 0 |
#define | NVIC_I2C3_IRQ_PRIO 0 |
#define | WD_DELAY 20 |
#define | WD_RECOVERY_TICKS 18 |
Enumerations | |
enum | STMI2CSubTransactionStatus { STMI2C_SubTra_Busy, STMI2C_SubTra_Ready_StopRequested, STMI2C_SubTra_Ready, STMI2C_SubTra_Error } |
Handling of I2C hardware for STM32.
Definition in file i2c_arch.c.
#define __I2C_REG_CRITICAL_ZONE_START __disable_irq(); |
Definition at line 71 of file i2c_arch.c.
#define __I2C_REG_CRITICAL_ZONE_STOP __enable_irq(); |
Definition at line 72 of file i2c_arch.c.
#define BIT_X_IS_SET_IN_REG | ( | X, | |
REG | |||
) | (((REG) & (X)) == (X)) |
Definition at line 62 of file i2c_arch.c.
#define I2C_SR1_ERR_MASK |
Definition at line 52 of file i2c_arch.c.
#define NVIC_I2C1_IRQ_PRIO 0 |
Definition at line 76 of file i2c_arch.c.
#define NVIC_I2C2_IRQ_PRIO 0 |
Definition at line 77 of file i2c_arch.c.
#define NVIC_I2C3_IRQ_PRIO 0 |
Definition at line 78 of file i2c_arch.c.
#define WD_DELAY 20 |
Definition at line 1155 of file i2c_arch.c.
#define WD_RECOVERY_TICKS 18 |
Definition at line 1156 of file i2c_arch.c.
Enumerator | |
---|---|
STMI2C_SubTra_Busy | |
STMI2C_SubTra_Ready_StopRequested | |
STMI2C_SubTra_Ready | |
STMI2C_SubTra_Error |
Definition at line 211 of file i2c_arch.c.
|
inlinestatic |
Definition at line 66 of file i2c_arch.c.
Referenced by i2c_stm32_setbitrate(), i2c_stm32_submit(), and mcu_deep_sleep().
|
inlinestatic |
Definition at line 67 of file i2c_arch.c.
Referenced by i2c_stm32_setbitrate(), i2c_stm32_submit(), and mcu_deep_sleep().
|
inlinestatic |
Definition at line 527 of file i2c_arch.c.
References i2c_errors::ack_fail_cnt, i2c_errors::arb_lost_cnt, i2c_errors::er_irq_cnt, i2c_periph::errors, i2c_errors::miss_start_stop_cnt, i2c_errors::over_under_cnt, i2c_errors::pec_recep_cnt, i2c_periph::reg_addr, i2c_errors::smbus_alert_cnt, and i2c_errors::timeout_tlow_cnt.
Referenced by i2c_irq().
|
inlinestatic |
Definition at line 600 of file i2c_arch.c.
References i2c_periph::errors, i2c_error(), I2C_SR1_ERR_MASK, I2C_TRANSACTION_QUEUE_LEN, I2CFailed, I2CIdle, I2CStartRequested, I2CTransFailed, I2CTransRx, I2CTransTxRx, if(), i2c_errors::last_unexpected_event, i2c_transaction::len_r, PPRZ_I2C_SEND_START(), PPRZ_I2C_SEND_STOP(), i2c_periph::reg_addr, i2c_transaction::status, i2c_periph::status, stmi2c_clear_pending_interrupts(), stmi2c_read1(), stmi2c_read2(), stmi2c_readmany(), stmi2c_send(), STMI2C_SubTra_Busy, STMI2C_SubTra_Error, STMI2C_SubTra_Ready, i2c_periph::trans, i2c_periph::trans_extract_idx, i2c_periph::trans_insert_idx, i2c_transaction::type, i2c_errors::unexpected_event_cnt, and i2c_periph::watchdog.
|
static |
Definition at line 1366 of file i2c_arch.c.
References BIT_X_IS_SET_IN_REG, I2CIdle, if(), i2c_periph::reg_addr, and i2c_periph::status.
|
static |
Definition at line 1071 of file i2c_arch.c.
References __disable_irq(), __enable_irq(), i2c_idle(), if(), and i2c_periph::reg_addr.
|
static |
Definition at line 1329 of file i2c_arch.c.
References __disable_irq(), __enable_irq(), i2c_periph::errors, I2C_TRANSACTION_QUEUE_LEN, I2CIdle, I2CTransFailed, I2CTransPending, PPRZ_I2C_SEND_START(), i2c_errors::queue_full_cnt, i2c_transaction::status, i2c_periph::status, i2c_periph::trans, i2c_periph::trans_extract_idx, i2c_periph::trans_insert_idx, i2c_periph::watchdog, and WD_DELAY.
|
inlinestatic |
Definition at line 180 of file i2c_arch.c.
References I2CStartRequested, i2c_periph::idx_buf, i2c_periph::reg_addr, i2c_periph::status, and i2c_periph::watchdog.
Referenced by i2c_irq(), and i2c_stm32_submit().
|
inlinestatic |
Definition at line 172 of file i2c_arch.c.
Referenced by i2c_irq(), stmi2c_read1(), stmi2c_read2(), and stmi2c_readmany().
|
inlinestatic |
Definition at line 563 of file i2c_arch.c.
References BIT_X_IS_SET_IN_REG.
Referenced by i2c_irq().
|
inlinestatic |
Definition at line 292 of file i2c_arch.c.
References __I2C_REG_CRITICAL_ZONE_START, __I2C_REG_CRITICAL_ZONE_STOP, BIT_X_IS_SET_IN_REG, i2c_transaction::buf, I2CAddrRdSent, I2CReadingLastByte, I2CStopRequested, I2CTransSuccess, PPRZ_I2C_SEND_STOP(), i2c_transaction::slave_addr, i2c_transaction::status, i2c_periph::status, STMI2C_SubTra_Busy, STMI2C_SubTra_Error, and STMI2C_SubTra_Ready_StopRequested.
Referenced by i2c_irq().
|
inlinestatic |
Definition at line 351 of file i2c_arch.c.
References __I2C_REG_CRITICAL_ZONE_START, __I2C_REG_CRITICAL_ZONE_STOP, BIT_X_IS_SET_IN_REG, i2c_transaction::buf, I2CAddrRdSent, I2CReadingByte, I2CStopRequested, I2CTransSuccess, PPRZ_I2C_SEND_STOP(), i2c_transaction::slave_addr, i2c_transaction::status, i2c_periph::status, STMI2C_SubTra_Busy, STMI2C_SubTra_Error, and STMI2C_SubTra_Ready_StopRequested.
Referenced by i2c_irq().
|
inlinestatic |
Definition at line 417 of file i2c_arch.c.
References __I2C_REG_CRITICAL_ZONE_START, __I2C_REG_CRITICAL_ZONE_STOP, BIT_X_IS_SET_IN_REG, i2c_transaction::buf, I2CAddrRdSent, I2CReadingByte, I2CStopRequested, I2CTransSuccess, i2c_periph::idx_buf, i2c_transaction::len_r, PPRZ_I2C_SEND_STOP(), i2c_transaction::slave_addr, i2c_transaction::status, i2c_periph::status, STMI2C_SubTra_Busy, STMI2C_SubTra_Error, and STMI2C_SubTra_Ready_StopRequested.
Referenced by i2c_irq().
|
inlinestatic |
Definition at line 220 of file i2c_arch.c.
References BIT_X_IS_SET_IN_REG, i2c_transaction::buf, I2CAddrWrSent, I2CSendingByte, I2CTransSuccess, I2CTransTx, i2c_periph::idx_buf, i2c_transaction::len_w, i2c_transaction::slave_addr, i2c_transaction::status, i2c_periph::status, STMI2C_SubTra_Busy, STMI2C_SubTra_Error, STMI2C_SubTra_Ready, and i2c_transaction::type.
Referenced by i2c_irq().