Skip to main content

LowLevel

Struct LowLevel 

Source
pub struct LowLevel<M: Model, I: Interface> { /* private fields */ }
Expand description

LowLevel is a low-level interface to EVE controllers which matches the primitive operations used in Programmers Guides for the various EVE controllers.

This is slightly higher-level than the Interface trait, providing size-specific memory accesses, but doesn’t have any special knowledge about the memory map or command set of any particular EVE implementation.

This struct tracks a “cursor” for appending display list entries using the dl method. Use dl_reset to reset that cursor to the beginning of display list memory, which you’ll typically (but not necessarily) do after writing REG_DLSWAP to swap the display list double buffer. LowLevel doesn’t manage display list buffer swapping itself, only the cursor for the next dl call.

Implementations§

Source§

impl<M: Model, I: Interface> LowLevel<M, I>

Source

pub fn new(interface: I) -> Self

Source

pub fn take_interface(self) -> I

Consumes the LowLevel object and returns the interface it was originally created with.

Source

pub fn borrow_interface<'a>(&'a mut self) -> &'a mut I

Source

pub fn wr8<R: HostAccessible>(&mut self, addr: Ptr<R>, v: u8) -> Result<(), I>

Source

pub fn wr16<R: HostAccessible>(&mut self, addr: Ptr<R>, v: u16) -> Result<(), I>

Source

pub fn wr32<R: HostAccessible>(&mut self, addr: Ptr<R>, v: u32) -> Result<(), I>

Source

pub fn wr8s<R: HostAccessible>( &mut self, addr: Ptr<R>, v: &[u8], ) -> Result<(), I>

Source

pub fn rd8<R: HostAccessible>(&mut self, addr: Ptr<R>) -> Result<u8, I>

Source

pub fn rd16<R: HostAccessible>(&mut self, addr: Ptr<R>) -> Result<u16, I>

Source

pub fn rd32<R: HostAccessible>(&mut self, addr: Ptr<R>) -> Result<u32, I>

Source

pub fn rd8s<R: HostAccessible>( &mut self, addr: Ptr<R>, into: &mut [u8], ) -> Result<(), I>

Source

pub fn main_mem_ptr(&self, offset: u32) -> Ptr<M::MainMem>

Source

pub fn reg_ptr(&self, reg: Register) -> Ptr<M::RegisterMem>

Source

pub fn host_command(&mut self, cmd: HostCmd, a0: u8, a1: u8) -> Result<(), I>

Source

pub fn dl_reset(&mut self)

Source

pub fn dl(&mut self, cmd: DLCmd) -> Result<(), I>

Trait Implementations§

Source§

impl<M, I> Builder for LowLevel<M, I>
where M: Model, I: Interface,

Source§

type Error = Error<I>

Source§

type Model = M

Source§

fn append_raw_command(&mut self, raw: u32) -> Result<(), I>

Source§

fn append_command(&mut self, cmd: DLCmd) -> Result<(), I>

Source§

fn alpha_test(&mut self, func: TestFunc, ref_val: u8) -> Result<(), Self::Error>

Source§

fn begin(&mut self, prim: GraphicsPrimitive) -> Result<(), Self::Error>

Source§

fn bitmap_cell(&mut self, idx: u8) -> Result<(), Self::Error>

Source§

fn bitmap_ext_format( &mut self, format: BitmapExtFormat, ) -> Result<(), Self::Error>

Source§

fn bitmap_handle(&mut self, bmp: BitmapHandle) -> Result<(), Self::Error>

Source§

fn bitmap_layout_l( &mut self, format: BitmapFormat, line_stride: u16, height: u16, ) -> Result<(), Self::Error>

Source§

fn bitmap_layout_h( &mut self, line_stride: u16, height: u16, ) -> Result<(), Self::Error>

Source§

fn bitmap_layout( &mut self, format: BitmapFormat, line_stride: u16, height: u16, ) -> Result<(), Self::Error>

Source§

fn bitmap_size_l( &mut self, width: u16, height: u16, filter: BitmapSizeFilter, wrap_x: BitmapWrapMode, wrap_y: BitmapWrapMode, ) -> Result<(), Self::Error>

Source§

fn bitmap_size_h(&mut self, width: u16, height: u16) -> Result<(), Self::Error>

Source§

fn bitmap_size( &mut self, width: u16, height: u16, filter: BitmapSizeFilter, wrap_x: BitmapWrapMode, wrap_y: BitmapWrapMode, ) -> Result<(), Self::Error>

Source§

fn bitmap_swizzle(&mut self, swizzle: BitmapSwizzle) -> Result<(), Self::Error>

Source§

fn bitmap_source( &mut self, ptr: Ptr<<<Self as Builder>::Model as Model>::MainMem>, ) -> Result<(), Self::Error>

Source§

fn bitmap_source_all( &mut self, bitmap: Bitmap<<<Self as Builder>::Model as Model>::MainMem>, ) -> Result<(), Self::Error>

Source§

fn bitmap_transform_a( &mut self, coeff: impl Into<MatrixCoeff>, ) -> Result<(), Self::Error>

Source§

fn bitmap_transform_b( &mut self, coeff: impl Into<MatrixCoeff>, ) -> Result<(), Self::Error>

Source§

fn bitmap_transform_c( &mut self, coeff: impl Into<MatrixCoeff>, ) -> Result<(), Self::Error>

Source§

fn bitmap_transform_d( &mut self, coeff: impl Into<MatrixCoeff>, ) -> Result<(), Self::Error>

Source§

fn bitmap_transform_e( &mut self, coeff: impl Into<MatrixCoeff>, ) -> Result<(), Self::Error>

