Zerocat Chipflasher  v0.4.3 (board-edition-1)
Flash free firmware to BIOS chips, kick the Manageability Engine.
Macros
fast-SPI.h File Reference

Inline Code Macros with Assembler, that provide fast SPI Bus access. More...

Go to the source code of this file.

Macros

#define NOP
 No Operation Command. Execution Time is 50ns @ 80MHz (5MHz Crystal). More...
 
#define t_NONE
 No extra delay. More...
 
#define t_FAST   ; NOP
 t as short as possible. More...
 
#define t_SLOW   ; NOP; NOP; NOP
 t which is really slow. More...
 
#define tSCLK   t_NONE
 Clock Delay. More...
 
#define tCLQV   t_NONE
 CE# Low to Output valid. More...
 
#define tDSU   t_NONE
 Data In Setup Time. More...
 
#define tCSL   t_NONE
 Chip Select Time. More...
 
#define tCSH   ; NOP; NOP
 Chip Deselect Time. More...
 
#define tSHWL   ; NOP; NOP
 Write Protect Hold Time. More...
 
#define tWHSL   ; NOP; NOP
 Write Protect Setup Time. More...
 
#define tHHQX   ; NOP
 Hold To Output Low-Z Time. More...
 
#define tHLQZ   ; NOP
 Hold To Output High-Z Time. More...
 
#define CHIP_ON
 
#define CHIP_OFF
 
#define WPn_HIGH
 
#define WPn_LOW
 
#define CLOCK_HIGH
 
#define CLOCK_LOW
 
#define SO_HIGH
 
#define SO_LOW
 
#define HOLDn_HIGH
 
#define HOLDn_LOW
 

Detailed Description

Zerocat Chipflasher — Flash free firmware to BIOS chips, kick the Manageability Engine.

Copyright (C) 2015, 2016, 2017, 2018 Kai Mertens kmx@p.nosp@m.oste.nosp@m.o.net

The Zerocat Chipflasher is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Zerocat Chipflasher is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

This file is part of the Zerocat Chipflasher.

Note
Assembler directives are using bits that are within 9-bit address space, thus resulting in propeller port pins 0..8!

Definition in file fast-SPI.h.

Macro Definition Documentation

◆ CHIP_OFF

#define CHIP_OFF
Value:
__asm__ volatile \
("andn dira, %0 'tristate, CE# goes high via pull-up" \
: /* no outputs */ \
: "i" (CEn_AVAIL)) \
tCSH

Definition at line 63 of file fast-SPI.h.

◆ CHIP_ON

#define CHIP_ON
Value:
__asm__ volatile \
("or dira, %0 'activate output, CE# goes low" \
: /* no outputs */ \
: "i" (CEn_AVAIL)) \
tCSL

Definition at line 57 of file fast-SPI.h.

◆ CLOCK_HIGH

#define CLOCK_HIGH
Value:
__asm__ volatile \
("or outa, %0 'clock high" \
: /* no outputs */ \
: "i" (SCLK_AVAIL)) \
tSCLK

Definition at line 81 of file fast-SPI.h.

◆ CLOCK_LOW

#define CLOCK_LOW
Value:
__asm__ volatile \
("andn outa, %0 'clock low" \
: /* no outputs */ \
: "i" (SCLK_AVAIL)) \
tSCLK

Definition at line 87 of file fast-SPI.h.

◆ HOLDn_HIGH

#define HOLDn_HIGH
Value:
OUTA |= BIT_HOLDn \
tHLQZ

Definition at line 118 of file fast-SPI.h.

◆ HOLDn_LOW

#define HOLDn_LOW
Value:
OUTA &= ~BIT_HOLDn \
tHHQX

Definition at line 121 of file fast-SPI.h.

◆ NOP

#define NOP
Value:
__asm__ volatile \
("nop 'delay 50ns" \
: /* no outputs */ \
: /* no inputs */ )

Definition at line 37 of file fast-SPI.h.

◆ SO_HIGH

#define SO_HIGH
Value:
__asm__ volatile \
("or outa, %0 'SO high" \
: /* no outputs */ \
: "i" (BIT_MOSI)) \
tDSU

Definition at line 93 of file fast-SPI.h.

◆ SO_LOW

#define SO_LOW
Value:
__asm__ volatile \
("andn outa, %0 'SO low" \
: /* no outputs */ \
: "i" (BIT_MOSI)) \
tDSU

Definition at line 99 of file fast-SPI.h.

◆ t_FAST

#define t_FAST   ; NOP

Definition at line 43 of file fast-SPI.h.

◆ t_NONE

#define t_NONE

Definition at line 42 of file fast-SPI.h.

◆ t_SLOW

#define t_SLOW   ; NOP; NOP; NOP

Definition at line 44 of file fast-SPI.h.

◆ tCLQV

#define tCLQV   t_NONE

Definition at line 47 of file fast-SPI.h.

◆ tCSH

#define tCSH   ; NOP; NOP

Definition at line 51 of file fast-SPI.h.

◆ tCSL

#define tCSL   t_NONE

Definition at line 49 of file fast-SPI.h.

◆ tDSU

#define tDSU   t_NONE

Definition at line 48 of file fast-SPI.h.

◆ tHHQX

#define tHHQX   ; NOP

Definition at line 54 of file fast-SPI.h.

◆ tHLQZ

#define tHLQZ   ; NOP

Definition at line 55 of file fast-SPI.h.

◆ tSCLK

#define tSCLK   t_NONE

Definition at line 46 of file fast-SPI.h.

◆ tSHWL

#define tSHWL   ; NOP; NOP

Definition at line 52 of file fast-SPI.h.

◆ tWHSL

#define tWHSL   ; NOP; NOP

Definition at line 53 of file fast-SPI.h.

◆ WPn_HIGH

#define WPn_HIGH
Value:
__asm__ volatile \
("or outa, %0 'WP# high" \
: /* no outputs */ \
: "i" (BIT_WPn)) \
tWHSL

Definition at line 69 of file fast-SPI.h.

◆ WPn_LOW

#define WPn_LOW
Value:
__asm__ volatile \
("andn outa, %0 'WP# low" \
: /* no outputs */ \
: "i" (BIT_WPn)) \
tSHWL

Definition at line 75 of file fast-SPI.h.

SCLK_AVAIL
#define SCLK_AVAIL
Definition: proppins.h:90
BIT_WPn
#define BIT_WPn
Definition: proppins.h:80
CEn_AVAIL
#define CEn_AVAIL
Definition: proppins.h:89
BIT_HOLDn
#define BIT_HOLDn
Definition: proppins.h:84
BIT_MOSI
#define BIT_MOSI
Definition: proppins.h:85