ATY_LIB V2_102_230218
ATY_LIB for general devices or ALGO
 
Loading...
Searching...
No Matches
gpio_input_stc8g1k08a.c File Reference
#include "fw_hal.h"

Go to the source code of this file.

Functions

void GPIO_Init (void)
 
int main (void)
 

Function Documentation

◆ GPIO_Init()

void GPIO_Init ( void  )

Definition at line 32 of file gpio_input_stc8g1k08a.c.

33{
34 // P3.2, P3.3
36 // P5.4, pullup
39}
#define GPIO_P5_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:99
#define GPIO_P3_SetMode(__PINS__, __MODE__)
Definition: fw_gpio.h:89
@ GPIO_Pin_2
Definition: fw_gpio.h:47
@ GPIO_Pin_4
Definition: fw_gpio.h:49
@ GPIO_Pin_3
Definition: fw_gpio.h:48
#define GPIO_SetPullUp(__PORT__, __PINS__, __STATE__)
Definition: fw_gpio.h:116
@ GPIO_Port_5
Definition: fw_gpio.h:36
@ GPIO_Mode_Input_HIP
Definition: fw_gpio.h:25
@ GPIO_Mode_Output_PP
Definition: fw_gpio.h:24
@ HAL_State_ON
Definition: fw_types.h:71

◆ main()

int main ( void  )

Definition at line 41 of file gpio_input_stc8g1k08a.c.

42{
43 GPIO_Init();
44 /* Turn LED1 on, LED2 off */
45 P32 = SET;
46 P33 = RESET;
47
48 while(1)
49 {
50 /* Check if P5.4 is low (Key pressed) */
51 if (P54 == RESET)
52 {
53 /* Switch */
54 P3 = P3 & 0xF3 | 0x08;
55 SYS_Delay(300);
56 /* Restore */
57 P3 = P3 & 0xF3 | 0x04;
58 }
59 }
60}
void SYS_Delay(uint16_t t)
Definition: fw_sys.c:65
@ RESET
Definition: fw_types.h:84
@ SET
Definition: fw_types.h:85
void GPIO_Init(void)