8#ifdef MAGRESWCH_EXPORTS
9#define MAGRESWCH_API __declspec(dllexport)
11#define MAGRESWCH_API __declspec(dllimport)
71 DIO_ADRSR_PIN_LOW = 0,
73} dio_adrsr_pin_state_e;
169 uint32_t* lnpdwVector,
190 uint32_t* lnpdwVector,
209 uint32_t* lpdwMemory,
227 uint32_t* lpdwMemory,
243 int32_t* lpdwCounter,
269 int32_t* lpdwCounter,
393 int32_t* lpdwCounter,
522MAGRESWCH_API
void DioSetADRSR_Low(
dio_handle_h nMasterHandle, uint8_t io_byte);
523MAGRESWCH_API
void DioSetADRSR_High(
dio_handle_h nMasterHandle, uint8_t io_byte);
567 uint8_t column, uint8_t y, uint8_t val);
594 uint8_t x, uint8_t y, uint8_t val);
682 uint8_t x, uint8_t y, uint8_t *arr,
size_t len);
735 uint8_t y, uint8_t *arr);
768 uint8_t col_width, uint8_t height, uint8_t *arr);
790 mode, uint8_t x, uint8_t y,
791 uint8_t col_width, uint8_t height,
897 uint8_t x, uint8_t y,
910 uint8_t x, uint8_t y,
923 uint8_t x, uint8_t y,
MAGRESWCH_API void DioWriteOLEDPixelPairImm(dio_handle_h nMasterHandle, uint8_t column, uint8_t y, uint8_t val)
Writes a value to a pair of pixels immediately.
MAGRESWCH_API void DioReadProgramCounter(dio_handle_h nHandle, int32_t *lpdwCounter, int16_t *lpnStatus)
Returns the specified master board program counter value.
MAGRESWCH_API void DioArm(dio_handle_h nMasterHandle, int16_t *lpnStatus)
Changes the board state from Halt to Pause.
dio_ext_trigger_modes_e
External Trigger modes.
Definition MAGResWCH.h:56
@ DIO_EXT_TRIG_IGNORE
Ignore the external trigger line.
Definition MAGResWCH.h:58
@ DIO_EXT_TRIG_LOW_HOLD
Trigger and change state when the line is held low.
Definition MAGResWCH.h:66
@ DIO_EXT_TRIG_HIGH_HOLD
Trigger and change state when the line is held high.
Definition MAGResWCH.h:64
@ DIO_EXT_TRIG_RISING_EDGE
Trigger and change state on the rising edge.
Definition MAGResWCH.h:60
@ DIO_EXT_TRIG_FALLING_EDGE
Trigger and change state on the falling edge.
Definition MAGResWCH.h:62
MAGRESWCH_API void DioClearOutMemory(dio_handle_h nMasterHandle, int16_t *lpnStatus)
Clears the output memory on the board.
MAGRESWCH_API void DioWriteSPI(dio_handle_h nMasterHandle, uint8_t addr, uint8_t *write_buff, size_t len, int16_t *lpnStatus)
Writes to the SPI.
MAGRESWCH_API void DioWriteOLEDStrImm(dio_handle_h nMasterHandle, uint8_t x, uint8_t y, char *str)
Writes a string immediately to the screen.
MAGRESWCH_API void DioWriteOLEDAreaArrImm(dio_handle_h nMasterHandle, uint8_t x, uint8_t y, uint8_t col_width, uint8_t height, uint8_t *arr)
Writes an array of length col_width*height to the screen immediately.
MAGRESWCH_API void DioClearCtrlMemory(dio_handle_h nMasterHandle, int16_t *lpnStatus)
Clears the control memory on the board.
MAGRESWCH_API void DioReadSPI(dio_handle_h nMasterHandle, uint8_t addr, uint8_t *read_buff, size_t len, int16_t *lpnStatus)
Reads the SPI.
dio_errors_e
Errors represented by lpnStatus.
Definition MAGResWCH.h:28
@ ERR_SPI_WRITE_ERR
Cannot write to the SPI.
Definition MAGResWCH.h:48
@ ERR_SPI_ADDR_OUT_OF_BOUNDS
Tried to access an invalid SPI address.
Definition MAGResWCH.h:50
@ ERR_BMP_INVALID_FILE
Tried to open invalid BMP file.
Definition MAGResWCH.h:52
@ ERR_STEP_SIZE_LESS_EQUAL_ZERO
Commanded step size is less than or equal to zero.
Definition MAGResWCH.h:36
@ ERR_SPI_READ_ERR
Cannot read SPI.
Definition MAGResWCH.h:44
@ ERR_READ_ZERO_BYTES
Number of bytes to read is specified to be zero, needs to be at least 1.
Definition MAGResWCH.h:42
@ ERR_CANNOT_GET_IO_REG_ADDR
Cannot get io_reg address for the CH367.
Definition MAGResWCH.h:34
@ ERR_SPI_STREAM_ERR
Cannot stream SPI.
Definition MAGResWCH.h:46
@ ERR_INVALID_CH367_HANDLE
Invalid CH367 handle returned.
Definition MAGResWCH.h:32
@ ERR_WRITE_LONGER_THAN_AVAIL_MEM
Number of bytes to write is larger than available memory.
Definition MAGResWCH.h:38
@ ERR_CANNOT_ALLOCATE_LPNMASTERHANDLE
Cannot allocate lpnMasterHandle.
Definition MAGResWCH.h:30
@ ERR_WRITE_ZERO_BYTES
Number of bytes to write is zero, needs to be at least 1.
Definition MAGResWCH.h:40
MAGRESWCH_API void DioWriteOLEDRowArrBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t y, uint8_t *arr)
Writes an array of length 128 to a row in the local screen buffer.
MAGRESWCH_API void DioWriteOLEDArrImm(dio_handle_h nMasterHandle, uint8_t x, uint8_t y, uint8_t *arr, size_t len)
Writes an array of length len to screen immediately.
MAGRESWCH_API void DioWriteOLEDRowArrImm(dio_handle_h nMasterHandle, uint8_t y, uint8_t *arr)
Writes an array of length 128 to a row on screen immediately.
MAGRESWCH_API void DioCloseBMP(dio_handle_h nMasterHandle, dio_bmp_h *bmp_handle)
Closes and deallocates memory for a bitmap file.
MAGRESWCH_API void DioWriteOLEDLineImm(dio_handle_h nMasterHandle, uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t val1, uint8_t val2)
Immediately writes a line to the screen that begins at (x1, y1), with value val1, to (x2,...
MAGRESWCH_API void DioWriteOLEDLineBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t val1, uint8_t val2)
Writes a line to the local screen buffer that begins at (x1, y1), with value val1,...
MAGRESWCH_API void DioWriteOLEDCharImm(dio_handle_h nMasterHandle, uint8_t x, uint8_t y, char letter)
Writes a single character immediately to the screen.
MAGRESWCH_API void DioReadCtrlMemory(dio_handle_h nHandle, uint32_t *lnpdwVector, uint32_t dwStart, uint32_t dwSize, int16_t *lpnStatus)
Reads a block of control memory from the specified board.
MAGRESWCH_API void DioSendOLEDBuff(dio_handle_h nMasterHandle)
Sends the current local screen buffer to the OLED screen.
MAGRESWCH_API void DioReadOutMemory(dio_handle_h nHandle, uint32_t *lnpdwVector, uint32_t dwStart, uint32_t dwSize, int16_t *lpnStatus)
Reads a block of output memory from the specified board.
MAGRESWCH_API dio_bmp_h DioOpenBMP(dio_handle_h nMasterHandle, char *path, int16_t *lpnStatus)
Opens and allocates memory for a bitmap file.
MAGRESWCH_API void DioWriteOLEDCharBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t x, uint8_t y, char letter)
Writes a single character to the local screen buffer.
MAGRESWCH_API void DioWriteOLEDRowValImm(dio_handle_h nMasterHandle, uint8_t y, uint8_t val)
Writes singular value to a row on screen immediately.
MAGRESWCH_API void DioWriteCurrentIO(dio_handle_h nHandle, int32_t dwCounter, int16_t *lpnStatus)
Writes the specified master board current output value.
MAGRESWCH_API void DioReadCurrentIO(dio_handle_h nHandle, int32_t *lpdwCounter, int16_t *lpnStatus)
Returns the specified master board current output value.
MAGRESWCH_API void DioSetupTriggerMode(dio_handle_h nMasterHandle, uint8_t nPauseMode, uint8_t nRunMode, int16_t *lpnstatus)
Sets the external trigger mode during the PAUSE and RUN states.
MAGRESWCH_API void DioWriteOLEDPixelPairBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t column, uint8_t y, uint8_t val)
Writes a value to a pair of pixels in the local screen buffer.
MAGRESWCH_API void DioStreamSPI(dio_handle_h nMasterHandle, uint8_t addr, uint8_t *write_buff, uint8_t *read_buff, size_t len, int16_t *lpnStatus)
Streams the SPI.
MAGRESWCH_API void DioHalt(dio_handle_h nMasterHandle, int16_t *lpnStatus)
Changes specified master board state to HALT.
dio_oled_write_mode_e
Pixel blending modes when using the OLED screen buffer.
Definition MAGResWCH.h:76
@ DIO_OLED_MODE_OR
Or current pixel with new pixel value.
Definition MAGResWCH.h:80
@ DIO_OLED_MODE_XOR
Xor current pixel with new pixel value.
Definition MAGResWCH.h:84
@ DIO_OLED_MODE_NONZERO
Overwrite current pixel with new pixel value as long as the new value is nonzero.
Definition MAGResWCH.h:86
@ DIO_OLED_MODE_GREATER_THAN
Overwrite current pixel if new pixel is greater than existing pixel.
Definition MAGResWCH.h:82
@ DIO_OLED_MODE_OVERWRITE
Overwrites what's there.
Definition MAGResWCH.h:78
MAGRESWCH_API void DioWriteOLEDScreenArrImm(dio_handle_h nMasterHandle, uint8_t *arr)
Writes 128x64 bytes to the screen at once, given a single dimensional array of that size.
MAGRESWCH_API void DioWriteOLEDAreaArrBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t x, uint8_t y, uint8_t col_width, uint8_t height, uint8_t *arr)
Writes an array of length col_width*height to the local screen buffer.
MAGRESWCH_API void DioClose(dio_handle_h nMasterHandle, int16_t *lpnStatus)
Closes the connection to the board, and releases the handle from being used.
struct dio_bmp_s * dio_bmp_h
The handle for a bmp file.
Definition MAGResWCH.h:25
MAGRESWCH_API void DioWriteOutMemory(dio_handle_h nHandle, uint32_t *lpdwMemory, uint32_t dwStart, uint32_t dwSize, int16_t *lpnStatus)
Writes a block of data to the output memory of the specified board.
MAGRESWCH_API void DioTrig(dio_handle_h nMasterHandle, int16_t *lpnStatus)
Takes the specified master board state from PAUSE to RUN.
MAGRESWCH_API void DioInitialize(short nMasterNum, dio_handle_h *lpnMasterHandle, int16_t *lpnStatus)
Provides a one time initialization of a master board and all slave boards associated with it.
MAGRESWCH_API void DioWriteOLEDArrBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t x, uint8_t y, uint8_t *arr, size_t len)
Writes an array of length len to the local screen buffer.
MAGRESWCH_API void DioClearOLEDBuff(dio_handle_h nMasterHandle)
Clears the current local screen buffer.
MAGRESWCH_API void DioResetDDS(dio_handle_h nMasterHandle, int16_t *lpnStatus)
Resets and initializes the DDS. Can only be sent during HALT.
MAGRESWCH_API void DioStep(dio_handle_h nMasterHandle, int32_t dwSteps, int16_t *lpnStatus)
Executes the specified master board program for a number of steps.
MAGRESWCH_API void DioWriteOLEDPixelImm(dio_handle_h nMasterHandle, uint8_t row, uint8_t column, uint8_t val)
Writes a pixel to the screen at the designated coordinate immediately.
MAGRESWCH_API void DioReadStatusRegister(dio_handle_h nHandle, int16_t *lpwData, int16_t *lpnStatus)
Reads the status register from the specified board.
MAGRESWCH_API void DioReset(dio_handle_h nHandle, int16_t *lpnStatus)
Changes state of specified master board to HALT.
MAGRESWCH_API const char * DioGetErrorStr(dio_handle_h nMasterHandle, int16_t lpnStatus)
Returns a null-terminated string associated with an lpnStatus error.
MAGRESWCH_API void DioWriteOLED2DUnpackedArrImm(dio_handle_h nMasterHandle, uint8_t **arr)
Writes 128x64 bytes to the screen at once, given a single dimensional array of that size.
MAGRESWCH_API void DioSetupOLED(dio_handle_h nMasterHandle, int16_t *lpnStatus)
Sets up and turns on the OLED.
MAGRESWCH_API void DIOClearOLEDImm(dio_handle_h nMasterHandle)
Clears the screen immediately.
MAGRESWCH_API void DioWriteOLEDPixelBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t x, uint8_t y, uint8_t val)
Writes a pixel to the screen at the designated coordinate in the local screen buffer.
MAGRESWCH_API void DioWriteProgramCounter(dio_handle_h nHandle, int32_t dwCounter, int16_t *lpnStatus)
Writes the specified master board program counter value.
MAGRESWCH_API void DioReadMaxDataLines(dio_handle_h nHandle, int32_t *lpdwCounter, int16_t *lpnStatus)
Returns the specified master board max data lines available to program.
MAGRESWCH_API void DioWriteOLEDAreaBMPBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t x, uint8_t y, dio_bmp_h bmp_handle)
Writes a BMP to the local screen buffer at an x and y offset.
MAGRESWCH_API void DioWriteOLEDScreenArrBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t *arr)
Writes 128x64 bytes to the local screen buffer, given a single dimensional array of that size.
MAGRESWCH_API void DioWriteOLEDStrBuff(dio_handle_h nMasterHandle, dio_oled_write_mode_e mode, uint8_t x, uint8_t y, char *str)
Writes a string to the local screen buffer.
MAGRESWCH_API void DioWriteOLEDAreaBMPImm(dio_handle_h nMasterHandle, uint8_t x, uint8_t y, dio_bmp_h bmp_handle)
Writes a BMP to the screen immediately at an x and y offset.
struct dio_handle_s * dio_handle_h
The board handle.
Definition MAGResWCH.h:22
MAGRESWCH_API void DioPause(dio_handle_h nMasterHandle, int16_t *lpnStatus)
Changes the specified master board state from a RUN to PAUSE state.
MAGRESWCH_API void DioWriteCtrlMemory(dio_handle_h nHandle, uint32_t *lpdwMemory, uint32_t dwStart, uint32_t dwSize, int16_t *lpnStatus)
Writes a block of data to the control memory of the specified board.