stm32f769i_discovery.c
Go to the documentation of this file.
1 
39 /* Dependencies
40 - stm32f7xx_hal_cortex.c
41 - stm32f7xx_hal_gpio.c
42 - stm32f7xx_hal_uart.c
43 - stm32f7xx_hal_i2c.c
44 EndDependencies */
45 
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f769i_discovery.h"
48 
74 #define __STM32F769I_DISCOVERY_BSP_VERSION_MAIN (0x02)
75 #define __STM32F769I_DISCOVERY_BSP_VERSION_SUB1 (0x00)
76 #define __STM32F769I_DISCOVERY_BSP_VERSION_SUB2 (0x01)
77 #define __STM32F769I_DISCOVERY_BSP_VERSION_RC (0x00)
78 #define __STM32F769I_DISCOVERY_BSP_VERSION ((__STM32F769I_DISCOVERY_BSP_VERSION_MAIN << 24)\
79  |(__STM32F769I_DISCOVERY_BSP_VERSION_SUB1 << 16)\
80  |(__STM32F769I_DISCOVERY_BSP_VERSION_SUB2 << 8 )\
81  |(__STM32F769I_DISCOVERY_BSP_VERSION_RC))
82 
96 uint32_t GPIO_PIN[LEDn] = {LED1_PIN,
97  LED2_PIN};
98 
101 
103 
104 const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN };
105 
107 
108 
111 
119 static void I2Cx_MspInit(I2C_HandleTypeDef *i2c_handler);
120 static void I2Cx_Init(I2C_HandleTypeDef *i2c_handler);
121 
122 static HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
123 static HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
124 static HAL_StatusTypeDef I2Cx_IsDeviceReady(I2C_HandleTypeDef *i2c_handler, uint16_t DevAddress, uint32_t Trials);
125 static void I2Cx_Error(I2C_HandleTypeDef *i2c_handler, uint8_t Addr);
126 
127 /* AUDIO IO functions */
128 void AUDIO_IO_Init(void);
129 void AUDIO_IO_DeInit(void);
130 void AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value);
131 uint16_t AUDIO_IO_Read(uint8_t Addr, uint16_t Reg);
132 void AUDIO_IO_Delay(uint32_t Delay);
133 
134 /* HDMI IO functions */
135 void HDMI_IO_Init(void);
136 void HDMI_IO_Delay(uint32_t Delay);
137 void HDMI_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
138 uint8_t HDMI_IO_Read(uint8_t Addr, uint8_t Reg);
139 
140 /* I2C EEPROM IO function */
141 void EEPROM_IO_Init(void);
142 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
143 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
144 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
145 
146 /* TouchScreen (TS) IO functions */
147 void TS_IO_Init(void);
148 void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
149 uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg);
150 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
151 void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
152 void TS_IO_Delay(uint32_t Delay);
153 
154 /* LCD Display IO functions */
155 void OTM8009A_IO_Delay(uint32_t Delay);
168 uint32_t BSP_GetVersion(void)
169 {
171 }
172 
182 {
183  GPIO_InitTypeDef gpio_init_structure;
184 
186  /* Configure the GPIO_LED pin */
187  gpio_init_structure.Pin = GPIO_PIN[Led];
188  gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
189  gpio_init_structure.Pull = GPIO_PULLUP;
190  gpio_init_structure.Speed = GPIO_SPEED_HIGH;
191 
192  HAL_GPIO_Init(GPIO_PORT[Led], &gpio_init_structure);
193 
194 }
195 
196 
207 {
208  GPIO_InitTypeDef gpio_init_structure;
209 
210  /* DeInit the GPIO_LED pin */
211  gpio_init_structure.Pin = GPIO_PIN[Led];
212 
213  /* Turn off LED */
215  HAL_GPIO_DeInit(GPIO_PORT[Led], gpio_init_structure.Pin);
216 }
217 
227 {
229 }
230 
240 {
242 }
243 
253 {
255 }
256 
271 {
272  GPIO_InitTypeDef gpio_init_structure;
273 
274  /* Enable the BUTTON clock */
276 
277  if(Button_Mode == BUTTON_MODE_GPIO)
278  {
279  /* Configure Button pin as input */
280  gpio_init_structure.Pin = BUTTON_PIN[Button];
281  gpio_init_structure.Mode = GPIO_MODE_INPUT;
282  gpio_init_structure.Pull = GPIO_NOPULL;
283  gpio_init_structure.Speed = GPIO_SPEED_FAST;
284  HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
285  }
286 
287  if(Button_Mode == BUTTON_MODE_EXTI)
288  {
289  /* Configure Button pin as input with External interrupt */
290  gpio_init_structure.Pin = BUTTON_PIN[Button];
291  gpio_init_structure.Pull = GPIO_NOPULL;
292  gpio_init_structure.Speed = GPIO_SPEED_FAST;
293 
294  gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
295 
296  HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
297 
298  /* Enable and set Button EXTI Interrupt to the lowest priority */
299  HAL_NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x0F, 0x00);
301  }
302 }
303 
314 {
315  GPIO_InitTypeDef gpio_init_structure;
316 
317  gpio_init_structure.Pin = BUTTON_PIN[Button];
319  HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
320 }
321 
322 
332 {
333  return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
334 }
335 
345 /*******************************************************************************
346  BUS OPERATIONS
347 *******************************************************************************/
348 
349 /******************************* I2C Routines *********************************/
355 static void I2Cx_MspInit(I2C_HandleTypeDef *i2c_handler)
356 {
357  GPIO_InitTypeDef gpio_init_structure;
358 
359  if (i2c_handler == (I2C_HandleTypeDef*)(&hI2cAudioHandler))
360  {
361  /*** Configure the GPIOs ***/
362  /* Enable GPIO clock */
365  /* Configure I2C Tx as alternate function */
366  gpio_init_structure.Pin = DISCOVERY_AUDIO_I2Cx_SCL_PIN;
367  gpio_init_structure.Mode = GPIO_MODE_AF_OD;
368  gpio_init_structure.Pull = GPIO_NOPULL;
369  gpio_init_structure.Speed = GPIO_SPEED_FAST;
370  gpio_init_structure.Alternate = DISCOVERY_AUDIO_I2Cx_SCL_AF;
371  HAL_GPIO_Init(DISCOVERY_AUDIO_I2Cx_SCL_GPIO_PORT, &gpio_init_structure);
372 
373  /* Configure I2C Rx as alternate function */
374  gpio_init_structure.Pin = DISCOVERY_AUDIO_I2Cx_SDA_PIN;
375  gpio_init_structure.Alternate = DISCOVERY_AUDIO_I2Cx_SDA_AF;
376  HAL_GPIO_Init(DISCOVERY_AUDIO_I2Cx_SDA_GPIO_PORT, &gpio_init_structure);
377 
378  /*** Configure the I2C peripheral ***/
379  /* Enable I2C clock */
381 
382  /* Force the I2C peripheral clock reset */
384 
385  /* Release the I2C peripheral clock reset */
387 
388  /* Enable and set I2C1 Interrupt to a lower priority */
391 
392  /* Enable and set I2C1 Interrupt to a lower priority */
395 
396  }
397  else
398  {
399  /*** Configure the GPIOs ***/
400  /* Enable GPIO clock */
402 
403  /* Configure I2C Tx as alternate function */
404  gpio_init_structure.Pin = DISCOVERY_EXT_I2Cx_SCL_PIN;
405  gpio_init_structure.Mode = GPIO_MODE_AF_OD;
406  gpio_init_structure.Pull = GPIO_NOPULL;
407  gpio_init_structure.Speed = GPIO_SPEED_FAST;
408  gpio_init_structure.Alternate = DISCOVERY_EXT_I2Cx_SCL_SDA_AF;
410 
411  /* Configure I2C Rx as alternate function */
412  gpio_init_structure.Pin = DISCOVERY_EXT_I2Cx_SDA_PIN;
414 
415  /*** Configure the I2C peripheral ***/
416  /* Enable I2C clock */
418 
419  /* Force the I2C peripheral clock reset */
421 
422  /* Release the I2C peripheral clock reset */
424 
425  /* Enable and set I2C1 Interrupt to a lower priority */
428 
429  /* Enable and set I2C1 Interrupt to a lower priority */
432  }
433 }
434 
440 static void I2Cx_Init(I2C_HandleTypeDef *i2c_handler)
441 {
442  if(HAL_I2C_GetState(i2c_handler) == HAL_I2C_STATE_RESET)
443  {
444  if (i2c_handler == (I2C_HandleTypeDef*)(&hI2cAudioHandler))
445  {
446  /* Audio and LCD I2C configuration */
447  i2c_handler->Instance = DISCOVERY_AUDIO_I2Cx;
448  }
449  else
450  {
451  /* External, camera and Arduino connector I2C configuration */
452  i2c_handler->Instance = DISCOVERY_EXT_I2Cx;
453  }
454  i2c_handler->Init.Timing = DISCOVERY_I2Cx_TIMING;
455  i2c_handler->Init.OwnAddress1 = 0;
458  i2c_handler->Init.OwnAddress2 = 0;
461 
462  /* Init the I2C */
463  I2Cx_MspInit(i2c_handler);
464  HAL_I2C_Init(i2c_handler);
465  }
466 }
467 
478 static HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
479 {
480  HAL_StatusTypeDef status = HAL_OK;
481 
482  status = HAL_I2C_Mem_Read(i2c_handler, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
483 
484  /* Check the communication status */
485  if(status != HAL_OK)
486  {
487  /* I2C error occured */
488  I2Cx_Error(i2c_handler, Addr);
489  }
490  return status;
491 }
492 
493 
504 static HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddress, uint8_t *Buffer, uint16_t Length)
505 {
506  HAL_StatusTypeDef status = HAL_OK;
507 
508  status = HAL_I2C_Mem_Write(i2c_handler, Addr, (uint16_t)Reg, MemAddress, Buffer, Length, 1000);
509 
510  /* Check the communication status */
511  if(status != HAL_OK)
512  {
513  /* Re-Initiaize the I2C Bus */
514  I2Cx_Error(i2c_handler, Addr);
515  }
516  return status;
517 }
518 
527 static HAL_StatusTypeDef I2Cx_IsDeviceReady(I2C_HandleTypeDef *i2c_handler, uint16_t DevAddress, uint32_t Trials)
528 {
529  return (HAL_I2C_IsDeviceReady(i2c_handler, DevAddress, Trials, 1000));
530 }
531 
538 static void I2Cx_Error(I2C_HandleTypeDef *i2c_handler, uint8_t Addr)
539 {
540  /* De-initialize the I2C communication bus */
541  HAL_I2C_DeInit(i2c_handler);
542 
543  /* Re-Initialize the I2C communication bus */
544  I2Cx_Init(i2c_handler);
545 }
546 
551 /*******************************************************************************
552  LINK OPERATIONS
553 *******************************************************************************/
554 
555 /********************************* LINK AUDIO *********************************/
556 
560 void AUDIO_IO_Init(void)
561 {
563 }
564 
568 void AUDIO_IO_DeInit(void)
569 {
570 
571 }
572 
580 void AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
581 {
582  uint16_t tmp = Value;
583 
584  Value = ((uint16_t)(tmp >> 8) & 0x00FF);
585 
586  Value |= ((uint16_t)(tmp << 8)& 0xFF00);
587 
588  I2Cx_WriteMultiple(&hI2cAudioHandler, Addr, Reg, I2C_MEMADD_SIZE_16BIT,(uint8_t*)&Value, 2);
589 }
590 
597 uint16_t AUDIO_IO_Read(uint8_t Addr, uint16_t Reg)
598 {
599  uint16_t read_value = 0, tmp = 0;
600 
601  I2Cx_ReadMultiple(&hI2cAudioHandler, Addr, Reg, I2C_MEMADD_SIZE_16BIT, (uint8_t*)&read_value, 2);
602 
603  tmp = ((uint16_t)(read_value >> 8) & 0x00FF);
604 
605  tmp |= ((uint16_t)(read_value << 8)& 0xFF00);
606 
607  read_value = tmp;
608 
609  return read_value;
610 }
611 
616 void AUDIO_IO_Delay(uint32_t Delay)
617 {
618  HAL_Delay(Delay);
619 }
620 
621 /******************************** LINK I2C EEPROM *****************************/
622 
626 void EEPROM_IO_Init(void)
627 {
629 }
630 
639 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
640 {
641  return (I2Cx_WriteMultiple(&hI2cExtHandler, DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
642 }
643 
652 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
653 {
654  return (I2Cx_ReadMultiple(&hI2cExtHandler, DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
655 }
656 
664 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
665 {
666  return (I2Cx_IsDeviceReady(&hI2cExtHandler, DevAddress, Trials));
667 }
668 
669 /******************************** LINK TS (TouchScreen) ***********************/
670 
675 void TS_IO_Init(void)
676 {
678 }
679 
687 void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
688 {
689  I2Cx_WriteMultiple(&hI2cAudioHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT,(uint8_t*)&Value, 1);
690 }
691 
698 uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
699 {
700  uint8_t read_value = 0;
701 
702  I2Cx_ReadMultiple(&hI2cAudioHandler, Addr, Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&read_value, 1);
703 
704  return read_value;
705 }
706 
716 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
717 {
718  return I2Cx_ReadMultiple(&hI2cAudioHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
719 }
720 
730 void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
731 {
732  I2Cx_WriteMultiple(&hI2cAudioHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
733 }
734 
740 void TS_IO_Delay(uint32_t Delay)
741 {
742  HAL_Delay(Delay);
743 }
744 
745 /**************************** LINK OTM8009A (Display driver) ******************/
750 void OTM8009A_IO_Delay(uint32_t Delay)
751 {
752  HAL_Delay(Delay);
753 }
754 
755 /**************************** LINK ADV7533 DSI-HDMI (Display driver) **********/
760 void HDMI_IO_Init(void)
761 {
763 }
764 
772 void HDMI_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
773 {
774  I2Cx_WriteMultiple(&hI2cAudioHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, &Value, 1);
775 }
776 
784 uint8_t HDMI_IO_Read(uint8_t Addr, uint8_t Reg)
785 {
786  uint8_t value = 0x00;
787 
788  I2Cx_ReadMultiple(&hI2cAudioHandler, Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, &value, 1);
789 
790  return value;
791 }
792 
798 void HDMI_IO_Delay(uint32_t Delay)
799 {
800  HAL_Delay(Delay);
801 }
818 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
HAL_I2C_Init
HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c)
LED1_PIN
#define LED1_PIN
Definition: stm32469i_discovery.h:156
LED2_GPIO_PORT
#define LED2_GPIO_PORT
Definition: stm32469i_discovery.h:143
HAL_StatusTypeDef
HAL_StatusTypeDef
HAL Status structures definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:40
DISCOVERY_EXT_I2Cx_SCL_SDA_AF
#define DISCOVERY_EXT_I2Cx_SCL_SDA_AF
Definition: stm32f769i_discovery.h:284
BUTTON_GPIO_CLK_ENABLE
#define BUTTON_GPIO_CLK_ENABLE()
Definition: stm32469i_discovery.h:186
BSP_GetVersion
uint32_t BSP_GetVersion(void)
This method returns the STM32F769I Discovery BSP Driver revision.
Definition: stm32f769i_discovery.c:168
HAL_I2C_GetState
HAL_I2C_StateTypeDef HAL_I2C_GetState(I2C_HandleTypeDef *hi2c)
I2C_InitTypeDef::OwnAddress1
uint32_t OwnAddress1
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:56
HAL_NVIC_EnableIRQ
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
I2Cx_WriteMultiple
static HAL_StatusTypeDef I2Cx_WriteMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length)
Writes a value in a register of the device through BUS in using DMA mode.
Definition: stm32f769i_discovery.c:504
I2C_InitTypeDef::AddressingMode
uint32_t AddressingMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:59
DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT
#define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_PORT
Definition: stm32f769i_discovery.h:283
BUTTON_MODE_GPIO
@ BUTTON_MODE_GPIO
Definition: stm32f4_discovery.h:78
hI2cExtHandler
static I2C_HandleTypeDef hI2cExtHandler
Definition: stm32f769i_discovery.c:110
BSP_PB_GetState
uint32_t BSP_PB_GetState(Button_TypeDef Button)
Returns the selected button state.
Definition: stm32f769i_discovery.c:331
DISCOVERY_EXT_I2Cx
#define DISCOVERY_EXT_I2Cx
User can use this section to tailor I2C1/I2C1 instance used and associated resources....
Definition: stm32f769i_discovery.h:272
BSP_LED_Toggle
void BSP_LED_Toggle(Led_TypeDef Led)
Toggles the selected LED.
Definition: stm32f769i_discovery.c:252
DISCOVERY_AUDIO_I2Cx_SDA_GPIO_CLK_ENABLE
#define DISCOVERY_AUDIO_I2Cx_SDA_GPIO_CLK_ENABLE()
Definition: stm32f769i_discovery.h:249
GPIO_InitTypeDef
GPIO Init structure definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:47
EEPROM_IO_Init
void EEPROM_IO_Init(void)
Initializes peripherals used by the I2C EEPROM driver.
Definition: stm32f769i_discovery.c:626
I2C_InitTypeDef::OwnAddress2
uint32_t OwnAddress2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:65
GPIO_PIN
uint32_t GPIO_PIN[LEDn]
Definition: stm32f769i_discovery.c:96
HDMI_IO_Write
void HDMI_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
HDMI writes single data.
Definition: stm32f769i_discovery.c:772
LEDx_GPIO_CLK_ENABLE
#define LEDx_GPIO_CLK_ENABLE(__INDEX__)
Definition: stm32f4_discovery.h:121
BSP_LED_Off
void BSP_LED_Off(Led_TypeDef Led)
Turns selected LED Off.
Definition: stm32f769i_discovery.c:239
EEPROM_IO_IsDeviceReady
HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
Definition: stm32f769i_discovery.c:664
GPIO_InitTypeDef::Alternate
uint32_t Alternate
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:61
BSP_LED_Init
void BSP_LED_Init(Led_TypeDef Led)
Configures LED GPIO.
Definition: stm32f769i_discovery.c:181
stm32f769i_discovery.h
This file contains definitions for STM32F769I-Discovery LEDs, push-buttons hardware resources.
I2C_ADDRESSINGMODE_7BIT
#define I2C_ADDRESSINGMODE_7BIT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:299
HAL_NVIC_DisableIRQ
void HAL_NVIC_DisableIRQ(IRQn_Type IRQn)
I2C_InitTypeDef::DualAddressMode
uint32_t DualAddressMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:62
GPIO_PIN_SET
@ GPIO_PIN_SET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:71
GPIO_PORT
GPIO_TypeDef * GPIO_PORT[LEDn]
Definition: stm32f769i_discovery.c:99
BSP_LED_DeInit
void BSP_LED_DeInit(Led_TypeDef Led)
DeInit LEDs.
Definition: stm32f769i_discovery.c:206
HAL_I2C_STATE_RESET
@ HAL_I2C_STATE_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:109
EEPROM_IO_WriteData
HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Write data to I2C EEPROM driver in using DMA channel.
Definition: stm32f769i_discovery.c:639
WAKEUP_BUTTON_EXTI_IRQn
#define WAKEUP_BUTTON_EXTI_IRQn
Definition: stm32469i_discovery.h:177
I2Cx_Error
static void I2Cx_Error(I2C_HandleTypeDef *i2c_handler, uint8_t Addr)
Manages error callback by re-initializing I2C.
Definition: stm32f769i_discovery.c:538
DISCOVERY_I2Cx_TIMING
#define DISCOVERY_I2Cx_TIMING
Definition: stm32f769i_discovery.h:297
WAKEUP_BUTTON_PIN
#define WAKEUP_BUTTON_PIN
Wakeup push-button.
Definition: stm32469i_discovery.h:173
LED1_GPIO_PORT
#define LED1_GPIO_PORT
Definition: stm32469i_discovery.h:142
HAL_I2C_Mem_Write
HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout)
DISCOVERY_AUDIO_I2Cx_SCL_AF
#define DISCOVERY_AUDIO_I2Cx_SCL_AF
Definition: stm32f769i_discovery.h:257
HAL_Delay
void HAL_Delay(uint32_t Delay)
This function provides minimum delay (in milliseconds) based on variable incremented.
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c:389
BUTTON_MODE_EXTI
@ BUTTON_MODE_EXTI
Definition: stm32f4_discovery.h:79
DISCOVERY_EXT_I2Cx_SDA_PIN
#define DISCOVERY_EXT_I2Cx_SDA_PIN
Definition: stm32f769i_discovery.h:285
I2C_InitTypeDef::NoStretchMode
uint32_t NoStretchMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:71
DISCOVERY_EXT_I2Cx_FORCE_RESET
#define DISCOVERY_EXT_I2Cx_FORCE_RESET()
Definition: stm32f769i_discovery.h:277
BUTTON_IRQn
const uint16_t BUTTON_IRQn[BUTTONn]
Definition: stm32f769i_discovery.c:106
HAL_GPIO_ReadPin
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
ButtonMode_TypeDef
ButtonMode_TypeDef
Definition: stm32f4_discovery.h:76
HAL_OK
@ HAL_OK
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h:42
LED2_PIN
#define LED2_PIN
Definition: stm32469i_discovery.h:157
hI2cAudioHandler
static I2C_HandleTypeDef hI2cAudioHandler
Definition: stm32f769i_discovery.c:109
I2Cx_Init
static void I2Cx_Init(I2C_HandleTypeDef *i2c_handler)
Initializes I2C HAL.
Definition: stm32f769i_discovery.c:440
I2Cx_MspInit
static void I2Cx_MspInit(I2C_HandleTypeDef *i2c_handler)
Initializes I2C MSP.
Definition: stm32f769i_discovery.c:355
BSP_PB_Init
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
Definition: stm32f769i_discovery.c:270
I2C_DUALADDRESS_DISABLE
#define I2C_DUALADDRESS_DISABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:308
HAL_GPIO_Init
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
HDMI_IO_Init
void HDMI_IO_Init(void)
Initializes HDMI IO low level.
Definition: stm32f769i_discovery.c:760
DISCOVERY_AUDIO_I2Cx
#define DISCOVERY_AUDIO_I2Cx
User can use this section to tailor I2C4/I2C4 instance used and associated resources (audio codec)....
Definition: stm32f769i_discovery.h:246
GPIO_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:52
I2C_GENERALCALL_DISABLE
#define I2C_GENERALCALL_DISABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:317
DISCOVERY_EXT_I2Cx_EV_IRQn
#define DISCOVERY_EXT_I2Cx_EV_IRQn
Definition of I2C interrupt requests.
Definition: stm32f769i_discovery.h:289
DISCOVERY_AUDIO_I2Cx_FORCE_RESET
#define DISCOVERY_AUDIO_I2Cx_FORCE_RESET()
Definition: stm32f769i_discovery.h:251
I2C_MEMADD_SIZE_16BIT
#define I2C_MEMADD_SIZE_16BIT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:336
GPIO_InitTypeDef::Pull
uint32_t Pull
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:55
GPIO_NOPULL
#define GPIO_NOPULL
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:154
DISCOVERY_EXT_I2Cx_CLK_ENABLE
#define DISCOVERY_EXT_I2Cx_CLK_ENABLE()
Definition: stm32f769i_discovery.h:273
DISCOVERY_EXT_I2Cx_SCL_PIN
#define DISCOVERY_EXT_I2Cx_SCL_PIN
Definition for I2C1 Pins.
Definition: stm32f769i_discovery.h:282
DISCOVERY_AUDIO_I2Cx_EV_IRQn
#define DISCOVERY_AUDIO_I2Cx_EV_IRQn
Definition of I2C4 interrupt requests.
Definition: stm32f769i_discovery.h:264
BUTTON_PIN
const uint16_t BUTTON_PIN[BUTTONn]
Definition: stm32f769i_discovery.c:104
BSP_LED_On
void BSP_LED_On(Led_TypeDef Led)
Turns selected LED On.
Definition: stm32f769i_discovery.c:226
DISCOVERY_AUDIO_I2Cx_ER_IRQn
#define DISCOVERY_AUDIO_I2Cx_ER_IRQn
Definition: stm32f769i_discovery.h:265
HAL_GPIO_DeInit
void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
IRQn_Type
IRQn_Type
STM32F4XX Interrupt Number Definition, according to the selected device in Library_configuration_sect...
Definition: stm32f407xx.h:66
DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE
#define DISCOVERY_EXT_I2Cx_SCL_SDA_GPIO_CLK_ENABLE()
Definition: stm32f769i_discovery.h:275
DISCOVERY_EXT_I2Cx_ER_IRQn
#define DISCOVERY_EXT_I2Cx_ER_IRQn
Definition: stm32f769i_discovery.h:290
I2C_InitTypeDef::Timing
uint32_t Timing
Definition: stm32f7xx_hal_i2c.h:50
GPIO_InitTypeDef::Speed
uint32_t Speed
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:58
I2C_MEMADD_SIZE_8BIT
#define I2C_MEMADD_SIZE_8BIT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:335
GPIO_PULLUP
#define GPIO_PULLUP
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:155
HAL_I2C_IsDeviceReady
HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout)
DISCOVERY_AUDIO_I2Cx_SCL_GPIO_PORT
#define DISCOVERY_AUDIO_I2Cx_SCL_GPIO_PORT
Definition: stm32f769i_discovery.h:258
GPIO_PIN_RESET
@ GPIO_PIN_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:70
BSP_PB_DeInit
void BSP_PB_DeInit(Button_TypeDef Button)
Push Button DeInit.
Definition: stm32f769i_discovery.c:313
HDMI_IO_Read
uint8_t HDMI_IO_Read(uint8_t Addr, uint8_t Reg)
Reads single data with I2C communication channel from HDMI bridge.
Definition: stm32f769i_discovery.c:784
I2C_InitTypeDef::GeneralCallMode
uint32_t GeneralCallMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:68
Button_TypeDef
Button_TypeDef
Definition: stm32f4_discovery.h:71
AUDIO_IO_Init
void AUDIO_IO_Init(void)
Initializes Audio low level.
Definition: stm32f769i_discovery.c:560
GPIO_TypeDef
General Purpose I/O.
Definition: stm32f407xx.h:527
I2C_HandleTypeDef::Init
I2C_InitTypeDef Init
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:193
GPIO_MODE_AF_OD
#define GPIO_MODE_AF_OD
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:123
TS_IO_Read
uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
Reads a single data.
Definition: stm32f769i_discovery.c:698
BUTTON_PORT
GPIO_TypeDef * BUTTON_PORT[BUTTONn]
Definition: stm32f769i_discovery.c:102
DISCOVERY_AUDIO_I2Cx_SCL_GPIO_CLK_ENABLE
#define DISCOVERY_AUDIO_I2Cx_SCL_GPIO_CLK_ENABLE()
Definition: stm32f769i_discovery.h:248
Led_TypeDef
Led_TypeDef
Definition: stm32f4_discovery.h:63
GPIO_MODE_IT_RISING
#define GPIO_MODE_IT_RISING
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:127
BUTTONn
@ BUTTONn
Definition: stm32h747i_discovery.h:75
DISCOVERY_AUDIO_I2Cx_SDA_PIN
#define DISCOVERY_AUDIO_I2Cx_SDA_PIN
Definition: stm32f769i_discovery.h:259
TS_IO_ReadMultiple
uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Reads multiple data with I2C communication channel from TouchScreen.
Definition: stm32f769i_discovery.c:716
DISCOVERY_EXT_I2Cx_RELEASE_RESET
#define DISCOVERY_EXT_I2Cx_RELEASE_RESET()
Definition: stm32f769i_discovery.h:278
HDMI_IO_Delay
void HDMI_IO_Delay(uint32_t Delay)
HDMI delay.
Definition: stm32f769i_discovery.c:798
OTM8009A_IO_Delay
void OTM8009A_IO_Delay(uint32_t Delay)
OTM8009A delay.
Definition: stm32f769i_discovery.c:750
I2C_HandleTypeDef
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:188
DISCOVERY_AUDIO_I2Cx_CLK_ENABLE
#define DISCOVERY_AUDIO_I2Cx_CLK_ENABLE()
Definition: stm32f769i_discovery.h:247
TS_IO_Delay
void TS_IO_Delay(uint32_t Delay)
Delay function used in TouchScreen low level driver.
Definition: stm32f769i_discovery.c:740
DISCOVERY_AUDIO_I2Cx_SDA_AF
#define DISCOVERY_AUDIO_I2Cx_SDA_AF
Definition: stm32f769i_discovery.h:260
TS_IO_WriteMultiple
void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
Writes multiple data with I2C communication channel from MCU to TouchScreen.
Definition: stm32f769i_discovery.c:730
DISCOVERY_AUDIO_I2Cx_RELEASE_RESET
#define DISCOVERY_AUDIO_I2Cx_RELEASE_RESET()
Definition: stm32f769i_discovery.h:252
I2Cx_ReadMultiple
static HAL_StatusTypeDef I2Cx_ReadMultiple(I2C_HandleTypeDef *i2c_handler, uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
Definition: stm32f769i_discovery.c:478
AUDIO_IO_Delay
void AUDIO_IO_Delay(uint32_t Delay)
AUDIO Codec delay.
Definition: stm32f769i_discovery.c:616
HAL_NVIC_SetPriority
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
AUDIO_IO_Write
void AUDIO_IO_Write(uint8_t Addr, uint16_t Reg, uint16_t Value)
Writes a single data.
Definition: stm32f769i_discovery.c:580
DISCOVERY_AUDIO_I2Cx_SCL_PIN
#define DISCOVERY_AUDIO_I2Cx_SCL_PIN
Definition for I2C4 Pins.
Definition: stm32f769i_discovery.h:256
AUDIO_IO_Read
uint16_t AUDIO_IO_Read(uint8_t Addr, uint16_t Reg)
Reads a single data.
Definition: stm32f769i_discovery.c:597
GPIO_MODE_OUTPUT_PP
#define GPIO_MODE_OUTPUT_PP
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:120
HAL_I2C_Mem_Read
HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout)
I2C_NOSTRETCH_DISABLE
#define I2C_NOSTRETCH_DISABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:326
HAL_GPIO_TogglePin
void HAL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
EEPROM_IO_ReadData
HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
Read data from I2C EEPROM driver in using DMA channel.
Definition: stm32f769i_discovery.c:652
I2C_HandleTypeDef::Instance
I2C_TypeDef * Instance
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:191
WAKEUP_BUTTON_GPIO_PORT
#define WAKEUP_BUTTON_GPIO_PORT
Definition: stm32469i_discovery.h:174
Length
Length
TS_IO_Write
void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
Definition: stm32f769i_discovery.c:687
GPIO_MODE_INPUT
#define GPIO_MODE_INPUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:119
__STM32F769I_DISCOVERY_BSP_VERSION
#define __STM32F769I_DISCOVERY_BSP_VERSION
Definition: stm32f769i_discovery.c:78
DISCOVERY_AUDIO_I2Cx_SDA_GPIO_PORT
#define DISCOVERY_AUDIO_I2Cx_SDA_GPIO_PORT
Definition: stm32f769i_discovery.h:261
I2Cx_IsDeviceReady
static HAL_StatusTypeDef I2Cx_IsDeviceReady(I2C_HandleTypeDef *i2c_handler, uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
Definition: stm32f769i_discovery.c:527
LEDn
@ LEDn
Definition: stm32h747i_discovery.h:69
HAL_I2C_DeInit
HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c)
TS_IO_Init
void TS_IO_Init(void)
Initializes Touchscreen low level.
Definition: stm32f769i_discovery.c:675
HAL_GPIO_WritePin
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
AUDIO_IO_DeInit
void AUDIO_IO_DeInit(void)
DeInitializes Audio low level.
Definition: stm32f769i_discovery.c:568
GPIO_InitTypeDef::Pin
uint32_t Pin
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:49


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:14:53