Go to the documentation of this file.
46 #define STM32_I3C_TP_PID(x) (x >> 16)
89 #endif // STM32_I3C_H_
int stm32_i3c_conf_irq(struct no_os_i3c_bus_desc *desc, uint8_t irq, bool en)
Configure I3C interrupts.
Definition: stm32_i3c.c:566
void no_os_memswap64(void *buf, uint32_t bytes, uint32_t step)
void HAL_I3C_CtrlTxCpltCallback(I3C_HandleTypeDef *hi3c)
Controller Transmit Complete callback.
Definition: stm32_i3c.c:119
uint32_t ibi_payload
Definition: no_os_i3c.h:170
#define NO_OS_I3C_CCC_GETBCR
Definition: no_os_i3c.h:114
#define NO_OS_I3C_BCR_IBI_PAYLOAD(bcr)
Definition: no_os_i3c.h:136
uint8_t irq_events
Definition: no_os_i3c.h:222
#define NO_OS_I3C_MAX_BUS_NUMBER
Definition: no_os_i3c.h:54
int stm32_i3c_init_bus(struct no_os_i3c_bus_desc *desc, const struct no_os_i3c_bus_init_param *param)
Initialize the I3C bus.
Definition: stm32_i3c.c:205
struct no_os_i3c_ccc_info ccc_info
Definition: no_os_i3c.h:224
#define STM32_I3C_TP_PID(x)
Definition: stm32_i3c.h:46
struct no_os_i3c_bus_desc * bus
Definition: no_os_i3c.h:296
void HAL_I3C_ErrorCallback(I3C_HandleTypeDef *hi3c)
Definition: stm32_i3c.c:133
int stm32_i3c_read(struct no_os_i3c_desc *desc, uint8_t *data, uint8_t data_len)
I3C private read transaction as bus.
Definition: stm32_i3c.c:461
Structure holding I3C device descriptor.
Definition: no_os_i3c.h:278
int stm32_i3c_send_ccc(struct no_os_i3c_bus_desc *desc, uint8_t addr, uint8_t id, bool rnw, bool defining, uint8_t *data, uint8_t size)
Send CCC as bus. Retrieve data is only valid for unicast commands. Multi frames are not supported suc...
Definition: stm32_i3c.c:323
void no_os_i3c_addr_set_status(struct no_os_i3c_bus_desc *desc, uint8_t addr, enum no_os_i3c_slot_status status)
Set status of an address.
Definition: no_os_i3c.c:600
int stm32_i3c_remove(struct no_os_i3c_desc *desc)
Free the resources allocated by stm32_i3c_init().
Definition: stm32_i3c.c:274
void HAL_I3C_CtrlMultipleXferCpltCallback(I3C_HandleTypeDef *hi3c)
Definition: stm32_i3c.c:141
Header file of I3C Interface.
struct no_os_i3c_bus_desc * i3c_table[NO_OS_I3C_MAX_BUS_NUMBER+1]
i3c_table contains the pointers towards the I3C buses.
Definition: no_os_i3c.c:51
STM32 platform specific I3C device descriptor.
Definition: stm32_i3c.h:65
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
Structure holding I3C bus descriptor.
Definition: no_os_i3c.h:200
void * extra
Definition: no_os_i3c.h:290
I3C_CCCInfoTypeDef ccc_info
Definition: stm32_i3c.h:58
void * extra
Definition: no_os_i3c.h:230
uint32_t ibi_payload_len
Definition: no_os_i3c.h:168
#define NO_OS_I3C_BCR_DEVICE_ROLE(bcr)
Definition: no_os_i3c.h:137
Structure holding the initialization parameters I3C bus.
Definition: stm32_i3c.h:74
I3C_HandleTypeDef * hi3c
Definition: stm32_i3c.h:76
Structure holding the parameters for I3C initialization.
Definition: no_os_i3c.h:237
const uint32_t device_id
Definition: no_os_i3c.h:239
I3C_XferTypeDef xfer
Definition: stm32_i3c.h:56
I3C_DeviceConfTypeDef dev_conf
Definition: stm32_i3c.h:67
#define NO_OS_I3C_IRQ_CR
Definition: no_os_i3c.h:131
const struct no_os_i3c_platform_ops stm32_i3c_ops
STM32 specific I3C platform ops structure.
Definition: stm32_i3c.c:734
bool async_irq
Definition: no_os_i3c.h:226
int stm32_i3c_get_ccc_info(struct no_os_i3c_bus_desc *desc, uint8_t irq)
Update I3C CCC info.
Definition: stm32_i3c.c:607
void HAL_I3C_CtrlDAACpltCallback(I3C_HandleTypeDef *hi3c)
Controller dynamic address assignment Complete callback.
Definition: stm32_i3c.c:113
#define DISABLE
Definition: ad77681.h:340
STM32 platform specific I3C bus descriptor.
Definition: stm32_i3c.h:52
struct no_os_i3c_desc * devs[NO_OS_I3C_MAX_DEV_NUMBER]
Definition: no_os_i3c.h:220
struct no_os_i3c_daa_lut daa_candidates[NO_OS_I3C_MAX_DEV_NUMBER]
Definition: no_os_i3c.h:216
int no_os_i3c_send_direct_ccc(struct no_os_i3c_desc *desc, uint32_t ccc, uint8_t *data)
Send CCC to device device.
Definition: no_os_i3c.c:388
void HAL_I3C_NotifyCallback(I3C_HandleTypeDef *hi3c, uint32_t eventId)
Definition: stm32_i3c.c:149
const struct no_os_i3c_platform_ops stm32_i3c_ops
stm32 platform specific I3C platform ops structure.
Definition: stm32_i3c.c:734
#define NO_OS_I3C_IRQ_HJ
Definition: no_os_i3c.h:130
int stm32_i3c_remove_bus(struct no_os_i3c_bus_desc *desc)
Deinit I3C bus and free resources allocated by stm32_i3c_init_bus().
Definition: stm32_i3c.c:292
uint8_t addr
Definition: no_os_i3c.h:282
struct no_os_i3c_bus_desc * i3c_table[]
i3c_table contains the pointers towards the I3C buses.
Definition: no_os_i3c.c:51
int stm32_i3c_write_and_read(struct no_os_i3c_desc *desc, uint8_t *tx_data, uint8_t tx_data_len, uint8_t *rx_data, uint8_t rx_data_len)
I3C private write and read transaction as bus.
Definition: stm32_i3c.c:503
uint8_t no_os_i3c_addr_get_free(struct no_os_i3c_bus_desc *desc, uint8_t start_addr)
Get a free address.
Definition: no_os_i3c.c:579
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
Header file for the stm32 I3C driver.
#define NO_OS_I3C_BCR_IBI_REQUEST_CAPABLE(bcr)
Definition: no_os_i3c.h:135
#define NULL
Definition: wrapper.h:64
Structure holding the parameters for I3C initialization. Works like a device tree,...
Definition: no_os_i3c.h:261
uint32_t ibi_cr_addr
Definition: no_os_i3c.h:166
void HAL_I3C_CtrlRxCpltCallback(I3C_HandleTypeDef *hi3c)
Controller Reception Complete callback.
Definition: stm32_i3c.c:126
#define NO_OS_I3C_BCAST_ADDR
Definition: no_os_i3c.h:59
int stm32_i3c_init(struct no_os_i3c_desc *desc, const struct no_os_i3c_init_param *param)
Initialize the I3C device.
Definition: stm32_i3c.c:176
int stm32_i3c_is_dev_ready(struct no_os_i3c_desc *desc)
Check if I3C device is ready.
Definition: stm32_i3c.c:545
I3C_HandleTypeDef * hi3c
Definition: stm32_i3c.h:54
#define NO_OS_I3C_IRQ_IBI
Definition: no_os_i3c.h:129
uint64_t pid
Definition: no_os_i3c.h:182
bool is_i3c
Definition: no_os_i3c.h:284
Header file of utility functions.
struct no_os_i3c_daa_lut daa_unknown[NO_OS_I3C_MAX_DEV_NUMBER]
Definition: no_os_i3c.h:218
int no_os_i3c_call_irq(struct no_os_i3c_bus_desc *desc)
Non-blocking I3C interrupt. Since a payload is always retrieved with it, also update the no_os_i3c_cc...
Definition: no_os_i3c.c:543
int stm32_i3c_do_daa(struct no_os_i3c_bus_desc *desc, bool rstdaa)
Do I3C DAA to assign the dynamic addresses.
Definition: stm32_i3c.c:249
@ NO_OS_I3C_ADDR_SLOT_I3C_DEV
Definition: no_os_i3c.h:156
int stm32_i3c_write(struct no_os_i3c_desc *desc, uint8_t *data, uint8_t data_len)
I3C private write transaction as bus.
Definition: stm32_i3c.c:419
Error macro definition for ARM Compiler.
uint8_t num_devs_unknown
Definition: no_os_i3c.h:206
#define NO_OS_I3C_MAX_DEV_NUMBER
Definition: no_os_i3c.h:55
void HAL_I3C_TgtReqDynamicAddrCallback(I3C_HandleTypeDef *hi3c, uint64_t targetPayload)
I3C target request a dynamic address callback. When called, assigns a dynamic address to the target.
Definition: stm32_i3c.c:61
void * extra
Definition: no_os_i3c.h:247