edu16_sbc/sbc_fw/iodefs.h
2026-05-10 15:33:08 +08:00

55 lines
1.3 KiB
C

/*
* @file iodefs.h
* @brief Hardware pin assignments for the SBC firmware.
*
* Created: 21.09.2025 05:39:48
* Author: ThePetrovich
*
* Copyright YKSA - Sakha Aerospace Systems, LLC.
* See the LICENSE file for details.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef LSENSE_IODEFS_H
#define LSENSE_IODEFS_H
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
/* Detector signal path */
#define DET_TRIG_PIN 21 /* PC7, event input */
#define DET_READ_PIN A3 /* PD3 (ADC3) */
#define DET_PREAMP_PIN A2 /* PD2 (ADC2) */
/* Status indicator */
#define STATUS_LED 31 /* PE1 */
/* Power and reset control */
#define HV_EN 16 /* PC2 */
#define DET_EN 18 /* PC4 */
#define DET_RST 20 /* PC6 */
/* Housekeeping ADC inputs */
#define V28V0_FB_PIN A0 /* PD0 (ADC0) */
#define HV_TEMP_PIN A1 /* PD1 (ADC1) */
#define AMP_TEMP_PIN A4 /* PD4 (ADC4) */
#define DET_TEMP_PIN A5 /* PD5 (ADC5) */
/* AD5160 digital potentiometer chip selects */
#define HV_CS 15 /* PC1 */
#define AMP_CS 17 /* PC3 */
#define DET_CS 19 /* PC5 */
/* Light sensor I2C bus pins (software-bitbanged) */
#define SCL0 8 /* PB0 */
#define SDA0 9 /* PB1 */
#define SCL1 10 /* PB2 */
#define SDA1 11 /* PB3 */
#define SCL2 12 /* PB4 */
#define SDA2 13 /* PB5 */
#endif /* LSENSE_IODEFS_H */