ATY_LIB V2_102_230218
ATY_LIB for general devices or ALGO
 
Loading...
Searching...
No Matches
blink_all_ports.c
Go to the documentation of this file.
1// Copyright 2021 IOsetting <iosetting(at)outlook.com>
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15/***
16 * Demo: LED Blink From All Ports(P0~P7)
17 */
18
19#include "fw_hal.h"
20
21void GPIO_Init(void)
22{
31}
32
33int main(void)
34{
36 GPIO_Init();
37
38 while(1)
39 {
40 P0 = 0xFF;
41 P1 = 0xFF;
42 P2 = 0xFF;
43 P3 = 0xFF;
44 P4 = 0xFF;
45 P5 = 0xFF;
46 P6 = 0xFF;
47 P7 = 0xFF;
48 SYS_Delay(500);
49
50 P0 = 0x00;
51 P1 = 0x00;
52 P2 = 0x00;
53 P3 = 0x00;
54 P4 = 0x00;
55 P5 = 0x00;
56 P6 = 0x00;
57 P7 = 0x00;
58 SYS_Delay(500);
59 }
60}
#define GPIO_P4_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:94
#define GPIO_P5_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:99
#define GPIO_P3_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:89
#define GPIO_P7_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:110
@ GPIO_Pin_All
Definition: fw_gpio.h:53
#define GPIO_P2_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:84
#define GPIO_P1_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:79
#define GPIO_P6_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:105
#define GPIO_P0_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:74
@ GPIO_Mode_Output_PP
Definition: fw_gpio.h:24
void SYS_SetClock(void)
Definition: fw_sys.c:40
void SYS_Delay(uint16_t t)
Definition: fw_sys.c:65