stm32469i_discovery.c
Go to the documentation of this file.
1 
39 /* Includes ------------------------------------------------------------------*/
40 #include "stm32469i_discovery.h"
41 
67 #define __STM32469I_DISCOVERY_BSP_VERSION_MAIN (0x02)
68 #define __STM32469I_DISCOVERY_BSP_VERSION_SUB1 (0x00)
69 #define __STM32469I_DISCOVERY_BSP_VERSION_SUB2 (0x01)
70 #define __STM32469I_DISCOVERY_BSP_VERSION_RC (0x00)
71 #define __STM32469I_DISCOVERY_BSP_VERSION ((__STM32469I_DISCOVERY_BSP_VERSION_MAIN << 24)\
72  |(__STM32469I_DISCOVERY_BSP_VERSION_SUB1 << 16)\
73  |(__STM32469I_DISCOVERY_BSP_VERSION_SUB2 << 8 )\
74  |(__STM32469I_DISCOVERY_BSP_VERSION_RC))
75 
89 uint32_t GPIO_PIN[LEDn] = {LED1_PIN,
90  LED2_PIN,
91  LED3_PIN,
92  LED4_PIN};
93 
98 
100 
101 const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN };
102 
104 
105 
108 
116 static void I2C1_MspInit(void);
117 static void I2C2_MspInit(void);
118 static void I2C1_Init(void);
119 static void I2C2_Init(void);
120 
121 #if defined(USE_IOEXPANDER)
122 static void I2C1_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
123 static uint8_t I2C1_Read(uint8_t Addr, uint8_t Reg);
124 #endif /* USE_IOEXPANDER */
125 static HAL_StatusTypeDef I2C1_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
126 static HAL_StatusTypeDef I2C2_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
127 static HAL_StatusTypeDef I2C1_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
128 static HAL_StatusTypeDef I2C2_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
129 static HAL_StatusTypeDef I2C1_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
130 static void I2C1_Error(uint8_t Addr);
131 static void I2C2_Error(uint8_t Addr);
132 
133 /* AUDIO IO functions */
134 void AUDIO_IO_Init(void);
135 void AUDIO_IO_DeInit(void);
136 void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
137 uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg);
138 void AUDIO_IO_Delay(uint32_t Delay);
139 
140 
141 /* I2C EEPROM IO function */
142 void EEPROM_IO_Init(void);
143 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
144 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
145 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
146 
147 /* TouchScreen (TS) IO functions */
148 void TS_IO_Init(void);
149 void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
150 uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg);
151 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
152 void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
153 void TS_IO_Delay(uint32_t Delay);
154 void OTM8009A_IO_Delay(uint32_t Delay);
167 uint32_t BSP_GetVersion(void)
168 {
170 }
171 
182 {
183  GPIO_InitTypeDef gpio_init_structure;
184 
185  if (Led <= LED4)
186  {
187  /* Configure the GPIO_LED pin */
188  gpio_init_structure.Pin = GPIO_PIN[Led];
189  gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
190  gpio_init_structure.Pull = GPIO_PULLUP;
191  gpio_init_structure.Speed = GPIO_SPEED_HIGH;
192 
193  switch(Led)
194  {
195  case LED1 :
197  break;
198  case LED2 :
200  break;
201  case LED3 :
203  break;
204  case LED4 :
206  break;
207  default :
208  break;
209 
210  } /* end switch */
211 
212  HAL_GPIO_Init(GPIO_PORT[Led], &gpio_init_structure);
213 
214  /* By default, turn off LED by setting a high level on corresponding GPIO */
216 
217  } /* of if (Led <= LED4) */
218 
219 }
220 
221 
233 {
234  GPIO_InitTypeDef gpio_init_structure;
235 
236  if (Led <= LED4)
237  {
238  /* DeInit the GPIO_LED pin */
239  gpio_init_structure.Pin = GPIO_PIN[Led];
240 
241  /* Turn off LED */
243  HAL_GPIO_DeInit(GPIO_PORT[Led], gpio_init_structure.Pin);
244  }
245 
246 }
247 
258 {
259  if (Led <= LED4)
260  {
262  }
263 
264 }
265 
276 {
277  if (Led <= LED4)
278  {
280  }
281 }
282 
293 {
294  if (Led <= LED4)
295  {
297  }
298 }
299 
313 {
314  GPIO_InitTypeDef gpio_init_structure;
315 
316  /* Enable the BUTTON clock */
318 
319  if(Button_Mode == BUTTON_MODE_GPIO)
320  {
321  /* Configure Button pin as input */
322  gpio_init_structure.Pin = BUTTON_PIN[Button];
323  gpio_init_structure.Mode = GPIO_MODE_INPUT;
324  gpio_init_structure.Pull = GPIO_NOPULL;
325  gpio_init_structure.Speed = GPIO_SPEED_FAST;
326  HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
327  }
328 
329  if(Button_Mode == BUTTON_MODE_EXTI)
330  {
331  /* Configure Button pin as input with External interrupt */
332  gpio_init_structure.Pin = BUTTON_PIN[Button];
333  gpio_init_structure.Pull = GPIO_NOPULL;
334  gpio_init_structure.Speed = GPIO_SPEED_FAST;
335 
336  gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
337 
338  HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
339 
340  /* Enable and set Button EXTI Interrupt to the lowest priority */
341  HAL_NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x0F, 0x00);
343  }
344 }
345 
355 {
356  GPIO_InitTypeDef gpio_init_structure;
357 
358  gpio_init_structure.Pin = BUTTON_PIN[Button];
360  HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
361 }
362 
363 
373 {
374  return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
375 }
376 
386 /*******************************************************************************
387  BUS OPERATIONS
388 *******************************************************************************/
389 
390 /******************************* I2C Routines *********************************/
394 static void I2C1_MspInit(void)
395 {
396  GPIO_InitTypeDef gpio_init_structure;
397 
398  /*** Configure the GPIOs ***/
399  /* Enable GPIO clock */
401 
402  /* Configure I2C Tx as alternate function */
403  gpio_init_structure.Pin = DISCO_I2C1_SCL_PIN;
404  gpio_init_structure.Mode = GPIO_MODE_AF_OD;
405  gpio_init_structure.Pull = GPIO_NOPULL;
406  gpio_init_structure.Speed = GPIO_SPEED_FAST;
407  gpio_init_structure.Alternate = DISCO_I2C1_SCL_SDA_AF;
408  HAL_GPIO_Init(DISCO_I2C1_SCL_SDA_GPIO_PORT, &gpio_init_structure);
409 
410  /* Configure I2C Rx as alternate function */
411  gpio_init_structure.Pin = DISCO_I2C1_SDA_PIN;
412  HAL_GPIO_Init(DISCO_I2C1_SCL_SDA_GPIO_PORT, &gpio_init_structure);
413 
414  /*** Configure the I2C peripheral ***/
415  /* Enable I2C clock */
417 
418  /* Force the I2C peripheral clock reset */
420 
421  /* Release the I2C peripheral clock reset */
423 
424  /* Enable and set I2C1 Interrupt to a lower priority */
427 
428  /* Enable and set I2C1 Interrupt to a lower priority */
431 }
432 
436 static void I2C2_MspInit(void)
437 {
438  GPIO_InitTypeDef gpio_init_structure;
439 
440  /*** Configure the GPIOs ***/
441  /* Enable GPIO clock */
443 
444  /* Configure I2C Tx as alternate function */
445  gpio_init_structure.Pin = DISCO_I2C2_SCL_PIN;
446  gpio_init_structure.Mode = GPIO_MODE_AF_OD;
447  gpio_init_structure.Pull = GPIO_NOPULL;
448  gpio_init_structure.Speed = GPIO_SPEED_FAST;
449  gpio_init_structure.Alternate = DISCO_I2C2_SCL_SDA_AF;
450  HAL_GPIO_Init(DISCO_I2C2_SCL_SDA_GPIO_PORT, &gpio_init_structure);
451 
452  /* Configure I2C Rx as alternate function */
453  gpio_init_structure.Pin = DISCO_I2C2_SDA_PIN;
454  HAL_GPIO_Init(DISCO_I2C2_SCL_SDA_GPIO_PORT, &gpio_init_structure);
455 
456  /*** Configure the I2C peripheral ***/
457  /* Enable I2C clock */
459 
460  /* Force the I2C peripheral clock reset */
462 
463  /* Release the I2C peripheral clock reset */
465 
466  /* Enable and set I2C1 Interrupt to a lower priority */
469 
470  /* Enable and set I2C1 Interrupt to a lower priority */
473 }
474 
478 static void I2C1_Init(void)
479 {
481  {
491 
492  /* Init the I2C */
493  I2C1_MspInit();
495  }
496 }
497 
501 static void I2C2_Init(void)
502 {
504  {
514 
515  /* Init the I2C */
516  I2C2_MspInit();
518  }
519 }
520 
527 static void I2C1_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
528 {
529  HAL_StatusTypeDef status = HAL_OK;
530 
531  status = HAL_I2C_Mem_Write(&heval_I2c1,
532  Addr,
533  (uint16_t)Reg,
535  &Value,
536  1,
537  100);
538 
539  /* Check the communication status */
540  if(status != HAL_OK)
541  {
542  /* Execute user timeout callback */
543  I2C1_Error(Addr);
544  }
545 }
546 
553 static uint8_t I2C1_Read(uint8_t Addr, uint8_t Reg)
554 {
555  HAL_StatusTypeDef status = HAL_OK;
556  uint8_t Value = 0;
557 
558  status = HAL_I2C_Mem_Read(&heval_I2c1,
559  Addr,
560  Reg,
562  &Value,
563  1,
564  1000);
565 
566  /* Check the communication status */
567  if(status != HAL_OK)
568  {
569  /* Execute user timeout callback */
570  I2C1_Error(Addr);
571  }
572  return Value;
573 }
574 
585  uint16_t Reg,
586  uint16_t MemAddress,
587  uint8_t *Buffer,
588  uint16_t Length)
589 {
590  HAL_StatusTypeDef status = HAL_OK;
591 
592  status = HAL_I2C_Mem_Read(&heval_I2c1,
593  Addr,
594  (uint16_t)Reg,
595  MemAddress,
596  Buffer,
597  Length,
598  1000);
599 
600  /* Check the communication status */
601  if(status != HAL_OK)
602  {
603  /* I2C error occured */
604  I2C1_Error(Addr);
605  }
606  return status;
607 }
608 
610  uint16_t Reg,
611  uint16_t MemAddress,
612  uint8_t *Buffer,
613  uint16_t Length)
614 {
615  HAL_StatusTypeDef status = HAL_OK;
616 
617  status = HAL_I2C_Mem_Read(&heval_I2c2,
618  Addr,
619  (uint16_t)Reg,
620  MemAddress,
621  Buffer,
622  Length,
623  1000);
624 
625  /* Check the communication status */
626  if(status != HAL_OK)
627  {
628  /* I2C2 error occured */
629  I2C2_Error(Addr);
630  }
631  return status;
632 }
633 
644  uint16_t Reg,
645  uint16_t MemAddress,
646  uint8_t *Buffer,
647  uint16_t Length)
648 {
649  HAL_StatusTypeDef status = HAL_OK;
650 
651  status = HAL_I2C_Mem_Write(&heval_I2c1,
652  Addr,
653  (uint16_t)Reg,
654  MemAddress,
655  Buffer,
656  Length,
657  1000);
658 
659  /* Check the communication status */
660  if(status != HAL_OK)
661  {
662  /* Re-Initiaize the I2C Bus */
663  I2C1_Error(Addr);
664  }
665  return status;
666 }
667 
669  uint16_t Reg,
670  uint16_t MemAddress,
671  uint8_t *Buffer,
672  uint16_t Length)
673 {
674  HAL_StatusTypeDef status = HAL_OK;
675 
676  status = HAL_I2C_Mem_Write(&heval_I2c2,
677  Addr,
678  (uint16_t)Reg,
679  MemAddress,
680  Buffer,
681  Length,
682  1000);
683 
684  /* Check the communication status */
685  if(status != HAL_OK)
686  {
687  /* Re-Initiaize the I2C2 Bus */
688  I2C2_Error(Addr);
689  }
690  return status;
691 }
692 
700 static HAL_StatusTypeDef I2C1_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
701 {
702  return (HAL_I2C_IsDeviceReady(&heval_I2c1, DevAddress, Trials, 1000));
703 }
704 
709 static void I2C1_Error(uint8_t Addr)
710 {
711  /* De-initialize the I2C comunication bus */
713 
714  /* Re-Initiaize the I2C comunication bus */
715  I2C1_Init();
716 }
717 
718 static void I2C2_Error(uint8_t Addr)
719 {
720  /* De-initialize the I2C2 comunication bus */
722 
723  /* Re-Initiaize the I2C2 comunication bus */
724  I2C2_Init();
725 }
726 
731 /*******************************************************************************
732  LINK OPERATIONS
733 *******************************************************************************/
734 
735 /********************************* LINK AUDIO *********************************/
736 
740 void AUDIO_IO_Init(void)
741 {
742  I2C2_Init();
743 }
744 
748 void AUDIO_IO_DeInit(void)
749 {
750 
751 }
752 
759 void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
760 {
761  I2C2_WriteMultiple(Addr, (uint16_t) Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&Value, 1);
762 }
763 
770 uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg)
771 {
772  uint8_t read_value = 0;
773 
774  I2C2_ReadMultiple(Addr, (uint16_t) Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&read_value, 1);
775 
776  return read_value;
777 }
778 
783 void AUDIO_IO_Delay(uint32_t Delay)
784 {
785  HAL_Delay(Delay);
786 }
787 
788 /******************************** LINK I2C EEPROM *****************************/
789 
793 void EEPROM_IO_Init(void)
794 {
795  I2C1_Init();
796 }
797 
806 HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
807 {
808  return (I2C1_WriteMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
809 }
810 
819 HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
820 {
821  return (I2C1_ReadMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
822 }
823 
831 HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
832 {
833  return (I2C1_IsDeviceReady(DevAddress, Trials));
834 }
835 
836 /******************************** LINK TS (TouchScreen) ***********************/
837 
842 void TS_IO_Init(void)
843 {
844  I2C1_Init();
845 }
846 
854 void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
855 {
856  I2C1_Write(Addr, Reg, Value);
857 }
858 
866 uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
867 {
868  return I2C1_Read(Addr, Reg);
869 }
870 
880 uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
881 {
882  return I2C1_ReadMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
883 }
884 
893 void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
894 {
895  I2C1_WriteMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
896 }
897 
902 void TS_IO_Delay(uint32_t Delay)
903 {
904  HAL_Delay(Delay);
905 }
906 
907 /**************************** LINK OTM8009A (Display driver) ******************/
912 void OTM8009A_IO_Delay(uint32_t Delay)
913 {
914  HAL_Delay(Delay);
915 }
916 
933 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
__STM32469I_DISCOVERY_BSP_VERSION
#define __STM32469I_DISCOVERY_BSP_VERSION
Definition: stm32469i_discovery.c:71
DISCO_I2C1_ER_IRQn
#define DISCO_I2C1_ER_IRQn
Definition: stm32469i_discovery.h:284
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
BUTTON_GPIO_CLK_ENABLE
#define BUTTON_GPIO_CLK_ENABLE()
Definition: stm32469i_discovery.h:186
DISCO_I2C2_FORCE_RESET
#define DISCO_I2C2_FORCE_RESET()
Definition: stm32469i_discovery.h:307
HAL_I2C_GetState
HAL_I2C_StateTypeDef HAL_I2C_GetState(I2C_HandleTypeDef *hi2c)
BSP_LED_DeInit
void BSP_LED_DeInit(Led_TypeDef Led)
DeInit LEDs.
Definition: stm32469i_discovery.c:232
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)
I2C_InitTypeDef::AddressingMode
uint32_t AddressingMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:59
BUTTON_MODE_GPIO
@ BUTTON_MODE_GPIO
Definition: stm32f4_discovery.h:78
I2C2_Error
static void I2C2_Error(uint8_t Addr)
Definition: stm32469i_discovery.c:718
LED4
@ LED4
Definition: stm32f4_discovery.h:65
GPIO_InitTypeDef
GPIO Init structure definition
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:47
I2C_InitTypeDef::OwnAddress2
uint32_t OwnAddress2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:65
I2C1_MspInit
static void I2C1_MspInit(void)
Initializes I2C MSP.
Definition: stm32469i_discovery.c:394
BSP_GetVersion
uint32_t BSP_GetVersion(void)
This method returns the STM32469I Discovery BSP Driver revision.
Definition: stm32469i_discovery.c:167
DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE
#define DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE()
Definition: stm32469i_discovery.h:305
AUDIO_IO_Write
void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
Definition: stm32469i_discovery.c:759
GPIO_InitTypeDef::Alternate
uint32_t Alternate
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:61
DISCO_I2C1_SCL_SDA_GPIO_PORT
#define DISCO_I2C1_SCL_SDA_GPIO_PORT
Definition: stm32469i_discovery.h:277
LED4_PIN
#define LED4_PIN
Definition: stm32f4_discovery.h:101
I2C_ADDRESSINGMODE_7BIT
#define I2C_ADDRESSINGMODE_7BIT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:299
DISCO_I2C1_FORCE_RESET
#define DISCO_I2C1_FORCE_RESET()
Definition: stm32469i_discovery.h:271
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
I2C2_ReadMultiple
static HAL_StatusTypeDef I2C2_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length)
Definition: stm32469i_discovery.c:609
GPIO_PORT
GPIO_TypeDef * GPIO_PORT[LEDn]
Definition: stm32469i_discovery.c:94
EEPROM_IO_Init
void EEPROM_IO_Init(void)
Initializes peripherals used by the I2C EEPROM driver.
Definition: stm32469i_discovery.c:793
AUDIO_IO_Delay
void AUDIO_IO_Delay(uint32_t Delay)
AUDIO Codec delay.
Definition: stm32469i_discovery.c:783
HAL_I2C_STATE_RESET
@ HAL_I2C_STATE_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:109
I2C2_WriteMultiple
static HAL_StatusTypeDef I2C2_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length)
Definition: stm32469i_discovery.c:668
WAKEUP_BUTTON_EXTI_IRQn
#define WAKEUP_BUTTON_EXTI_IRQn
Definition: stm32469i_discovery.h:177
I2C_DUTYCYCLE_2
#define I2C_DUTYCYCLE_2
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:290
LED2_GPIO_CLK_ENABLE
#define LED2_GPIO_CLK_ENABLE()
Definition: stm32469i_discovery.h:149
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: stm32469i_discovery.c:806
BUTTON_IRQn
const uint16_t BUTTON_IRQn[BUTTONn]
Definition: stm32469i_discovery.c:103
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)
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
I2C_InitTypeDef::NoStretchMode
uint32_t NoStretchMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:71
LED2
@ LED2
Definition: stm32469i_discovery.h:72
DISCO_I2C2_EV_IRQn
#define DISCO_I2C2_EV_IRQn
Definition of I2C2 interrupt requests.
Definition: stm32469i_discovery.h:319
HAL_GPIO_ReadPin
GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
ButtonMode_TypeDef
ButtonMode_TypeDef
Definition: stm32f4_discovery.h:76
LED4_GPIO_PORT
#define LED4_GPIO_PORT
Definition: stm32f4_discovery.h:102
I2C1_Init
static void I2C1_Init(void)
Initializes I2C HAL.
Definition: stm32469i_discovery.c:478
I2C1_Read
static uint8_t I2C1_Read(uint8_t Addr, uint8_t Reg)
Reads a single data.
Definition: stm32469i_discovery.c:553
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
I2C1_Write
static void I2C1_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes a single data.
Definition: stm32469i_discovery.c:527
LED3_GPIO_PORT
#define LED3_GPIO_PORT
Definition: stm32f4_discovery.h:107
DISCO_I2C2_SCL_SDA_AF
#define DISCO_I2C2_SCL_SDA_AF
Definition: stm32469i_discovery.h:314
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)
GPIO_InitTypeDef::Mode
uint32_t Mode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:52
I2C1_IsDeviceReady
static HAL_StatusTypeDef I2C1_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
Definition: stm32469i_discovery.c:700
I2C_GENERALCALL_DISABLE
#define I2C_GENERALCALL_DISABLE
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:317
I2C_MEMADD_SIZE_16BIT
#define I2C_MEMADD_SIZE_16BIT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:336
DISCO_I2C1_CLK_ENABLE
#define DISCO_I2C1_CLK_ENABLE()
Definition: stm32469i_discovery.h:267
I2C_InitTypeDef::DutyCycle
uint32_t DutyCycle
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:53
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
LED1
@ LED1
Definition: stm32469i_discovery.h:70
DISCO_I2C2_SCL_SDA_GPIO_PORT
#define DISCO_I2C2_SCL_SDA_GPIO_PORT
Definition: stm32469i_discovery.h:313
BUTTON_PIN
const uint16_t BUTTON_PIN[BUTTONn]
Definition: stm32469i_discovery.c:101
I2C1_WriteMultiple
static HAL_StatusTypeDef I2C1_WriteMultiple(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: stm32469i_discovery.c:643
DISCO_I2C2_ER_IRQn
#define DISCO_I2C2_ER_IRQn
Definition: stm32469i_discovery.h:320
BSP_LED_Toggle
void BSP_LED_Toggle(Led_TypeDef Led)
Toggles the selected LED.
Definition: stm32469i_discovery.c:292
I2C1_Error
static void I2C1_Error(uint8_t Addr)
Manages error callback by re-initializing I2C.
Definition: stm32469i_discovery.c:709
HAL_GPIO_DeInit
void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
BSP_PB_GetState
uint32_t BSP_PB_GetState(Button_TypeDef Button)
Returns the selected button state.
Definition: stm32469i_discovery.c:372
I2C1_ReadMultiple
static HAL_StatusTypeDef I2C1_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length)
Reads multiple data.
Definition: stm32469i_discovery.c:584
IRQn_Type
IRQn_Type
STM32F4XX Interrupt Number Definition, according to the selected device in Library_configuration_sect...
Definition: stm32f407xx.h:66
I2C2_MspInit
static void I2C2_MspInit(void)
Initializes I2C MSP.
Definition: stm32469i_discovery.c:436
DISCO_I2C1_SCL_SDA_AF
#define DISCO_I2C1_SCL_SDA_AF
Definition: stm32469i_discovery.h:278
BSP_LED_On
void BSP_LED_On(Led_TypeDef Led)
Turns selected LED On.
Definition: stm32469i_discovery.c:257
GPIO_InitTypeDef::Speed
uint32_t Speed
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:58
AUDIO_IO_Read
uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg)
Reads a single data.
Definition: stm32469i_discovery.c:770
BSP_LED_Off
void BSP_LED_Off(Led_TypeDef Led)
Turns selected LED Off.
Definition: stm32469i_discovery.c:275
I2C_MEMADD_SIZE_8BIT
#define I2C_MEMADD_SIZE_8BIT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:335
I2C2_SCL_FREQ_KHZ
#define I2C2_SCL_FREQ_KHZ
I2C2 clock speed configuration (in Hz) WARNING: Make sure that this define is not already declared in...
Definition: stm32469i_discovery.h:295
DISCO_I2C2_CLK_ENABLE
#define DISCO_I2C2_CLK_ENABLE()
Definition: stm32469i_discovery.h:304
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)
LED3_PIN
#define LED3_PIN
Definition: stm32f4_discovery.h:106
GPIO_PIN_RESET
@ GPIO_PIN_RESET
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:70
LED1_GPIO_CLK_ENABLE
#define LED1_GPIO_CLK_ENABLE()
Definition: stm32469i_discovery.h:147
I2C_InitTypeDef::GeneralCallMode
uint32_t GeneralCallMode
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:68
LED3
@ LED3
Definition: stm32f4_discovery.h:66
Button_TypeDef
Button_TypeDef
Definition: stm32f4_discovery.h:71
EEPROM_IO_IsDeviceReady
HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
Checks if target device is ready for communication.
Definition: stm32469i_discovery.c:831
OTM8009A_IO_Delay
void OTM8009A_IO_Delay(uint32_t Delay)
OTM8009A delay.
Definition: stm32469i_discovery.c:912
GPIO_TypeDef
General Purpose I/O.
Definition: stm32f407xx.h:527
I2C1_SCL_FREQ_KHZ
#define I2C1_SCL_FREQ_KHZ
I2C clock speed configuration (in Hz) WARNING: Make sure that this define is not already declared in ...
Definition: stm32469i_discovery.h:258
I2C_HandleTypeDef::Init
I2C_InitTypeDef Init
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:193
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: stm32469i_discovery.c:893
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_Delay
void TS_IO_Delay(uint32_t Delay)
Delay function used in TouchScreen low level driver.
Definition: stm32469i_discovery.c:902
DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE
#define DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE()
Definition: stm32469i_discovery.h:269
DISCO_I2C1_SCL_PIN
#define DISCO_I2C1_SCL_PIN
Definition for I2C1 Pins.
Definition: stm32469i_discovery.h:276
DISCO_I2C2_RELEASE_RESET
#define DISCO_I2C2_RELEASE_RESET()
Definition: stm32469i_discovery.h:308
I2C2_Init
static void I2C2_Init(void)
Initializes I2C HAL.
Definition: stm32469i_discovery.c:501
Led_TypeDef
Led_TypeDef
Definition: stm32f4_discovery.h:63
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: stm32469i_discovery.c:819
GPIO_MODE_IT_RISING
#define GPIO_MODE_IT_RISING
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:127
TS_IO_Write
void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
Writes single data with I2C communication channel from MCU to TouchScreen.
Definition: stm32469i_discovery.c:854
BUTTONn
@ BUTTONn
Definition: stm32h747i_discovery.h:75
BSP_PB_DeInit
void BSP_PB_DeInit(Button_TypeDef Button)
Push Button DeInit.
Definition: stm32469i_discovery.c:354
I2C_HandleTypeDef
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:188
DISCO_I2C1_RELEASE_RESET
#define DISCO_I2C1_RELEASE_RESET()
Definition: stm32469i_discovery.h:272
DISCO_I2C2_SDA_PIN
#define DISCO_I2C2_SDA_PIN
Definition: stm32469i_discovery.h:315
GPIO_PIN
uint32_t GPIO_PIN[LEDn]
Definition: stm32469i_discovery.c:89
I2C1
#define I2C1
Definition: stm32f407xx.h:1078
I2C2
#define I2C2
Definition: stm32f407xx.h:1079
DISCO_I2C1_EV_IRQn
#define DISCO_I2C1_EV_IRQn
Definition of I2C interrupt requests.
Definition: stm32469i_discovery.h:283
HAL_NVIC_SetPriority
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
I2C_InitTypeDef::ClockSpeed
uint32_t ClockSpeed
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_i2c.h:50
DISCO_I2C1_SDA_PIN
#define DISCO_I2C1_SDA_PIN
Definition: stm32469i_discovery.h:279
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
AUDIO_IO_Init
void AUDIO_IO_Init(void)
Initializes Audio low level.
Definition: stm32469i_discovery.c:740
HAL_GPIO_TogglePin
void HAL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin)
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
BSP_LED_Init
void BSP_LED_Init(Led_TypeDef Led)
Configures LED GPIO.
Definition: stm32469i_discovery.c:181
heval_I2c2
static I2C_HandleTypeDef heval_I2c2
Definition: stm32469i_discovery.c:107
LED3_GPIO_CLK_ENABLE
#define LED3_GPIO_CLK_ENABLE()
Definition: stm32f4_discovery.h:108
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: stm32469i_discovery.c:880
GPIO_MODE_INPUT
#define GPIO_MODE_INPUT
Definition: stm32f407/stm32f407g-disc1/Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_gpio.h:119
AUDIO_IO_DeInit
void AUDIO_IO_DeInit(void)
DeInitializes Audio low level.
Definition: stm32469i_discovery.c:748
LEDn
@ LEDn
Definition: stm32h747i_discovery.h:69
heval_I2c1
static I2C_HandleTypeDef heval_I2c1
Definition: stm32469i_discovery.c:106
HAL_I2C_DeInit
HAL_StatusTypeDef HAL_I2C_DeInit(I2C_HandleTypeDef *hi2c)
TS_IO_Read
uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
Reads single data with I2C communication channel from TouchScreen.
Definition: stm32469i_discovery.c:866
BSP_PB_Init
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
Configures button GPIO and EXTI Line.
Definition: stm32469i_discovery.c:312
BUTTON_PORT
GPIO_TypeDef * BUTTON_PORT[BUTTONn]
Definition: stm32469i_discovery.c:99
HAL_GPIO_WritePin
void HAL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
stm32469i_discovery.h
This file contains definitions for STM32469I-Discovery LEDs, push-buttons hardware resources.
TS_IO_Init
void TS_IO_Init(void)
Initialize I2C communication channel from MCU to TouchScreen (TS).
Definition: stm32469i_discovery.c:842
DISCO_I2C2_SCL_PIN
#define DISCO_I2C2_SCL_PIN
Definition for I2C2 Pins.
Definition: stm32469i_discovery.h:312
LED4_GPIO_CLK_ENABLE
#define LED4_GPIO_CLK_ENABLE()
Definition: stm32f4_discovery.h:103
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:51