libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
Defined Constants and Types for the NRF52xx I2C More...
Modules | |
I2C event -> task shortcuts | |
The effect of activated shortcut is, that upon I2C event triggering, the hardware will automatically start chosen task without intervention of the software. | |
I2C interrupt enable flags | |
I2C peripheral mode | |
I2C instances | |
I2C interrupts | |
I2C frequency constants | |
Macros | |
#define | I2C_EVENT_RXSTARTED(i2c) MMIO32((i2c) + 0x14C) |
#define | I2C_EVENT_TXSTARTED(i2c) MMIO32((i2c) + 0x150) |
#define | I2C_EVENT_LASTRX(i2c) MMIO32((i2c) + 0x15C) |
#define | I2C_EVENT_LASTTX(i2c) MMIO32((i2c) + 0x160) |
#define | I2C_RXDPTR(i2c) MMIO32((i2c) + 0x534) |
#define | I2C_RXDMAXCNT(i2c) MMIO32((i2c) + 0x538) |
#define | I2C_RXDAMOUNT(i2c) MMIO32((i2c) + 0x53C) |
#define | I2C_RXDLIST(i2c) MMIO32((i2c) + 0x540) |
#define | I2C_TXDPTR(i2c) MMIO32((i2c) + 0x544) |
#define | I2C_TXDMAXCNT(i2c) MMIO32((i2c) + 0x548) |
#define | I2C_TXDAMOUNT(i2c) MMIO32((i2c) + 0x54C) |
#define | I2C_TXDLIST(i2c) MMIO32((i2c) + 0x550) |
#define | I2C_TASK_STARTRX(i2c) MMIO32((i2c) + 0x000) |
#define | I2C_TASK_STARTTX(i2c) MMIO32((i2c) + 0x008) |
#define | I2C_TASK_STOP(i2c) MMIO32((i2c) + 0x014) |
#define | I2C_TASK_SUSPEND(i2c) MMIO32((i2c) + 0x01c) |
#define | I2C_TASK_RESUME(i2c) MMIO32((i2c) + 0x020) |
#define | I2C_EVENT_STOPPED(i2c) MMIO32((i2c) + 0x104) |
#define | I2C_EVENT_RXDREADY(i2c) MMIO32((i2c) + 0x108) |
#define | I2C_EVENT_TXDSENT(i2c) MMIO32((i2c) + 0x11c) |
#define | I2C_EVENT_ERROR(i2c) MMIO32((i2c) + 0x124) |
#define | I2C_EVENT_BB(i2c) MMIO32((i2c) + 0x138) |
#define | I2C_EVENT_SUSPENDED(i2c) MMIO32((i2c) + 0x148) |
#define | I2C_SHORTS(i2c) MMIO32((i2c) + 0x200) |
#define | I2C_INTEN(i2c) MMIO32((i2c) + 0x300) |
#define | I2C_INTENSET(i2c) MMIO32((i2c) + 0x304) |
#define | I2C_INTENCLR(i2c) MMIO32((i2c) + 0x308) |
#define | I2C_ERRORSRC(i2c) MMIO32((i2c) + 0x4c4) |
#define | I2C_ENABLE(i2c) MMIO32((i2c) + 0x500) |
#define | I2C_PSELSCL(i2c) MMIO32((i2c) + 0x508) |
#define | I2C_PSELSDA(i2c) MMIO32((i2c) + 0x50c) |
#define | I2C_RXD(i2c) MMIO32((i2c) + 0x518) |
#define | I2C_TXD(i2c) MMIO32((i2c) + 0x51c) |
#define | I2C_FREQUENCY(i2c) MMIO32((i2c) + 0x524) |
#define | I2C_ADDRESS(i2c) MMIO32((i2c) + 0x588) |
#define | I2C_ERRORSRC_OVERRUN (1 << 0) |
#define | I2C_ERRORSRC_ANACK (1 << 1) |
#define | I2C_ERRORSRC_DNACK (1 << 2) |
#define | I2C_PSEL_OFF (0xffffffff) |
Functions | |
void | i2c_set_tx_buffer (uint32_t i2c, const uint8_t *buffer, uint8_t len) |
Configure I2C transmit buffer properties. More... | |
void | i2c_set_rx_buffer (uint32_t i2c, uint8_t *buffer, uint8_t len) |
Configure I2C receive buffer properties. More... | |
Defined Constants and Types for the NRF52xx I2C
LGPL License Terms libopencm3 License
#define I2C_ADDRESS | ( | i2c | ) | MMIO32((i2c) + 0x588) |
Definition at line 73 of file common/i2c.h.
#define I2C_ENABLE | ( | i2c | ) | MMIO32((i2c) + 0x500) |
Definition at line 67 of file common/i2c.h.
#define I2C_ERRORSRC | ( | i2c | ) | MMIO32((i2c) + 0x4c4) |
Definition at line 66 of file common/i2c.h.
#define I2C_ERRORSRC_ANACK (1 << 1) |
Definition at line 104 of file common/i2c.h.
#define I2C_ERRORSRC_DNACK (1 << 2) |
Definition at line 105 of file common/i2c.h.
#define I2C_ERRORSRC_OVERRUN (1 << 0) |
Definition at line 103 of file common/i2c.h.
#define I2C_EVENT_BB | ( | i2c | ) | MMIO32((i2c) + 0x138) |
Definition at line 58 of file common/i2c.h.
#define I2C_EVENT_ERROR | ( | i2c | ) | MMIO32((i2c) + 0x124) |
Definition at line 57 of file common/i2c.h.
#define I2C_EVENT_RXDREADY | ( | i2c | ) | MMIO32((i2c) + 0x108) |
Definition at line 55 of file common/i2c.h.
#define I2C_EVENT_STOPPED | ( | i2c | ) | MMIO32((i2c) + 0x104) |
Definition at line 54 of file common/i2c.h.
#define I2C_EVENT_SUSPENDED | ( | i2c | ) | MMIO32((i2c) + 0x148) |
Definition at line 59 of file common/i2c.h.
#define I2C_EVENT_TXDSENT | ( | i2c | ) | MMIO32((i2c) + 0x11c) |
Definition at line 56 of file common/i2c.h.
#define I2C_FREQUENCY | ( | i2c | ) | MMIO32((i2c) + 0x524) |
Definition at line 72 of file common/i2c.h.
#define I2C_INTEN | ( | i2c | ) | MMIO32((i2c) + 0x300) |
Definition at line 63 of file common/i2c.h.
#define I2C_INTENCLR | ( | i2c | ) | MMIO32((i2c) + 0x308) |
Definition at line 65 of file common/i2c.h.
#define I2C_INTENSET | ( | i2c | ) | MMIO32((i2c) + 0x304) |
Definition at line 64 of file common/i2c.h.
#define I2C_PSEL_OFF (0xffffffff) |
Definition at line 139 of file common/i2c.h.
#define I2C_PSELSCL | ( | i2c | ) | MMIO32((i2c) + 0x508) |
Definition at line 68 of file common/i2c.h.
#define I2C_PSELSDA | ( | i2c | ) | MMIO32((i2c) + 0x50c) |
Definition at line 69 of file common/i2c.h.
#define I2C_RXD | ( | i2c | ) | MMIO32((i2c) + 0x518) |
Definition at line 70 of file common/i2c.h.
#define I2C_SHORTS | ( | i2c | ) | MMIO32((i2c) + 0x200) |
Definition at line 62 of file common/i2c.h.
#define I2C_TASK_RESUME | ( | i2c | ) | MMIO32((i2c) + 0x020) |
Definition at line 51 of file common/i2c.h.
#define I2C_TASK_STARTRX | ( | i2c | ) | MMIO32((i2c) + 0x000) |
Definition at line 47 of file common/i2c.h.
#define I2C_TASK_STARTTX | ( | i2c | ) | MMIO32((i2c) + 0x008) |
Definition at line 48 of file common/i2c.h.
#define I2C_TASK_STOP | ( | i2c | ) | MMIO32((i2c) + 0x014) |
Definition at line 49 of file common/i2c.h.
#define I2C_TASK_SUSPEND | ( | i2c | ) | MMIO32((i2c) + 0x01c) |
Definition at line 50 of file common/i2c.h.
#define I2C_TXD | ( | i2c | ) | MMIO32((i2c) + 0x51c) |
Definition at line 71 of file common/i2c.h.
void i2c_set_rx_buffer | ( | uint32_t | i2c, |
uint8_t * | buffer, | ||
uint8_t | len | ||
) |
Configure I2C receive buffer properties.
Configures receive buffer for EasyDMA transaction. This API is only available if I2C_MODE_MASTER mode is activated.
Configures linear RX buffer for EasyDMA transmission.
[in] | i2c | i2c peripheral base, see I2C instances |
[in] | buffer | address of buffer start |
[in] | len | length of the buffer |
Definition at line 54 of file i2c.c.
References I2C_RXDLIST, I2C_RXDMAXCNT, and I2C_RXDPTR.
void i2c_set_tx_buffer | ( | uint32_t | i2c, |
const uint8_t * | buffer, | ||
uint8_t | len | ||
) |
Configure I2C transmit buffer properties.
Configures transmit buffer for EasyDMA transaction. This API is only available if I2C_MODE_MASTER mode is activated.
Configures linear TX buffer for EasyDMA transmission.
[in] | i2c | i2c peripheral base, see I2C instances |
[in] | buffer | address of buffer start |
[in] | len | length of data in the buffer |
Definition at line 37 of file i2c.c.
References I2C_TXDLIST, I2C_TXDMAXCNT, and I2C_TXDPTR.