C89 Project Template
Loading...
Searching...
No Matches
template.h File Reference

Template (Hardware-Agnostic) More...

#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  template_instance

Functions

static void template_instance_init (struct template_instance *self)
static void template_instance_set_test (struct template_instance *self, uint8_t val)
static uint8_t template_instance_update (struct template_instance *self)

Detailed Description

Template (Hardware-Agnostic)

This file contains the software implementation of the #TEMPLATE logic. The design is hardware-agnostic, requiring an external adaptation layer for hardware interaction.

Conventions: C89, Linux kernel style, MISRA, rule of 10, No hardware specific code, only generic C and some binding layer. Be extra specific about types.

Scientific units where posible at end of the names, for example:

  • timer_10s (timer_10s has a resolution of 10s per bit)
  • power_150w (power 150W per bit or 0.15kw per bit)

Keep variables without units if they're unknown or not specified or hard to define with short notation.

Copyright (c) 2025 furdog <https://github.com/furdog>
SPDX-License-Identifier: 0BSD

Be free, be wise and take care of yourself! With best wishes and respect, furdog

Function Documentation

◆ template_instance_init()

void template_instance_init ( struct template_instance * self)
static

Template init function

◆ template_instance_set_test()

void template_instance_set_test ( struct template_instance * self,
uint8_t val )
static

Template 'test' setter

◆ template_instance_update()

uint8_t template_instance_update ( struct template_instance * self)
static

Template Main Loop