1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
28
29
32
33
36
37
40
43
44
47
50
61
62
65
68
69
72
76
77
81
82
83
84
85
86
87
88
89
90
91
92
95
96
99
100
101
102
103
104
105
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
142
143
146
147
151
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
182
185
188
191
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
249
250
251
252
253
254
255
256
257
258
259
266
267
268
269
270
271
272
273
274
275
276
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
360
361
364
365
368
369
370
373
374
375
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
529
530
531
532
533
534
535
536
537
538
539
540
541
542
547
548
549
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
692
693
694
695
702
706
707
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
732
733
736
737
738
739
742
746
747
750
754
755
761
765
766
772
773
774
775
776
777
778
779
780
781
785
789
790
791
792
795
799
800
801
802
803
804
805
806
807
808
812
813
814
815
816
817
818
819
820
821
825
826
833
837
838
839
840
844
848
849
856
860
861
868
872
873
874
875
876
877
878
879
880
881
882
886
887
888
889
890
891
892
893
894
895
899
900
904
908
909
920
924
928
929
932
933
936
937
940
941
/* ... */
#include "stm32469i_discovery.h"
/* ... */
/* ... */
/* ... */
/* ... */
/* ... */
/* ... */
/* ... */
#define __STM32469I_DISCOVERY_BSP_VERSION_MAIN (0x02)
#define __STM32469I_DISCOVERY_BSP_VERSION_SUB1 (0x01)
#define __STM32469I_DISCOVERY_BSP_VERSION_SUB2 (0x02)
#define __STM32469I_DISCOVERY_BSP_VERSION_RC (0x00)
#define __STM32469I_DISCOVERY_BSP_VERSION ((__STM32469I_DISCOVERY_BSP_VERSION_MAIN << 24)\
|(__STM32469I_DISCOVERY_BSP_VERSION_SUB1 << 16)\
|(__STM32469I_DISCOVERY_BSP_VERSION_SUB2 << 8 )\
|(__STM32469I_DISCOVERY_BSP_VERSION_RC))...
5 defines
/* ... */
/* ... */
/* ... */
/* ... */
uint32_t GPIO_PIN[LEDn] = {LED1_PIN,
LED2_PIN,
LED3_PIN,
LED4_PIN...};
GPIO_TypeDef* GPIO_PORT[LEDn] = {LED1_GPIO_PORT,
LED2_GPIO_PORT,
LED3_GPIO_PORT,
LED4_GPIO_PORT...};
GPIO_TypeDef* BUTTON_PORT[BUTTONn] = {WAKEUP_BUTTON_GPIO_PORT };
const uint16_t BUTTON_PIN[BUTTONn] = {WAKEUP_BUTTON_PIN };
const uint16_t BUTTON_IRQn[BUTTONn] = {WAKEUP_BUTTON_EXTI_IRQn };
static I2C_HandleTypeDef heval_I2c1;
static I2C_HandleTypeDef heval_I2c2;
/* ... */
/* ... */
static void I2C1_MspInit(void);
static void I2C2_MspInit(void);
static void I2C1_Init(void);
static void I2C2_Init(void);
#if defined(USE_IOEXPANDER)
static void I2C1_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
static uint8_t I2C1_Read(uint8_t Addr, uint8_t Reg);/* ... */
#endif
static HAL_StatusTypeDef I2C1_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
static HAL_StatusTypeDef I2C2_ReadMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
static HAL_StatusTypeDef I2C1_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
static HAL_StatusTypeDef I2C2_WriteMultiple(uint8_t Addr, uint16_t Reg, uint16_t MemAddSize, uint8_t *Buffer, uint16_t Length);
static HAL_StatusTypeDef I2C1_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
static void I2C1_Error(uint8_t Addr);
static void I2C2_Error(uint8_t Addr);
void AUDIO_IO_Init(void);
void AUDIO_IO_DeInit(void);
void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg);
void AUDIO_IO_Delay(uint32_t Delay);
void EEPROM_IO_Init(void);
HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize);
HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials);
void TS_IO_Init(void);
void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value);
uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg);
uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length);
void TS_IO_Delay(uint32_t Delay);
void OTM8009A_IO_Delay(uint32_t Delay);
void NT35510_IO_Delay(uint32_t Delay);
/* ... */
/* ... */
/* ... */
uint32_t BSP_GetVersion(void)
{
return __STM32469I_DISCOVERY_BSP_VERSION;
}{ ... }
/* ... */
void BSP_LED_Init(Led_TypeDef Led)
{
GPIO_InitTypeDef gpio_init_structure;
if (Led <= LED4)
{
gpio_init_structure.Pin = GPIO_PIN[Led];
gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
gpio_init_structure.Pull = GPIO_PULLUP;
gpio_init_structure.Speed = GPIO_SPEED_HIGH;
switch(Led)
{
case LED1 :
LED1_GPIO_CLK_ENABLE();
break;case LED1 :
case LED2 :
LED2_GPIO_CLK_ENABLE();
break;case LED2 :
case LED3 :
LED3_GPIO_CLK_ENABLE();
break;case LED3 :
case LED4 :
LED4_GPIO_CLK_ENABLE();
break;case LED4 :
default :
break;
default
}switch (Led) { ... }
HAL_GPIO_Init(GPIO_PORT[Led], &gpio_init_structure);
HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_SET);
}if (Led <= LED4) { ... }
}{ ... }
/* ... */
void BSP_LED_DeInit(Led_TypeDef Led)
{
GPIO_InitTypeDef gpio_init_structure;
if (Led <= LED4)
{
gpio_init_structure.Pin = GPIO_PIN[Led];
HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_SET);
HAL_GPIO_DeInit(GPIO_PORT[Led], gpio_init_structure.Pin);
}if (Led <= LED4) { ... }
}{ ... }
/* ... */
void BSP_LED_On(Led_TypeDef Led)
{
if (Led <= LED4)
{
HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_RESET);
}if (Led <= LED4) { ... }
}{ ... }
/* ... */
void BSP_LED_Off(Led_TypeDef Led)
{
if (Led <= LED4)
{
HAL_GPIO_WritePin(GPIO_PORT[Led], GPIO_PIN[Led], GPIO_PIN_SET);
}if (Led <= LED4) { ... }
}{ ... }
/* ... */
void BSP_LED_Toggle(Led_TypeDef Led)
{
if (Led <= LED4)
{
HAL_GPIO_TogglePin(GPIO_PORT[Led], GPIO_PIN[Led]);
}if (Led <= LED4) { ... }
}{ ... }
/* ... */
void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode)
{
GPIO_InitTypeDef gpio_init_structure;
BUTTON_GPIO_CLK_ENABLE();
if(Button_Mode == BUTTON_MODE_GPIO)
{
gpio_init_structure.Pin = BUTTON_PIN[Button];
gpio_init_structure.Mode = GPIO_MODE_INPUT;
gpio_init_structure.Pull = GPIO_NOPULL;
gpio_init_structure.Speed = GPIO_SPEED_FAST;
HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
}if (Button_Mode == BUTTON_MODE_GPIO) { ... }
if(Button_Mode == BUTTON_MODE_EXTI)
{
gpio_init_structure.Pin = BUTTON_PIN[Button];
gpio_init_structure.Pull = GPIO_NOPULL;
gpio_init_structure.Speed = GPIO_SPEED_FAST;
gpio_init_structure.Mode = GPIO_MODE_IT_RISING;
HAL_GPIO_Init(BUTTON_PORT[Button], &gpio_init_structure);
HAL_NVIC_SetPriority((IRQn_Type)(BUTTON_IRQn[Button]), 0x0F, 0x00);
HAL_NVIC_EnableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
}if (Button_Mode == BUTTON_MODE_EXTI) { ... }
}{ ... }
/* ... */
void BSP_PB_DeInit(Button_TypeDef Button)
{
GPIO_InitTypeDef gpio_init_structure;
gpio_init_structure.Pin = BUTTON_PIN[Button];
HAL_NVIC_DisableIRQ((IRQn_Type)(BUTTON_IRQn[Button]));
HAL_GPIO_DeInit(BUTTON_PORT[Button], gpio_init_structure.Pin);
}{ ... }
/* ... */
uint32_t BSP_PB_GetState(Button_TypeDef Button)
{
return HAL_GPIO_ReadPin(BUTTON_PORT[Button], BUTTON_PIN[Button]);
}{ ... }
/* ... */
/* ... */
/* ... */
/* ... */
static void I2C1_MspInit(void)
{
GPIO_InitTypeDef gpio_init_structure;
DISCO_I2C1_SCL_SDA_GPIO_CLK_ENABLE();
#if defined(USE_STM32469I_DISCO_REVC)
gpio_init_structure.Pin = DISCO_I2C1_SCL_PIN;
gpio_init_structure.Mode = GPIO_MODE_OUTPUT_OD;
gpio_init_structure.Pull = GPIO_NOPULL;
gpio_init_structure.Speed = GPIO_SPEED_FAST;
gpio_init_structure.Alternate = 0;
HAL_GPIO_Init( DISCO_I2C1_SCL_SDA_GPIO_PORT, &gpio_init_structure );
for(uint8_t count = 10; count > 0; count-- )
{
HAL_GPIO_WritePin( DISCO_I2C1_SCL_SDA_GPIO_PORT, DISCO_I2C1_SCL_PIN, GPIO_PIN_SET );
HAL_Delay(1);
HAL_GPIO_WritePin( DISCO_I2C1_SCL_SDA_GPIO_PORT, DISCO_I2C1_SCL_PIN, GPIO_PIN_RESET );
HAL_Delay(1);
}for (uint8_t count = 10; count > 0; count--) { ... }
/* ... */#endif
gpio_init_structure.Pin = DISCO_I2C1_SCL_PIN;
gpio_init_structure.Mode = GPIO_MODE_AF_OD;
gpio_init_structure.Pull = GPIO_NOPULL;
gpio_init_structure.Speed = GPIO_SPEED_FAST;
gpio_init_structure.Alternate = DISCO_I2C1_SCL_SDA_AF;
HAL_GPIO_Init(DISCO_I2C1_SCL_SDA_GPIO_PORT, &gpio_init_structure);
gpio_init_structure.Pin = DISCO_I2C1_SDA_PIN;
HAL_GPIO_Init(DISCO_I2C1_SCL_SDA_GPIO_PORT, &gpio_init_structure);
DISCO_I2C1_CLK_ENABLE();
DISCO_I2C1_FORCE_RESET();
DISCO_I2C1_RELEASE_RESET();
HAL_NVIC_SetPriority(DISCO_I2C1_EV_IRQn, 0x05, 0);
HAL_NVIC_EnableIRQ(DISCO_I2C1_EV_IRQn);
HAL_NVIC_SetPriority(DISCO_I2C1_ER_IRQn, 0x05, 0);
HAL_NVIC_EnableIRQ(DISCO_I2C1_ER_IRQn);
}{ ... }
/* ... */
static void I2C2_MspInit(void)
{
GPIO_InitTypeDef gpio_init_structure;
DISCO_I2C2_SCL_SDA_GPIO_CLK_ENABLE();
gpio_init_structure.Pin = DISCO_I2C2_SCL_PIN;
gpio_init_structure.Mode = GPIO_MODE_AF_OD;
gpio_init_structure.Pull = GPIO_NOPULL;
gpio_init_structure.Speed = GPIO_SPEED_FAST;
gpio_init_structure.Alternate = DISCO_I2C2_SCL_SDA_AF;
HAL_GPIO_Init(DISCO_I2C2_SCL_SDA_GPIO_PORT, &gpio_init_structure);
gpio_init_structure.Pin = DISCO_I2C2_SDA_PIN;
HAL_GPIO_Init(DISCO_I2C2_SCL_SDA_GPIO_PORT, &gpio_init_structure);
DISCO_I2C2_CLK_ENABLE();
DISCO_I2C2_FORCE_RESET();
DISCO_I2C2_RELEASE_RESET();
HAL_NVIC_SetPriority(DISCO_I2C2_EV_IRQn, 0x05, 0);
HAL_NVIC_EnableIRQ(DISCO_I2C2_EV_IRQn);
HAL_NVIC_SetPriority(DISCO_I2C2_ER_IRQn, 0x05, 0);
HAL_NVIC_EnableIRQ(DISCO_I2C2_ER_IRQn);
}{ ... }
/* ... */
static void I2C1_Init(void)
{
if(HAL_I2C_GetState(&heval_I2c1) == HAL_I2C_STATE_RESET)
{
heval_I2c1.Instance = I2C1;
heval_I2c1.Init.ClockSpeed = I2C1_SCL_FREQ_KHZ;
heval_I2c1.Init.DutyCycle = I2C_DUTYCYCLE_2;
heval_I2c1.Init.OwnAddress1 = 0;
heval_I2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
heval_I2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
heval_I2c1.Init.OwnAddress2 = 0;
heval_I2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
heval_I2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
I2C1_MspInit();
HAL_I2C_Init(&heval_I2c1);
}if (HAL_I2C_GetState(&heval_I2c1) == HAL_I2C_STATE_RESET) { ... }
}{ ... }
/* ... */
static void I2C2_Init(void)
{
if(HAL_I2C_GetState(&heval_I2c2) == HAL_I2C_STATE_RESET)
{
heval_I2c2.Instance = I2C2;
heval_I2c2.Init.ClockSpeed = I2C2_SCL_FREQ_KHZ;
heval_I2c2.Init.DutyCycle = I2C_DUTYCYCLE_2;
heval_I2c2.Init.OwnAddress1 = 0;
heval_I2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
heval_I2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
heval_I2c2.Init.OwnAddress2 = 0;
heval_I2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
heval_I2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
I2C2_MspInit();
HAL_I2C_Init(&heval_I2c2);
}if (HAL_I2C_GetState(&heval_I2c2) == HAL_I2C_STATE_RESET) { ... }
}{ ... }
/* ... */
static void I2C1_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
{
HAL_StatusTypeDef status = HAL_OK;
status = HAL_I2C_Mem_Write(&heval_I2c1,
Addr,
(uint16_t)Reg,
I2C_MEMADD_SIZE_8BIT,
&Value,
1,
100);
if(status != HAL_OK)
{
I2C1_Error(Addr);
}if (status != HAL_OK) { ... }
}{ ... }
/* ... */
static uint8_t I2C1_Read(uint8_t Addr, uint8_t Reg)
{
HAL_StatusTypeDef status = HAL_OK;
uint8_t Value = 0;
status = HAL_I2C_Mem_Read(&heval_I2c1,
Addr,
Reg,
I2C_MEMADD_SIZE_8BIT,
&Value,
1,
1000);
if(status != HAL_OK)
{
I2C1_Error(Addr);
}if (status != HAL_OK) { ... }
return Value;
}{ ... }
/* ... */
static HAL_StatusTypeDef I2C1_ReadMultiple(uint8_t Addr,
uint16_t Reg,
uint16_t MemAddress,
uint8_t *Buffer,
uint16_t Length)
{
HAL_StatusTypeDef status = HAL_OK;
status = HAL_I2C_Mem_Read(&heval_I2c1,
Addr,
(uint16_t)Reg,
MemAddress,
Buffer,
Length,
1000);
if(status != HAL_OK)
{
I2C1_Error(Addr);
}if (status != HAL_OK) { ... }
return status;
}{ ... }
static HAL_StatusTypeDef I2C2_ReadMultiple(uint8_t Addr,
uint16_t Reg,
uint16_t MemAddress,
uint8_t *Buffer,
uint16_t Length)
{
HAL_StatusTypeDef status = HAL_OK;
status = HAL_I2C_Mem_Read(&heval_I2c2,
Addr,
(uint16_t)Reg,
MemAddress,
Buffer,
Length,
1000);
if(status != HAL_OK)
{
I2C2_Error(Addr);
}if (status != HAL_OK) { ... }
return status;
}{ ... }
/* ... */
static HAL_StatusTypeDef I2C1_WriteMultiple(uint8_t Addr,
uint16_t Reg,
uint16_t MemAddress,
uint8_t *Buffer,
uint16_t Length)
{
HAL_StatusTypeDef status = HAL_OK;
status = HAL_I2C_Mem_Write(&heval_I2c1,
Addr,
(uint16_t)Reg,
MemAddress,
Buffer,
Length,
1000);
if(status != HAL_OK)
{
I2C1_Error(Addr);
}if (status != HAL_OK) { ... }
return status;
}{ ... }
static HAL_StatusTypeDef I2C2_WriteMultiple(uint8_t Addr,
uint16_t Reg,
uint16_t MemAddress,
uint8_t *Buffer,
uint16_t Length)
{
HAL_StatusTypeDef status = HAL_OK;
status = HAL_I2C_Mem_Write(&heval_I2c2,
Addr,
(uint16_t)Reg,
MemAddress,
Buffer,
Length,
1000);
if(status != HAL_OK)
{
I2C2_Error(Addr);
}if (status != HAL_OK) { ... }
return status;
}{ ... }
/* ... */
static HAL_StatusTypeDef I2C1_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
{
return (HAL_I2C_IsDeviceReady(&heval_I2c1, DevAddress, Trials, 1000));
}{ ... }
/* ... */
static void I2C1_Error(uint8_t Addr)
{
HAL_I2C_DeInit(&heval_I2c1);
I2C1_Init();
}{ ... }
static void I2C2_Error(uint8_t Addr)
{
HAL_I2C_DeInit(&heval_I2c2);
I2C2_Init();
}{ ... }
/* ... */
/* ... */
I2C Routines
/* ... */
void AUDIO_IO_Init(void)
{
I2C2_Init();
}{ ... }
/* ... */
void AUDIO_IO_DeInit(void)
{
}{ ... }
/* ... */
void AUDIO_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
{
I2C2_WriteMultiple(Addr, (uint16_t) Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&Value, 1);
}{ ... }
/* ... */
uint8_t AUDIO_IO_Read(uint8_t Addr, uint8_t Reg)
{
uint8_t read_value = 0;
I2C2_ReadMultiple(Addr, (uint16_t) Reg, I2C_MEMADD_SIZE_8BIT, (uint8_t*)&read_value, 1);
return read_value;
}{ ... }
/* ... */
void AUDIO_IO_Delay(uint32_t Delay)
{
HAL_Delay(Delay);
}{ ... }
LINK AUDIO
/* ... */
void EEPROM_IO_Init(void)
{
I2C1_Init();
}{ ... }
/* ... */
HAL_StatusTypeDef EEPROM_IO_WriteData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
{
return (I2C1_WriteMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
}{ ... }
/* ... */
HAL_StatusTypeDef EEPROM_IO_ReadData(uint16_t DevAddress, uint16_t MemAddress, uint8_t* pBuffer, uint32_t BufferSize)
{
return (I2C1_ReadMultiple(DevAddress, MemAddress, I2C_MEMADD_SIZE_16BIT, pBuffer, BufferSize));
}{ ... }
/* ... */
HAL_StatusTypeDef EEPROM_IO_IsDeviceReady(uint16_t DevAddress, uint32_t Trials)
{
return (I2C1_IsDeviceReady(DevAddress, Trials));
}{ ... }
LINK I2C EEPROM
/* ... */
void TS_IO_Init(void)
{
I2C1_Init();
}{ ... }
/* ... */
void TS_IO_Write(uint8_t Addr, uint8_t Reg, uint8_t Value)
{
I2C1_Write(Addr, Reg, Value);
}{ ... }
/* ... */
uint8_t TS_IO_Read(uint8_t Addr, uint8_t Reg)
{
return I2C1_Read(Addr, Reg);
}{ ... }
/* ... */
uint16_t TS_IO_ReadMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
{
return I2C1_ReadMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
}{ ... }
/* ... */
void TS_IO_WriteMultiple(uint8_t Addr, uint8_t Reg, uint8_t *Buffer, uint16_t Length)
{
I2C1_WriteMultiple(Addr, (uint16_t)Reg, I2C_MEMADD_SIZE_8BIT, Buffer, Length);
}{ ... }
/* ... */
void TS_IO_Delay(uint32_t Delay)
{
HAL_Delay(Delay);
}{ ... }
LINK TS (TouchScreen)
/* ... */
void OTM8009A_IO_Delay(uint32_t Delay)
{
HAL_Delay(Delay);
}{ ... }
LINK OTM8009A (Display driver)
/* ... */
void NT35510_IO_Delay(uint32_t Delay)
{
HAL_Delay(Delay);
}{ ... }
/* ... */
/* ... */
/* ... */
/* ... */