Source§

fn bitmap_transform_f( &mut self, coeff: impl Into<MatrixCoeff>, ) -> Result<(), Self::Error>

Source§

fn bitmap_transform_matrix( &mut self, matrix: impl Into<Matrix3x2>, ) -> Result<(), Self::Error>

Appends six display list commands to set all six of the bitmap transform matrix coefficients to match the given matrix.
Source§

fn blend_func( &mut self, src: BlendFunc, dst: BlendFunc, ) -> Result<(), Self::Error>

Source§

fn call( &mut self, addr: Ptr<<<Self as Builder>::Model as Model>::DisplayListMem>, ) -> Result<(), Self::Error>

Source§

fn clear( &mut self, color: bool, stencil: bool, tag: bool, ) -> Result<(), Self::Error>

Source§

fn clear_all(&mut self) -> Result<(), Self::Error>

Source§

fn clear_color_rgb(&mut self, color: RGB) -> Result<(), Self::Error>

Source§

fn clear_color_alpha(&mut self, alpha: u8) -> Result<(), Self::Error>

Source§

fn clear_color_rgba(&mut self, color: RGBA) -> Result<(), Self::Error>

Source§

fn clear_stencil(&mut self, v: u8) -> Result<(), Self::Error>

Source§

fn clear_tag(&mut self, v: u8) -> Result<(), Self::Error>

Source§

fn color_rgb(&mut self, color: RGB) -> Result<(), Self::Error>

Source§

fn color_mask(&mut self, mask: ColorMask) -> Result<(), Self::Error>

Source§

fn color_alpha(&mut self, alpha: u8) -> Result<(), Self::Error>

Source§

fn display(&mut self) -> Result<(), Self::Error>

Source§

fn draw( &mut self, prim: GraphicsPrimitive, f: impl FnOnce(VertexBuilder<'_, Self>) -> Result<(), Self::Error>, ) -> Result<(), Self::Error>

Draw a graphics primitive of a particular type, with zero or vertices defined in a closure. Read more
Source§

fn draw_iter( &mut self, prim: GraphicsPrimitive, iter: impl Iterator<Item = Vertex2F>, ) -> Result<(), Self::Error>

Draw a graphics primitive of a particular type, with zero or vertices defined in an iterator of vertices. Read more
Source§

fn end(&mut self) -> Result<(), Self::Error>

Source§

fn command_from_macro(&mut self, num: u8) -> Result<(), Self::Error>

Source§

fn jump( &mut self, addr: Ptr<<<Self as Builder>::Model as Model>::DisplayListMem>, ) -> Result<(), Self::Error>

Source§

fn line_width(&mut self, v: u16) -> Result<(), Self::Error>

Source§

fn nop(&mut self) -> Result<(), Self::Error>

Source§

fn palette_source( &mut self, ptr: Ptr<<<Self as Builder>::Model as Model>::MainMem>, ) -> Result<(), Self::Error>

Source§

fn point_size(&mut self, size: u16) -> Result<(), Self::Error>

Source§

fn restore_context(&mut self) -> Result<(), Self::Error>

Source§

fn return_from_call(&mut self) -> Result<(), Self::Error>

Source§

fn save_context(&mut self) -> Result<(), Self::Error>

Source§

fn scissor_size(&mut self, dims: (u16, u16)) -> Result<(), Self::Error>

Source§

fn scissor_pos(&mut self, pos: impl Into<ScissorPos>) -> Result<(), Self::Error>

Source§

fn scissor_rect( &mut self, rect: impl Into<ScissorRect>, ) -> Result<(), Self::Error>

Source§

fn stencil_test( &mut self, func: TestFunc, ref_val: u8, mask: u8, ) -> Result<(), Self::Error>

Source§

fn stencil_mask(&mut self, mask: u8) -> Result<(), Self::Error>

Source§

fn stencil_op( &mut self, fail: StencilOp, pass: StencilOp, ) -> Result<(), Self::Error>

Source§

fn tag(&mut self, v: u8) -> Result<(), Self::Error>

Source§

fn tag_mask(&mut self, update: bool) -> Result<(), Self::Error>

Source§

fn vertex_2f<Pos: Into<Vertex2F>>( &mut self, pos: Pos, ) -> Result<(), Self::Error>

Source§

fn vertex_2ii<Pos: Into<Vertex2II>>( &mut self, pos: Pos, ) -> Result<(), Self::Error>

Source§

fn vertex_format(&mut self, fmt: VertexFormat) -> Result<(), Self::Error>

Source§

fn vertex_translate_x(&mut self, v: i16) -> Result<(), Self::Error>

Source§

fn vertex_translate_y(&mut self, v: i16) -> Result<(), Self::Error>

Source§

fn vertex_translate(&mut self, offset: (i16, i16)) -> Result<(), Self::Error>

Auto Trait Implementations§

§

impl<M, I> Freeze for LowLevel<M, I>
where I: Freeze,

§

impl<M, I> RefUnwindSafe for LowLevel<M, I>

§

impl<M, I> Send for LowLevel<M, I>
where I: Send, M: Send, <M as Model>::DisplayListMem: Send,

§

impl<M, I> Sync for LowLevel<M, I>
where I: Sync, M: Sync, <M as Model>::DisplayListMem: Sync,

§

impl<M, I> Unpin for LowLevel<M, I>
where I: Unpin, M: Unpin, <M as Model>::DisplayListMem: Unpin,

§

impl<M, I> UnsafeUnpin for LowLevel<M, I>
where I: UnsafeUnpin,

§

impl<M, I> UnwindSafe for LowLevel<M, I>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.