Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/Tools/Linux_HAL_Essentials/pru/pwmpru/prucomm.h
Views: 1800
/*1* prucomm.h - structure definitions for communication2*3*/4#pragma once56#include "pru_defs.h"78struct pwm_config {9u32 hi_cycles;10u32 hi_err;11u32 lo_cycles;12u32 lo_err;13};1415/* maximum (PRU0 + PRU1) */16#define MAX_PWMS 121718/* mask of the possibly enabled PWMs (due to h/w) */19/* 14, 15 are not routed out for PRU1 */20#define PWM_EN_MASK ( \21BIT( 0)|BIT( 1)|BIT( 2)|BIT( 3)|BIT( 4)|BIT( 5)|BIT( 6)|BIT( 7)| \22BIT( 8)|BIT( 9)|BIT(10)|BIT(11)|BIT(12) \23)2425#define MIN_PWM_PULSE PRU_us(4)2627struct pwm_multi_config {28u32 enmask; /* enable mask */29u32 offmsk; /* state when pwm is off */30u32 hilo[MAX_PWMS][2];31};3233#define PWM_CMD_MAGIC 0xf00fbaaf34#define PWM_REPLY_MAGIC 0xbaaff00f35#define PWM_CMD_CONFIG 0 /* full configuration in one go */36#define PWM_CMD_ENABLE 1 /* enable a pwm */37#define PWM_CMD_DISABLE 2 /* disable a pwm */38#define PWM_CMD_MODIFY 3 /* modify a pwm */39#define PWM_CMD_SET 4 /* set a pwm output explicitly */40#define PWM_CMD_CLR 5 /* clr a pwm output explicitly */41#define PWM_CMD_TEST 6 /* various crap */4243struct pwm_cmd {44u32 magic;45u32 enmask; /* enable mask */46u32 offmsk; /* state when pwm is off */47u32 periodhi[MAX_PWMS][2];48u32 hilo_read[MAX_PWMS][2];49u32 enmask_read;50};51struct pwm_cmd_l{52u32 enmask;53u32 offmsk;54u32 hilo[MAX_PWMS][2];55};565758struct cxt {59u32 cnt;60u32 next;61u32 enmask;62u32 stmask;63u32 setmsk;64u32 clrmsk;65u32 deltamin;66u32 *next_hi_lo;67};686970/* the command is at the start of shared DPRAM */71#define PWM_CMD ((volatile struct pwm_cmd *)DPRAM_SHARED)727374