#ifdef __cplusplus
extern "C" {
#endif

#ifndef _LINPAC_AM335X_H
#define _LINPAC_AM335X_H

//#define HA401 1
#define LP5231 1

#ifdef HA401
#define UBUNTU 1
#else
#define ANGSTROM 1
#endif
/*
#define NOERROR      0   --> refert to lincon.h
#define NOOPEN       1
#define NOFILE       2
#define NODEVICE     3
#define NORIGHTARG   4
*/

//am335x.c
#define NO_OPEN       -11
#define NO_FILE       -12
#define NO_DEVICE     -13
#define NO_RIGHTARG   -14
#define SN_ERROR      -15	
#define CRC_ERROR     -16	


#define DIRECTION_OUT 1
#define DIRECTION_IN  0

int gpio_direction_status(int gpio, unsigned char *direction);
int gpio_direction_set(int gpio, unsigned char direction);
int gpio_value_out(int gpio, unsigned char value);
int gpio_value_in(int gpio, unsigned int *value);
//int gpio_value_in(int gpio, unsigned char *value);


#ifdef HA401
#else
//int read_sn(char *sn);
int lp5231_buzzer(int turn);
int lp5231_set_led(int led, int green, int red);
int rotary_switch_read(unsigned int *value);  //cindy, 20230825
//int rotary_switch_read(unsigned char *value);
int angstrom_ip_static(char *ip, char *mask, char *gateway);
int angstrom_ip_dhcp(void);
#endif

#endif


#ifdef __cplusplus
}
#endif
