mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
!arm/stm32h5: standardize public API prefix to stm32_
BREAKING CHANGE: Public STM32H5 APIs were renamed from stm32h5_* forms to canonical stm32_* forms. Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
parent
3490eec26d
commit
8ece56ff11
14 changed files with 50 additions and 52 deletions
|
|
@ -2585,12 +2585,11 @@ static int adc_timinit(struct stm32_dev_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_adc_initialize
|
||||
* Name: stm32_adc_initialize
|
||||
****************************************************************************/
|
||||
|
||||
struct adc_dev_s *stm32h5_adc_initialize(int intf,
|
||||
const uint8_t *chanlist,
|
||||
int cchannels)
|
||||
struct adc_dev_s *stm32_adc_initialize(int intf, const uint8_t *chanlist,
|
||||
int cchannels)
|
||||
{
|
||||
struct adc_dev_s *dev;
|
||||
struct stm32_dev_s *priv;
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ extern "C"
|
|||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_adc_initialize
|
||||
* Name: stm32_adc_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the ADC.
|
||||
|
|
@ -516,9 +516,8 @@ extern "C"
|
|||
****************************************************************************/
|
||||
|
||||
struct adc_dev_s;
|
||||
struct adc_dev_s *stm32h5_adc_initialize(int intf,
|
||||
const uint8_t *chanlist,
|
||||
int nchannels);
|
||||
struct adc_dev_s *stm32_adc_initialize(int intf, const uint8_t *chanlist,
|
||||
int nchannels);
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
|
|
@ -538,7 +538,7 @@ static int stm32_dts_isr(int irq, void *context, void *arg)
|
|||
* Name: stm32_dts_register
|
||||
****************************************************************************/
|
||||
|
||||
int stm32h5_dts_register(int devno)
|
||||
int stm32_dts_register(int devno)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ extern "C"
|
|||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
int stm32h5_dts_register(int devno);
|
||||
int stm32_dts_register(int devno);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -45,16 +45,16 @@ extern "C"
|
|||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
void stm32h5_flash_getopt(uint32_t *opt1, uint32_t *opt2);
|
||||
void stm32_flash_getopt(uint32_t *opt1, uint32_t *opt2);
|
||||
|
||||
int stm32h5_flash_optmodify(uint32_t clear1, uint32_t set1,
|
||||
uint32_t clear2, uint32_t set2);
|
||||
int stm32_flash_optmodify(uint32_t clear1, uint32_t set1,
|
||||
uint32_t clear2, uint32_t set2);
|
||||
|
||||
int stm32h5_flash_swapbanks(void);
|
||||
int stm32_flash_swapbanks(void);
|
||||
|
||||
void stm32h5_flash_lock(void);
|
||||
void stm32_flash_lock(void);
|
||||
|
||||
void stm32h5_flash_unlock(void);
|
||||
void stm32_flash_unlock(void);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
#ifdef CONFIG_STM32H5_HAVE_HSI48
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_enable_hsi48
|
||||
* Name: stm32_enable_hsi48
|
||||
*
|
||||
* Description:
|
||||
* The HSI48
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32h5_enable_hsi48(enum syncsrc_e syncsrc)
|
||||
void stm32_enable_hsi48(enum syncsrc_e syncsrc)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ void stm32h5_enable_hsi48(enum syncsrc_e syncsrc)
|
|||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_disable_hsi48
|
||||
* Name: stm32_disable_hsi48
|
||||
*
|
||||
* Description:
|
||||
* Disable the HSI48 clock.
|
||||
|
|
@ -147,7 +147,7 @@ void stm32h5_enable_hsi48(enum syncsrc_e syncsrc)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32h5_disable_hsi48(void)
|
||||
void stm32_disable_hsi48(void)
|
||||
{
|
||||
uint32_t regval;
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ enum syncsrc_e
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_enable_hsi48
|
||||
* Name: stm32_enable_hsi48
|
||||
*
|
||||
* Description:
|
||||
* On STM32H5X3, STM32H596xx/4A6xx and STM32H5XR devices only, the HSI48
|
||||
|
|
@ -74,10 +74,10 @@ enum syncsrc_e
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32h5_enable_hsi48(enum syncsrc_e syncsrc);
|
||||
void stm32_enable_hsi48(enum syncsrc_e syncsrc);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_disable_hsi48
|
||||
* Name: stm32_disable_hsi48
|
||||
*
|
||||
* Description:
|
||||
* Disable the HSI48 clock.
|
||||
|
|
@ -90,7 +90,7 @@ void stm32h5_enable_hsi48(enum syncsrc_e syncsrc);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32h5_disable_hsi48(void);
|
||||
void stm32_disable_hsi48(void);
|
||||
|
||||
#endif /* CONFIG_STM32H5_HAVE_HSI48 */
|
||||
#endif /* __ARCH_ARM_SRC_STM32H5_STM32_HSI48_H */
|
||||
|
|
|
|||
|
|
@ -2829,7 +2829,7 @@ static int stm32_hw_initialize(struct stm32_usbhost_s *priv)
|
|||
|
||||
/* Enable VBUS drive */
|
||||
|
||||
stm32h5_usbhost_vbusdrive(0, true);
|
||||
stm32_usbdrdhost_vbusdrive(0, true);
|
||||
|
||||
uinfo("USB Host initialized\n");
|
||||
|
||||
|
|
@ -2841,14 +2841,14 @@ static int stm32_hw_initialize(struct stm32_usbhost_s *priv)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_usbhost_initialize
|
||||
* Name: stm32_usbdrdhost_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize USB host controller
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
struct usbhost_connection_s *stm32h5_usbhost_initialize(void)
|
||||
struct usbhost_connection_s *stm32_usbdrdhost_initialize(void)
|
||||
{
|
||||
struct stm32_usbhost_s *priv = &g_usbhost;
|
||||
int ret;
|
||||
|
|
@ -2872,7 +2872,7 @@ struct usbhost_connection_s *stm32h5_usbhost_initialize(void)
|
|||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_usbhost_vbusdrive
|
||||
* Name: stm32_usbdrdhost_vbusdrive
|
||||
*
|
||||
* Description:
|
||||
* Control VBUS power
|
||||
|
|
@ -2881,7 +2881,7 @@ struct usbhost_connection_s *stm32h5_usbhost_initialize(void)
|
|||
****************************************************************************/
|
||||
|
||||
__attribute__((weak))
|
||||
void stm32_usbhost_vbusdrive(int port, bool enable)
|
||||
void stm32_usbdrdhost_vbusdrive(int port, bool enable)
|
||||
{
|
||||
/* Default implementation - do nothing.
|
||||
* Board-specific code should override this to control VBUS power.
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@
|
|||
* to the board-level USB host logic.
|
||||
*/
|
||||
|
||||
struct stm32h5_usbhost_connection_s
|
||||
struct stm32_usbhost_connection_s
|
||||
{
|
||||
/* Wait for device connection/disconnection */
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ extern "C"
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_usbhost_initialize
|
||||
* Name: stm32_usbdrdhost_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize USB host controller hardware.
|
||||
|
|
@ -108,10 +108,10 @@ extern "C"
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
struct usbhost_connection_s *stm32h5_usbhost_initialize(void);
|
||||
struct usbhost_connection_s *stm32_usbdrdhost_initialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_usbhost_vbusdrive
|
||||
* Name: stm32_usbdrdhost_vbusdrive
|
||||
*
|
||||
* Description:
|
||||
* Enable/disable VBUS power to the connected USB device.
|
||||
|
|
@ -133,7 +133,7 @@ struct usbhost_connection_s *stm32h5_usbhost_initialize(void);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32h5_usbhost_vbusdrive(int port, bool enable);
|
||||
void stm32_usbdrdhost_vbusdrive(int port, bool enable);
|
||||
|
||||
#undef EXTERN
|
||||
#if defined(__cplusplus)
|
||||
|
|
|
|||
|
|
@ -344,14 +344,14 @@ static void flash_lock_opt(void)
|
|||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_flash_unlock
|
||||
* Name: stm32_flash_unlock
|
||||
*
|
||||
* Description:
|
||||
* Unlock non-secure flash control
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32h5_flash_unlock(void)
|
||||
void stm32_flash_unlock(void)
|
||||
{
|
||||
nxmutex_lock(&g_lock);
|
||||
flash_unlock_nscr();
|
||||
|
|
@ -359,14 +359,14 @@ void stm32h5_flash_unlock(void)
|
|||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_flash_lock
|
||||
* Name: stm32_flash_lock
|
||||
*
|
||||
* Description:
|
||||
* Lock non-secure flash control
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32h5_flash_lock(void)
|
||||
void stm32_flash_lock(void)
|
||||
{
|
||||
nxmutex_lock(&g_lock);
|
||||
flash_lock_nscr();
|
||||
|
|
@ -374,7 +374,7 @@ void stm32h5_flash_lock(void)
|
|||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_flash_getopt
|
||||
* Name: stm32_flash_getopt
|
||||
*
|
||||
* Description:
|
||||
* Read the current flash option bytes from FLASH_OPTSR_CUR and
|
||||
|
|
@ -386,14 +386,14 @@ void stm32h5_flash_lock(void)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void stm32h5_flash_getopt(uint32_t *opt1, uint32_t *opt2)
|
||||
void stm32_flash_getopt(uint32_t *opt1, uint32_t *opt2)
|
||||
{
|
||||
*opt1 = getreg32(STM32_FLASH_OPTSR_CUR);
|
||||
*opt2 = getreg32(STM32_FLASH_OPTSR2_CUR);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_flash_optmodify
|
||||
* Name: stm32_flash_optmodify
|
||||
*
|
||||
* Description:
|
||||
* Modifies the current flash option bytes, given bits to set and clear.
|
||||
|
|
@ -412,8 +412,8 @@ void stm32h5_flash_getopt(uint32_t *opt1, uint32_t *opt2)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32h5_flash_optmodify(uint32_t clear1, uint32_t set1,
|
||||
uint32_t clear2, uint32_t set2)
|
||||
int stm32_flash_optmodify(uint32_t clear1, uint32_t set1,
|
||||
uint32_t clear2, uint32_t set2)
|
||||
{
|
||||
int ret;
|
||||
uint32_t reg;
|
||||
|
|
@ -451,7 +451,7 @@ int stm32h5_flash_optmodify(uint32_t clear1, uint32_t set1,
|
|||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32h5_flash_swapbanks
|
||||
* Name: stm32_flash_swapbanks
|
||||
*
|
||||
* Description:
|
||||
* Swaps banks 1 and 2 in the processor's memory map. Takes effect
|
||||
|
|
@ -464,7 +464,7 @@ int stm32h5_flash_optmodify(uint32_t clear1, uint32_t set1,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32h5_flash_swapbanks(void)
|
||||
int stm32_flash_swapbanks(void)
|
||||
{
|
||||
uint32_t reg;
|
||||
bool was_locked;
|
||||
|
|
|
|||
|
|
@ -845,7 +845,7 @@ void stm32_rcc_enableperipherals(void)
|
|||
#ifdef STM32_USE_HSI48
|
||||
/* Enable HSI48 clocking to support USB transfers or RNG */
|
||||
|
||||
stm32h5_enable_hsi48(STM32_HSI48_SYNCSRC);
|
||||
stm32_enable_hsi48(STM32_HSI48_SYNCSRC);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ int stm32_adc_setup(void)
|
|||
stm32_configgpio(g_pinlist1[i]);
|
||||
}
|
||||
|
||||
adc1 = stm32h5_adc_initialize(1, g_chanlist1, ADC1_NCHANNELS);
|
||||
adc1 = stm32_adc_initialize(1, g_chanlist1, ADC1_NCHANNELS);
|
||||
if (adc1 == NULL)
|
||||
{
|
||||
aerr("ERROR: Failed to get ADC interface 1\n");
|
||||
|
|
@ -145,7 +145,7 @@ int stm32_adc_setup(void)
|
|||
stm32_configgpio(g_pinlist2[i]);
|
||||
}
|
||||
|
||||
adc2 = stm32h5_adc_initialize(2, g_chanlist2, ADC2_NCHANNELS);
|
||||
adc2 = stm32_adc_initialize(2, g_chanlist2, ADC2_NCHANNELS);
|
||||
if (adc2 == NULL)
|
||||
{
|
||||
aerr("ERROR: Failed to get ADC interface 1\n");
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ int stm32_dts_setup(int devno)
|
|||
{
|
||||
/* Register the DTS driver at "/dev/sensor_temp0" */
|
||||
|
||||
ret = stm32h5_dts_register(0);
|
||||
ret = stm32_dts_register(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
aerr("ERROR: dts_register /dev/dts0 failed: %d\n", ret);
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ int stm32_usbhost_initialize(void)
|
|||
/* Then get an instance of the USB host interface */
|
||||
|
||||
uinfo("Initialize USB host\n");
|
||||
g_usbconn = stm32h5_usbhost_initialize();
|
||||
g_usbconn = stm32_usbdrdhost_initialize();
|
||||
if (g_usbconn)
|
||||
{
|
||||
/* Start a thread to handle device connection. */
|
||||
|
|
@ -203,7 +203,7 @@ int stm32_usbhost_initialize(void)
|
|||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_usbhost_vbusdrive
|
||||
* Name: stm32_usbdrdhost_vbusdrive
|
||||
*
|
||||
* Description:
|
||||
* Enable/disable driving of VBUS 5V output. This function must be
|
||||
|
|
@ -232,7 +232,7 @@ int stm32_usbhost_initialize(void)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST
|
||||
void stm32h5_usbhost_vbusdrive(int port, bool enable)
|
||||
void stm32_usbdrdhost_vbusdrive(int port, bool enable)
|
||||
{
|
||||
/* The Nucleo-h563zi doesn't have hardware for a vbus drive.
|
||||
* Instead to get host working, you need to put an extra jumper
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue