/*
 *      armplat.h
 *
 *      v 0.00 2021.6.3 by Golden
 *
 * 	header fo i8k/armplat.c
 *
 *      History
 *
 *              0.00    create 
 */


#ifdef __cplusplus
extern "C" {
#endif

//#include "am335x.h"   //cindy, 20230817 
#ifndef _LINPAC_ARMPLAT_H
#define _LINPAC_ARMPLAT_H

#define NOERROR      0
#define NOOPEN       1
#define NOFILE       2
#define NODEVICE     3
#define NORIGHTARG   4
#define SNERROR     5	
#define CRCERROR     6	

#define DIRECTION_OUT 1
#define DIRECTION_IN  0

//i.MX8 LinPAC ID
#define LP2841 29
#define LP2841_4G 13
#define LP9X81 25
#define ALP9X81 26
#define SV4801 28

int imx_wdt_init(int PAC);
int buzzer(int PAC, int millisec);
int init_led(int PAC);
int set_led(int PAC, int led, int on);
int read_sn(int PAC, unsigned char serial_num[]);
int read_battery(unsigned int *value);
int read_pacid(int PAC, unsigned int *value);
int linpac_read_pacid(unsigned int *value);	//for i.MX8 LinPAC
int rsw_init(int PAC);

//for ALP-9x81
#define alp9x81_buzzer(millisec) buzzer(ALP9X81, millisec)
#define alp9x81_read_rsw(value) read_rsw(ALP9X81, value)
#define alp9x81_init_led() init_led(ALP9X81)
#define alp9x81_set_led(led, on) set_led(ALP9X81, led, on)

//for LP-9x8x
#define lp9x81_buzzer(millisec) buzzer(LP9X81, millisec)
#define lp9x81_read_rsw(value) read_rsw(LP9X81, value)
#define lp9x81_init_led() init_led(LP9X81)
#define lp9x81_set_led(led, on) set_led(LP9X81, led, on)

//for LP-2841/2841-4G
#define lp2841_init_led() init_led(LP2841)
#define lp2841_set_led(led, on) set_led(LP2841, led, on)
#define lp2841_read_rsw(value) read_rsw(LP2841, value)
#define lp2841_read_sn(serial_num) read_sn(LP2841, serial_num)
#define lp2841_buzzer(millisec) buzzer(LP2841, millisec)

#endif


#ifdef __cplusplus
}
#endif
