mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:22:32 +08:00
include/nuttx/i2c/i2c_master.h: Add a definition to distinguish a new START of messages from a repeated start. No lower-half I2C drivers actually implement this new flag bit, however. drivers/i2c/i2c_writeread.c: Use new repeated START definition where appopriated. Other: Some cosmetic changes, updates to README files, etc.
This commit is contained in:
@@ -542,8 +542,6 @@ static void sam_xosc0_configure(const struct sam_clockconfig_s *config)
|
|||||||
regval = sam_xoscctrl(config);
|
regval = sam_xoscctrl(config);
|
||||||
putreg32(regval, SAM_OSCCTRL_XOSCCTRL0);
|
putreg32(regval, SAM_OSCCTRL_XOSCCTRL0);
|
||||||
|
|
||||||
/* If the XOSC was enabled, then wait for it to become ready */
|
|
||||||
|
|
||||||
/* Wait for XOSC32 to become ready if it was enabled */
|
/* Wait for XOSC32 to become ready if it was enabled */
|
||||||
|
|
||||||
if (config->enable)
|
if (config->enable)
|
||||||
@@ -574,8 +572,6 @@ void sam_xosc1_configure(const struct sam_xosc_config_s *config)
|
|||||||
regval = sam_xoscctrl(config);
|
regval = sam_xoscctrl(config);
|
||||||
putreg32(regval, SAM_OSCCTRL_XOSCCTRL1);
|
putreg32(regval, SAM_OSCCTRL_XOSCCTRL1);
|
||||||
|
|
||||||
/* If the XOSC was enabled, then wait for it to become ready */
|
|
||||||
|
|
||||||
/* Wait for XOSC32 to become ready if it was enabled */
|
/* Wait for XOSC32 to become ready if it was enabled */
|
||||||
|
|
||||||
if (config->enable)
|
if (config->enable)
|
||||||
@@ -631,7 +627,6 @@ static void sam_gclk_configure(uintptr_t regaddr,
|
|||||||
regval = GCLK_GENCTRL_SRC(config->source) | GCLK_GENCTRL_GENEN |
|
regval = GCLK_GENCTRL_SRC(config->source) | GCLK_GENCTRL_GENEN |
|
||||||
GCLK_GENCTRL1_DIV(config->div);
|
GCLK_GENCTRL1_DIV(config->div);
|
||||||
|
|
||||||
|
|
||||||
if (config->idc)
|
if (config->idc)
|
||||||
{
|
{
|
||||||
regval |= GCLK_GENCTRL_IDC;
|
regval |= GCLK_GENCTRL_IDC;
|
||||||
@@ -872,7 +867,6 @@ static void sam_dfll_ready(const struct sam_dfll_config_s *config)
|
|||||||
if ((regval8 & OSCCTRL_DFLLCTRLB_MODE) != 0)
|
if ((regval8 & OSCCTRL_DFLLCTRLB_MODE) != 0)
|
||||||
{
|
{
|
||||||
ready = OSCCTRL_INT_DFLLRDY | OSCCTRL_INT_DFLLLCKC;
|
ready = OSCCTRL_INT_DFLLRDY | OSCCTRL_INT_DFLLLCKC;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* In open-loop mode, wait only for DFLL ready */
|
/* In open-loop mode, wait only for DFLL ready */
|
||||||
|
|||||||
@@ -45,6 +45,12 @@ STATUS
|
|||||||
hardware. The primary JTAG problem seems to be that it is now unable
|
hardware. The primary JTAG problem seems to be that it is now unable
|
||||||
to halt the CPU.
|
to halt the CPU.
|
||||||
|
|
||||||
|
This is most likely a consequence of something happening in the NuttX
|
||||||
|
boot-up sequence that interferes with JTAG operation. When I continue
|
||||||
|
debugging in the future, I will put an infinitel loop, branch-on-self
|
||||||
|
at the code startup up (__start) so that I can attached the debugger
|
||||||
|
and step through the initial configuration.
|
||||||
|
|
||||||
Unlocking FLASH
|
Unlocking FLASH
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
|||||||
@@ -89,12 +89,13 @@ int i2c_writeread(FAR struct i2c_master_s *dev,
|
|||||||
msg[0].buffer = (FAR uint8_t *)wbuffer; /* Override const */
|
msg[0].buffer = (FAR uint8_t *)wbuffer; /* Override const */
|
||||||
msg[0].length = wbuflen;
|
msg[0].length = wbuflen;
|
||||||
|
|
||||||
/* The second is either a read (rbuflen > 0) or a write (rbuflen < 0) with
|
/* The second is either a read (rbuflen > 0) with a repeated start or a
|
||||||
* no restart.
|
* write (rbuflen < 0) with no restart.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (rbuflen > 0)
|
if (rbuflen > 0)
|
||||||
{
|
{
|
||||||
|
msg[0].flags |= I2C_M_NOSTOP;
|
||||||
msg[1].flags = (flags | I2C_M_READ);
|
msg[1].flags = (flags | I2C_M_READ);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -77,8 +77,9 @@
|
|||||||
|
|
||||||
#define I2C_M_READ 0x0001 /* Read data, from slave to master */
|
#define I2C_M_READ 0x0001 /* Read data, from slave to master */
|
||||||
#define I2C_M_TEN 0x0002 /* Ten bit address */
|
#define I2C_M_TEN 0x0002 /* Ten bit address */
|
||||||
|
#define I2C_M_NOSTOP 0x0040 /* Message should not end with a STOP */
|
||||||
#define I2C_M_NORESTART 0x0080 /* Message should not begin with
|
#define I2C_M_NORESTART 0x0080 /* Message should not begin with
|
||||||
* (re-)start of transfer */
|
* (re-)START of transfer */
|
||||||
|
|
||||||
/* I2C Character Driver IOCTL Commands **************************************/
|
/* I2C Character Driver IOCTL Commands **************************************/
|
||||||
/* The I2C driver is intended to support application testing of the I2C bus.
|
/* The I2C driver is intended to support application testing of the I2C bus.
|
||||||
|
|||||||
Reference in New Issue
Block a user