summaryrefslogtreecommitdiff
path: root/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.h
blob: 6b0cb56301621e13311514385d4a1ee63483f2ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
 * Copyright (c) 2006-2026, RT-Thread Development Team
 * Copyright 2024-2025 NXP
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * FRDM-MCXA366 onboard segment LCD helper (wraps NXP fsl_slcd).
 * Digit layout (left -> right): digit6 digit5 digit4 digit3 digit2 digit1
 * Points: P1/P2/P3 (upper) and P4/P5/P6 (lower).
 */

#ifndef __DRV_SLCD_H__
#define __DRV_SLCD_H__

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

#define SLCD_P1 0x01u
#define SLCD_P2 0x02u
#define SLCD_P3 0x04u
#define SLCD_P4 0x08u
#define SLCD_P5 0x10u
#define SLCD_P6 0x20u

/* Colon between digit5 and digit4 (HH:MM / MM:SS). */
#define SLCD_COLON (SLCD_P1 | SLCD_P4)
/* Decimal point between digit3 and digit2. */
#define SLCD_DOT (SLCD_P6)

int rt_hw_slcd_init(void);
void rt_hw_slcd_clear(void);
void rt_hw_slcd_display_all(void);
void rt_hw_slcd_display_num(uint8_t digit, uint8_t num);
void rt_hw_slcd_display_string(const char *str);
void rt_hw_slcd_display_point(uint8_t point);
/* Show HH:MM, e.g. rt_hw_slcd_display_time(12, 30) -> 12:30 */
void rt_hw_slcd_display_time(uint8_t hour, uint8_t minute);

#ifdef __cplusplus
}
#endif

#endif /* __DRV_SLCD_H__ */