Skip to content

Commit

Permalink
STM32: increase i2c slave rx limit.
Browse files Browse the repository at this point in the history
Use uint16_t variables for i2c slave_rx_buffer_size and slave_rx_count
variables. This allows to receive more than 255 bytes in slave mode. The
bytes are received one by one in slave mode so there are no hardware
limitations forcing a 1 byte rx count limit.
  • Loading branch information
Mathieu Othacehe committed Jan 28, 2022
1 parent 4095c65 commit 3c0c9c2
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32F0/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32F1/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32F2/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32F3/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32F4/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32F7/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32G0/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32G4/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32H7/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32L0/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32L1/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32L4/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32L5/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32U5/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32WB/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down
4 changes: 2 additions & 2 deletions targets/TARGET_STM/TARGET_STM32WL/objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ struct i2c_s {
volatile uint8_t pending_slave_tx_master_rx;
volatile uint8_t pending_slave_rx_maxter_tx;
uint8_t *slave_rx_buffer;
volatile uint8_t slave_rx_buffer_size;
volatile uint8_t slave_rx_count;
volatile uint16_t slave_rx_buffer_size;
volatile uint16_t slave_rx_count;
#endif
#if DEVICE_I2C_ASYNCH
uint32_t address;
Expand Down

0 comments on commit 3c0c9c2

Please sign in to comment.