/******************************************************************************* * Function Name: Pin_1_Write ******************************************************************************** * * Summary: * Write a data array to the fifo. * * Parameters: * *buff: The pointer to data array. * len : The length of the array to be written. * Length MUST be less than 10. * * Return: * None * *******************************************************************************/ void `$INSTANCE_NAME`_write2fifo(unsigned char* buff, unsigned char len){ unsigned char i; for(i=0;i<len;i++){ if(i<5){ `$INSTANCE_NAME`_write_byte(buff[i], FIFO_F0); }else{ `$INSTANCE_NAME`_write_byte(buff[i], FIFO_F1); } } }
static int value_set(struct sol_flow_node *node, void *data, uint16_t port, uint16_t conn_id, const struct sol_flow_packet *packet) { int32_t value; int r; struct segments_ctl_data *mdata = data; if (mdata->needs_clear) { _clear(node); mdata->needs_clear = false; } #define RANGE_MIN (0) #define RANGE_MAX (15) r = sol_flow_packet_get_irange_value(packet, &value); SOL_INT_CHECK(r, < 0, r); if ((value < RANGE_MIN) || (value > RANGE_MAX)) { sol_flow_send_error_packet(node, ERANGE, "Range invalid, it should be between %d and %d but was %" PRId32, RANGE_MIN, RANGE_MAX, value); return 0; } _write_byte(node, font[value]); return 0; #undef RANGE_MAX #undef RANGE_MIN }
static int segments_set(struct sol_flow_node *node, void *data, uint16_t port, uint16_t conn_id, const struct sol_flow_packet *packet) { unsigned char byte; int r; struct segments_ctl_data *mdata = sol_flow_node_get_private_data(node); if (mdata->needs_clear) { _clear(node); mdata->needs_clear = false; } r = sol_flow_packet_get_byte(packet, &byte); SOL_INT_CHECK(r, < 0, r); _write_byte(node, _convert_order(byte)); return 0; }
// low level byte write void EDB::edbWrite(unsigned long ee, const byte* p, unsigned int recsize) { for (unsigned int i = 0; i < recsize; i++) _write_byte(ee++, *p++); }