TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
cat.c File Reference
#include "cat.h"
#include "reg.h"
#include "timer.h"
#include <stdbool.h>
#include <tenstorrent/post_code.h>
#include <tenstorrent/sys_init_defines.h>
#include <zephyr/sys/util.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/init.h>
#include <zephyr/drivers/sensor.h>
#include <zephyr/drivers/sensor/tenstorrent/pvt_tt_bh.h>

Data Structures

struct  RESET_UNIT_CATMON_THERM_TRIP_CNTL_reg_t
union  RESET_UNIT_CATMON_THERM_TRIP_CNTL_reg_u

Macros

#define RESET_UNIT_CATMON_THERM_TRIP_STATUS_REG_ADDR   0x80030164
#define RESET_UNIT_CATMON_THERM_TRIP_CNTL_REG_ADDR   0x80030168
#define RESET_UNIT_CATMON_THERM_TRIP_CNTL_REG_DEFAULT   0x00000318
#define CAT_EARLY_TRIP_TEMP   100
#define DEFAULT_CALIBRATION   (CAT_EARLY_TRIP_TEMP - T_J_SHUTDOWN)
#define TRIM_CODE_BITS   6

Functions

static uint8_t TempToTrimCode (float temp)
static float TrimCodeToTemp (int32_t trim_code)
static void WaitCATUpdate (void)
static void EnableCAT (uint8_t trim_code, bool shutdown_on_trip)
static int CATEarlyInit (void)
 SYS_INIT_APP (CATEarlyInit)
static float CalibrateCAT (void)
static int CATInit (void)
 SYS_INIT_APP (CATInit)

Variables

static const struct devicegpio1 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(gpio1))

Macro Definition Documentation

◆ CAT_EARLY_TRIP_TEMP

#define CAT_EARLY_TRIP_TEMP   100

◆ DEFAULT_CALIBRATION

#define DEFAULT_CALIBRATION   (CAT_EARLY_TRIP_TEMP - T_J_SHUTDOWN)

◆ RESET_UNIT_CATMON_THERM_TRIP_CNTL_REG_ADDR

#define RESET_UNIT_CATMON_THERM_TRIP_CNTL_REG_ADDR   0x80030168

◆ RESET_UNIT_CATMON_THERM_TRIP_CNTL_REG_DEFAULT

#define RESET_UNIT_CATMON_THERM_TRIP_CNTL_REG_DEFAULT   0x00000318

◆ RESET_UNIT_CATMON_THERM_TRIP_STATUS_REG_ADDR

#define RESET_UNIT_CATMON_THERM_TRIP_STATUS_REG_ADDR   0x80030164

◆ TRIM_CODE_BITS

#define TRIM_CODE_BITS   6

Function Documentation

◆ CalibrateCAT()

float CalibrateCAT ( void )
static

◆ CATEarlyInit()

int CATEarlyInit ( void )
static

◆ CATInit()

int CATInit ( void )
static

◆ EnableCAT()

void EnableCAT ( uint8_t trim_code,
bool shutdown_on_trip )
static

◆ SYS_INIT_APP() [1/2]

SYS_INIT_APP ( CATEarlyInit )

◆ SYS_INIT_APP() [2/2]

SYS_INIT_APP ( CATInit )

◆ TempToTrimCode()

uint8_t TempToTrimCode ( float temp)
static

◆ TrimCodeToTemp()

float TrimCodeToTemp ( int32_t trim_code)
static

◆ WaitCATUpdate()

void WaitCATUpdate ( void )
static

Variable Documentation

◆ gpio1

const struct device* gpio1 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(gpio1))
static