Skip to content

Commit 7cf9bf5

Browse files
committed
- Added definiton for i2c_reset;
- Removed unneeded code from i2c and serial modules.
1 parent 8663958 commit 7cf9bf5

File tree

2 files changed

+8
-68
lines changed

2 files changed

+8
-68
lines changed

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/i2c_api.c

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,14 @@ int i2c_write(i2c_t *obj, int address, const char *data, int length, int stop)
191191

192192
void i2c_reset(i2c_t *obj)
193193
{
194-
return;
194+
ADI_I2C_RESULT I2C_Return;
195+
ADI_I2C_HANDLE I2C_Handle = *obj->pI2C_Handle;
196+
197+
I2C_Return = adi_i2c_Reset(I2C_Handle);
198+
if (I2C_Return) {
199+
obj->error = I2C_EVENT_ERROR;
200+
return;
201+
}
195202
}
196203

197204

@@ -206,33 +213,4 @@ int i2c_byte_write(i2c_t *obj, int data)
206213
return 0;
207214
}
208215

209-
210-
211-
#if DEVICE_I2CSLAVE
212-
void i2c_slave_mode(i2c_t *obj, int enable_slave)
213-
{
214-
215-
}
216-
217-
int i2c_slave_receive(i2c_t *obj)
218-
{
219-
220-
}
221-
222-
int i2c_slave_read(i2c_t *obj, char *data, int length)
223-
{
224-
return length;
225-
}
226-
227-
int i2c_slave_write(i2c_t *obj, const char *data, int length)
228-
{
229-
return length;
230-
}
231-
232-
void i2c_slave_address(i2c_t *obj, int idx, uint32_t address, uint32_t mask)
233-
{
234-
235-
}
236-
#endif // #if DEVICE_I2CSLAVE
237-
238216
#endif // #if DEVICE_I2C

targets/TARGET_Analog_Devices/TARGET_ADUCM4X50/TARGET_ADUCM4050/api/serial_api.c

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -302,44 +302,6 @@ void serial_break_clear(serial_t *obj)
302302
adi_uart_ForceTxBreak(hDevice[obj->index], false);
303303
}
304304

305-
#if DEVICE_SERIAL_ASYNCH
306-
uint8_t serial_tx_active(serial_t *obj)
307-
{
308-
return 0;
309-
}
310-
311-
uint8_t serial_rx_active(serial_t *obj)
312-
{
313-
return 0;
314-
}
315-
316-
int serial_irq_handler_asynch(serial_t *obj)
317-
{
318-
return 0;
319-
}
320-
321-
322-
323-
int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx_width, uint32_t handler, uint32_t event, DMAUsage hint)
324-
{
325-
return 0;
326-
}
327-
328-
void serial_rx_asynch(serial_t *obj, void *rx, size_t rx_length, uint8_t rx_width, uint32_t handler, uint32_t event, uint8_t char_match, DMAUsage hint)
329-
{
330-
331-
}
332-
333-
void serial_tx_abort_asynch(serial_t *obj)
334-
{
335-
336-
}
337-
338-
void serial_rx_abort_asynch(serial_t *obj)
339-
{
340-
341-
}
342-
#endif
343305
void serial_irq_handler(serial_t *obj, uart_irq_handler handler, uint32_t id)
344306
{
345307

0 commit comments

Comments
 (0)