aboutsummaryrefslogtreecommitdiff
path: root/include/sysled.h
blob: b1a21c150d66a372f9e0f1b484d3dbfc75d3bfd5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

/* Easily turn on and off the system-led. */

#include "ch573/gpio.h"

static inline void enable_sysled()
{
  CH573_GPIO__GPIO_PORT_T_INTF.dir.set(ch573_gpio__gpio_port_b, DIR_OUT, 10);
  CH573_GPIO__GPIO_PORT_T_INTF.pd_drv.set(ch573_gpio__gpio_port_b, 1, 10);
}

static inline void set_sysled(int on)
{
   CH573_GPIO__GPIO_PORT_T_INTF.out.set(
       ch573_gpio__gpio_port_b, on ? ON : OFF, 10);
}